/* Carrinho Sidebar */
#cartSidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#cartSidebar.active {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
}

#cartSidebar.active ~ .cart-overlay,
.cart-overlay.active {
    display: block;
}

.cart-header {
    background: #180c08 !important;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cart-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    opacity: 0.8;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.cart-items {
    padding: 20px;
    flex-shrink: 0;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.cart-item-pricing {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-old-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
}

.cart-item-discount {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-qty-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cart-qty-btn:hover {
    background: #e0e0e0;
}

.cart-qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-remove {
    color: #dc3545;
    font-size: 12px;
    text-decoration: none;
    margin-left: auto;
}

.cart-remove:hover {
    text-decoration: underline;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    position: relative;
    z-index: 2;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.cart-total-price {
    color: #333;
    font-size: 20px;
}

.cart-checkout-btn {
    width: 100%;
    background: #4b2a1a;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.cart-checkout-btn:hover {
    background: #3c2415;
    box-shadow: 0 4px 8px rgba(75, 42, 26, 0.3);
}

.cart-continue-btn {
    width: 100%;
    background: #fff;
    color: #4b2a1a;
    border: 1px solid #4b2a1a;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    box-sizing: border-box;
}

.cart-continue-btn:hover {
    background: #f5f5f5;
}

/* Badge do carrinho no header */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b35;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.cart-toggle {
    position: relative;
}

/* Responsivo */
@media (max-width: 768px) {
    #cartSidebar {
        max-width: 100%;
    }
}

/* Upsell no carrinho */
.cart-upsell {
    padding: 12px 16px;
    border-top: 2px solid #f0e0cc;
    background: #fdf5e6;
    flex-shrink: 0;
}

.cart-upsell-title {
    font-size: 13px;
    font-weight: 700;
    color: #3c2415;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-upsell-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.cart-upsell-track::-webkit-scrollbar {
    display: none;
}

.cart-upsell-card {
    flex: 0 0 110px;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    border: 1px solid #f0e8dd;
    transition: box-shadow 0.2s;
}

.cart-upsell-card:hover {
    box-shadow: 0 2px 8px rgba(75,42,26,0.12);
}

.cart-upsell-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-upsell-name {
    font-size: 10px;
    font-weight: 600;
    color: #3c2415;
    text-align: center;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
}

.cart-upsell-price {
    font-size: 12px;
    font-weight: 700;
    color: #28a745;
}

.cart-upsell-btn {
    background: #180c08;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 2px;
}

.cart-upsell-btn:hover {
    background: #3c2415;
}

/* Setas de scroll nos upsells */
.cart-upsell-wrapper {
    position: relative;
}

.upsell-scroll-btn {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    color: #3c2415;
    padding: 0;
    transition: background-color 0.2s;
}

.upsell-scroll-btn:hover {
    background: #fff;
}

.upsell-scroll-left {
    left: -6px;
}

.upsell-scroll-right {
    right: -6px;
}
