﻿/* mobile.css : socle du design mobile (chargé sur le site public ET les espaces).
   Propriétaire : agent "shell". Les autres fichiers m-*.css consomment ces variables.
   Le mobile = max-width: 759px. Entre 760 et 1023 = tablette (menu burger, contenu aéré). */

:root {
  --c-green: #0B5B40;
  --c-green-dark: #08422F;
  --c-green-soft: #E3EEE8;
  --c-green-tint: #F4F8F5;
  --c-coral: #FF6A3D;
  --c-coral-soft: #FFF1EB;
  --c-rust: #8A2E10;
  --c-ink: #1D2420;
  --c-ink-2: #3C4540;
  --c-cream: #FBF8F3;
  --c-sand: #F2EDE4;
  --c-line: #E7E1D6;
  --m-gutter: 18px;          /* marge latérale standard sur mobile */
  --m-radius: 20px;          /* rayon des cartes */
  --m-radius-sm: 14px;       /* rayon des champs / boutons */
  --m-tap: 52px;             /* hauteur mini d'une zone tactile principale */
  --m-shadow: 0 6px 22px rgba(11, 91, 64, .10);
  --m-shadow-up: 0 -8px 28px rgba(29, 36, 32, .12);
  --m-bar-h: 64px;           /* hauteur de la barre d'onglets basse */
  --m-safe-b: env(safe-area-inset-bottom, 0px);
}

/* Utilitaires */
.m-only { display: none !important; }
@media (max-width: 759px) {
  .m-only { display: revert !important; }
  .m-hide { display: none !important; }
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; -webkit-tap-highlight-color: rgba(11, 91, 64, .12); }
  /* iOS : pas de zoom au focus, il faut >= 16px */
  input, select, textarea { font-size: 16px !important; }
}

/* ==========================================================================
   SHELL PUBLIC : en-tête, menu plein écran (drawer), barre d'onglets, footer
   ========================================================================== */
html.no-scroll, html.no-scroll body { overflow: hidden; }

