/* ── Navbar : icônes panier + compte ── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    margin-right: 1rem;
}
.nav-cart-btn,
.nav-account-btn {
    background: #0c2d1a;
    border: 1.5px solid #e8c96a;
    cursor: pointer;
    position: relative;
    font-size: .85rem;
    font-weight: 600;
    color: #e8c96a;
    padding: .45rem 1rem;
    border-radius: 999px;
    transition: background .2s, color .2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nav-account-btn:hover {
    background: #e8c96a;
    color: #0c2d1a;
}
.nav-account-btn.logged-in {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #15803d;
}
.nav-account-label { font-size: .82rem; }
.nav-cart-btn:hover,
.nav-account-btn:hover { background: var(--ivory); }

.cart-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── Account dropdown ── */
.nav-account { position: relative; }
.account-dropdown {
    position: absolute;
    right: 0; top: calc(100% + .5rem);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 200px;
    padding: .5rem 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
}
.account-dropdown.open { display: flex; }
.account-dropdown a,
.account-dropdown button {
    background: none;
    border: none;
    text-align: left;
    padding: .75rem 1.25rem;
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    transition: background .15s;
}
.account-dropdown a:hover,
.account-dropdown button:hover { background: var(--ivory); }
.account-greeting {
    padding: .75rem 1.25rem;
    font-size: .85rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

/* ── Cart backdrop ── */
.cart-backdrop,
.auth-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.cart-backdrop.open,
.auth-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Cart panel ── */
.cart-panel {
    position: fixed;
    top: 0; right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    background: #fff;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,.12);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.cart-panel.open { transform: translateX(0); }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 1.4rem; margin: 0; }
.cart-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.2rem; color: var(--muted);
    padding: .4rem; border-radius: 50%;
    transition: background .2s;
}
.cart-close:hover { background: var(--ivory); color: var(--text); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-tag {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--green);
    background: var(--green-pale);
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: .35rem;
}
.cart-item-name {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-unit {
    font-size: .8rem;
    color: var(--muted);
}
.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .4rem;
}
.cart-qty {
    display: flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 6px;
}
.cart-qty span { font-size: .9rem; min-width: 1.5rem; text-align: center; }
.qty-minus, .qty-plus {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; color: var(--text);
    padding: 0 4px; line-height: 1;
}
.cart-line-total {
    font-size: .85rem;
    font-weight: 600;
    color: var(--green);
}
.cart-remove {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: .8rem;
    padding: 2px 4px; border-radius: 4px;
    transition: color .2s;
}
.cart-remove:hover { color: #ef4444; }

/* Cart footer */
.cart-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #fff;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.cart-total strong { font-size: 1.2rem; color: var(--green); }
.btn-checkout {
    width: 100%;
    padding: .9rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: opacity .2s;
}
.btn-checkout:hover { opacity: .9; }

/* Cart empty state */
.cart-empty {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--muted);
    padding: 2rem;
}
.cart-empty i { font-size: 3rem; opacity: .3; }
.cart-empty p { font-size: 1rem; }

/* ── Auth modal ── */
.auth-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 10002;
    width: min(440px, 95vw);
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.auth-modal.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}
.auth-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; color: var(--muted);
    padding: .35rem; border-radius: 50%;
    transition: background .2s;
}
.auth-close:hover { background: var(--ivory); }

