/* ==========================================
   FICHIER : /css/pages/cart.css
   PROJET  : Divine Hair Secrets by Lionne
   Dépend de : main.css
========================================== */


/* ─────────────────────────────────────
   1. HERO
───────────────────────────────────── */
.cart-hero {
    background: linear-gradient(135deg,
        var(--green-900) 0%, var(--green-800) 60%, var(--brown-900) 100%);
    padding: 40px 0 36px;
    position: relative;
}

.cart-hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(197,160,89,.1) 0%, transparent 60%);
    pointer-events: none;
}

.cart-hero-inner { position: relative; }

.cart-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-heading); font-size: .78rem; font-weight: 700;
    color: rgba(255,255,255,.55); text-decoration: none;
    letter-spacing: .06em; text-transform: uppercase;
    transition: color .2s; margin-bottom: 14px;
}
.cart-back-link:hover { color: var(--gold-500); }
.cart-back-link .material-icons-round { font-size: 1rem; }

.cart-hero-title {
    font-family: var(--font-heading); font-size: clamp(1.6rem,4vw,2.4rem);
    font-weight: 800; color: #fff; display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px; letter-spacing: -.02em;
}
.cart-hero-title .material-icons-round { font-size: clamp(1.4rem,3.5vw,2rem); }

.cart-hero-subtitle {
    font-family: var(--font-body); font-size: .92rem; font-style: italic;
    color: rgba(255,255,255,.6);
}


/* ─────────────────────────────────────
   2. MAIN
───────────────────────────────────── */
.cart-main { padding: 40px 0 80px; min-height: 60vh; }


/* ─────────────────────────────────────
   3. ÉTATS (non connecté / vide)
───────────────────────────────────── */
.cart-state {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; padding: 80px 24px; text-align: center;
}

.cart-state .material-icons-round {
    font-size: 3.5rem; color: var(--green-900); opacity: .2;
}

.cart-state h2 {
    font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800;
    color: var(--brown-900);
}

.cart-state p {
    font-family: var(--font-body); font-size: .92rem; color: #aaa;
    max-width: 320px; line-height: 1.55;
}


/* ─────────────────────────────────────
   4. LAYOUT — 2 COLONNES
───────────────────────────────────── */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: flex-start;
}


/* ─────────────────────────────────────
   5. COLONNE ARTICLES
───────────────────────────────────── */
.cart-items-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}

.cart-section-title {
    font-family: var(--font-heading); font-size: 1.05rem; font-weight: 800;
    color: var(--brown-900);
}

.cart-clear-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; font-family: var(--font-heading);
    font-size: .76rem; font-weight: 700;
    color: #c0392b; background: rgba(192,57,43,.06);
    border: 1.5px solid rgba(192,57,43,.18);
    border-radius: var(--radius-lg); cursor: pointer;
    transition: var(--transition-fast);
}
.cart-clear-btn:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.cart-clear-btn .material-icons-round { font-size: .9rem; }


/* ─────────────────────────────────────
   6. CARTE ARTICLE
───────────────────────────────────── */
.cart-item-card {
    background: #fff; border-radius: var(--radius-md);
    border: 1px solid rgba(22,53,40,.06); box-shadow: var(--shadow-sm);
    padding: 18px 20px; display: flex; align-items: center; gap: 16px;
    margin-bottom: 12px; transition: var(--transition-fast);
    animation: itemIn .3s ease;
}

@keyframes itemIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.cart-item-card:hover { box-shadow: var(--shadow-md); }

.cart-item-img {
    width: 72px; height: 72px; border-radius: var(--radius-sm);
    object-fit: cover; flex-shrink: 0;
    border: 1px solid rgba(22,53,40,.08);
    background: var(--beige-100);
}

.cart-item-img-ph {
    width: 72px; height: 72px; border-radius: var(--radius-sm);
    background: var(--beige-100); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px dashed rgba(22,53,40,.14); color: #ccc;
}
.cart-item-img-ph .material-icons-round { font-size: 1.6rem; }

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
    font-family: var(--font-heading); font-size: .92rem; font-weight: 700;
    color: var(--brown-900); display: block; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cart-item-unit-price {
    font-family: var(--font-body); font-size: .8rem; color: #aaa;
    display: block; margin-bottom: 12px;
}