/* --- En-tête : boutons d'icône (visibles < 1024) --- */
.hd-user { display: none; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--c-sand); color: var(--c-green); text-decoration: none; font-size: 26px; }
.hd-menu { align-items: center; gap: 8px; }
.hd-menu .ti { font-size: 22px; }
.hd-call { display: none; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: 99px; background: var(--c-green-soft); color: var(--c-green); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.hd-call .ti { font-size: 20px; }
body:not(.tone-app) .hd-user { display: flex; }

/* --- Drawer : panneau latéral sur tablette, plein écran sur mobile --- */
#drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(20, 28, 24, .5); opacity: 0; transition: opacity .25s ease; }
#drawer-backdrop.is-open { opacity: 1; }
#drawer-backdrop[hidden] { display: none; }
#drawer { position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--c-cream); display: flex; flex-direction: column; transform: translateX(102%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; box-shadow: -18px 0 50px rgba(0, 0, 0, .18); }
#drawer.is-open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.dr-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 6px 18px; background: #fff; border-bottom: 1px solid var(--c-line); }
.dr-logo { display: flex; }
.dr-logo img { height: 50px; width: auto; margin: -4px -8px; display: block; }
.dr-close { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--c-sand); color: var(--c-ink); font-size: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dr-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.dr-title { margin: 8px 2px -4px; font-family: Outfit, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--c-rust); }
.dr-cta { display: flex; align-items: center; gap: 14px; padding: 16px 16px; border-radius: var(--m-radius); text-decoration: none; color: #fff; background: linear-gradient(135deg, #0E6848, var(--c-green-dark)); box-shadow: var(--m-shadow); }
.dr-cta > .ti:first-child { font-size: 30px; color: #FFB199; flex: none; }
.dr-cta span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dr-cta strong { font-family: Outfit, sans-serif; font-size: 18px; line-height: 1.2; }
.dr-cta small { font-size: 14px; color: #DDEBE3; }
.dr-cta-go { font-size: 22px; opacity: .8; }
.dr-rays { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dr-ray { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--c-line); border-radius: 18px; text-decoration: none; color: var(--c-ink); min-width: 0; }
.dr-ray:active { background: var(--c-green-tint); }
.dr-ray-ico { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 23px; flex: none; }
.dr-ray-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dr-ray-lbl strong { font-family: Outfit, sans-serif; font-size: 15.5px; line-height: 1.22; color: var(--c-green); overflow-wrap: anywhere; }
.dr-ray-lbl small { font-size: 13px; color: var(--c-ink-2); font-weight: 700; }
.dr-all { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: var(--m-radius-sm); border: 2px solid var(--c-green); color: var(--c-green); font-weight: 700; text-decoration: none; background: #fff; }
.dr-links { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: var(--m-radius); overflow: hidden; }
.dr-links a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; text-decoration: none; color: var(--c-ink); font-weight: 700; font-size: 16.5px; }
.dr-links a + a { border-top: 1px solid #F2EDE4; }
.dr-links a:active { background: var(--c-green-tint); }
.dr-links a > .ti:first-child { font-size: 22px; color: var(--c-green); width: 26px; text-align: center; flex: none; }
.dr-links a > .ti:last-child { margin-left: auto; font-size: 18px; color: #A29B8C; }
.dr-size { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border: 2px dashed #CFC7B6; background: transparent; border-radius: var(--m-radius-sm); color: var(--c-ink); font-weight: 700; font-size: 15.5px; cursor: pointer; }
.dr-size .ti { font-size: 22px; color: var(--c-green); }
.dr-foot { flex: none; display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--m-safe-b)); background: #fff; border-top: 1px solid var(--c-line); box-shadow: var(--m-shadow-up); }
.dr-call { width: 54px; height: 54px; flex: none; border-radius: var(--m-radius-sm); background: var(--c-coral-soft); color: var(--c-rust); display: flex; align-items: center; justify-content: center; font-size: 26px; text-decoration: none; }
.dr-account { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; height: 54px; border-radius: var(--m-radius-sm); background: var(--c-green); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; }
.dr-account .ti { font-size: 24px; }
.dr-close:focus-visible, .dr-links a:focus-visible, .dr-ray:focus-visible, .dr-cta:focus-visible, .dr-all:focus-visible, .dr-size:focus-visible, .dr-call:focus-visible, .dr-account:focus-visible { outline: 3px solid var(--c-coral); outline-offset: 2px; }
@media (min-width: 1024px) { #drawer, #drawer-backdrop, .tabbar { display: none !important; } }

/* --- Barre d'onglets basse (mobile) --- */
.tabbar { display: none; }

@media (max-width: 759px) {
  body:not(.tone-app) { padding-bottom: calc(var(--m-bar-h) + var(--m-safe-b)); }
  #drawer { width: 100%; box-shadow: none; }
  #drawer-backdrop { display: none !important; }

  /* Barre du haut : on la retire (la localisation est dans le footer, l'agrandissement du texte dans le menu) */
  .topbar { display: none !important; }

  /* En-tête compact */
  .site-head { box-shadow: 0 1px 0 var(--c-line), 0 6px 20px rgba(29, 36, 32, .04); }
  .site-head-row { padding: 4px var(--m-gutter) !important; min-height: 60px; gap: 10px !important; }
  .site-head-logo img { height: 50px !important; margin: -4px -8px !important; }
  body:not(.tone-app) .hd-cart, body:not(.tone-app) .hd-user, body:not(.tone-app) .hd-menu { display: none; }
  .hd-call { display: inline-flex; }

  /* Barre d'onglets */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; height: calc(var(--m-bar-h) + var(--m-safe-b)); padding: 6px 6px var(--m-safe-b); background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--c-line); box-shadow: var(--m-shadow-up); }
  .tab { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; text-decoration: none; color: #4A5350; -webkit-tap-highlight-color: transparent; }
  .tab-ico { position: relative; width: 56px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 25px; transition: background .2s ease, color .2s ease; }
  .tab-lbl { font-size: 12.5px; font-weight: 700; line-height: 1.1; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tab.is-on { color: var(--c-green); }
  .tab.is-on .tab-ico { background: var(--c-green-soft); }
  .tab:active .tab-ico { background: var(--c-sand); }
  .tab-badge { position: absolute; top: -3px; right: 6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--c-coral); color: var(--c-ink); font-family: Outfit, sans-serif; font-size: 12px; font-weight: 800; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px #fff; }
  .tab:focus-visible { outline: 3px solid var(--c-coral); outline-offset: -3px; border-radius: 14px; }

  /* Cookies : carte flottante au-dessus de la barre d'onglets */
  #cookies { position: fixed !important; left: 10px !important; right: 10px !important; bottom: calc(var(--m-bar-h) + var(--m-safe-b) + 10px) !important; margin: 0 !important; padding: 16px !important; border-radius: 20px !important; gap: 12px !important; z-index: 85 !important; box-shadow: 0 14px 44px rgba(0, 0, 0, .22) !important; }
  #cookies > span { flex: 1 1 100% !important; font-size: 14.5px !important; line-height: 1.45 !important; }
  #cookies > button { flex: 1 1 0; height: 50px !important; border-radius: 14px !important; font-size: 16px !important; }

  /* Toast au-dessus de la barre d'onglets */
  .toast { left: 14px; right: 14px; bottom: calc(var(--m-bar-h) + var(--m-safe-b) + 14px); text-align: center; font-weight: 700; border-radius: 16px; padding: 14px 16px; z-index: 88; }

  /* --- Footer mobile --- */
  .site-foot { margin-top: 84px; }
  .site-foot-invite { margin: 0 var(--m-gutter); padding: 20px 18px; border-radius: 24px; gap: 14px; }
  .site-foot-invite-copy strong { font-size: 23px; }
  .site-foot-invite-actions { flex-direction: column; width: 100%; }
  .site-foot-btn { min-height: 54px; font-size: 16px; }
  .site-foot-panel { border-radius: 28px 28px 0 0; padding-top: 60px; }
  .site-foot-grid { padding: 6px var(--m-gutter) 24px; grid-template-columns: 1fr 1fr; gap: 26px 18px; }
  .site-foot-brand, .site-foot-rays { grid-column: 1 / -1; }
  .site-foot-logo img { height: 52px; }
  .site-foot-contact li { font-size: 15.5px; }
  .site-foot-contact a { display: inline-block; padding: 4px 0; }
  .site-foot-ray-list { columns: 2; column-gap: 18px; }
  .site-foot-col a:not(.site-foot-title) { padding: 6px 0; }
  .site-foot-bar { padding: 16px var(--m-gutter) calc(24px + var(--m-bar-h) + var(--m-safe-b)); flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .tab-ico { width: 48px; }
  .dr-rays { gap: 8px; }
  .dr-ray { padding: 12px; }
}

/* --- Footer : colonnes repliables (dépliées sur desktop, accordéons sur mobile) --- */
.site-foot-fold { display: block; width: 100%; }
.site-foot-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.site-foot-sum { list-style: none; cursor: default; pointer-events: none; }
.site-foot-sum::-webkit-details-marker { display: none; }
.site-foot-rays .site-foot-sum, .site-foot-all { display: none; }
@media (max-width: 759px) {
  .site-foot-title-desk { display: none !important; }
  .site-foot-grid { grid-template-columns: 1fr; gap: 0; padding-bottom: 8px; }
  .site-foot-brand { grid-column: 1 / -1; padding-bottom: 22px; }
  .site-foot-col { border-top: 1px solid rgba(255, 255, 255, .16); }
  .site-foot-rays .site-foot-sum { display: flex; }
  .site-foot-sum { pointer-events: auto; cursor: pointer; display: flex; align-items: center; min-height: 58px; margin: 0 !important; font-size: 18px !important; }
  .site-foot-sum::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); transition: transform .2s ease; margin-right: 4px; }
  .site-foot-fold[open] > .site-foot-sum::after { transform: rotate(-135deg); }
  .site-foot-sum:focus-visible { outline: 2px solid var(--c-coral); outline-offset: 2px; border-radius: 6px; }
  .site-foot-links { padding: 0 0 18px 16px; gap: 2px; }
  .site-foot-links a { padding: 9px 0 !important; min-height: 44px; display: flex !important; align-items: center; }
  .site-foot-all { display: flex !important; font-weight: 700; color: #fff !important; text-decoration: underline !important; text-underline-offset: 3px; }
  .site-foot-ray-list { columns: 1; }
  .site-foot-bar ul { gap: 6px; }
  .site-foot-bar li { padding: 5px 10px; }
}

/* --- En-tête desktop resserré entre 1024 et 1199 px (iPad paysage) : évite le scroll horizontal --- */
@media (min-width: 1024px) and (max-width: 1199px) {
  .site-head-row { gap: 10px !important; }
  .site-head nav { gap: 0 !important; }
  .site-head nav > a { padding: 10px 8px !important; font-size: 15px; }
  .site-head .nav-drop-link { font-size: 15px; padding-left: 8px; }
  .hd-acc-lbl { display: none; }
}
