/* =============================================
   CART DRAWER - Estilo Growth Supplements
   ============================================= */

/* Overlay escuro atrás do drawer */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer lateral */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
}

.cart-drawer.active {
    right: 0;
}

/* Header do Drawer */
.cart-drawer-header {
    background: var(--color-black);
    color: var(--color-white);
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 2px solid var(--color-gold-primary);
}

.cart-drawer-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    color: var(--color-white);
}

.cart-drawer-close {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.cart-drawer-close:hover {
    color: var(--color-gold-primary);
}

/* Body - itens do carrinho */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Item individual do carrinho */
.cart-drawer-item {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-drawer-item-img {
    width: 70px;
    height: 70px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-drawer-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-drawer-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cart-drawer-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
}

.cart-drawer-item-price {
    font-size: 0.8rem;
    color: #888;
    text-decoration: line-through;
}

.cart-drawer-item-final-price {
    font-size: 1.05rem;
    font-weight: 900;
    color: #1d9c28;
}

/* Controle de quantidade */
.cart-drawer-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.3rem;
    width: fit-content;
}

.cart-drawer-qty button {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border: none;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cart-drawer-qty button:hover {
    background: #e0e0e0;
}

.cart-drawer-qty span {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    background: #fff;
}

.cart-drawer-item-remove {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s;
}

.cart-drawer-item-remove:hover {
    color: #e74c3c;
}

/* Estado Vazio */
.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #999;
    gap: 1rem;
}

.cart-drawer-empty svg {
    opacity: 0.3;
}

.cart-drawer-empty p {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

.cart-drawer-empty span {
    font-size: 0.85rem;
    color: #999;
}

/* Seção de ofertas */
.cart-drawer-offers {
    background: #f0faf1;
    padding: 1rem 1.2rem;
    border-top: 1px solid #d4edda;
}

.cart-drawer-offers h4 {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1d9c28;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.cart-drawer-offer-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
}

.cart-drawer-offer-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}

.cart-drawer-offer-info {
    flex: 1;
}

.cart-drawer-offer-info .offer-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.cart-drawer-offer-info .offer-price {
    font-size: 0.85rem;
    font-weight: 900;
    color: #1d9c28;
}

.cart-drawer-offer-add {
    background: #222;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-drawer-offer-add:hover {
    background: #444;
}

/* Footer do Drawer */
.cart-drawer-footer {
    flex-shrink: 0;
    background: #fff;
    border-top: 2px solid #eee;
    padding: 1.2rem;
}

.cart-drawer-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cart-drawer-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-drawer-summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.cart-drawer-summary-value {
    font-size: 0.85rem;
    color: #888;
    text-decoration: line-through;
}

.cart-drawer-summary-total {
    font-size: 1.1rem;
    font-weight: 900;
    color: #1d9c28;
}

.cart-drawer-pix-info {
    font-size: 0.75rem;
    color: #1d9c28;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.8rem;
    background: #f0faf1;
    padding: 0.5rem;
    border-radius: 4px;
}

.cart-drawer-checkout-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #1d9c28;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.cart-drawer-checkout-btn:hover {
    background: #167a1f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 156, 40, 0.3);
}

.cart-drawer-continue {
    display: block;
    text-align: center;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.cart-drawer-continue:hover {
    color: #333;
}

/* Mobile */
@media (max-width: 480px) {
    .cart-drawer {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }
    
    .cart-drawer-item-img {
        width: 55px;
        height: 55px;
    }
}
