/* ===== Thème Station Genin — inspiré de station-genin-app.lovable.app =====
   Palette chaleureuse terracotta + crème, coins arrondis, titres serif (Fraunces). */
:root {
    --radius: 1rem;

    --background: #fff9f1;
    --foreground: #371f19;
    --surface: #ffffff;
    --card-foreground: #371f19;

    --primary: #d65a32;
    --primary-hover: #c14e2a;
    --primary-foreground: #fff9f1;

    --secondary: #f6e9da;
    --secondary-foreground: #492921;

    --muted: #f3e9df;
    --muted-foreground: #7e6158;

    --accent: #fddfc2;
    --accent-foreground: #4d271d;

    --danger: #d4212d;
    --success: #2e7d32;

    --border: #e4d5c7;
    --input: #e9dbcf;

    --shadow-sm: 0 1px 2px rgba(55, 31, 25, .06);
    --shadow-md: 0 6px 20px rgba(55, 31, 25, .08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background);
}

/* ===== Typographie ===== */
h1.title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 4px 0;
}
.title.center { text-align: center; }
.subtitle { color: var(--muted-foreground); font-size: 15px; margin: 2px 0 4px; }

.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.center { text-align: center; }
.spacer { flex: 1; }

.price { color: var(--primary); font-weight: 700; }
.price.big { font-size: 20px; font-family: 'Fraunces', serif; }

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 12px;
}

/* Card de connexion : padding propre + espacement vertical entre chaque bloc (titre, message,
   accroche, champs, bouton, lien de bas de page), plutôt que de dépendre des marges par défaut. */
.login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
}
.login-card > * { margin: 0; }
.field-group { display: flex; flex-direction: column; }

.empty, .loader {
    text-align: center;
    color: var(--muted-foreground);
    padding: 48px 0;
}

.section { margin: 16px 0; }
.section-label {
    font-family: 'Fraunces', serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--foreground);
    margin: 14px 0 8px;
}

/* ===== Boutons ===== */
.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 999px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: var(--muted); color: var(--muted-foreground); cursor: not-allowed; }
.btn-primary.full { width: 100%; }

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border: none;
    border-radius: 999px;
    padding: 13px 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-secondary:hover { background: var(--accent); }
.btn-secondary.tiny { padding: 7px 14px; font-size: 12px; }

.btn-trash {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
    border-radius: 10px;
    padding: 6px 8px;
}
.btn-trash:hover { background: var(--muted); }

.round-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    font-size: 22px;
    cursor: pointer;
    transition: background .15s;
}
.round-btn:hover { background: var(--accent); }
.round-btn.small { width: 36px; height: 36px; font-size: 18px; }

/* ===== Page / header ===== */
.page-grid { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 14px 16px 14px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}
.header-back {
    display: flex;
    align-items: center;
    height: 44px;
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0 4px;
    white-space: nowrap;
}
.header-back:hover { color: var(--foreground); }
.brand {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--foreground);
}
.topbar-clock { font-size: 18px; }
.topbar-date, .topbar-slot {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--foreground);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
}
.topbar-spacer { flex: 1; }

.account-menu { position: relative; flex: 0 0 auto; }

.account-link {
    display: flex;
    align-items: center;
    height: 44px;
    gap: 6px;
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.account-link:hover { background: var(--accent); }

.account-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 170px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 30;
}
.account-dropdown a, .account-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--foreground);
    text-decoration: none;
    cursor: pointer;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--muted); }
.account-dropdown-logout { color: var(--danger); }

/* Icône seule sur mobile : la topbar est déjà chargée (panier, etc.). */
@media (max-width: 720px) {
    .account-link-text { display: none; }
    .account-link { padding: 0; width: 44px; justify-content: center; }
}

/* Sélecteur de langue, en bout de topbar : seule la langue active est affichée (esprit bandeau
   simple type site constructeur auto), le clic ouvre la liste des langues disponibles. */
.lang-menu { position: relative; flex: 0 0 auto; }

.lang-current {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 6px 4px;
    cursor: pointer;
    transition: color .15s;
}
.lang-current:hover { color: var(--primary); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 64px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 30;
}
.lang-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--foreground);
    cursor: pointer;
}
.lang-dropdown button:hover { background: var(--muted); }
.lang-dropdown button.active { color: var(--primary); }

.menu-head { padding: 6px 16px 10px; }

.pickup-button {
    display: flex;
    align-items: center;
    height: 44px;
    gap: 6px;
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.pickup-button:hover { background: var(--accent); }

.pickup-text-short { display: none; }

/* Téléphone : date en format court, sans icône (place limitée dans la topbar). */
@media (max-width: 560px) {
    .pickup-icon, .pickup-text-full { display: none; }
    .pickup-text-short { display: inline; }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px;
    z-index: 100;
}
.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px;
    width: 100%;
    max-width: 340px;
}
.pickup-modal .pickup-controls { flex-wrap: wrap; }
.pickup-modal-close {
    margin-top: 14px;
    width: 100%;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 999px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.cart-button {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px; height: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: background .15s;
}
.cart-button:hover { background: var(--accent); }
.cart-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 6px;
    border: 2px solid var(--background);
}

