﻿/* ============================================= */
/* STILURI PENTRU COȘUL LATERAL         */
/* ============================================= */

/* Container principal al coșului */
#cosLateral .cart-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header-ul coșului */
#cosLateral .cart-header {
    display: flex; /* Adăugat pentru aliniere */
    justify-content: space-between; /* Aliniază titlul la stânga și butonul la dreapta */
    align-items: center; /* Aliniază pe verticală */
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;

}

#cosLateral .cart-header-title {
    font-family: 'Teko', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    line-height: 1;
    text-transform: uppercase; /* Pentru a scrie "COȘUL TĂU" cu majuscule */

}

/* Zona unde apar produsele */
.cart-items-container {
    padding: 1rem 1.5rem;
    overflow-y: auto; /* Permite scroll dacă sunt multe produse */
    flex-grow: 1; /* Ocupă spațiul rămas */
}

.empty-cart-message {
    text-align: center;
    color: #777;
    margin-top: 2rem;
    font-style: italic;
}

/* Stil pentru fiecare produs din coș */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

    .cart-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.cart-item-image {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item-name {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

/* Selectorul de cantitate (+/-) */
.cart-item-quantity-selector {
    display: flex;
    align-items: center;
}

.cart-quantity-btn {
    background: #f1f1f1;
    border: 1px solid #ddd;
    width: 28px;
    height: 28px;
    cursor: pointer;
    border-radius: 50%;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .cart-quantity-btn:hover {
        background-color: #e0e0e0;
    }

.cart-quantity-value {
    margin: 0 0.8rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Totalul pe produs și butonul de ștergere */
.cart-item-total {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
}

    .cart-item-total span {
        font-weight: 600;
        font-size: 0.9rem;
    }

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    margin-top: 0.5rem;
}

    .cart-item-remove:hover {
        color: #c10206; /* Roșu la hover */
    }

/* Subsolul coșului (subtotal, buton checkout) */
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    flex-shrink: 0; /* Nu se micșorează */
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

#cart-subtotal-value {
    color: var(--brand-orange);
}

.checkout-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #c10206; /* Roșu principal */
    color: white;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

    .checkout-button:hover {
        background-color: #a00003;
        transform: scale(1.02);
    }

/* ============================================= */
/* FIX: Setează culoarea textului pe negru în coș */
/* ============================================= */

/* Setează culoarea pentru titlul "COȘUL TĂU" */
#cosLateral .cart-header-title {
    color: #000;
}

/* Setează culoarea pentru numele produsului */
.cart-item-name {
    color: #333; /* Un gri închis, mai plăcut ochiului decât negru pur */
}

/* Setează culoarea pentru butoanele de cantitate (+/-) și valoarea numerică */
.cart-quantity-btn,
.cart-quantity-value {
    color: #333;
}

/* Setează culoarea pentru totalul fiecărui produs */
.cart-item-total span {
    color: #000;
}

/* Setează culoarea pentru textul "Subtotal" din subsol */
.cart-subtotal span:first-child {
    color: #000;
}

/* Setează culoarea pentru mesajul "Coșul tău este gol" */
.empty-cart-message {
    color: #555;
}


/* ============================================= */
/* STIL FINAL PENTRU BARA DE PROGRES (SIMPLIFICAT) */
/* ============================================= */

/* Wrapper-ul principal pentru bară */
.cart-shipping-progress {
    padding: 0 1.5rem 1.5rem 1.5rem;
    flex-shrink: 0;
}

/* Conținutul text de deasupra barei */
.progress-text-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px; /* Spațiu între text și bară */
    font-size: 13px;
    font-weight: 600;
    color: #000000; /* Text negru, mereu vizibil */
    text-align: center;
}

    /* Asigurăm că iconița este neagră */
    .progress-text-content .icon-masina-transport path,
    .progress-text-content .icon-masina-transport ellipse {
        stroke: #000000 !important;
        stroke-width: 1.5;
    }

/* Fundalul barei (track-ul) - acum mult mai subțire și elegant */
.progress-track {
    height: 8px;
    background-color: #e9ecef; /* Un gri neutru */
    border-radius: 99px;
    overflow: hidden;
}

/* Bara colorată care arată progresul (fill-ul) */
.progress-fill {
    height: 100%;
    width: 0%; /* Începe de la 0, JavaScript va modifica lățimea */
    background-color: #c10206; /* Roșul brandului */
    border-radius: 99px;
    transition: width 0.5s ease; /* Animație fluidă */
}

/* === HIGHLIGHT PENTRU PRODUSE NOU ADĂUGATE === */
.cart-item.newly-added {
    position: relative;
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 1%, #ffffff 2%, #ffffff 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    transform: scale(1.02);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-item.highlight-pulse {
    animation: highlightPulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3), 0 8px 25px rgba(245, 158, 11, 0.2);
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3), 0 8px 25px rgba(245, 158, 11, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.5), 0 12px 35px rgba(245, 158, 11, 0.3);
    }
}

/* Badge "NOU" pentru produs */
.cart-item.newly-added::before {
    content: "NOU";
    position: absolute;
    top: -8px;
    right: 16px;
    background: #dc2626;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 10;
    animation: bounceIn 0.5s ease-out 0.3s both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-10px);
    }

    50% {
        opacity: 1;
        transform: scale(1.1) translateY(-2px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth transitions când se remove highlight */
.cart-item {
    transition: all 0.4s ease;
}
