/* JLR Wine — theme "cave" : sombre, bordeaux et or */
:root {
  --fond: #140A0F;
  --fond2: #1C0F16;
  --panneau: #241520;
  --panneau2: #2F1B29;
  --bord: #452837;
  --texte: #F4ECEF;
  --texte2: #B9A3AE;
  --texte3: #8C7480;
  --bordeaux: #9E2445;
  --bordeaux2: #C23A5E;
  --or: #D9B25F;
  --or2: #F0D28C;
  --vert: #6FCF97;
  --bleu: #7DB3E8;
  --orange: #F2994A;
  --rouge: #EB5757;
  --c-rouge: #8E1B35;
  --c-blanc: #E8D58A;
  --c-rose: #F2A3B3;
  --c-effervescent: #F3E7B5;
  --c-liquoreux: #D99A2B;
  --c-fortifie: #6B2A1A;
  --c-autre: #9A8A94;
  --rayon: 14px;
  --ombre: 0 8px 28px rgba(0,0,0,.45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); min-height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; font-size: 15px; }
body { overflow-x: hidden; }
.cache { display: none !important; }
a { color: var(--or2); }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: .2px; }
button { font: inherit; cursor: pointer; }

/* ---------- Champs & boutons ---------- */
input, textarea, select {
  font: inherit; color: var(--texte); background: var(--fond2); border: 1px solid var(--bord);
  border-radius: 10px; padding: 11px 12px; width: 100%; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--or); }
textarea { resize: vertical; min-height: 80px; }
label.champ { display: block; font-size: 12.5px; color: var(--texte2); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .6px; }
.ligne-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { border: 0; border-radius: 11px; padding: 12px 18px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--bordeaux2), var(--bordeaux)); box-shadow: 0 4px 14px rgba(158,36,69,.35);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.or { background: linear-gradient(135deg, var(--or2), var(--or)); color: #2A1620; box-shadow: 0 4px 14px rgba(217,178,95,.3); }
.btn.sec { background: var(--panneau2); color: var(--texte); box-shadow: none; border: 1px solid var(--bord); }
.btn.danger { background: transparent; color: var(--rouge); border: 1px solid rgba(235,87,87,.5); box-shadow: none; }
.btn.plein { width: 100%; }
.btn.petit { padding: 8px 12px; font-size: 13.5px; border-radius: 9px; }
.lien { background: none; border: 0; color: var(--or2); padding: 4px; text-decoration: underline; }
.msg-erreur { color: var(--rouge); min-height: 20px; font-size: 13.5px; margin-top: 8px; }
.discret { color: var(--texte2); font-size: 13px; }

/* ---------- Connexion ---------- */
#ecran-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(circle at 50% 15%, #3A1426 0%, var(--fond) 65%); }
.login-boite { width: min(380px, 100%); background: rgba(36,21,32,.85); border: 1px solid var(--bord); border-radius: 20px;
  padding: 30px 24px; box-shadow: var(--ombre); text-align: center; }
.login-boite img { width: 84px; height: 84px; border-radius: 22px; }
.login-boite h1 { margin: 12px 0 2px; font-size: 30px; color: var(--or2); }
.login-boite .sous { color: var(--texte2); margin: 0 0 18px; font-size: 13.5px; }
.login-boite form { text-align: left; }
.login-boite .btn { margin-top: 18px; }

/* ---------- Structure ---------- */
#appli { min-height: 100vh; }
header.barre { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(20,10,15,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bord); }
header.barre img { width: 34px; height: 34px; border-radius: 9px; }
header.barre .titre { font-family: Georgia, serif; font-size: 20px; color: var(--or2); font-weight: 600; }
header.barre .stats { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--texte2); line-height: 1.25; }
header.barre .stats b { color: var(--texte); font-size: 14px; }
.btn-menu { background: var(--panneau2); border: 1px solid var(--bord); color: var(--texte); width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
main { min-width: 0; padding: 16px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; }

nav.onglets { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(28,15,22,.97); border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(10px); }
nav.onglets button { background: none; border: 0; color: var(--texte3); padding: 8px 2px 9px; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; }
nav.onglets button svg { width: 24px; height: 24px; }
nav.onglets button.actif { color: var(--or2); }
nav.onglets button.scan { position: relative; color: #fff; }
nav.onglets button.scan .rond { width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bordeaux2), var(--bordeaux)); box-shadow: 0 6px 18px rgba(158,36,69,.55); border: 3px solid var(--fond); }
nav.onglets button.scan svg { width: 28px; height: 28px; }

