/* Transitions natives entre pages (API View Transitions, navigation
   cross-document) — sans ça, chaque écran s'affiche par un jump brut ; avec,
   le contenu s'estompe en douceur et la barre d'onglets reste stable, comme
   une vraie app. Support : Safari 18+/WKWebView récent, Chrome 126+. */
@view-transition { navigation: auto; }

@font-face {
    font-family: 'SL';
    src: local('Helvetica Neue');
}

:root {
    --noir: #0c0c0e;
    --surface: #17171b;
    --surface-2: #202024;
    --accent: #ff4319;
    --accent-soft: rgba(255, 67, 25, .14);
    --jaune: #ffcf3f;
    --text: #f5f3ef;
    --text-muted: #8f8f96;
    --line: rgba(255, 255, 255, .1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--noir);
    color: var(--text);
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
}

.ecran { padding: 20px 20px 40px; max-width: 480px; margin: 0 auto; }
.ecran.avec-onglets { padding-bottom: 96px; }

/* ── Marque ──────────────────────────────────────────────────────────────── */
.marque {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.02em;
    text-transform: uppercase;
}
.marque span { color: var(--accent); }

/* ── Entête ──────────────────────────────────────────────────────────────── */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.entete-titre { display: flex; align-items: center; gap: 12px; }
.entete h1 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.retour { background: none; border: none; color: var(--text); font-size: 22px; padding: 4px 6px 4px 0; cursor: pointer; }
.icone-btn { background: var(--surface); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.icone-btn svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 2; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.bouton {
    display: block; width: 100%; background: var(--accent); color: #fff; border: none;
    padding: 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    border-radius: 99px; cursor: pointer; margin-top: 8px; font-family: inherit;
}
.bouton:active { opacity: .85; }
.bouton-secondaire { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.bouton-erreur { color: #ff6b5b; font-size: 13px; margin-top: 12px; min-height: 16px; }

/* ── Champs ──────────────────────────────────────────────────────────────── */
.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 7px; }
.champ input, .champ select {
    width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text);
    padding: 14px 15px; font-size: 15px; border-radius: 12px; font-family: inherit;
}
.champ input:focus, .champ select:focus { outline: none; border-color: var(--accent); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 5px 10px; border-radius: 99px; }
.badge-drop { background: var(--jaune); color: #1a1400; }
.badge-nouveau { background: var(--accent); color: #fff; }
.badge-rupture { background: var(--surface-2); color: var(--text-muted); }

/* ── Onboarding ──────────────────────────────────────────────────────────── */
.onboard-visuel {
    height: 340px; border-radius: 20px; margin-bottom: 26px; position: relative; overflow: hidden;
    background: linear-gradient(155deg, #2a1206, var(--noir) 65%);
    display: flex; align-items: flex-end; padding: 22px;
}
.onboard-visuel .badge { position: absolute; top: 18px; left: 18px; }
.onboard-visuel::after {
    content: "S"; position: absolute; right: -10px; bottom: -40px; font-size: 260px; font-weight: 900;
    color: rgba(255,255,255,.05); letter-spacing: -.05em; line-height: 1;
}
.point-progression { display: flex; justify-content: center; gap: 6px; margin: 18px 0 26px; }
.point-progression span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.point-progression span.actif { background: var(--accent); width: 22px; border-radius: 4px; }
.lien-discret { display: block; text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 14px; text-decoration: none; }

/* ── Onglets bas ─────────────────────────────────────────────────────────── */
.onglets {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: space-around;
    background: rgba(23,23,27,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
    view-transition-name: barre-onglets;
}
.onglet { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; color: var(--text-muted); font-family: inherit; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; flex: 1; position: relative; }
.onglet svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 2; }
.onglet.actif { color: var(--accent); }
.onglet .pastille { position: absolute; top: -2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ── Bandeau catégories / filtres ───────────────────────────────────────── */
.filtres { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 2px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.puce-filtre { flex-shrink: 0; font-size: 12.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--text-muted); padding: 9px 16px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.puce-filtre.actif { background: var(--text); border-color: var(--text); color: var(--noir); }

/* ── Bannière accueil ────────────────────────────────────────────────────── */
.hero-drop {
    border-radius: 20px; padding: 26px 22px; margin-bottom: 24px; position: relative; overflow: hidden;
    background: linear-gradient(150deg, #3a1608, #0c0c0e 70%);
    min-height: 190px; display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-drop .badge { margin-bottom: 10px; align-self: flex-start; }
.hero-drop h2 { font-size: 25px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 4px; }
.hero-drop p { font-size: 13px; color: var(--text-muted); }
.hero-drop::after {
    content: "S"; position: absolute; right: -14px; bottom: -46px; font-size: 210px; font-weight: 900;
    color: rgba(255,255,255,.05); letter-spacing: -.05em; line-height: 1;
}
.compte-rebours { display: flex; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.compte-rebours-unite { background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 7px 10px; text-align: center; min-width: 44px; }
.compte-rebours-unite span { display: block; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1; }
.compte-rebours-unite small { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 3px; }

.section-titre { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 14px; }
.section-titre h3 { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.section-titre a { font-size: 12px; color: var(--text-muted); text-decoration: none; }

/* ── Grille produits ─────────────────────────────────────────────────────── */
.grille-produits { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.carte-produit { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; }
.produit-visuel { height: 128px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.produit-visuel::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.16) 50%, transparent 60%);
}
.produit-visuel::after {
    content: attr(data-lettre);
    font-size: 44px; font-weight: 900; color: rgba(255,255,255,.16); letter-spacing: -.02em;
}
.produit-visuel .badge { position: absolute; top: 9px; left: 9px; font-size: 9px; padding: 4px 8px; }
.produit-visuel .fav { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(12,12,14,.55); display: flex; align-items: center; justify-content: center; }
.produit-visuel .fav svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; }
.produit-visuel .fav.actif svg { fill: var(--accent); stroke: var(--accent); }
.produit-infos { padding: 11px 12px 13px; }
.produit-nom { font-size: 13px; font-weight: 700; margin-bottom: 2px; line-height: 1.3; }
.produit-cat { font-size: 11px; color: var(--text-muted); margin-bottom: 7px; }
.produit-prix { font-size: 14px; font-weight: 800; }
.produit-prix .barre { color: var(--text-muted); text-decoration: line-through; font-weight: 500; font-size: 12px; margin-left: 6px; }

/* Liste produits (une colonne, plus riche — favoris, recherche) */
.liste-produits { display: flex; flex-direction: column; gap: 12px; }
.ligne-produit { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; cursor: pointer; align-items: center; }
.ligne-produit .produit-visuel { width: 84px; height: 84px; border-radius: 12px; flex-shrink: 0; }
.ligne-produit .produit-infos { padding: 0; flex: 1; }

/* ── Détail produit — visionneuse 3D (glisser pour tourner) ─────────────── */
.viewer-3d {
    height: 300px; border-radius: 20px; margin-bottom: 10px; position: relative;
    display: flex; align-items: center; justify-content: center;
    perspective: 900px; overflow: hidden; touch-action: pan-y; cursor: grab;
    background: radial-gradient(120% 100% at 50% 15%, #1c1c20, var(--noir) 75%);
}
.viewer-3d:active { cursor: grabbing; }
.viewer-3d-carte {
    width: 62%; height: 62%; border-radius: 18px; position: relative;
    transform-style: preserve-3d; will-change: transform;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 30px 50px -20px rgba(0,0,0,.6);
}
.viewer-3d-face {
    position: absolute; inset: 0; border-radius: 18px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    backface-visibility: hidden;
}
.viewer-3d-face img { width: 100%; height: 100%; object-fit: cover; }
.viewer-3d-face .lettre-geante { font-size: 96px; font-weight: 900; color: rgba(255,255,255,.22); letter-spacing: -.03em; }
.viewer-3d-face::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%);
}
.viewer-3d-face.arriere { transform: rotateY(180deg); }
.viewer-3d-ombre {
    position: absolute; bottom: 14px; left: 50%; width: 46%; height: 14px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0,0,0,.5), transparent 75%);
    transform: translateX(-50%); transition: width .1s, opacity .1s;
}
.viewer-3d-badge {
    position: absolute; top: 14px; left: 14px; z-index: 2;
}
.viewer-3d-indice {
    position: absolute; bottom: 10px; right: 14px; z-index: 2;
    font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em;
    display: flex; align-items: center; gap: 5px;
}
.viewer-3d-indice svg { width: 13px; height: 13px; stroke: var(--text-muted); fill: none; stroke-width: 2; }
.viewer-3d-degre {
    text-align: center; font-size: 11px; color: var(--text-muted); margin-bottom: 22px; font-variant-numeric: tabular-nums;
}

.produit-entete-detail { margin-bottom: 4px; }
.produit-entete-detail .produit-cat { margin-bottom: 4px; }
.produit-entete-detail h1 { font-size: 23px; font-weight: 900; letter-spacing: -.01em; line-height: 1.2; }
.produit-prix-detail { font-size: 21px; font-weight: 900; margin: 10px 0 20px; }

.bloc-choix { margin-bottom: 22px; }
.bloc-choix-titre { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px; }
.bloc-choix-titre strong { color: var(--text); }
.rangee-couleurs { display: flex; gap: 10px; }
.pastille-couleur { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; position: relative; }
.pastille-couleur.actif { border-color: var(--accent); }
.pastille-couleur.actif::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--accent); }
.grille-tailles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.taille { text-align: center; padding: 11px 0; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; cursor: pointer; }
.taille.actif { background: var(--text); color: var(--noir); border-color: var(--text); }
.taille.indispo { opacity: .3; text-decoration: line-through; pointer-events: none; }

.produit-description { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }

.barre-achat { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(12,12,14,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.barre-achat .bouton { margin-top: 0; }

/* ── Panier ──────────────────────────────────────────────────────────────── */
.ligne-panier { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ligne-panier:last-child { border-bottom: none; }
.ligne-panier .produit-visuel { width: 72px; height: 72px; border-radius: 12px; flex-shrink: 0; }
.panier-corps { flex: 1; }
.panier-nom { font-size: 14px; font-weight: 700; }
.panier-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.panier-prix { font-size: 14px; font-weight: 800; margin-top: 6px; }
.quantite { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.quantite button { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 14px; cursor: pointer; }
.suppr-ligne { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; align-self: flex-start; }

.recap-ligne { display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 0; color: var(--text-muted); }
.recap-ligne.total { color: var(--text); font-weight: 900; font-size: 18px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; }

/* ── Paiement ────────────────────────────────────────────────────────────── */
.moyen-paiement { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; margin-bottom: 10px; cursor: pointer; }
.moyen-paiement.actif { border-color: var(--accent); background: var(--accent-soft); }
.moyen-paiement-detail { flex: 1; font-size: 14px; font-weight: 600; }
.moyen-paiement .coche { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.moyen-paiement.actif .coche { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--noir); }
.adresse-carte { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.adresse-carte-texte { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.adresse-carte-texte strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 3px; }
.adresse-carte a { color: var(--accent); font-size: 12.5px; font-weight: 700; text-decoration: none; flex-shrink: 0; }

/* ── États système ───────────────────────────────────────────────────────── */
.etat-systeme { text-align: center; padding: 60px 24px; }
.etat-icone { width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.etat-icone svg { width: 30px; height: 30px; stroke: var(--text-muted); fill: none; stroke-width: 1.8; }
.etat-icone.succes { border-color: rgba(255,207,63,.5); background: rgba(255,207,63,.08); }
.etat-icone.succes svg { stroke: var(--jaune); }
.etat-titre { font-size: 19px; font-weight: 900; margin-bottom: 9px; }
.etat-texte { font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 300px; margin: 0 auto; }

/* ── Commandes ───────────────────────────────────────────────────────────── */
.carte-commande { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px; margin-bottom: 12px; cursor: pointer; }
.carte-commande-tete { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.carte-commande-ref { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.carte-commande-date { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.statut-commande { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 5px 10px; border-radius: 99px; }
.statut-livree { background: rgba(255,207,63,.16); color: var(--jaune); }
.statut-transit { background: var(--accent-soft); color: var(--accent); }
.statut-preparation { background: var(--surface-2); color: var(--text-muted); }
.carte-commande-produits { display: flex; gap: 8px; }
.mini-visuel { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; }
.carte-commande-bas { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.carte-commande-total { font-size: 14px; font-weight: 800; }

.suivi-etapes { display: flex; flex-direction: column; gap: 0; margin: 22px 0; }
.suivi-etape { display: flex; gap: 14px; }
.suivi-etape-rail { display: flex; flex-direction: column; align-items: center; }
.suivi-etape-point { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); flex-shrink: 0; margin-top: 2px; }
.suivi-etape.fait .suivi-etape-point { background: var(--accent); border-color: var(--accent); }
.suivi-etape-trait { width: 2px; flex: 1; background: var(--line); min-height: 30px; }
.suivi-etape.fait .suivi-etape-trait { background: var(--accent); }
.suivi-etape-corps { padding-bottom: 26px; }
.suivi-etape-titre { font-size: 13.5px; font-weight: 700; }
.suivi-etape-titre.attenue { color: var(--text-muted); font-weight: 500; }
.suivi-etape-date { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Profil ──────────────────────────────────────────────────────────────── */
.avatar { width: 74px; height: 74px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: var(--accent); margin: 0 auto 14px; }
.profil-nom { text-align: center; font-size: 19px; font-weight: 900; }
.profil-sous { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 26px; }
.ligne-option { display: flex; justify-content: space-between; align-items: center; padding: 15px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ligne-option:last-child { border-bottom: none; }
.ligne-option-titre { font-size: 14.5px; font-weight: 600; }
.ligne-option-sous { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.recherche-barre { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; margin-bottom: 18px; }
.recherche-barre svg { width: 18px; height: 18px; stroke: var(--text-muted); flex-shrink: 0; }
.recherche-barre input { flex: 1; background: none; border: none; color: var(--text); font-size: 15px; font-family: inherit; }
.recherche-barre input:focus { outline: none; }

.vide { text-align: center; color: var(--text-muted); font-size: 14px; padding: 40px 0; }
.chargement { text-align: center; color: var(--text-muted); font-size: 14px; padding: 40px 0; }
