/* ================================================
   CASI — Drawer Panier + FAB + Modal + Tags
   ================================================ */

/* ── Overlay ─────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(26,18,8,.55);
  opacity: 0; pointer-events: none;
  transition: opacity .3s cubic-bezier(.4,0,.2,1);
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

/* ── Drawer ──────────────────────────────────── */
.drawer-panier {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 301;
  width: min(420px, 100vw);
  background: var(--cream);
  box-shadow: -12px 0 48px rgba(26,18,8,.18);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
}
.drawer-panier.open { transform: translateX(0); }
body.drawer-open { overflow: hidden; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--white);
}
.drawer-titre {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 400;
  color: var(--ink);
}
.drawer-count {
  display: inline-block;
  background: var(--terra); color: var(--white);
  font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--font-ui);
  vertical-align: middle; margin-left: 6px;
}
.drawer-close {
  background: none; border: none; cursor: pointer;
  padding: 7px; border-radius: var(--r-sm);
  color: var(--stone);
  transition: background .2s, color .2s;
  line-height: 0;
}
.drawer-close:hover  { background: var(--cream-3); color: var(--ink); }
.drawer-close:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

/* ── Body ────────────────────────────────────── */
.drawer-body {
  flex: 1; overflow-y: auto;
  padding: 12px 24px;
  scroll-behavior: smooth;
}

.drawer-vide {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 52px 16px; text-align: center;
  color: var(--stone);
}
.drawer-vide__icon { font-size: 2.8rem; }
.drawer-vide p { font-size: .9rem; }

/* ── Items ───────────────────────────────────── */
.drawer-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.drawer-item:last-child { border-bottom: none; }

.drawer-item__info { grid-column: 1; grid-row: 1; }
.drawer-item__nom  { font-weight: 500; font-size: .9rem; display: block; color: var(--ink); }
.drawer-item__prix { font-size: .78rem; color: var(--stone); margin-top: 2px; display: block; }

.drawer-item__sous-total {
  grid-column: 2; grid-row: 1;
  font-weight: 600; font-size: .9rem;
  color: var(--terra); white-space: nowrap;
  padding-top: 2px;
}

.drawer-item__controls {
  grid-column: 1; grid-row: 2;
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.drawer-item__moins,
.drawer-item__plus {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--white); border-radius: var(--r-sm);
  cursor: pointer; font-size: 1rem; line-height: 1;
  color: var(--ink); transition: background .2s, border-color .2s;
  display: flex; align-items: center; justify-content: center;
}
.drawer-item__moins:hover,
.drawer-item__plus:hover  { background: var(--cream-3); border-color: var(--sand); }
.drawer-item__qty { min-width: 24px; text-align: center; font-size: .88rem; font-weight: 500; }
.drawer-item__del {
  margin-left: 6px; background: none; border: none; cursor: pointer;
  color: var(--stone); padding: 4px; border-radius: var(--r-sm);
  transition: color .2s, background .2s; line-height: 0;
}
.drawer-item__del:hover { color: var(--corail); background: var(--terra-lt); }

/* ── Footer ──────────────────────────────────── */
.drawer-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--white);
  display: flex; flex-direction: column; gap: 10px;
}
.drawer-footer__total {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1rem;
}
.drawer-footer__total strong { font-size: 1.25rem; color: var(--terra); }

/* ── Bouton WhatsApp ─────────────────────────── */
.bouton--wa {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-md);
  background: #25D366; color: var(--white);
  font-size: .88rem; font-weight: 500;
  border: none; cursor: pointer;
  transition: background .2s, transform .2s;
  text-decoration: none;
}
.bouton--wa:hover  { background: #1dba5a; transform: translateY(-1px); }
.bouton--wa:active { transform: translateY(0); }
.bouton--wa:focus-visible { outline: 2px solid #25D366; outline-offset: 3px; }

/* ── FAB panier (mobile) ─────────────────────── */
.panier-fab {
  position: fixed; bottom: 24px; right: 20px; z-index: 290;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--terra); color: var(--white);
  box-shadow: 0 4px 16px rgba(212,91,42,.4);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.panier-fab:hover  { background: var(--terra-dk); transform: scale(1.07); }
.panier-fab:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; }
@media (min-width: 900px) { .panier-fab { display: none; } }

.panier-fab__count {
  position: absolute; top: -4px; right: -4px;
  background: var(--ink); color: var(--white);
  font-size: .65rem; font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 999px; border: 2px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui);
}

/* Pulse badge */
@keyframes cas-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.pulse { animation: cas-pulse .35s ease; }

/* nav button reset */
.nav__panier-icon {
  background: none; border: none; cursor: pointer;
  font-family: inherit; color: inherit;
  display: flex; align-items: center; gap: 6px;
  position: relative; padding: 0;
}

