/* Instant Sucré by Yona — socle commun (site + espace de gestion)
   Propriétés logiques partout (inline-start/end) : la mise en page se retourne seule en hébreu (dir="rtl"). */

/* Titres : Fraunces (serif chaleureuse, très lisible) · Texte : DM Sans. La calligraphie n'existe que dans le logo. */
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces.woff2') format('woff2'); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-italic.woff2') format('woff2'); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/dm-sans.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --ivory: #F6EBDD;
  --ivory-light: #FBF6EF;
  --marble: #F2F0EE;
  --white: #FFFDFA;
  --choc: #3F2418;
  --choc-deep: #2A170F;
  --choc-soft: #6A5145;
  --rose: #B98A6B;
  --rose-light: #C9A58C;
  --rose-pale: #EBD9CB;
  --rose-deep: #8A5D43;
  --caramel: #C98F4F;
  --berry: #C9707C;
  --berry-deep: #A44F5C;
  --blush: #F3DDD6;
  --green: #5F7A52;
  --line: rgba(185, 138, 107, .38);
  --line-soft: rgba(185, 138, 107, .2);
  --shadow: 0 30px 60px -32px rgba(63, 36, 24, .45);
  --shadow-soft: 0 14px 34px -20px rgba(63, 36, 24, .38);
  --gold: linear-gradient(105deg, #A9714F 0%, #D9B08C 28%, #F3DEC4 46%, #C99A72 62%, #A9714F 100%);

  --font-serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-sans: 'DM Sans', 'Avenir Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-script: var(--font-serif);

  --ease: cubic-bezier(.22, .8, .26, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --pad: clamp(1.15rem, 5vw, 2rem);
  --bar-h: 3.75rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 1rem); }
body {
  margin: 0; background: var(--ivory-light); color: var(--choc);
  font: 400 1.0625rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 400; font-optical-sizing: auto; text-wrap: balance; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--choc); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--rose-light); color: var(--choc-deep); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Typographie ── */
.script { font-family: var(--font-serif); font-style: italic; font-weight: 400; line-height: 1.12; letter-spacing: -.01em; }
.caps { font: 600 .72rem/1.4 var(--font-sans); letter-spacing: .22em; text-transform: uppercase; color: var(--rose-deep); }
.serif { font-family: var(--font-serif); }
.muted { color: var(--choc-soft); }