/* ===== Familles ===== */
.familles {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 16px 12px;
}
.famille-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .05s;
}
.famille-pill-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.famille-pill:hover { border-color: var(--primary); }
.famille-pill:active { transform: scale(.97); }
.famille-pill.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }

/* ===== Articles ===== */
.articles { flex: 1; padding: 4px 16px 24px; }
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px) {
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .articles-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
    .articles-grid { grid-template-columns: repeat(4, 1fr); }
}
.article-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: box-shadow .15s, transform .08s, border-color .15s;
}
.article-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-1px); }
.article-card.indispo { opacity: .5; }
.article-img {
    width: 80px; height: 80px;
    border-radius: 12px;
    background: var(--muted) center/cover no-repeat;
    flex: 0 0 auto;
}
.article-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.article-nom { font-weight: 600; font-size: 15px; }
.article-info .price { font-size: 16px; }
.article-indispo { color: var(--danger); font-size: 11px; }

/* ===== Détail ===== */
.detail-page { display: flex; flex-direction: column; min-height: 100vh; }

/* Barre supérieure du détail */
.detail-topbar { padding: 14px 16px 8px; }
.brand-block { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; color: inherit; }
.brand-sub {
    font-size: 10px;
    letter-spacing: .14em;
    color: var(--muted-foreground);
    font-weight: 600;
}
.date-pill {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.back-link {
    align-self: flex-start;
    margin: 2px 0 6px;
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
}
.back-link:hover { color: var(--foreground); }

/* Disposition deux colonnes (image figée à gauche, configuration à droite) */
.detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 4px 16px 28px;
}
/* Grand écran : l'image gagne en largeur, la configuration se resserre. */
@media (min-width: 1024px) {
    .detail-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* Lien retour : sa propre ligne, uniquement au-dessus de la colonne image, pour que la
   configuration s'aligne avec le haut de l'image plutôt qu'avec le lien. */
.detail-back {
    grid-column: 1;
    grid-row: 1;
    text-align: left;
}

/* Colonne média */
.detail-media { grid-column: 1; grid-row: 2; position: sticky; top: 16px; }
.media-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.media-img { aspect-ratio: 4 / 3; background: var(--muted) center/cover no-repeat; }
.media-caption { padding: 14px 16px 16px; }
.media-caption .title { margin: 0; }
.media-allergenes { margin-top: 6px; font-size: 13px; color: var(--foreground); }

/* Colonne configuration */
.detail-config { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; }
.config-section { margin-bottom: 6px; }

.banner-danger {
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
}

/* Bouton « Sans crudités » : rouge tant qu'il n'est pas activé, vert une fois activé. */
.crudites-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(212, 33, 45, .1);
    color: var(--danger);
    border: none;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.crudites-toggle:hover { background: rgba(212, 33, 45, .16); }
.crudites-toggle-label { display: flex; align-items: center; gap: 6px; }
.crudites-toggle-hint { font-weight: 500; font-size: 12px; opacity: .75; }
.crudites-toggle-state { font-size: 14px; font-weight: 600; white-space: nowrap; }
.crudites-toggle.active { background: var(--success); color: #fff; }

/* Tailles : grille de pastilles deux lignes (nom + delta de prix) */
.size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.size-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    padding: 10px 6px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}
.size-pill:hover { border-color: var(--primary); }
.size-pill:active { transform: scale(.97); }
.size-name { font-weight: 700; font-size: 18px; }
.size-delta { font-size: 11px; color: var(--muted-foreground); }
.size-pill.selected { background: var(--primary); border-color: var(--primary); }
.size-pill.selected .size-name,
.size-pill.selected .size-delta { color: var(--primary-foreground); }
.size-pill.indispo { opacity: .4; cursor: not-allowed; }

/* Options : cartes pleine largeur, vignette ronde, indicateur à droite */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.opt-card:hover { border-color: var(--primary); }
.opt-card.locked { cursor: default; }
.opt-card.locked:hover { border-color: var(--border); }
.opt-thumb {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--muted) center/cover no-repeat;
    flex: 0 0 auto;
}
.opt-name { flex: 1; font-weight: 500; }
.opt-price { color: var(--primary); font-weight: 700; font-size: 14px; }
.opt-check {
    width: 24px; height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid var(--input);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-foreground);
    font-size: 13px;
    font-weight: 700;
}
.opt-check.on { background: var(--primary); border-color: var(--primary); }
.opt-check.lock { border: none; background: none; font-size: 14px; }

/* Carte d'action : quantité + total + ajout */
.config-action {
    margin-top: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 14px;
    position: sticky;
    bottom: 12px;
}
.action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.step-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    transition: background .15s;
}
.step-btn:hover { background: var(--accent); }
.step-btn.plus { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.step-btn.plus:hover { background: var(--primary-hover); }
.qty-val { min-width: 28px; text-align: center; font-weight: 700; font-size: 16px; }
.action-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }

