/* ==========================================================================
   Prise de rendez-vous en ligne (template-parts/booking.php)
   Variables du thème uniquement ; préfixe .bk-. Mobile d'abord (360 px).
   ========================================================================== */

.bk { color: var(--text); font-family: var(--font-sans); max-width: 860px; }
.bk [hidden] { display: none !important; }
.bk-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bk-hp { position: absolute; left: -9999px; }
.bk :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Progression ---------- */
.bk-progress { display: flex; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: bk-step; }
.bk-progress li { flex: 1 1 0; min-width: 0; padding-top: 10px; border-top: 3px solid var(--line); font-size: 12.5px; line-height: 1.3; color: var(--muted); counter-increment: bk-step; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-progress li::before { content: counter(bk-step) ". "; }
.bk-progress li.is-done { border-top-color: var(--blue); color: var(--text); }
.bk-progress li[aria-current="step"] { border-top-color: var(--navy); color: var(--navy); font-weight: 600; }

/* ---------- Panneaux ---------- */
.bk-form { display: grid; gap: 16px; }
.bk-panel { padding: 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.bk-title { margin: 0 0 18px; font-family: var(--font-serif); font-size: 24px; font-weight: 400; line-height: 1.25; color: var(--navy); }
.bk-title:focus { outline: none; }
.bk-title:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.bk-count { display: block; margin-bottom: 6px; font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--muted); }
.bk-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.bk-help { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.bk-help:empty { display: none; }
.bk-notice { margin-top: 16px; }
.bk-notice .notice { margin: 0; }

/* ---------- Récapitulatif de sélection ---------- */
.bk-summary { padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius); background: var(--surface); }
.bk-summary__label { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bk-summary__value { margin: 0; font-size: 15px; color: var(--navy); }

/* ---------- Options (motif, interlocuteur) ---------- */
.bk-options { display: grid; gap: 10px; }
.bk-option { position: relative; display: block; cursor: pointer; }
.bk-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bk-option__body { display: grid; gap: 4px; padding: 14px 16px 14px 46px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: border-color .15s, background-color .15s; position: relative; }
.bk-option__body::before { content: ""; position: absolute; left: 16px; top: 17px; width: 16px; height: 16px; border: 1px solid var(--muted); border-radius: 50%; background: var(--paper); }
.bk-option:hover .bk-option__body { border-color: var(--blue); }
.bk-option input:checked + .bk-option__body { border-color: var(--navy); background: var(--surface); }
.bk-option input:checked + .bk-option__body::before { border: 5px solid var(--navy); }
.bk-option input:focus-visible + .bk-option__body { outline: 2px solid var(--blue); outline-offset: 2px; }
.bk-option__title { font-size: 16px; font-weight: 600; color: var(--navy); }
.bk-option__meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.bk-option__meta .icon { width: 16px; height: 16px; }
.bk-option__desc { font-size: 14px; line-height: 1.45; color: var(--muted); }
.bk-choices label[hidden] { display: none; }

/* ---------- Navigation entre étapes ---------- */
.bk-nav, .bk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.bk-nav { flex-direction: column-reverse; }
.bk-nav .btn { width: 100%; }
.bk-nav .btn:disabled, .bk-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.bk-link { padding: 8px 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bk-link:hover { color: var(--navy); }

/* ---------- Calendrier ---------- */
.bk-picker { display: grid; gap: 20px; }
.bk-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.bk-cal__month { margin: 0; font-size: 16px; font-weight: 600; color: var(--navy); }
.bk-cal__nav { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--navy); cursor: pointer; }
.bk-cal__nav:hover:not(:disabled) { border-color: var(--blue); }
.bk-cal__nav:disabled { color: var(--line); cursor: default; }
.bk-cal__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bk-cal__grid th { padding: 6px 0; font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: center; }
.bk-cal__grid td { padding: 2px; text-align: center; }
.bk-cal__day { position: relative; width: 100%; max-width: 44px; aspect-ratio: 1; min-height: 38px; border: 1px solid transparent; border-radius: var(--radius); background: none; font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--navy); cursor: pointer; }
.bk-cal__day:not(:disabled) { border-color: var(--line); background: var(--paper); font-weight: 600; }
.bk-cal__day:not(:disabled)::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--blue); }
.bk-cal__day:not(:disabled):hover { border-color: var(--blue); }
.bk-cal__day:disabled { color: var(--muted); opacity: .5; cursor: default; }
.bk-cal__day[aria-pressed="true"] { border-color: var(--fill); background: var(--fill); color: var(--on-fill); }
.bk-cal__day[aria-pressed="true"]::after { background: var(--paper); }
.bk-cal__legend { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.bk-cal__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.bk-cal[aria-busy="true"] .bk-cal__month, .bk-slots [aria-busy="true"] { opacity: .6; }

/* ---------- Créneaux ---------- */
.bk-slots { padding-top: 18px; border-top: 1px solid var(--line); }
.bk-slots__empty { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--navy); }
.bk-slots__group + .bk-slots__group { margin-top: 14px; }
.bk-slots__label { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.bk-slots__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.bk-slot { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--navy); cursor: pointer; }
.bk-slot:hover { border-color: var(--blue); }
.bk-slot[aria-pressed="true"] { border-color: var(--fill); background: var(--fill); color: var(--on-fill); font-weight: 600; }

/* ---------- Coordonnées ---------- */
.bk-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.bk .field__input input[aria-invalid="true"] { box-shadow: inset 3px 0 0 var(--warning); }
.bk-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.bk-consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.bk-consent a { color: var(--blue-dark); }

/* ---------- Confirmation / gestion ---------- */
.bk-done__badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--success); }
.bk-done__badge .icon { width: 20px; height: 20px; }
.bk-recap { margin: 0 0 4px; border-top: 1px solid var(--line); }
.bk-recap div { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bk-recap dt { font-size: 13px; color: var(--muted); }
.bk-recap dd { margin: 0; font-size: 15.5px; color: var(--navy); }
.bk-panel > .notice { margin: 0 0 16px; }
.bk-confirm { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--warning); border-radius: var(--radius); background: var(--surface); }
.bk-confirm p { margin: 0; font-size: 15px; }
.bk-confirm .bk-actions { margin-top: 12px; }

/* ---------- Écrans plus larges ---------- */
@media (min-width: 640px) {
	.bk-panel { padding: 28px; }
	.bk-title { font-size: 28px; }
	.bk-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bk-nav { flex-direction: row; justify-content: space-between; }
	.bk-nav .btn { width: auto; }
	.bk-nav .btn:only-child { margin-left: auto; }
	.bk-progress li { font-size: 13.5px; }
	.bk-recap div { grid-template-columns: 140px 1fr; gap: 12px; }
}

@media (min-width: 860px) {
	.bk-picker { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
	.bk-slots { padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--line); min-height: 100%; }
}

@media (max-width: 380px) {
	.bk-progress li { font-size: 0; }
	.bk-progress li::before { font-size: 12.5px; }
	.bk-progress li[aria-current="step"] { font-size: 12.5px; }
	.bk-progress li[aria-current="step"]::before { content: counter(bk-step) ". "; }
}

@media (prefers-reduced-motion: reduce) {
	.bk * { transition: none !important; }
}
