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

/* One brand colour drives everything. A shop can override --brand (shops/{id}.primaryColor); the rest is derived. */
:root {
  --brand: #2F5D50;
  --brand-hover: color-mix(in srgb, var(--brand) 85%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 11%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 38%, #fff);
  --on-brand: #FFFFFF;
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --text: #1F2A24;
  --text-2: #444C46;
  --muted: #5E655D;
  --line: #DAD5C8;
  --line-soft: #E9E5DB;
  --danger: #B3402F;
  --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@keyframes spin { to { transform: rotate(360deg); } }
.bk-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 1rem; }
.bk-spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
.bk-loading p { color: var(--muted); font-size: 0.9rem; }
.bk-error { display: none; text-align: center; padding: 4rem 2rem; color: var(--danger); font-size: 1rem; }

/* ── NAV LOGO (shared) ── */
.nav-logo { font-size: 1.05rem; font-weight: 600; color: var(--text); text-decoration: none; flex-shrink: 0; letter-spacing: -0.01em; }

/* ── LANG SWITCHER ── */
.lang-switcher { display: flex; gap: 0.35rem; align-items: center; }
.lang-btn {
  width: 32px; height: 22px; padding: 0;
  border: 2px solid transparent; background: none;
  cursor: pointer; border-radius: 4px; overflow: hidden;
  opacity: 0.5; transition: opacity 0.2s, border-color 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.lang-btn svg { width: 100%; height: 100%; display: block; }
.lang-btn:hover { opacity: 0.85; }
.lang-btn.active { opacity: 1; border-color: var(--brand); }

/* ── FORM ELEMENTS ── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
label { font-size: 0.82rem; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); padding: 0.65rem 0.85rem;
  font-family: inherit; font-size: 16px;
  outline: none; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none; border-radius: var(--radius);
}
input::placeholder, textarea::placeholder { color: #8A9087; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ── BUTTONS ── */
.btn-primary, .btn-next, .bk-footer-btn {
  background: var(--brand); color: var(--on-brand);
  border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background 0.15s;
}
.btn-primary { padding: 0.85rem 1.8rem; }
.btn-next { padding: 0.8rem 1.8rem; }
.btn-primary:hover, .btn-next:hover, .bk-footer-btn:hover { background: var(--brand-hover); }
.btn-next:disabled { background: var(--line-soft); color: var(--muted); cursor: not-allowed; }

.error-msg { font-size: 0.82rem; color: var(--danger); margin-top: 0.4rem; display: none; }
.error-msg.show { display: block; }
.bk-privacy { font-size: 0.8rem; color: var(--muted); margin: 0.9rem 0 0.2rem; line-height: 1.5; }
.bk-privacy a { color: var(--brand); }

/* ── BOOKING PAGE LAYOUT ── */
.booking-page { background: var(--bg); min-height: 100vh; max-width: 1100px; margin: 0 auto; }

.bk-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  height: 56px;
}
.bk-back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-family: inherit;
  font-size: 0.9rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0; transition: color 0.15s;
}
.bk-back-btn:hover { color: var(--brand); }

.bk-main {
  max-width: 860px; margin: 0 auto;
  padding: 5rem 2rem 5.5rem;
}
.bk-header { margin-bottom: 1.4rem; }
.bk-tag { font-size: 0.85rem; color: var(--brand); font-weight: 600; margin-bottom: 0.2rem; }
.bk-title {
  font-size: clamp(1.7rem, 4.5vw, 2.3rem); font-weight: 600;
  letter-spacing: -0.02em; color: var(--text); line-height: 1.15;
}

/* ── STEP INDICATORS ── */
.booking-steps { display: flex; align-items: center; margin-bottom: 1.6rem; }
.step-item { display: flex; flex-direction: column; align-items: center; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
  border: 1.5px solid var(--line);
  color: var(--muted); background: var(--surface);
  transition: all 0.2s; flex-shrink: 0;
}
.step-dot.active { border-color: var(--brand); color: var(--brand); }
.step-dot.done { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.step-line { flex: 1; height: 1.5px; background: var(--line); transition: background 0.2s; }
.step-line.done { background: var(--brand); }
.step-label { font-size: 0.72rem; color: var(--muted); text-align: center; margin-top: 0.3rem; white-space: nowrap; }

/* ── BOOKING STEPS ── */
.booking-step { display: none; padding-top: 0.2rem; }
.booking-step.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── FIXED FOOTER BAR ── */
.bk-footer-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 0.9rem 2rem;
}
.bk-footer-total { display: flex; flex-direction: column; }
.bk-footer-label { font-size: 0.78rem; color: var(--muted); }
.bk-footer-price { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.15; letter-spacing: -0.01em; }
.bk-footer-btn { padding: 0.85rem 1.7rem; white-space: nowrap; flex-shrink: 0; }

/* ── SERVICE LIST ── */
.svc-cat-tabs { display: flex; margin-bottom: 0.6rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.svc-tab {
  background: none; border: none; color: var(--muted);
  font-family: inherit; font-size: 0.92rem; font-weight: 500;
  padding: 0.7rem 1.1rem; cursor: pointer; position: relative; transition: color 0.15s;
}
.svc-tab:hover { color: var(--text); }
.svc-tab::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--brand); transform: scaleX(0); transition: transform 0.15s; }
.svc-tab.active { color: var(--brand); }
.svc-tab.active::after { transform: scaleX(1); }