.auth-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    background: var(--ivory);
    padding: 4px;
    border-radius: 999px;
}
.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: .6rem 1rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
    transition: all .2s;
}
.auth-tab.active {
    background: #fff;
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form--hidden { display: none; }
.auth-group { display: flex; flex-direction: column; gap: .35rem; }
.auth-group label { font-size: .85rem; font-weight: 600; }
.auth-group input {
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: .95rem;
    transition: border-color .2s;
}
.auth-group input:focus {
    outline: none;
    border-color: var(--green);
}
.auth-error {
    font-size: .85rem;
    color: #ef4444;
    min-height: 1.2em;
}
.btn-auth {
    padding: .85rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.btn-auth:hover { opacity: .9; }

/* ── Auth : logo dans modal ── */
.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.auth-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
}

/* ── Bouton Google ── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    background: #fff;
    color: #3c4043;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    margin-bottom: .5rem;
}
.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 6px rgba(0,0,0,.12);
}

/* ── Séparateur ou ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #aaa;
    font-size: .8rem;
    margin: .5rem 0;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ── Champ mot de passe avec œil ── */
.pwd-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.pwd-wrap input {
    width: 100%;
    padding-right: 2.5rem;
}
.pwd-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: .95rem;
    padding: 4px;
    transition: color .2s;
    display: flex;
    align-items: center;
}
.pwd-toggle:hover { color: #333; }

/* ── Mot de passe oublié ── */
.auth-forgot {
    background: none;
    border: none;
    cursor: pointer;
    color: #0369a1;
    font-size: .82rem;
    text-align: right;
    padding: 0;
    align-self: flex-end;
    text-decoration: underline;
    margin-top: -.4rem;
}
.auth-forgot:hover { color: #075985; }

/* ── Section reset MDP ── */
.auth-back {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin-bottom: .5rem;
}
.auth-back:hover { color: #111; }
.reset-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.reset-desc {
    font-size: .83rem;
    color: #666;
    margin-bottom: .75rem;
    line-height: 1.4;
}
.auth-success {
    color: #16a34a;
    font-size: .83rem;
    min-height: 1.2em;
}
.auth-hint {
    color: #888;
    font-weight: 400;
    font-size: .8rem;
}
.auth-field-hint {
    font-size: .75rem;
    color: #999;
    margin-top: -4px;
}

/* ── Page Mon Compte ── */
.account-page {
    max-width: 800px;
    margin: 120px auto 80px;
    padding: 0 1.5rem;
}
.account-page h1 { font-size: 2.5rem; margin-bottom: .5rem; }
.account-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}
.account-section h2 { font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--green); }
.profile-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.profile-avatar {
    width: 60px; height: 60px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700;
    flex-shrink: 0;
}
.profile-info strong { display: block; font-size: 1.1rem; }
.profile-info span { color: var(--muted); font-size: .9rem; }
.btn-logout {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    padding: .5rem 1.2rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .9rem;
    cursor: pointer;
    color: var(--muted);
    transition: all .2s;
    display: flex; align-items: center; gap: .5rem;
}
.btn-logout:hover { border-color: #ef4444; color: #ef4444; }

.order-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}
.order-date { font-size: .85rem; color: var(--muted); }
.order-status {
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.status-sent       { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e3a8a; }
.status-delivered  { background: #dcfce7; color: #166534; }
.order-items { list-style: none; margin: 0 0 .75rem; padding: 0; }
.order-items li { font-size: .9rem; color: var(--muted); padding: .2rem 0; }
.order-items li::before { content: "• "; }
.order-total { font-weight: 700; font-size: .95rem; }
.order-method { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.orders-empty { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ── Add-to-cart button (catalogue + index) ── */
.add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    padding: .65rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    margin-top: .5rem;
}
.add-to-cart-btn:hover { opacity: .85; }
.add-to-cart-btn:disabled { opacity: .6; cursor: default; }

/* ── Responsive 768px ── */
@media (max-width: 768px) {
    /* Icônes navbar plus compactes sur mobile */
    .nav-actions { margin-right: .5rem; gap: .2rem; }
    .nav-cart-btn,
    .nav-account-btn { font-size: 1.05rem; padding: .3rem; }

    /* Panneau panier plein écran sur mobile */
    .cart-panel { width: 100vw; }
    .cart-header { padding: 1.25rem 1rem .75rem; }
    .cart-items  { padding: .75rem 1rem; }
    .cart-footer { padding: 1rem; }

    /* Dropdown compte moins large */
    .account-dropdown { min-width: 180px; }

    /* Modal auth padding réduit */
    .auth-modal { padding: 1.5rem; }

    /* Page Mon Compte : marge top selon hauteur navbar mobile */
    .account-page { margin-top: 90px; }
}

/* ── Responsive 480px ── */
@media (max-width: 480px) {
    /* Panneau panier */
    .cart-item { gap: .5rem; }
    .cart-item-name { font-size: .88rem; }
    .cart-qty span { min-width: 1.25rem; }

    /* Modal auth */
    .auth-modal { padding: 1.25rem; }
    .auth-tabs { padding: 3px; }
    .auth-tab { padding: .5rem .6rem; font-size: .82rem; }

    /* Profil page : bouton déco en bas sur petit écran */
    .profile-row { flex-direction: column; align-items: flex-start; }
    .btn-logout { margin-left: 0; margin-top: .75rem; }
    .account-page { margin-top: 80px; }

    /* Dropdown compte repositionné */
    .account-dropdown { right: -1rem; }

    /* Admin login box */
    .login-box { padding: 1.75rem 1.25rem; }
}
