/*
 * Общие стили демо-сайтов. Палитру (--bg, --accent, шрифты) задаёт каждое демо
 * в своём файле, здесь — сетка, отступы и компоненты.
 *
 * Правила интерфейса те же, что у портфолио: ширина 1180 px, поля 24/16 px,
 * отступы 4–48 px, кнопки 40/44 px с радиусом 8 px и шрифтом 14 px.
 */

:root {
  --page-max: 1180px;
  --page-gutter: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --control-height: 40px;
  --control-height-sm: 32px;
  --control-radius: 8px;
  --control-font: 14px;
  --card-radius: 16px;

  /* Цвета столиков на карте. Красного нет намеренно. */
  --free: #2fbf71;
  --busy: #f2c335;
  --small: #9aa0a8;

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

@media (max-width: 760px) {
  :root {
    --page-gutter: 16px;
    --control-height: 44px;
    --control-height-sm: 40px;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.wrap {
  width: min(var(--page-max), 100% - var(--page-gutter) * 2);
  margin-inline: auto;
}

/* ============ Плашка демо: возврат в портфолио и язык ============ */

.demo-bar {
  position: relative;
  z-index: 60;
  background: #0c0d10;
  color: #e9ebf0;
  font-size: 13px;
}

.demo-bar .wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.demo-bar a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  text-decoration: none;
}

.demo-bar a:hover {
  color: #ffffff;
}

.demo-badge {
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  background: #3d4bff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-note {
  color: #9aa0ad;
}

.demo-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lang {
  display: flex;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--control-radius);
}

.lang button {
  height: 28px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 6px;
  background: none;
  color: #9aa0ad;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang button.on {
  background: #ffffff;
  color: #0c0d10;
}

/* ============ Шапка сайта и вкладки ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: var(--space-1);
  margin-right: auto;
}

.tabs button {
  height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--control-radius);
  background: none;
  color: var(--muted);
  font-size: var(--control-font);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button.on {
  background: var(--line);
  color: var(--ink);
}

/* ============ Кнопки и выбор ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-size: var(--control-font);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.2s,
    background-color 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--ghost {
  border-color: var(--line-2);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--ink);
}

.btn--block {
  width: 100%;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-2);
  border-radius: var(--control-radius);
  background: transparent;
  font-size: var(--control-font);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper {
  display: inline-flex;
  align-items: center;
  height: var(--control-height);
  border: 1px solid var(--line-2);
  border-radius: var(--control-radius);
}

.stepper button {
  width: var(--control-height);
  height: 100%;
  border: 0;
  background: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.stepper output {
  min-width: 72px;
  text-align: center;
  font-weight: 700;
}

.field-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============ Разделы ============ */

.panel {
  padding: var(--space-7) 0 calc(var(--space-7) * 2);
  animation: panel-in 0.4s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.h1 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 88px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 60ch;
  margin: 0 0 var(--space-6);
  color: var(--muted);
  font-size: 18px;
}

.card {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

/* ============ Меню и прайс ============ */

.menu-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px dashed var(--line-2);
}

.menu-item b {
  font-size: 17px;
}

.menu-item .price {
  font-family: var(--font-display);
  font-weight: 700;
  white-space: nowrap;
}

.menu-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tag {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  border-radius: 6px;
  background: var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ============ Бронирование: карта и панель ============ */

.booking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-5);
  align-items: start;
}

/* minmax(0, 1fr) и min-width: 0 обязательны: иначе прокручиваемые на телефоне ряды
   кнопок растягивают колонку по своей ширине и страница уезжает вбок. */
.booking-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.booking-controls .row > div {
  min-width: 0;
  max-width: 100%;
}

.booking-controls .row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-5);
}

.floor {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--floor-bg, var(--surface));
}

.floor svg {
  display: block;
  width: 100%;
  height: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend .l-free {
  background: var(--free);
}

.legend .l-busy {
  background: var(--busy);
}

.legend .l-small {
  background: var(--small);
}

/* Столики */
.table {
  cursor: pointer;
  outline: none;
  transition: opacity 0.3s;
}

.table .chair {
  fill: var(--chair, #d9d2c5);
  stroke: rgba(0, 0, 0, 0.15);
  stroke-width: 1;
}

.table .table-top,
.table .sofa {
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 1.5;
  transition:
    fill 0.3s,
    filter 0.3s;
}

.table .sofa {
  fill: var(--sofa, #5b4a7a);
}

.table.is-free .table-top {
  fill: var(--free);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--free) 70%, transparent));
}

.table.is-busy .table-top {
  fill: var(--busy);
}

.table.is-small {
  opacity: 0.45;
}

.table.is-small .table-top {
  fill: var(--small);
}

.table.is-busy,
.table.is-small {
  cursor: not-allowed;
}

.table.is-free:hover .table-top,
.table.is-free:focus-visible .table-top {
  filter: drop-shadow(0 0 14px var(--free));
}

.table.is-selected .table-top {
  stroke: var(--ink);
  stroke-width: 4;
  animation: table-pulse 1.4s ease-in-out infinite;
}

