/* Base styles + layout shared by all themes.
   Themes only override the CSS variables and a few accents:
   public/assets/css/themes.css defines [data-theme="barber"|"beauty"|"workshop"]. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; max-width: 1000px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.logo img { height: 36px; width: auto; }
.logo-name {
  font-weight: 800; font-size: 17px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.lang-switch { display: flex; gap: 4px; margin-left: auto; }
.lang-switch button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: var(--radius-s); padding: 4px 8px; font: inherit; font-size: 12px;
  cursor: pointer; text-transform: uppercase;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ---------- nav ---------- */
.nav { display: flex; gap: 2px; overflow-x: auto; padding: 0 12px 10px; max-width: 1000px; margin: 0 auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto; text-decoration: none; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.nav a.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.nav a.cta { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 36px;
  text-align: var(--hero-align, left);
}
.hero h1 { font-size: clamp(26px, 6vw, 40px); margin: 0 0 8px; line-height: 1.15; letter-spacing: var(--heading-space, 0); text-transform: var(--heading-case, none); }
.hero p { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.hero-logo { height: 72px; margin: 0 auto 16px; display: var(--hero-logo-display, none); }

/* ---------- sections ---------- */
section.block { padding: 32px 0; }
h2.section-title {
  font-size: 22px; margin: 0 0 18px; letter-spacing: var(--heading-space, 0);
  text-transform: var(--heading-case, none);
}

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card .desc { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.price { font-weight: 800; color: var(--accent); font-size: 18px; }
.duration { color: var(--muted); font-size: 13px; }

.staff-photo { width: 84px; height: 84px; border-radius: var(--avatar, 50%); object-fit: cover; background: var(--line); }
.staff-row { display: flex; gap: 14px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid var(--accent); cursor: pointer;
  background: var(--accent); color: var(--accent-contrast);
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 20px; border-radius: var(--radius); text-decoration: none;
  transition: filter .15s ease, transform .05s ease;
  text-align: center;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.block { display: block; width: 100%; }

/* ---------- booking wizard ---------- */
.steps { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.step-chip {
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--card);
}
.step-chip.current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.step-chip.done { border-color: var(--accent); color: var(--accent); }

.pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pick {
  text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.pick:hover { border-color: var(--accent); }
.pick.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pick .title { font-weight: 700; }
.pick .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pick .price { margin-top: 6px; }

.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.date-grid .dow { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.date-cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 0;
}
.date-cell.empty { background: transparent; border: none; cursor: default; }
.date-cell small { font-size: 9px; color: var(--accent); line-height: 1; }
.date-cell:disabled { color: var(--disabled); background: transparent; border-color: var(--line); cursor: not-allowed; }
.date-cell.selected { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.date-cell.selected small { color: var(--accent-contrast); }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month-name { font-weight: 700; text-transform: capitalize; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.t-group { margin-top: 14px; }
.t-label {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.slot {
  font: inherit; font-weight: 700; font-size: 15px; padding: 10px 0;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--card); color: var(--text); cursor: pointer; text-align: center;
}
.slot:hover { border-color: var(--accent); }
.slot.selected { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="url"], .field input[type="password"], .field input[type="number"],
.field select, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 10px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip { position: relative; }
.radio-chip input { position: absolute; opacity: 0; inset: 0; }
.radio-chip span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; cursor: pointer; background: var(--card);
}
.radio-chip input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 700; }

/* ---------- misc ---------- */
.summary-box { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; }
.summary-box b { font-size: 15px; }

.alert { border-radius: var(--radius-s); padding: 12px 14px; font-size: 14px; margin: 12px 0; border: 1px solid; }
.alert.error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert.info { background: var(--accent-soft); border-color: var(--accent); }

.code-big {
  font-size: clamp(26px, 7vw, 38px); font-weight: 800; letter-spacing: 3px;
  font-variant-numeric: tabular-nums; color: var(--accent);
  background: var(--card); border: 2px dashed var(--accent);
  border-radius: var(--radius); padding: 14px 18px; margin: 12px 0; text-align: center;
}

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery-grid img { border-radius: var(--radius-s); aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--line); }

.contacts { display: grid; gap: 8px; font-size: 15px; }
.contacts .line { display: flex; gap: 10px; align-items: baseline; }
.contacts .k { color: var(--muted); min-width: 90px; font-size: 13px; }
.social-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.social-row a {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--text); background: var(--card);
}

.empty-note { color: var(--muted); font-style: italic; }

.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.footer a { color: var(--muted); }

.privacy-text { white-space: pre-wrap; font-size: 15px; }
.privacy-text:empty::after { content: attr(data-empty); color: var(--muted); font-style: italic; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px;
  border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}

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

@media (min-width: 720px) {
  .topbar-inner { padding: 12px 16px; }
  .nav { padding-bottom: 0; }
  .hero { padding: 56px 0 48px; }
  .hero-center { --hero-align: center; --hero-logo-display: block; }
}

/* booking wizard: services grouped by category */
.svc-group + .svc-group { margin-top: 22px; }
.svc-group-title { margin: 0 0 10px; font-size: 18px; }
.privacy-text p { margin: 0 0 16px; }
.privacy-text b { display: inline-block; margin-bottom: 2px; }