/* ── Modal Plat ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(26,18,8,.6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}

.modal-plat {
  background: var(--cream);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(30px);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.modal-overlay.open .modal-plat { transform: translateY(0); }
@media (min-width: 600px) {
  .modal-plat { border-radius: var(--r-lg); max-height: 85vh; }
}

.modal-plat__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: rgba(255,255,255,.85); border: none; cursor: pointer;
  border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.modal-plat__close:hover { background: var(--white); }

.modal-plat__img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--cream-3);
}
.modal-plat__img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--cream-3) 0%, var(--sand-lt) 100%);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}

.modal-plat__body { padding: 20px 24px 28px; }
.modal-plat__entete {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.modal-plat__nom  { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; }
.modal-plat__prix { font-size: 1.25rem; font-weight: 600; color: var(--terra); white-space: nowrap; }
.modal-plat__desc { color: var(--stone); font-size: .9rem; line-height: 1.6; margin-bottom: 14px; }

/* Tags */
.plat-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.plat-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 500;
  background: var(--cream-3); color: var(--ink);
  border: 1px solid var(--border);
}
.plat-tag--spicy    { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }
.plat-tag--vegan    { background: var(--palm-lt); color: var(--palm); border-color: #A7D6C5; }
.plat-tag--vegetarian { background: var(--palm-lt); color: var(--palm); border-color: #A7D6C5; }
.plat-tag--no_pork  { background: var(--gold-lt); color: #92400E; border-color: #FCD34D; }
.plat-tag--gluten_free { background: var(--turq-lt); color: var(--turq); border-color: #99D6CE; }
.plat-tag--halal    { background: var(--mango-lt); color: #92400E; border-color: #FDBA74; }

/* Allergènes */
.plat-allergenes {
  margin-bottom: 16px;
}
.plat-allergenes__toggle {
  background: none; border: none; cursor: pointer;
  color: var(--stone); font-size: .82rem; font-family: var(--font-ui);
  display: flex; align-items: center; gap: 5px;
  padding: 0; transition: color .2s;
}
.plat-allergenes__toggle:hover { color: var(--ink); }
.plat-allergenes__liste {
  margin-top: 8px; padding: 10px 14px;
  background: var(--gold-lt); border-radius: var(--r-sm);
  font-size: .8rem; color: var(--ink);
  border: 1px solid #FCD34D;
}

/* Stepper quantité */
.modal-stepper {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; width: fit-content; margin-bottom: 16px;
}
.modal-stepper__btn {
  width: 44px; height: 44px; border: none; background: none;
  cursor: pointer; font-size: 1.2rem; color: var(--ink);
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-stepper__btn:hover { background: var(--cream-3); }
.modal-stepper__val {
  padding: 0 20px; font-size: 1rem; font-weight: 500;
  min-width: 48px; text-align: center;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.modal-plat__ajouter {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 4px;
}

/* Bandeau plats du jour */
.bandeau-jour {
  background: linear-gradient(90deg, var(--terra) 0%, var(--corail) 100%);
  color: var(--white); padding: 12px 0; overflow: hidden;
}
.bandeau-jour__inner {
  display: flex; align-items: center; gap: 12px;
  max-width: var(--max-w); margin: 0 auto; padding: 0 32px;
  flex-wrap: wrap;
}
.bandeau-jour__label {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap;
  background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 999px;
}
.bandeau-jour__plats {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.bandeau-jour__plat {
  font-size: .85rem; font-weight: 500;
  background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 999px;
  transition: background .2s;
}
.bandeau-jour__plat:hover { background: rgba(255,255,255,.3); }

/* Plat épuisé */
.plat--epuise {
  opacity: .5; position: relative;
}
.plat--epuise::after {
  content: 'Épuisé';
  position: absolute; top: 10px; left: 10px;
  background: var(--ink); color: var(--white);
  font-size: .7rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 4px;
}
.plat--epuise .bouton--panier,
.plat--epuise [data-ajouter-panier] {
  pointer-events: none; opacity: .4;
}

/* Filtres carte */
.carte-filtres {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
}
.carte-filtre {
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--white);
  font-size: .82rem; cursor: pointer; font-family: var(--font-ui);
  transition: background .2s, border-color .2s, color .2s;
  color: var(--stone);
}
.carte-filtre:hover   { border-color: var(--terra); color: var(--terra); }
.carte-filtre.actif   { background: var(--terra); color: var(--white); border-color: var(--terra); }
.carte-filtre:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

/* Estimation traiteur */
.estimation-live {
  background: var(--gold-lt); border: 1px solid #FCD34D;
  border-radius: var(--r-md); padding: 18px 20px; margin-top: 16px;
  display: none;
}
.estimation-live.visible { display: block; }
.estimation-live__titre {
  font-weight: 600; color: var(--ink); margin-bottom: 6px;
  font-size: .92rem;
}
.estimation-live__fourchette {
  font-family: var(--font-display); font-size: 1.6rem;
  font-weight: 400; color: var(--terra); margin-bottom: 4px;
}
.estimation-live__note {
  font-size: .75rem; color: var(--stone);
}

/* Consentement RGPD */
.champ-rgpd {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--cream-2);
}
.champ-rgpd input[type=checkbox] {
  margin-top: 2px; flex-shrink: 0;
  width: 16px; height: 16px; accent-color: var(--terra); cursor: pointer;
}
.champ-rgpd label {
  font-size: .82rem; color: var(--stone); line-height: 1.5; cursor: pointer;
}
.champ-rgpd a { color: var(--terra); text-decoration: underline; }

/* Loading state sur le bouton panier */
.bouton--panier.loading {
  opacity: .6; pointer-events: none;
}

/* Bouton disabled générique */
button[disabled] { opacity: .5; pointer-events: none; }

/* ── Sélecteur mode ──────────────────────────── */
.drawer-mode { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.drawer-mode__tabs {
  display: flex; gap: 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 8px;
}
.drawer-mode__tab {
  flex: 1; padding: 9px 12px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-ui); font-size: .82rem;
  color: var(--stone); transition: background .2s, color .2s;
}
.drawer-mode__tab:first-child { border-right: 1px solid var(--border); }
.drawer-mode__tab.actif { background: var(--terra); color: var(--white); font-weight: 500; }
.drawer-mode__tab:focus-visible { outline: 2px solid var(--terra); outline-offset: -2px; }

@media (max-width: 479px) {
  .drawer-header { padding: 16px 18px; }
  .drawer-body   { padding: 12px 18px; }
  .drawer-footer { padding: 14px 18px 20px; }
}