.cart-item-controls {
    display: flex; align-items: center; gap: 0;
    border: 1.5px solid rgba(22,53,40,.12); border-radius: var(--radius-lg);
    overflow: hidden; align-self: flex-start; width: fit-content;
}

.cart-qty-btn {
    width: 34px; height: 34px; background: var(--beige-100); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--green-900); transition: var(--transition-fast);
}
.cart-qty-btn:hover { background: var(--green-900); color: #fff; }
.cart-qty-btn .material-icons-round { font-size: .9rem; }

.cart-qty-val {
    font-family: var(--font-heading); font-size: .88rem; font-weight: 800;
    color: var(--brown-900); min-width: 36px; text-align: center;
    border-left: 1.5px solid rgba(22,53,40,.1);
    border-right: 1.5px solid rgba(22,53,40,.1);
    line-height: 34px;
}

.cart-item-right {
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 12px; flex-shrink: 0;
}

.cart-item-total-price {
    font-family: var(--font-heading); font-size: 1rem; font-weight: 800;
    color: var(--green-900);
}

.cart-item-delete {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(192,57,43,.06); border: 1.5px solid rgba(192,57,43,.15);
    color: #c0392b; cursor: pointer; transition: var(--transition-fast);
}
.cart-item-delete:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.cart-item-delete .material-icons-round { font-size: 1rem; }


/* ─────────────────────────────────────
   7. RÉSUMÉ DE COMMANDE
───────────────────────────────────── */
.cart-summary-col { position: sticky; top: 80px; }

.cart-summary-card {
    background: #fff; border-radius: var(--radius-md);
    border: 1px solid rgba(22,53,40,.07); box-shadow: var(--shadow-sm);
    padding: 24px;
}

.cart-summary-lines { margin: 18px 0; }

.cart-summary-line {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; padding: 8px 0;
    border-bottom: 1px solid rgba(22,53,40,.05);
    font-family: var(--font-body); font-size: .88rem;
}

.cart-summary-line:last-child { border-bottom: none; }

.cart-summary-line .line-name {
    color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 55%;
}

.cart-summary-line .line-price {
    font-family: var(--font-heading); font-size: .86rem;
    font-weight: 700; color: var(--brown-900); flex-shrink: 0;
}

.cart-summary-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0; border-top: 2px solid rgba(22,53,40,.1);
    font-family: var(--font-heading); font-weight: 800;
}

.cart-summary-total span:first-child { font-size: .88rem; color: var(--brown-500); text-transform: uppercase; letter-spacing: .08em; }
#cart-total { font-size: 1.3rem; color: var(--green-900); }

.cart-summary-note {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-body); font-size: .76rem; color: #bbb;
    font-style: italic; margin-bottom: 18px;
}
.cart-summary-note .material-icons-round { font-size: .9rem; }

/* Boutons résumé */
.cart-btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px; font-family: var(--font-heading);
    font-size: .88rem; font-weight: 700; color: #fff;
    background: var(--green-900); border: none;
    border-radius: var(--radius-lg); cursor: pointer;
    text-decoration: none; transition: var(--transition-fast);
    margin-bottom: 10px;
}
.cart-btn-primary:hover { background: var(--gold-500); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(197,160,89,.3); }
.cart-btn-primary .material-icons-round { font-size: 1.05rem; }

/* Bouton état (non connecté/vide) — inline-flex */
.cart-state .cart-btn-primary { display: inline-flex; width: auto; }