.svc-list { display: flex; flex-direction: column; margin-bottom: 0.5rem; }
.svc-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.95rem 0.6rem; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: background 0.15s; border-radius: var(--radius);
}
.svc-row:hover { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.svc-row.selected { background: var(--brand-soft); }
.svc-check-circle {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: transparent; flex-shrink: 0; transition: all 0.15s;
}
.svc-row.selected .svc-check-circle { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.svc-row-info { flex: 1; }
.svc-row-name { font-size: 0.98rem; font-weight: 500; color: var(--text); line-height: 1.3; }
.svc-row-dur { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.svc-row-price { font-size: 0.98rem; font-weight: 600; color: var(--text); white-space: nowrap; flex-shrink: 0; }

/* ── BARBER DROPDOWN ── */
.barber-select-row {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--line);
  padding: 0.15rem 0.9rem; border-radius: var(--radius); margin-bottom: 1rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.barber-select-row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.barber-select-row.invalid { border-color: var(--danger); }
.barber-dropdown {
  flex: 1; background: none; border: none; color: var(--text); box-shadow: none;
  font-family: inherit; font-size: 0.98rem; cursor: pointer; outline: none; padding: 0.7rem 1.6rem 0.7rem 0;
  -webkit-appearance: none; appearance: none; border-radius: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235E655D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.1rem center;
}
.barber-dropdown:focus { box-shadow: none; }
.barber-dropdown option { background: var(--surface); color: var(--text); }

/* ── DATE STRIP ── */
.date-strip-wrapper { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.strip-arrow {
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); border-radius: var(--radius);
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s; display: flex; align-items: center; justify-content: center;
}
.strip-arrow:hover { border-color: var(--brand); color: var(--brand); }
.date-strip {
  display: flex; gap: 0.4rem; flex: 1;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.date-strip::-webkit-scrollbar { display: none; }
.day-card {
  flex: 1 0 44px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0.55rem 0.3rem;
  cursor: pointer; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.day-card:hover:not(.day-disabled):not(.day-selected) { border-color: var(--brand-line); background: var(--brand-soft); }
.day-card.day-selected { border-color: var(--brand); background: var(--brand); }
.day-card.day-disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }
.day-card.day-today:not(.day-selected) { border-color: var(--brand-line); }
.day-name { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.1rem; }
.day-num { font-size: 1.2rem; font-weight: 600; line-height: 1.1; color: var(--text); }
.day-month { font-size: 0.7rem; color: var(--muted); margin-top: 0.05rem; }
.day-card.day-selected .day-name, .day-card.day-selected .day-num, .day-card.day-selected .day-month { color: var(--on-brand); }
.time-slots-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; text-align: center; }

/* ── TIME SLOTS ── */
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.4rem; }
.time-btn {
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); padding: 0.6rem 0.3rem;
  font-size: 0.9rem; cursor: pointer; text-align: center;
  border-radius: var(--radius); transition: border-color 0.15s, background 0.15s;
}
.time-btn:hover:not(.unavail) { border-color: var(--brand-line); background: var(--brand-soft); }
.time-btn.selected { border-color: var(--brand); background: var(--brand); color: var(--on-brand); font-weight: 600; }
.time-btn.unavail { background: var(--line-soft); border-color: var(--line-soft); color: var(--muted); cursor: not-allowed; text-decoration: line-through; opacity: 0.7; }
.time-btn.past { opacity: 0.45; }

/* ── CONTACT FORM ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }

/* ── INLINE SUMMARY ── */
.inline-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1rem 0; }
.is-datetime { font-weight: 600; color: var(--text); font-size: 0.98rem; margin-bottom: 0.15rem; }
.is-barber { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.is-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; color: var(--text-2); gap: 1rem; }
.is-total { display: flex; justify-content: space-between; align-items: baseline; padding: 0.6rem 0 0; font-weight: 600; color: var(--text); }
.is-total strong { color: var(--text); font-size: 1.15rem; font-weight: 700; }

/* ── CONFIRMATION SCREEN ── */
.confirm-box { text-align: center; padding: 3rem 1.5rem; }
.confirm-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand-soft); border: 1.5px solid var(--brand); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 600; margin: 0 auto 1.4rem;
}
.confirm-box h2 { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.confirm-box p { color: var(--muted); font-size: 1rem; line-height: 1.7; max-width: 400px; margin: 0 auto 2rem; }
.confirm-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; max-width: 420px; margin: 0 auto 2rem; text-align: left; }
.summary-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; gap: 1rem; }
.summary-row:last-child { border-bottom: none; }
.summary-row .key { color: var(--muted); flex-shrink: 0; }
.summary-row .val { color: var(--text); font-weight: 500; text-align: right; }

/* ── FULL-WIDTH CONFIRM BUTTON ── */
.bk-confirm-full { width: 100%; margin-top: 1.2rem; padding: 0.95rem; font-size: 1rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .bk-topbar { padding: 0 1.2rem; height: 52px; }
  .bk-footer-bar { padding: 0.8rem 1.2rem; }
  .bk-main { padding: 4rem 1rem 5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .time-grid { gap: 0.4rem; }
  .step-label { display: none; }
}
@media (max-width: 480px) {
  .bk-topbar { padding: 0 0.9rem; height: 50px; }
  .bk-footer-bar { padding: 0.7rem 0.9rem; }
  .bk-footer-price { font-size: 1.3rem; }
  .bk-footer-btn { padding: 0.75rem 1.1rem; font-size: 0.9rem; }
  .bk-main { padding: 3.8rem 0.75rem 5rem; }
  .time-grid { grid-template-columns: repeat(3, 1fr); }
  .strip-arrow { width: 30px; height: 30px; font-size: 0.85rem; }
  .date-strip { gap: 0.3rem; }
  .day-card { flex: 1 0 38px; padding: 0.45rem 0.15rem; }
  .svc-tab { padding: 0.6rem 0.8rem; font-size: 0.85rem; }
  .svc-row { gap: 0.7rem; padding: 0.85rem 0.4rem; }
}

.bk-none { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 0.95rem; padding: 1.5rem 0; }
