/* ===== Сайт «Изделия из бетона» — мобильный первый ===== */

:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1a;
  --accent: #eab81b;
  --text: #e9e9e9;
  --text-muted: #999;
  --font-size-body: 18px;
  --font-size-lead: 20px;
  --font-size-h1: 28px;
  --font-size-h2: 22px;
  --tap-min: 48px;
  --space: 1.25rem;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--font-size-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----- Шапка ----- */
.header {
  background: var(--bg-card);
  padding: var(--space) 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(234, 184, 27, 0.2);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

.logo img {
  max-height: 56px;
  width: auto;
}

/* ----- Hero-баннер (главная) ----- */
/* Тёмный градиент в стиле бетона — читаемость текста */
/* Full-width на всех экранах: прижат к краям, без чёрных полос */
.hero {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  min-height: clamp(280px, 75vw, 600px);
  background: linear-gradient(180deg, #0d0d0d 0%, #171717 30%, #222 70%, #252520 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -1.5rem calc(-50vw + 50%) 1.5rem;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  text-align: center;
}

.hero__title {
  margin: 0 0 0.5rem;
  font-size: var(--font-size-h1);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.hero__subtitle {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.hero__intro {
  margin: 0;
  font-size: var(--font-size-lead);
  color: rgba(255,255,255,0.95);
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hero__text {
  margin-top: 1.5rem;
  text-align: left;
}

.hero__text p {
  margin: 0 0 1rem;
  font-size: var(--font-size-body);
  color: rgba(255,255,255,0.95);
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hero__text p:last-child {
  margin-bottom: 0;
}

@media (min-width: 600px) {
  .hero {
    margin: -1.5rem calc(-50vw + 50%) 2rem;
    padding: 3rem 1.5rem;
  }

  .hero__title {
    font-size: 2rem;
  }
}

@media (min-width: 900px) {
  .hero {
    margin: -1.5rem calc(-50vw + 50%) 2rem;
  }
}

/* Кнопка меню на телефоне */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.menu-toggle:hover {
  background: rgba(234, 184, 27, 0.15);
}

.menu-toggle[aria-expanded="true"] {
  background: rgba(234, 184, 27, 0.2);
}

/* Навигация */
.nav {
  width: 100%;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-list a {
  display: block;
  padding: 0.9rem 0.75rem;
  color: var(--text);
  font-size: var(--font-size-lead);
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  border-radius: var(--radius);
}

.nav-list a:hover,
.nav-list a:focus {
  background: rgba(234, 184, 27, 0.12);
  color: var(--accent);
  text-decoration: none;
}

/* Скрытие меню на мобильном по умолчанию */
@media (max-width: 799px) {
  .nav {
    display: none;
  }

  .nav.is-open {
    display: block;
    margin-top: 0.5rem;
  }
}

/* Десктоп: меню в строку */
@media (min-width: 800px) {
  .menu-toggle {
    display: none;
  }

  .nav {
    width: auto;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .nav-list a {
    padding: 0.5rem 1rem;
    min-height: auto;
    font-size: 1.1rem;
  }
}

/* ----- Основной контент ----- */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.page-title {
  font-size: var(--font-size-h1);
  margin: 0 0 1rem;
  color: var(--accent);
  line-height: 1.3;
}

.page-lead {
  font-size: var(--font-size-lead);
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.content-block p {
  margin: 0 0 1rem;
}

.content-block h2 {
  font-size: var(--font-size-h2);
  margin: 1.5rem 0 0.75rem;
  color: var(--accent);
}

/* Карточки (прайс, контакты) */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  min-height: var(--tap-min);
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  font-size: var(--font-size-lead);
  font-weight: 600;
  margin-top: 0.5rem;
}

.download-link:hover {
  opacity: 0.9;
  text-decoration: none;
  color: var(--bg);
}

/* Контакты */
.contacts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contacts-list li {
  padding: 0.6rem 0;
  font-size: var(--font-size-lead);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.contacts-list a {
  color: var(--accent);
}

/* Схема проезда (кнопки Яндекс.Карты и 2ГИС) */
.contacts-map {
  margin-top: 2rem;
  max-width: 480px;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contacts-map__title {
  font-size: var(--font-size-h2);
  margin: 0 0 0.5rem;
}

.contacts-map__address {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.contacts-map__canvas {
  margin-bottom: 1.25rem;
  min-height: 320px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.contacts-map__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contacts-map__btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: var(--tap-min);
  line-height: 1.2;
  box-sizing: border-box;
}

.contacts-map__btn:hover {
  opacity: 0.92;
  text-decoration: none;
  color: var(--bg);
}

/* Галерея — стиль как на телефоне, 2 колонки */
.gallery-phones {
  margin-top: 1rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-grid-2col {
  display: -webkit-grid;
  display: grid;
  -webkit-grid-template-columns: 1fr 1fr;
  grid-template-columns: 1fr 1fr;
  -webkit-column-gap: 0.5rem;
  column-gap: 0.5rem;
  -webkit-row-gap: 0.5rem;
  row-gap: 0.5rem;
  gap: 0.5rem;
}

.gallery-item {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-item--video {
  grid-column: 1 / -1;
  border: 2px solid var(--accent);
}

.gallery-item__video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
@supports not (aspect-ratio: 16 / 9) {
  .gallery-item__video-wrap {
    padding-bottom: 56.25%; /* 16:9 */
  }
}

.gallery-item__video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.gallery-item__photo-wrap {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  aspect-ratio: 1;
  /* fallback для Safari без aspect-ratio */
}
@supports not (aspect-ratio: 1) {
  .gallery-item__photo-wrap {
    padding-bottom: 100%;
  }
}

.gallery-item__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@supports not (aspect-ratio: 1) {
  .gallery-item__photo-wrap .gallery-item__img {
    position: absolute;
    top: 0;
    left: 0;
  }
}

.gallery-item__caption {
  margin: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

@media (min-width: 520px) {
  .gallery-phones {
    max-width: 500px;
  }

  .gallery-grid-2col {
    -webkit-column-gap: 0.75rem;
    column-gap: 0.75rem;
    -webkit-row-gap: 0.75rem;
    row-gap: 0.75rem;
    gap: 0.75rem;
  }
}

/* Лайтбокс галереи */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  box-sizing: border-box;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: 90%;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  z-index: 1;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
}

.lightbox__prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
}

.lightbox__next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
}

@media (max-width: 600px) {
  .lightbox {
    padding: 2rem 3rem;
  }

  .lightbox__close,
  .lightbox__prev,
  .lightbox__next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }

  .lightbox__prev {
    left: 0.5rem;
  }

  .lightbox__next {
    right: 0.5rem;
  }

  .lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* Подвал */
.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer a {
  color: var(--accent);
}

/* Кнопка «Редактировать» для админа */
.admin-edit {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: rgba(234, 184, 27, 0.2);
  color: var(--accent);
  border-radius: var(--radius);
}

.admin-edit:hover {
  background: rgba(234, 184, 27, 0.3);
  color: var(--accent);
  text-decoration: none;
}

/* ----- Продукция: карточки категорий ----- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.product-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.2s, transform 0.2s;
}

.product-card:hover {
  border-color: rgba(234, 184, 27, 0.4);
  text-decoration: none;
  transform: translateY(-2px);
}

.product-card__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #111;
}

.product-card__title {
  margin: 0;
  padding: 1rem 1rem 0;
  font-size: 1.15rem;
  color: var(--accent);
}

.product-card__desc {
  margin: 0;
  padding: 0.5rem 1rem 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ----- Прайсы: таблицы и секции ----- */
.prices-content {
  margin-top: 2rem;
}

.price-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 1rem;
}

.price-section__title {
  font-size: var(--font-size-h2);
  color: var(--accent);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(234, 184, 27, 0.3);
}

.price-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.price-table-wrap--scroll {
  max-width: 100%;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.price-table th,
.price-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
}

.price-table th {
  background: rgba(234, 184, 27, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.price-table--compact th,
.price-table--compact td {
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
}

/* Код 0 = номенклатуры в 1С нет */
.price-table td.price-cell--no-1c {
  color: var(--text-muted);
}

.price-table td.price-cell--from-1c {
  color: rgba(255, 255, 255, 0.95);
}

.price-note {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.price-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