.cart-btn-whatsapp {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; font-family: var(--font-heading);
    font-size: .86rem; font-weight: 700; color: #fff;
    background: #25D366; border-radius: var(--radius-lg);
    text-decoration: none; transition: var(--transition-fast);
    margin-bottom: 10px;
}
.cart-btn-whatsapp:hover { background: #1da855; }
.cart-btn-whatsapp .material-icons-round { font-size: 1.05rem; }

.cart-btn-outline {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px; font-family: var(--font-heading);
    font-size: .86rem; font-weight: 700; color: var(--green-900);
    background: transparent; border: 2px solid var(--green-900);
    border-radius: var(--radius-lg); text-decoration: none;
    transition: var(--transition-fast); cursor: pointer;
}
.cart-btn-outline:hover { background: var(--green-900); color: #fff; }
.cart-btn-outline .material-icons-round { font-size: 1rem; }

.cart-btn-full { width: 100%; }


/* ─────────────────────────────────────
   8. BOTTOM SHEET
───────────────────────────────────── */
.bs-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.42); backdrop-filter: blur(3px); z-index: 600;
}
.bs-backdrop.open { display: block; animation: bdIn .2s ease; }
@keyframes bdIn { from{opacity:0} to{opacity:1} }

.bottom-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-radius: 20px 20px 0 0;
    padding: 12px 28px 40px; z-index: 601; text-align: center;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 -8px 32px rgba(0,0,0,.12);
}
.bottom-sheet.open { transform: translateY(0); }

.bs-handle { width: 40px; height: 4px; border-radius: 2px; background: #e0e0e0; margin: 0 auto 20px; }

.bs-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(192,57,43,.08); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.bs-icon .material-icons-round { font-size: 1.6rem; color: #c0392b; }

.bs-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; color: var(--brown-900); margin-bottom: 8px; }
.bs-desc { font-family: var(--font-body); font-size: .88rem; color: #aaa; line-height: 1.55; margin-bottom: 28px; max-width: 320px; margin-left: auto; margin-right: auto; }

.bs-actions { display: flex; gap: 12px; max-width: 400px; margin: 0 auto; }

.bs-btn-cancel { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px; font-family: var(--font-heading); font-size: .88rem; font-weight: 700; color: var(--brown-500); background: var(--beige-100); border: 1.5px solid rgba(22,53,40,.1); border-radius: var(--radius-lg); cursor: pointer; transition: var(--transition-fast); }
.bs-btn-cancel:hover { background: #eee; color: var(--green-950); }
.bs-btn-cancel .material-icons-round { font-size: .95rem; }

.bs-btn-delete { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px; font-family: var(--font-heading); font-size: .88rem; font-weight: 700; color: #fff; background: #c0392b; border: none; border-radius: var(--radius-lg); cursor: pointer; transition: var(--transition-fast); }
.bs-btn-delete:hover { background: #a93226; }
.bs-btn-delete .material-icons-round { font-size: .95rem; }


/* ─────────────────────────────────────
   9. TOASTS
───────────────────────────────────── */
#toast-root { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 16px; background: #fff; border-left: 4px solid var(--green-900); border-radius: var(--radius-md); box-shadow: 0 6px 22px rgba(0,0,0,.12); min-width: 240px; max-width: 320px; pointer-events: all; animation: tIn .3s ease; }
.toast.error { border-left-color: #c0392b; }
.toast.removing { animation: tOut .22s ease forwards; }
@keyframes tIn  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
@keyframes tOut { to{opacity:0;transform:translateY(8px)} }
.toast .material-icons-round { font-size: 1.1rem; flex-shrink:0; }
.toast.success .material-icons-round { color: var(--green-900); }
.toast.error   .material-icons-round { color: #c0392b; }
.toast-body { flex:1; }
.toast-title { font-family:var(--font-heading); font-size:.82rem; font-weight:700; color:var(--brown-900); display:block; margin-bottom:2px; }
.toast-desc  { font-family:var(--font-body); font-size:.74rem; color:#aaa; }
.toast-x { background:none; border:none; color:#ccc; cursor:pointer; flex-shrink:0; transition:color .15s; }
.toast-x:hover { color:var(--brown-900); }
.toast-x .material-icons-round { font-size:.88rem; }


/* ─────────────────────────────────────
   10. RESPONSIVE
───────────────────────────────────── */
@media (max-width: 860px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary-col { position: static; }
}

@media (max-width: 480px) {
    .cart-hero { padding: 28px 0 24px; }
    .cart-item-card { flex-wrap: wrap; }
    .cart-item-img, .cart-item-img-ph { width: 56px; height: 56px; }
    .cart-item-right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
    .bs-actions { flex-direction: column; }
}