/* ═══════════════════════════════════════════════════════════
   PBX MTL — Barbier booking demo
   Theme: dark wood #1b130f, cream, brass
   Works alone or with demo-themes.css (theme-barber / ind-page)
   ═══════════════════════════════════════════════════════════ */

:root {
  --wood: #1b130f;
  --wood-mid: #2a1f18;
  --wood-light: #3d2e24;
  --cream: #f5efe6;
  --cream-dim: #e8dfd0;
  --cream-muted: #c4b8a8;
  --brass: #c9a227;
  --brass-hover: #dbb83a;
  --brass-dim: #a8841f;
  --success: #3d8b5a;
  --error: #c44;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Fira Code", ui-monospace, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body.theme-barber,
body.ind-page,
body {
  font-family: var(--font);
  background: var(--wood);
  color: var(--cream);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brass);
  text-decoration: none;
}
a:hover {
  color: var(--brass-hover);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* ── Banner ── */
.demo-banner {
  background: var(--brass);
  color: var(--wood);
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.demo-banner a {
  color: var(--wood);
  text-decoration: underline;
}

/* ── Layout ── */
.booking-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

.booking-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.booking-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.booking-header .subtitle {
  color: var(--cream-muted);
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.booking-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-top: 0.85rem;
  font-size: 0.875rem;
}

/* ── Progress steps ── */
.progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  list-style: none;
}

.progress li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--cream-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.progress li .dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--wood-light);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--wood-mid);
}

.progress li.active {
  color: var(--brass);
}
.progress li.active .dot {
  border-color: var(--brass);
  background: var(--brass);
  color: var(--wood);
}
.progress li.done {
  color: var(--cream-dim);
}
.progress li.done .dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.progress li:not(:last-child)::after {
  content: "";
  width: 0.75rem;
  height: 2px;
  background: var(--wood-light);
  margin-left: 0.15rem;
}

@media (max-width: 540px) {
  .progress li .label {
    display: none;
  }
}

/* ── Grid: main + sticky summary ── */
.booking-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .booking-grid {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.panel {
  background: var(--wood-mid);
  border: 1px solid var(--wood-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--cream);
  font-weight: 600;
}

.panel[hidden] {
  display: none !important;
}

/* ── Option cards ── */
.options {
  display: grid;
  gap: 0.75rem;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  background: var(--wood);
  border: 2px solid var(--wood-light);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--cream);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font: inherit;
}

.option-card:hover {
  border-color: var(--brass-dim);
  background: var(--wood-light);
}

.option-card:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.option-card.selected {
  border-color: var(--brass);
  background: rgba(201, 162, 39, 0.12);
}

.option-card .opt-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.option-card .opt-body {
  flex: 1;
  min-width: 0;
}

.option-card .opt-title {
  font-weight: 600;
  font-size: 1rem;
}

.option-card .opt-meta {
  font-size: 0.85rem;
  color: var(--cream-muted);
  margin-top: 0.2rem;
}

.option-card .opt-price {
  font-weight: 700;
  color: var(--brass);
  white-space: nowrap;
  font-size: 1rem;
}

/* ── Date / time grids ── */
.date-grid,
.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.chip {
  background: var(--wood);
  border: 2px solid var(--wood-light);
  border-radius: 8px;
  padding: 0.65rem 0.5rem;
  color: var(--cream);
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.chip:hover:not(:disabled) {
  border-color: var(--brass-dim);
}

.chip:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.chip.selected {
  border-color: var(--brass);
  background: rgba(201, 162, 39, 0.15);
  color: var(--brass);
  font-weight: 600;
}

.chip:disabled,
.chip.taken {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.chip .chip-day {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--cream-muted);
  letter-spacing: 0.03em;
}

.chip .chip-date {
  display: block;
  font-weight: 600;
  margin-top: 0.15rem;
}

/* ── Form ── */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--cream-dim);
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--wood);
  border: 2px solid var(--wood-light);
  border-radius: 8px;
  color: var(--cream);
  font: inherit;
  font-size: 1rem;
}

.form-group input::placeholder {
  color: var(--cream-muted);
  opacity: 0.7;
}

.form-group input:focus {
  outline: none;
  border-color: var(--brass);
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--cream-muted);
  margin-top: 0.25rem;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ── Buttons ── */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brass);
  color: var(--wood);
  border-color: var(--brass);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brass-hover);
  border-color: var(--brass-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--cream-dim);
  border-color: var(--wood-light);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--cream-muted);
  color: var(--cream);
}

.btn-demo {
  background: var(--wood-light);
  color: var(--brass);
  border-color: var(--brass-dim);
}

.btn-demo:hover:not(:disabled) {
  background: rgba(201, 162, 39, 0.2);
}

/* ── Sticky summary ── */
.summary {
  position: sticky;
  top: 1rem;
}

.summary h2 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--wood-light);
  font-size: 0.9rem;
}

.summary-row .label {
  color: var(--cream-muted);
}

.summary-row .value {
  font-weight: 600;
  text-align: right;
}

.summary-deposit {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--brass-dim);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.summary-deposit .label {
  font-weight: 600;
  color: var(--cream-dim);
}

.summary-deposit .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brass);
}

.summary-note {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--cream-muted);
}

/* Mobile summary bar */
@media (max-width: 767px) {
  .summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 50;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  }

  .summary h2 {
    display: none;
  }

  .summary-details {
    display: none;
  }

  .summary.expanded .summary-details {
    display: block;
    margin-bottom: 0.5rem;
  }

  .summary-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    color: var(--cream);
    font: inherit;
    cursor: pointer;
    padding: 0;
  }

  .summary-toggle .toggle-hint {
    font-size: 0.75rem;
    color: var(--brass);
  }

  .booking-wrap {
    padding-bottom: 7rem;
  }
}

@media (min-width: 768px) {
  .summary-toggle {
    display: none;
  }
}

/* ── Payment ── */
.payment-box {
  margin-top: 0.5rem;
}

.payment-mode-badge {
  display: inline-block;
  background: rgba(201, 162, 39, 0.2);
  color: var(--brass);
  border: 1px solid var(--brass-dim);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#payment-element {
  min-height: 40px;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--wood);
  border-radius: 8px;
  border: 1px solid var(--wood-light);
}

.payment-demo-note {
  font-size: 0.85rem;
  color: var(--cream-muted);
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--wood);
  border-radius: 8px;
  border-left: 3px solid var(--brass);
}

/* ── Confirmation ── */
.confirm-box {
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.confirm-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

.confirm-box h2 {
  color: var(--brass);
  margin-bottom: 0.5rem;
}

.confirm-ref {
  font-family: var(--mono);
  background: var(--wood);
  border: 1px solid var(--wood-light);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: inline-block;
  margin: 1rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  word-break: break-all;
}

.confirm-details {
  text-align: left;
  max-width: 360px;
  margin: 1.25rem auto;
}

.confirm-details .summary-row:last-child {
  border-bottom: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brass);
  color: var(--wood);
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
}