/* Empilement sur mobile : retour à l'ordre naturel (lien, image, configuration) */
@media (max-width: 720px) {
    .detail-layout { grid-template-columns: 1fr; gap: 16px; }
    .detail-back, .detail-media, .detail-config { grid-column: 1; grid-row: auto; }
    .detail-media { position: static; }
}

/* ===== Barre d'action ===== */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(55,31,25,.06);
    position: sticky;
    bottom: 0;
}
.action-bar.two .btn-primary, .action-bar.two .btn-secondary { flex: 1; }

/* ===== Upsell ===== */
.upsell-title { padding: 0 16px; }
.upsell-list { flex: 1; padding: 0 16px; }
.upsell-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 10px 0;
}
.upsell-img {
    width: 66px; height: 66px;
    border-radius: 14px;
    background: var(--muted) center/cover no-repeat;
}
.upsell-info { flex: 1; }
.upsell-nom { font-weight: 600; }
.qty-group { display: flex; align-items: center; gap: 8px; }

/* ===== Panier ===== */
.cart-head { padding: 0 16px 4px; }
.cart-head .title { margin: 0; }

/* Disposition deux colonnes (articles à gauche, total + formulaire à droite) */
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
    padding: 8px 16px 28px;
}

.cart-main { display: flex; flex-direction: column; gap: 12px; }

/* Carte « heure de retrait » */
.pickup-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 12px 16px;
}
.pickup-label {
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}
.pickup-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Utilisée hors de .cart-layout (qui a déjà son propre gouttière) : accueil notamment. */
.pickup-card-standalone { margin: 0 16px 12px; }

/* Article au panier */
.cart-item {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px;
}
.cart-item-img {
    width: 56px; height: 56px;
    border-radius: 12px;
    background: var(--muted) center/cover no-repeat;
    cursor: pointer;
    flex: 0 0 auto;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cart-item-nom { font-weight: 700; cursor: pointer; font-size: 16px; }
.cart-item-details {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 13px;
    color: var(--muted-foreground);
}
.cart-item-details li { padding-left: 12px; position: relative; line-height: 1.5; }
.cart-item-details li::before { content: "·"; position: absolute; left: 2px; }
.cart-item-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.btn-link-modifier {
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.btn-link-modifier:hover { color: var(--primary); }

/* Colonne droite */
.cart-side { display: flex; flex-direction: column; gap: 10px; }
.total-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--foreground);
    color: var(--primary-foreground);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-md);
}
.total-label { font-weight: 700; letter-spacing: .06em; }
.total-value { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; }
.total-value-strike { text-decoration: line-through; opacity: .6; font-size: 14px; margin-right: 4px; }

.coupon-option, .coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 14px;
}
.coupon-applied { border-color: var(--primary); background: var(--accent); }

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    margin: 6px 0 -2px;
}
.field {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    background: var(--surface);
    font-family: inherit;
    color: var(--foreground);
    margin-bottom: 16px;
}
.field:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
/* La card de connexion gère déjà l'espacement via son gap flex : éviter le cumul. */
.login-card .field { margin-bottom: 0; }
.cart-side .btn-primary { margin-top: 6px; }

/* Empilement sur mobile */
@media (max-width: 720px) {
    .cart-layout { grid-template-columns: 1fr; gap: 16px; }
    .cart-side { order: 2; }
}

/* ===== Compte / historique ===== */
.detail-page > .card,
.detail-page > .total-card,
.detail-page > .empty,
.detail-page > .loader { margin: 12px 16px 0; }
.detail-page > .card:first-child,
.detail-page > .total-card:first-child { margin-top: 16px; }

.profile-header { display: flex; align-items: center; gap: 14px; }
.profile-header .title { margin: 0; }
.profile-header-info { flex: 1; min-width: 0; }
.avatar-circle {
    flex: 0 0 auto;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-size: 20px;
    font-weight: 700;
}

.link-danger {
    display: block;
    margin: 18px auto 0;
    background: none;
    border: none;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 0;
}
.link-danger:hover { text-decoration: underline; }

.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.order-ref { color: var(--muted-foreground); font-size: 12px; letter-spacing: .04em; margin-bottom: 2px; }
.order-card .btn-primary { width: 100%; margin-top: 10px; }

/* ===== Confirmation ===== */
.confirmation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 100vh;
    padding: 28px;
}
.check {
    font-size: 40px;
    width: 88px; height: 88px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent);
    color: var(--success);
    border-radius: 50%;
}
.confirm-box { padding: 18px 28px; text-align: center; }
.confirm-num { font-weight: 700; font-size: 18px; font-family: 'Fraunces', serif; }

/* ===== Toast ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 0; right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 1000;
}
.toast {
    background: var(--foreground);
    color: var(--primary-foreground);
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    max-width: 90%;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== Erreur Blazor ===== */
#blazor-error-ui {
    background: #ffeceb;
    color: var(--danger);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1001;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.loading-progress { display: block; width: 6rem; height: 6rem; margin: 20vh auto 1rem; }
.loading-progress circle { fill: none; stroke: var(--muted); stroke-width: 0.4rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--primary); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { text-align: center; color: var(--muted-foreground); font-family: 'Fraunces', serif; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Chargement"); }
