/*
 * Бренд-версія "blago Івано-Франківськ".
 * Палітра підібрана під референс blagodeveloper.com: лаймовий акцент
 * #c1f500, майже чорний текст #191919, шрифт Manrope.
 */

:root {
  --bg: #f4f3f1;
  --surface: #ffffff;
  --surface-muted: #edebe8;
  --text: #191919;
  --text-muted: #737272;
  --primary: #191919;
  --primary-dark: #000000;
  --accent: #c1f500;
  --accent-soft: #effcc4;
  --accent-ink: #3c4a00;
  --success: #4b7300;
  --success-soft: #effcc4;
  --border: #e5e3df;
  --shadow: 0 4px 16px rgba(25, 25, 25, 0.08);
  --shadow-hover: 0 10px 28px rgba(25, 25, 25, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --premium-from: #7c3aed;
  --premium-to: #ec4899;
  --premium-gradient: linear-gradient(135deg, var(--premium-from), var(--premium-to));
  --premium-soft: #f6eefe;
  --premium-ink: #7a1fa8;
  --premium-glow: 0 10px 28px rgba(168, 61, 220, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1c1c1c;
    --surface-muted: #262626;
    --text: #f3f3f1;
    --text-muted: #9a9a9a;
    --primary: #f3f3f1;
    --primary-dark: #ffffff;
    --accent: #c1f500;
    --accent-soft: #2b3400;
    --accent-ink: #e4ff8a;
    --success: #c1f500;
    --success-soft: #2b3400;
    --border: #2e2e2e;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.6);
    --premium-soft: #2a1a36;
    --premium-ink: #e9b5ff;
    --premium-glow: 0 12px 32px rgba(190, 80, 240, 0.35);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-button {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.brand__logo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.brand__location {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.catalog-menu {
  position: relative;
}

.catalog-menu__button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.catalog-menu__button:hover {
  border-color: var(--accent);
}

.catalog-menu__button[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.catalog-menu__chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.catalog-menu__button[aria-expanded="true"] .catalog-menu__chevron {
  transform: rotate(180deg);
}

.catalog-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 8px;
  z-index: 20;
}

.catalog-menu__panel[hidden] {
  display: none;
}

.catalog-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}

.catalog-menu__item:hover {
  background: var(--surface-muted);
}

.catalog-menu__item.active {
  background: var(--accent);
  color: var(--primary-dark);
}

.catalog-menu__soon {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* Каталог-плитки: широка панель на всю ширину шапки */

.tile-menu {
  position: static;
}

.tile-menu__panel {
  left: 24px;
  right: 24px;
  top: calc(100% - 4px);
  max-height: 75vh;
  padding: 16px;
}

/* Панель - сітка з 6 колонок; група займає --span колонок (задає app.js з tile-groups.json).
   Групи в одному ряду однакової висоти, плитки розтягуються під неї - без пустих дірок. */
.tile-menu__groups {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.tile-menu__group {
  grid-column: span var(--span);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.tile-menu__group-title {
  margin: 0 0 10px 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* --cols - скільки плиток у ряд всередині групи */
.tile-menu__grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
}

.tile-menu__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tile-menu__tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.tile-menu__tile:has(.active) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tile-menu__tile--soon span.tile-menu__icon {
  opacity: 0.55;
}

.tile-menu__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  background: none;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

/* "Скоро" - у кутку плитки, окремо від підкатегорій */
.tile-menu__main .catalog-menu__soon {
  position: absolute;
  top: 8px;
  right: 8px;
  margin-left: 0;
}

.tile-menu__icon {
  font-size: 36px;
  line-height: 1;
}

img.tile-menu__icon {
  width: 64px;
  height: 64px;
  margin: -6px 0;
  object-fit: contain;
}

img.works-view__icon-img {
  width: 48px;
  height: 48px;
}

.tile-menu__label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

/* Підкатегорії - кнопки на всю ширину плитки, щоб легше було влучити */
.tile-menu__children {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px 8px 8px;
  border-top: 1px solid var(--border);
}

.tile-menu__tile--wide .tile-menu__children {
  grid-template-columns: 1fr 1fr;
}

/* Непарна остання підкатегорія - на весь рядок, щоб не лишалось дірки */
.tile-menu__tile--wide .tile-menu__chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.tile-menu__chip {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.tile-menu__chip:has(.tile-menu__chip-icon) {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.tile-menu__chip-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin: -4px 0;
  font-size: 18px;
  line-height: 26px;
  text-align: center;
}

/* "Скоро" на підкатегорії - на верхній рамці кнопки, щоб не стискати назву */
.tile-menu__chip {
  position: relative;
}

.tile-menu__chip .catalog-menu__soon {
  position: absolute;
  top: -7px;
  right: 6px;
  margin-left: 0;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.3;
  border: 1px solid var(--border);
}

.tile-menu__chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.tile-menu__chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
}

.phone-menu {
  margin-left: auto;
}

.phone-menu__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.phone-menu__role {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.phone-menu__number {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.cart-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.cart-button:hover {
  border-color: var(--accent);
}

.cart-button__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Toolbar */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toolbar__count {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Перемикач Базова / Преміум / Усі: "повзунок" їздить під активною опцією */

.tier-filter {
  --tier-index: 2;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.tier-filter[hidden] {
  display: none;
}

.tier-filter[data-active="base"] {
  --tier-index: 0;
}

.tier-filter[data-active="premium"] {
  --tier-index: 1;
}

.tier-filter__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 999px;
  background: var(--primary);
  transform: translateX(calc(100% * var(--tier-index)));
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.tier-filter[data-active="premium"] .tier-filter__thumb {
  background: var(--premium-gradient);
  box-shadow: var(--premium-glow);
}

.tier-filter__option {
  position: relative;
  z-index: 1;
  border: none;
  background: none;
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.tier-filter__option:hover {
  color: var(--text);
}

.tier-filter__option--premium {
  color: var(--premium-ink);
}

.tier-filter__option.active {
  color: var(--bg);
}

.tier-filter__option--premium.active {
  color: #fff;
}

.tier-filter__count {
  font-weight: 600;
  opacity: 0.6;
  margin-left: 2px;
}

@media (max-width: 640px) {
  .tier-filter {
    order: 3;
    width: 100%;
  }

  .tier-filter__option {
    padding: 8px 6px;
  }
}

/* Плашка "Преміум" */

.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--premium-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(168, 61, 220, 0.35);
}

.premium-badge--small {
  margin-left: 8px;
  padding: 3px 7px;
  font-size: 9px;
  box-shadow: none;
  vertical-align: 1px;
}

/* Grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.toolbar[hidden],
.grid[hidden] {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.card__image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-muted);
}

.card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card__premium {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
}

/* Градієнтна рамка через подвійний background: padding-box - фон картки, border-box - градієнт */
.card--premium {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--premium-gradient) border-box;
}

.card--premium:hover {
  border-color: transparent;
  box-shadow: var(--premium-glow);
}

.card__cart-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, color 0.15s ease;
}

.card__cart-btn:hover {
  background: var(--accent-soft);
}

.card__cart-btn.in-cart {
  background: var(--accent);
  color: var(--primary-dark);
}

.card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card__collection {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.card__descr {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.card__colors {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Варіанти (розміри) однієї моделі */

.variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card__body .variants {
  margin-top: auto;
  padding-top: 8px;
}

.variant-chip {
  position: relative;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.variant-chip:hover {
  border-color: var(--text-muted);
}

.variant-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
  cursor: default;
}

.variant-chip--premium::before {
  content: "✦ ";
  color: var(--premium-ink);
}

.variant-chip--premium.active {
  background: var(--premium-gradient);
  border-color: transparent;
  color: #fff;
}

.variant-chip--premium.active::before {
  color: inherit;
}

/* Розмір, що вже лежить у кошику */
.variant-chip.in-cart::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.variants--large .variant-chip {
  padding: 9px 14px;
  font-size: 13px;
}

.modal__variants {
  margin: -4px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal__variants[hidden] {
  display: none;
}

.modal__variants-caption {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  outline: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  background-size: cover;
  background-position: center;
}

.swatch:hover,
.swatch.active {
  outline: 2px solid var(--accent);
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  box-shadow: var(--shadow-hover);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 2;
}

.modal__gallery {
  background: var(--surface-muted);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__main-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.modal__main-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.modal__nav:hover {
  opacity: 1;
  background: var(--accent-soft);
}

.modal__nav[hidden] {
  display: none;
}

.modal__nav--prev {
  left: 10px;
}

.modal__nav--next {
  right: 10px;
}

.modal__thumbnails {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal__thumbnails img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.modal__thumbnails img:hover {
  opacity: 0.9;
}

.modal__thumbnails img.active {
  opacity: 1;
  border-color: var(--accent);
}

.modal__info {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.modal__collection {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.modal__title {
  margin: 4px 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.modal__premium {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px 0 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--premium-soft);
}

.modal__premium[hidden] {
  display: none;
}

.modal__premium-note {
  font-size: 13px;
  font-weight: 600;
  color: var(--premium-ink);
}

.modal__specs {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal__specs div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.modal__specs dt {
  color: var(--text-muted);
}

.modal__specs dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.modal__cart-btn {
  margin-top: 4px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.modal__cart-btn:hover {
  filter: brightness(0.95);
}

.modal__cart-btn.in-cart {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Посилання на калькулятор виробника (кабіни під індивідуальні розміри) */

.calc-link {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--premium-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--premium-glow);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.calc-link:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.calc-link[hidden] {
  display: none;
}

.calc-link--large {
  margin-top: 4px;
  padding: 12px;
  font-size: 14px;
}

.modal__link {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal__link:hover {
  color: var(--accent-ink);
}

@media (max-width: 640px) {
  .modal {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 15px;
}

.works-view {
  text-align: center;
  padding: 100px 20px;
}

.works-view__icon {
  display: block;
  font-size: 40px;
  margin-bottom: 16px;
}

.works-view h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.works-view p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Наші роботи: як сітка каталогу, але 2 картки в ряд і фото на всю картку */

.works[hidden] {
  display: none;
}

.works-view[hidden] {
  display: none;
}

.works-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card--work .card__image-wrap {
  aspect-ratio: 3 / 2;
}

.card--work .card__image {
  object-fit: cover;
}

.card--work .card__descr {
  font-size: 18px;
}

/* Модалка роботи: одна колонка - фото на всю ширину, без характеристик і кошика */

.modal--work {
  max-width: 1100px;
  grid-template-columns: 1fr;
}

.modal--work .modal__info {
  order: -1;
  padding: 20px 64px 0 24px;
}

.modal--work .modal__title {
  margin-bottom: 0;
}

.modal--work .modal__specs {
  display: none;
}

.modal--work .modal__main-image-wrap {
  aspect-ratio: auto;
  height: min(66vw, 62vh);
  background: var(--surface-muted);
}

.modal--work .modal__thumbnails img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.modal__cart-btn[hidden],
.modal__link[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .works-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal--work .modal__gallery {
    padding: 12px;
  }

  .modal--work .modal__thumbnails img {
    width: 56px;
    height: 56px;
  }
}

#works-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
}

@media (max-width: 840px) {
  .mobile-menu-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    font-size: 18px;
    cursor: pointer;
  }

  .header-actions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-left: 0;
    max-height: 70vh;
    overflow-y: auto;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
  }

  .header-actions.open {
    display: flex;
  }

  .header-actions .catalog-menu {
    width: 100%;
  }

  .header-actions .catalog-menu__button,
  .header-actions #works-button {
    width: 100%;
    justify-content: space-between;
  }

  .phone-menu .catalog-menu__button-label {
    display: none;
  }

  .phone-menu .catalog-menu__button {
    padding: 8px 12px;
  }

  .header-actions .catalog-menu__panel {
    position: static;
    margin-top: 4px;
    padding: 4px;
    background: var(--surface-muted);
    border: none;
    box-shadow: none;
  }

  .tile-menu__groups {
    grid-template-columns: 1fr;
  }

  .tile-menu__group {
    grid-column: auto;
    padding: 8px;
    background: var(--surface);
  }

  .tile-menu__grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .site-header__inner {
    padding: 12px 16px;
    gap: 8px;
  }

  .page {
    padding: 16px;
  }
}

@media (max-width: 360px) {
  .brand__location {
    display: none;
  }
}

/* Кошик */

.cart-modal {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  padding: 24px;
}

.cart-modal__header {
  margin-bottom: 16px;
}

.cart-modal__header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item__image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__collection {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.cart-item__descr {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.cart-item__remove {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.cart-item__remove:hover {
  color: var(--accent-ink);
}

.cart-share-btn {
  margin-top: 16px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.cart-share-btn:hover {
  filter: brightness(0.95);
}