/* ── Boutons ── */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.25rem; padding: .7rem 1.6rem; border-radius: 999px;
  font: 500 1rem/1.2 var(--font-sans); letter-spacing: .01em; text-decoration: none; text-align: center;
  border: 1px solid transparent; transition: transform .25s var(--ease-out), background-color .2s, border-color .2s, box-shadow .25s, color .2s;
}
.btn:active { transform: scale(.965); }
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn--primary { background: var(--choc); color: var(--ivory-light); box-shadow: var(--shadow-soft); }
.btn--primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(243, 222, 196, .28), transparent); transition: transform .7s var(--ease-out);
}
@media (hover: hover) {
  .btn--primary:hover { background: var(--choc-deep); transform: translateY(-2px); box-shadow: 0 18px 34px -18px rgba(63, 36, 24, .6); }
  .btn--primary:hover::before { transform: translateX(120%) skewX(-18deg); }
  .btn--ghost:hover { background: var(--white); border-color: var(--rose-deep); transform: translateY(-2px); }
}
.btn--ghost { border-color: var(--rose); color: var(--choc); background: rgba(255, 253, 250, .6); }
.btn--gold { background: var(--gold); background-size: 200% 100%; color: var(--choc-deep); font-weight: 600; box-shadow: var(--shadow-soft); }
.btn--wa { background: #1E9E57; color: #fff; box-shadow: 0 14px 30px -18px rgba(30, 158, 87, .8); }
.btn--quiet { min-height: 2.75rem; padding: .4rem .9rem; color: var(--rose-deep); text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--line); }
.btn--danger { border-color: var(--berry); color: var(--berry-deep); }
.btn--block { display: flex; width: 100%; }
.btn--small { min-height: 2.75rem; padding: .45rem 1.1rem; font-size: .94rem; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .5; pointer-events: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after { content: ''; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; position: relative; transition: background-color .2s, transform .2s var(--ease-out); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 1.45rem; height: 1.45rem; }

/* ── Formulaires ── */
.field { display: grid; gap: .35rem; }
.field > label, .field > .label { font: 500 .92rem/1.3 var(--font-sans); }
.field .hint { font-size: .86rem; color: var(--choc-soft); }
.error { font-size: .9rem; color: var(--berry-deep); font-weight: 500; }
.input {
  width: 100%; min-height: 3.1rem; padding: .7rem .95rem; border-radius: 14px;
  border: 1px solid var(--line); background: var(--white); font-size: 1rem; /* ≥ 16px : pas de zoom iOS */
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 5.2rem; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #A8948A; }
.input:focus { outline: none; border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(185, 138, 107, .22); }
.input[aria-invalid='true'] { border-color: var(--berry-deep); }

/* Pastilles à choix (créneaux, formats, filtres) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span, button.chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .45rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); font-size: .96rem; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease-out);
}
.chip input:checked + span, button.chip[aria-pressed='true'] { background: var(--choc); border-color: var(--choc); color: var(--ivory-light); }
.chip input:active + span { transform: scale(.95); }
.chip input:focus-visible + span { outline: 2px solid var(--choc); outline-offset: 3px; }
.chip input:disabled + span { opacity: .45; }

/* Compteur de quantité */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.stepper button { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%; transition: transform .15s var(--ease-out), background-color .15s; }
.stepper button:active { transform: scale(.85); background: var(--ivory); }
.stepper button svg { width: 1rem; height: 1rem; }
.stepper output { min-width: 1.6rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Feuilles (dialog) : glissent du bas sur téléphone, fenêtre centrée sur grand écran ── */
dialog.sheet {
  border: 0; padding: 0; margin: 0; color: inherit; background: var(--ivory-light);
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 93dvh;
  border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px -20px rgba(63, 36, 24, .35); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .5s var(--ease-out); }
dialog.sheet.is-closing { animation: sheet-out .22s ease-in forwards; }
dialog.sheet::backdrop { background: rgba(42, 23, 15, .48); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in .35s ease; }
dialog.sheet.is-closing::backdrop { opacity: 0; transition: opacity .2s; }
dialog.sheet--full { height: 100dvh; max-height: 100dvh; border-radius: 0; }
.sheet-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .6rem .6rem var(--pad); border-block-end: 1px solid var(--line-soft); flex: none; }
.sheet-head h2 { flex: 1; font: 500 1.35rem/1.2 var(--font-serif); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: var(--pad); }
.sheet-foot { flex: none; padding: .9rem var(--pad) calc(.9rem + env(safe-area-inset-bottom)); border-block-start: 1px solid var(--line-soft); background: var(--ivory-light); }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
html.has-sheet { overflow: hidden; }

@media (min-width: 760px) {
  dialog.sheet, dialog.sheet--full { inset: 0; margin: auto; width: min(36rem, 92vw); height: auto; max-height: min(92dvh, 56rem); border-radius: 26px; box-shadow: var(--shadow); }
  dialog.sheet[open] { animation: pop-in .4s var(--ease-out); }
  dialog.sheet.is-closing { animation: pop-out .18s ease-in forwards; }
  @keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
  @keyframes pop-out { to { opacity: 0; transform: translateY(8px); } }
}

/* Message éphémère */
.toast {
  position: fixed; inset-inline: 0; bottom: calc(5.6rem + env(safe-area-inset-bottom)); z-index: 60; margin-inline: auto; width: fit-content; max-width: calc(100vw - 2rem);
  display: flex; align-items: center; gap: .55rem;
  padding: .7rem 1.15rem; border-radius: 999px; background: var(--choc-deep); color: var(--ivory-light); font-size: .95rem; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .3s, transform .4s var(--spring); pointer-events: none;
}
.toast svg { width: 1.1rem; height: 1.1rem; color: #E9C9A6; flex: none; }
.toast.is-on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
