/* Système de réservation – feuille de style unique.
   La couleur principale et l'arrondi viennent de config/business.json (theme). */

:root {
  --accent: #111111;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 6%, white);
  --accent-line: color-mix(in srgb, var(--accent) 35%, white);
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #e5e5e5;
  --danger: #b42318;
  --danger-soft: #fdf0ef;
  --ok: #111111;
  --ok-soft: #f2f2f2;
  --star: #111111;
  --radius: 12px;
  --radius-sm: calc(var(--radius) * 0.66);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.06);
  --maxw: 1120px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after { box-sizing: border-box; }

body { margin: 0; background: var(--bg); font-size: 15px; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.25rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: filter .15s, background .15s, border-color .15s;
}
.btn:hover { filter: brightness(0.94); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text); filter: none; }
.btn--soft { background: var(--accent-soft); color: var(--accent); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, white); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Mise en page ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
/* Dans une grille, l'espacement vient de gap : la marge ci-dessus agrandirait toutes les cases sauf la première. */
:is(.team, .settings, .cat-list, .grid-2) > .card + .card { margin-top: 0; }
.card h2 { margin-bottom: 14px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { height: 32px; width: auto; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- En-tête vitrine ---------- */
.hero { padding: 24px 0 16px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.01em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); }
.hero-meta a { color: inherit; }
.rating { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; text-decoration: none; }
.stars { color: var(--star); letter-spacing: 1px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.badge--open { background: var(--ok-soft); color: var(--ok); }
.badge--closed { background: #f2f2f2; color: var(--muted); }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Galerie ---------- */
.gallery { position: relative; display: grid; gap: 8px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 180px 180px; border-radius: var(--radius); overflow: hidden; }
.gallery button { border: 0; padding: 0; cursor: zoom-in; background: var(--line); overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.03); }
.gallery button:first-child { grid-row: span 2; }
.gallery[data-count='1'] { grid-template-columns: 1fr; grid-template-rows: 320px; }
.gallery[data-count='2'] { grid-template-columns: 2fr 1fr; grid-template-rows: 320px; }
.gallery[data-count='2'] button:first-child, .gallery[data-count='1'] button:first-child { grid-row: auto; }
.gallery[data-count='3'] { grid-template-columns: 2fr 1fr; }
.gallery-more { position: absolute; right: 12px; bottom: 12px; }

/* ---------- Grille principale ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; padding: 24px 0 48px; }
.sidebar { position: sticky; top: 76px; }
section.block { margin-bottom: 32px; scroll-margin-top: 76px; }
section.block > h2 { margin-bottom: 14px; }

/* Prestations */
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat + .cat { margin-top: 14px; }
.cat h3 { font-size: .95rem; padding: 14px 18px; background: #fafafa; border-bottom: 1px solid var(--line); }
.service { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.service + .service { border-top: 1px solid var(--line); }
.service-info { flex: 1; min-width: 0; }
.service-name { font-weight: 600; }
.service-desc { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.service-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.service-price { color: var(--text); font-weight: 600; }

/* Équipe */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.member { text-align: center; padding: 16px 10px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.3rem; object-fit: cover; }
.avatar--sm { width: 40px; height: 40px; font-size: 1rem; margin: 0; }

/* Avis */
.reviews-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.big-score { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.bars { flex: 1; min-width: 200px; display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 22px 1fr 26px; gap: 8px; align-items: center; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--star); }
.review { padding: 16px 0; border-top: 1px solid var(--line); }
.review-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }

/* Horaires */
.hours { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hours td { padding: 5px 0; vertical-align: top; }
.hours td:last-child { text-align: right; }
.hours tr.today { font-weight: 700; }
.hours .closed { color: var(--muted); }
.map { width: 100%; height: 180px; border: 0; border-radius: var(--radius-sm); margin: 12px 0; background: var(--line); }
.contact-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: .92rem; }
.contact-list li { display: flex; justify-content: space-between; gap: 12px; }
.contact-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .86rem; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer a { color: inherit; }

.mobile-cta { display: none; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(0 0 0 / .88); }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 16px; }
.lightbox img { max-height: 80vh; width: auto; border-radius: 8px; }
.lightbox figcaption { color: #eee; text-align: center; margin-top: 10px; }
.lightbox .lb-btn { position: absolute; background: rgb(255 255 255 / .12); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; }
.lb-next { right: 12px; top: 50%; }

/* ---------- Panneau de réservation ---------- */
.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); max-width: 100vw; background: var(--surface); box-shadow: -8px 0 32px rgb(0 0 0 / .12); }
.drawer::backdrop { background: rgb(20 20 20 / .45); }
.drawer[open] { animation: slide-in .22s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

.booking { display: flex; flex-direction: column; height: 100%; background: var(--surface); }
.booking-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 60px; }
.booking-head h2 { font-size: 1.05rem; flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 1.25rem; display: grid; place-items: center; color: var(--text); }
.icon-btn:hover { background: #f2f2f2; }
.steps { display: flex; gap: 6px; padding: 12px 16px 0; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.done { background: var(--accent); }
.booking-body { flex: 1; overflow-y: auto; padding: 16px; }
.booking-foot { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; background: var(--surface); }
.booking-foot .total { flex: 1; font-size: .9rem; color: var(--muted); }
.booking-foot .total strong { display: block; color: var(--text); font-size: 1rem; }
.step-title { font-size: 1.05rem; margin-bottom: 4px; }
.step-sub { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

.pick-list { display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; }
.pick:hover { border-color: var(--accent-line); }
.pick[aria-pressed='true'], .pick[aria-checked='true'] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pick .check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; font-size: .8rem; color: var(--accent-ink); }
.pick[aria-checked='true'] .check { background: var(--accent); border-color: var(--accent); }
.pick-main { flex: 1; min-width: 0; }
.pick-main strong { display: block; font-weight: 600; }
.pick-side { text-align: right; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.pick-side strong { display: block; color: var(--text); }
.pick-cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.pick-cat:first-child { margin-top: 0; }

.recap { background: #fafafa; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: .92rem; }
.recap-row { display: flex; justify-content: space-between; gap: 12px; }
.recap-row + .recap-row { margin-top: 4px; }
.recap .edit { font-size: .85rem; }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.week-nav strong { text-transform: capitalize; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.day { padding: 8px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: center; line-height: 1.25; }
.day small { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.day b { font-size: 1.05rem; }
.day:disabled { cursor: default; color: #bbbbbb; background: #fafafa; }
.day:disabled small { color: inherit; }
.day[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day[aria-pressed='true'] small { color: inherit; opacity: .85; }
.slot-group { margin-bottom: 14px; }
.slot-group h4 { margin: 0 0 8px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { height: 40px; border: 1px solid var(--accent-line); border-radius: var(--radius-sm); background: var(--surface); color: var(--accent); font-weight: 600; cursor: pointer; }
.slot:hover { background: var(--accent-soft); }
.slot[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.empty .btn { margin-top: 12px; }

.form { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field label .opt { font-weight: 400; color: var(--muted); }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .84rem; margin-top: 4px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--ok { background: var(--ok-soft); color: var(--ok); }

.success { text-align: center; padding: 12px 0; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 12px; }
.success .recap { text-align: left; margin-top: 18px; }
.actions { display: grid; gap: 8px; margin-top: 16px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Page widget (iframe) ---------- */
body.embed { background: var(--surface); }
body.embed .booking { min-height: 100vh; }
body.embed.inline .booking { min-height: 0; }
body.embed.inline .booking-body { overflow: visible; }

/* ---------- Page "mon rendez-vous" ---------- */
.narrow { max-width: 560px; margin: 32px auto; padding: 0 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 110px; }
  .gallery button:first-child { grid-column: span 2; grid-row: auto; }
  .gallery button:nth-child(n + 4) { display: none; }
  .gallery[data-count='1'] { grid-template-rows: 240px; }
  .gallery[data-count='2'] { grid-template-columns: 1fr; grid-template-rows: 240px; }
  .gallery[data-count='2'] button:nth-child(2) { display: none; }
  .service { flex-wrap: wrap; }
  .service .btn { width: 100%; }
  .service-meta { width: 100%; justify-content: space-between; }
  .topbar [data-book] { display: none; }
  .mobile-cta { display: block; position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 30; }
  body.has-cta { padding-bottom: 72px; }
  .drawer { width: 100vw; }
  .row-2 { grid-template-columns: 1fr; }
  .days { gap: 4px; }
  .day b { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Paiement ---------- */
.pay-box { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.pick .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.pick[aria-checked='true'] .radio { border: 6px solid var(--accent); }
.alert--info { background: var(--ok-soft); color: var(--text); border: 1px solid var(--line); }
.pay-sim-top { margin-top: 16px; }
.pay-sim-form { margin-top: 20px; }

/* Avis clients */
.verified { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--muted); font-size: .75rem; font-weight: 600; vertical-align: 1px; }
.review-reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--line); background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .92rem; }
.review-reply p { margin: 4px 0 0; }
.reviews-policy { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-card { margin-top: 16px; }
.review-card h2 { margin-bottom: 12px; }
.review-given { font-size: 1.4rem; margin: 4px 0 8px; }
.star-field { border: 0; padding: 0; margin: 0; }
.star-field legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.star-row { display: flex; gap: 4px; }
.star-pick { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; border-radius: 6px; }
.star-pick.on { color: var(--star); }
.star-row input:focus-visible + .star-pick { outline: 2px solid var(--accent); outline-offset: 2px; }