@media (min-width: 900px) {
  #appli { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
  header.barre { grid-column: 1 / 3; }
  nav.onglets { position: sticky; top: 56px; height: calc(100vh - 56px); display: flex; flex-direction: column; gap: 4px;
    border-top: 0; border-right: 1px solid var(--bord); padding: 18px 12px; background: var(--fond2); }
  nav.onglets button { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 11px 14px; border-radius: 10px; }
  nav.onglets button.actif { background: var(--panneau2); }
  nav.onglets button.scan { order: -1; margin-bottom: 12px; background: linear-gradient(135deg, var(--bordeaux2), var(--bordeaux)); }
  nav.onglets button.scan .rond { width: auto; height: auto; margin: 0; background: none; box-shadow: none; border: 0; }
  main { padding: 24px 28px 40px; width: 100%; }
}

.entete-vue { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.entete-vue h2 { margin: 0; font-size: 24px; flex: 1; min-width: 150px; }

/* ---------- Cave : filtres & cartes ---------- */
.recherche { position: relative; flex: 1 1 260px; }
.recherche input { padding-left: 38px; }
.recherche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--texte3); }
.puces { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce { flex: none; border: 1px solid var(--bord); background: var(--panneau); color: var(--texte2); border-radius: 20px; padding: 7px 13px; font-size: 13px; }
.puce.actif { background: var(--or); color: #2A1620; border-color: var(--or); font-weight: 600; }
.grille-vins { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.carte-vin { display: flex; gap: 12px; background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; cursor: pointer; position: relative; overflow: hidden; }
.carte-vin:hover { border-color: #6A3A50; }
.carte-vin::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--coul, var(--c-autre)); }
.vignette { width: 74px; height: 96px; flex: none; border-radius: 9px; background: var(--fond2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--texte3); }
/* photos de bouteilles (souvent detourees, hautes et sombres) : entieres, sur fond clair */
.vignette.photo { background-color: #EFE8EB; background-size: contain; background-origin: content-box; padding: 4px; }
.carte-vin .infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.carte-vin .nom { font-family: Georgia, serif; font-size: 16px; font-weight: 600; line-height: 1.2; }
.carte-vin .sous { color: var(--texte2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-vin .bas { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.qte { background: var(--panneau2); border: 1px solid var(--bord); border-radius: 8px; padding: 2px 8px; font-weight: 700; }
.qte.zero { opacity: .5; }
.badge { border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.m-jeune { background: rgba(125,179,232,.16); color: var(--bleu); }
.m-buvable { background: rgba(111,207,151,.15); color: var(--vert); }
.m-apogee { background: rgba(217,178,95,.2); color: var(--or2); }
.m-boire { background: rgba(242,153,74,.18); color: var(--orange); }
.m-passe { background: rgba(235,87,87,.18); color: var(--rouge); }
.m-inconnu { background: var(--panneau2); color: var(--texte3); }
.prix { color: var(--or2); font-weight: 600; }
.vide { text-align: center; padding: 50px 16px; color: var(--texte2); }
.vide svg { width: 64px; height: 64px; color: var(--bord); }
.vide h3 { color: var(--texte); }

/* ---------- Feuille (modale) ---------- */
.voile { position: fixed; inset: 0; z-index: 60; background: rgba(8,3,6,.7); display: flex; align-items: flex-end; justify-content: center; }
.feuille { width: 100%; max-width: 760px; max-height: 94vh; overflow-y: auto; background: var(--fond2); border: 1px solid var(--bord);
  border-radius: 20px 20px 0 0; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--ombre); animation: monte .22s ease-out; }
.feuille.etroite { max-width: 480px; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) { .voile { align-items: center; } .feuille { border-radius: 20px; max-height: 90vh; } }
.feuille-tete { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 0 10px; background: var(--fond2); }
.feuille-tete h3 { margin: 0; flex: 1; font-size: 19px; }
.fermer { background: var(--panneau2); border: 1px solid var(--bord); color: var(--texte); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; line-height: 1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.actions .btn { flex: 1 1 140px; }

/* ---------- Fiche vin ---------- */
.fiche-haut { display: flex; gap: 16px; align-items: flex-start; }
.fiche-photo { width: 120px; flex: none; border-radius: 12px; cursor: zoom-in; background: #EFE8EB; aspect-ratio: 3/4; object-fit: contain; padding: 4px; }
.fiche-haut h2 { margin: 0 0 4px; font-size: 23px; line-height: 1.2; }
.fiche-haut .appel { color: var(--texte2); font-size: 14px; }
.fiche-haut .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { background: var(--panneau2); border: 1px solid var(--bord); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; color: var(--texte2); }
.resume { margin: 14px 0 0; padding: 12px 14px; background: rgba(217,178,95,.08); border-left: 3px solid var(--or); border-radius: 8px; font-style: italic; line-height: 1.5; }
.section { margin-top: 18px; background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; }
.section h4 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 16px; color: var(--or2); display: flex; align-items: center; gap: 8px; }
.section h4 .droite { margin-left: auto; font-family: inherit; font-size: 12px; color: var(--texte3); font-weight: 400; }
.prix-grand { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.prix-grand .v { font-size: 26px; font-weight: 700; color: var(--or2); }
.prix-grand .e { color: var(--texte2); font-size: 13px; }
.offres { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.offre { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--fond2); border-radius: 9px; font-size: 13.5px; text-decoration: none; color: var(--texte); }
.offre b { color: var(--or2); white-space: nowrap; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.note { background: var(--fond2); border-radius: 10px; padding: 10px; font-size: 13px; }
.note .n { font-size: 20px; font-weight: 700; color: var(--or2); }
.note .s { font-weight: 600; }
.note .x { color: var(--texte2); margin-top: 4px; line-height: 1.4; }
.degust { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 14px; line-height: 1.45; }
.degust dt { color: var(--texte3); }
.degust dd { margin: 0; }
.accords { display: flex; flex-wrap: wrap; gap: 6px; }
.accords span { background: rgba(111,207,151,.12); color: #BFEBD0; border-radius: 8px; padding: 4px 9px; font-size: 13px; }
.accords.possibles span { background: var(--panneau2); color: var(--texte); }
.accords.eviter span { background: rgba(235,87,87,.12); color: #F2B8B8; }
.sous-titre-acc { font-size: 12px; color: var(--texte3); text-transform: uppercase; letter-spacing: .6px; margin: 10px 0 6px; }
.courbe svg { width: 100%; height: auto; display: block; }
.service { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.service div { background: var(--fond2); border-radius: 9px; padding: 9px 10px; font-size: 13.5px; }
.service small { display: block; color: var(--texte3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.bouteilles { display: flex; flex-direction: column; gap: 6px; }
.bouteille { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--fond2); border-radius: 9px; font-size: 13.5px; }
.bouteille .ou { flex: 1; }
.sources a { display: block; font-size: 12.5px; padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.texte-court { font-size: 14px; line-height: 1.5; color: var(--texte); margin: 0; }

/* ---------- Scan ---------- */
.scan-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.scan-choix label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 10px; border: 1.5px dashed var(--bord);
  border-radius: 16px; background: var(--panneau); cursor: pointer; text-align: center; font-weight: 600; }
.scan-choix label svg { width: 36px; height: 36px; color: var(--or2); }
.scan-choix input { display: none; }
.scan-choix label span { display: block; margin-top: 2px; }
.scan-choix.survol label { border-color: var(--or); background: var(--panneau2); }
.deux-col > .section:first-child { margin-top: 0; }
@media (min-width: 1100px) {
  .deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .deux-col > .section { margin-top: 0; }
}
.apercu { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 14px; background: #000; }
.attente { text-align: center; padding: 30px 10px; }
.verre-anime { width: 70px; height: 70px; margin: 0 auto 14px; }
.verre-anime .vin { animation: remplit 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes remplit { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.attente .etape { color: var(--texte); font-weight: 600; }
.attente .chrono { color: var(--texte3); font-size: 13px; margin-top: 6px; }
.alerte { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-top: 12px; line-height: 1.4; }
.alerte.info { background: rgba(125,179,232,.12); color: #CFE3F7; }
.alerte.attention { background: rgba(242,153,74,.14); color: #F7D2B0; }
.compteur { display: flex; align-items: center; gap: 10px; }
.compteur button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--bord); background: var(--panneau2); color: var(--texte); font-size: 20px; }
.compteur input { width: 70px; text-align: center; font-weight: 700; font-size: 18px; }

/* ---------- Rayonnages ---------- */
.grille-rayons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.carte-rayon { background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; cursor: pointer; }
.carte-rayon .img { height: 150px; background: var(--fond2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--texte3); }
.carte-rayon .txt { padding: 10px 12px; }
.carte-rayon .txt b { font-family: Georgia, serif; font-size: 16px; }
.jauge { height: 6px; border-radius: 4px; background: var(--fond2); margin-top: 8px; overflow: hidden; }
.jauge div { height: 100%; background: linear-gradient(90deg, var(--bordeaux2), var(--or)); }
.photo-rayon { position: relative; border-radius: 14px; overflow: hidden; background: #000; }
.photo-rayon img { width: 100%; display: block; max-height: 60vh; object-fit: contain; }
.photo-rayon .repere { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff;
  background: var(--coul, var(--bordeaux)); box-shadow: 0 0 0 3px rgba(0,0,0,.35); cursor: pointer; }
.photo-rayon .repere.vise { animation: pulse 1s ease-in-out infinite; z-index: 2; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-color: var(--or2); }
.photo-rayon .repere.propose { border-style: dashed; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(240,210,140,.8); } 50% { box-shadow: 0 0 0 12px rgba(240,210,140,0); } }
.casier-zone { overflow-x: auto; padding-bottom: 6px; }
.casier { display: grid; gap: 4px; margin: 0 auto; width: max-content; min-width: 100%; padding: 8px; background: #2A1810;
  border-radius: 12px; border: 1px solid #4A2E1E; }
.case { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #3E2618; background: #1A0E09; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.9); cursor: pointer; padding: 0; position: relative; }
.case.pleine { background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.35), transparent 45%), var(--coul); border-color: rgba(0,0,0,.4); color: #fff; text-shadow: 0 1px 2px #000; }
.case.pleine.clair { color: #2A1620; text-shadow: none; }
.case.vise { outline: 3px solid var(--or2); outline-offset: 2px; animation: pulse 1s infinite; }
.case.choisie { outline: 3px solid var(--vert); outline-offset: 2px; }
.case.propose { border-style: dashed; border-color: var(--or2); }
.case.inconnue { background: repeating-linear-gradient(45deg, #5a4650, #5a4650 4px, #3d2d35 4px, #3d2d35 8px); }
.legende-casier { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--texte3); margin: 4px 4px 0; }
.liste-prop { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.prop { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: center; background: var(--panneau); border-radius: 10px; padding: 8px; font-size: 13px; }
.prop .pos { font-weight: 700; color: var(--or2); text-align: center; }
.prop select { padding: 7px 8px; font-size: 13px; }
.prop .desc { grid-column: 2; color: var(--texte3); font-size: 12px; }

/* ---------- Sommelier & carnet ---------- */
.idees-rapides { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.choix-somm { display: flex; gap: 12px; background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px; margin-top: 12px; }
.choix-somm .rang { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--or); color: #2A1620; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.choix-somm .corps { flex: 1; min-width: 0; }
.choix-somm .ou { color: var(--or2); font-size: 13px; margin-top: 6px; }
.etoiles { display: inline-flex; gap: 2px; }
.etoiles button { background: none; border: 0; font-size: 28px; color: var(--bord); padding: 0 2px; }
.etoiles button.on { color: var(--or); }
.etoiles.petites { font-size: 14px; color: var(--or); letter-spacing: 1px; }
.histo { display: flex; gap: 12px; background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; margin-bottom: 10px; }
.histo .vignette { width: 52px; height: 68px; }
.histo .date { color: var(--texte3); font-size: 12.5px; }
.histo p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; }

/* ---------- Menu ---------- */
.menu-liste { display: flex; flex-direction: column; gap: 6px; }
.menu-liste button { text-align: left; background: var(--panneau); border: 1px solid var(--bord); color: var(--texte); padding: 13px 14px; border-radius: 11px; display: flex; gap: 12px; align-items: center; }
.menu-liste button svg { width: 20px; color: var(--or2); flex: none; }
.compte-ligne { display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--panneau); border-radius: 10px; margin-bottom: 6px; font-size: 13.5px; flex-wrap: wrap; }
.compte-ligne .qui { flex: 1; min-width: 140px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--panneau2); color: var(--texte);
  border: 1px solid var(--or); border-radius: 12px; padding: 11px 16px; box-shadow: var(--ombre); font-size: 14px; max-width: 90vw; }
.zoom { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.zoom img { max-width: 96vw; max-height: 94vh; }