@keyframes table-pulse {
  50% {
    stroke-width: 7;
  }
}

.table-num {
  fill: #10120f;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.table-seats {
  fill: rgba(16, 18, 15, 0.75);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}

.map-label {
  fill: var(--map-label, rgba(0, 0, 0, 0.45));
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-anchor: middle;
  text-transform: uppercase;
}

.side {
  position: sticky;
  top: 88px;
}

.side h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 24px;
}

.side .muted,
.muted {
  color: var(--muted);
}

.facts {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.facts b {
  text-align: right;
}

.form {
  display: grid;
  gap: var(--space-3);
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-2);
  border-radius: var(--control-radius);
  background: var(--bg);
  font-size: 16px;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.form .invalid {
  border-color: #e0a100;
}

.success {
  padding: var(--space-4);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--free) 16%, transparent);
  font-weight: 700;
}

/* ============ Уведомление ============ */

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: var(--space-5);
  max-width: calc(100% - var(--page-gutter) * 2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--control-radius);
  background: #0c0d10;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.3s,
    transform 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============ «Zobacz swoją stronę» (demo/brand.js) ============ */

/* Виджет — инструмент студии, а не часть дизайна демо, поэтому он везде одинаковый:
   тёмный, как плашка «Demo» сверху, с фирменным синим цветом студии. */
.brand-widget {
  position: fixed;
  z-index: 70;
  left: var(--space-5);
  bottom: var(--space-5);
  color: #e9ebf0;
  font-family: var(--font);
  font-size: 14px;
  /* На телефоне виджет растянут на всю ширину — пустое место вокруг кнопки
     не должно перехватывать нажатия по странице. */
  pointer-events: none;
}

.brand-widget > * {
  pointer-events: auto;
}

.brand-widget-open {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding: 0 var(--space-4);
  border: 0;
  border-radius: 999px;
  background: #3d4bff;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 16px 32px -16px rgba(61, 75, 255, 0.9);
  cursor: pointer;
}

/* Пульсирующая точка привлекает внимание, пока виджет свёрнут. */
.brand-widget-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  animation: brand-pulse 1.6s ease-out infinite;
}

@keyframes brand-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }

  100% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

.brand-widget-card {
  display: none;
  width: 320px;
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--card-radius);
  background: #0c0d10;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

.brand-widget.open .brand-widget-card {
  display: block;
  animation: brand-in 0.25s ease-out;
}

.brand-widget.open .brand-widget-open {
  display: none;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.brand-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 16px;
}

.brand-widget-close {
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  border: 0;
  border-radius: var(--control-radius);
  background: transparent;
  color: #9aa0ad;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.brand-widget-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.brand-widget-card p {
  margin: var(--space-1) 0 var(--space-3);
  color: #9aa0ad;
  line-height: 1.45;
}

.brand-widget-input {
  width: 100%;
  height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--control-radius);
  background: #17191e;
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.brand-widget-input:focus {
  outline: 2px solid #3d4bff;
  outline-offset: 1px;
}

.brand-widget-card .brand-widget-label {
  margin: var(--space-3) 0 var(--space-2);
  color: #e9ebf0;
  font-weight: 700;
}

.brand-widget-colors {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1);
}

.brand-widget-swatch {
  width: 24px;
  height: 24px;
  flex: none;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

/* «Родной цвет» демо — нейтральная шахматка, чтобы не путать с цветами палитры. */
.brand-widget-swatch--original {
  background: conic-gradient(#ffffff 0 25%, #9aa0ad 0 50%, #ffffff 0 75%, #9aa0ad 0);
}

.brand-widget-swatch.on {
  border-color: #ffffff;
  outline: 2px solid #3d4bff;
}

.brand-widget-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.brand-widget-btn {
  flex: 1;
  height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--control-radius);
  background: transparent;
  color: #e9ebf0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.brand-widget-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.brand-widget-btn--main {
  flex: 1.6;
  border-color: #3d4bff;
  background: #3d4bff;
  color: #ffffff;
}

.brand-widget-btn--main:hover {
  background: #2f3cf0;
}

@media (max-width: 760px) {
  .brand-widget {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }

  .brand-widget-card {
    width: 100%;
  }
}

/* ============ Подвал ============ */

.site-footer {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ============ Адаптивность ============ */

/* Шапка: с 1100 px вкладки уходят во второй ряд, остальная адаптация — с 980 px. */
@media (max-width: 1100px) {
  /* Логотип, вкладки и кнопка не помещаются в одну строку уже на планшете:
     вкладки уходят во второй ряд — одну горизонтально прокручиваемую полосу. */
  .site-header .wrap {
    flex-wrap: wrap;
    gap: 0 var(--space-3);
    padding-top: var(--space-2);
  }

  .site-header .btn {
    margin-left: auto;
  }

  .tabs {
    order: 3;
    width: calc(100% + var(--page-gutter) * 2);
    margin: var(--space-2) calc(var(--page-gutter) * -1) 0;
    padding: 0 var(--page-gutter) var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 980px) {
  .booking {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .demo-note {
    display: none;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .booking-controls .row {
    gap: var(--space-4);
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
