/**
 * Кастомные стили темы (без сборки SCSS).
 * Подключается в header.php после css/main.css и css/constructor-blocks.css.
 */

/* ============================================================
   Обёртка конструктора
   ============================================================ */

.builder-block[data-layout="hero_cta"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   Hero CTA — базовые стили
   (дублируют constructor-blocks.css на случай если тот 404)
   ============================================================ */

.hero-cta-block {
  position: relative;
  min-height: 16rem;
  padding: 3.5rem 2rem;
  overflow: hidden;
  border-radius: 1.25rem;
  color: #fff;
}
@media screen and (max-width: 1024px) {
  .hero-cta-block {
    min-height: 14rem;
    padding: 3rem 1.75rem;
  }
}
@media screen and (max-width: 768px) {
  .hero-cta-block {
    min-height: 12rem;
    padding: 2.5rem 1.25rem;
  }
}

/* Фон и оверлей */
.hero-cta-block__bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 0;
}
.hero-cta-block__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 1;
}

/* Градиент по умолчанию (нет фото) — тёмный нейтральный */
.hero-cta-block--gradient:not(.hero-cta-block--has-bg) {
  background: linear-gradient(135deg, #1a1c22 0%, #2c3038 50%, #1a1c22 100%);
}
/* При наличии фото — только тёмная завеса без цветного оттенка */
.hero-cta-block--has-bg .hero-cta-block__overlay {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.35) 100%);
}

/* ============================================================
   Внутренний контент — по центру
   ============================================================ */

.hero-cta-block__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.75rem;
}

.hero-cta-block__text {
  max-width: 52rem;
  width: 100%;
}

.hero-cta-block__title {
  margin: 0 0 0.75rem;
  font-family: "Exo 2", sans-serif, -apple-system, BlinkMacSystemFont;
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.01em;
}
@media screen and (max-width: 1024px) {
  .hero-cta-block__title {
    font-size: 2.25rem;
  }
}
@media screen and (max-width: 768px) {
  .hero-cta-block__title {
    font-size: 1.75rem;
  }
}

.hero-cta-block__subtitle {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-line;
}
@media screen and (max-width: 768px) {
  .hero-cta-block__subtitle {
    font-size: 1rem;
  }
}

/* Кнопка */
.hero-cta-block__cta {
  display: flex;
  justify-content: center;
}
.hero-cta-block .btn.btn-shadow {
  color: #151416;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.875rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.625rem;
  box-shadow: 0 2px 8px rgba(21, 20, 22, 0.1), 0 8px 24px rgba(21, 20, 22, 0.12), inset 0 1px 0 #fff;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.hero-cta-block .btn.btn-shadow:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(21, 20, 22, 0.12), 0 12px 32px rgba(21, 20, 22, 0.16), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}
.hero-cta-block .btn.btn-shadow svg,
.hero-cta-block .btn.btn-shadow path {
  fill: #151416;
}
@media screen and (max-width: 768px) {
  .hero-cta-block__cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Хлебные крошки над hero (шаблон «Аренда»)
   ============================================================ */

/* Общий враппер — слева, как на обычной странице */
.rental-hero-breadcrumbs,
.hero-cta-breadcrumbs-wrap {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.rental-hero-breadcrumbs .breadcrumbs,
.hero-cta-breadcrumbs-wrap .breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.4;
  color: #394c56;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  justify-content: flex-start;
  overflow-x: auto;
}

.rental-hero-breadcrumbs .breadcrumbs span,
.hero-cta-breadcrumbs-wrap .breadcrumbs span {
  flex: 0 0 auto;
  font-size: inherit;
}

.rental-hero-breadcrumbs .breadcrumbs a,
.hero-cta-breadcrumbs-wrap .breadcrumbs a {
  font-size: inherit;
  font-weight: 400;
  color: #151416;
  text-decoration: none;
}
.rental-hero-breadcrumbs .breadcrumbs a:hover,
.hero-cta-breadcrumbs-wrap .breadcrumbs a:hover {
  color: #eb6d02;
}
.rental-hero-breadcrumbs .breadcrumbs .breadcrumb_last,
.rental-hero-breadcrumbs .breadcrumbs span.breadcrumb_last,
.hero-cta-breadcrumbs-wrap .breadcrumbs .breadcrumb_last,
.hero-cta-breadcrumbs-wrap .breadcrumbs span.breadcrumb_last {
  color: #a1a1a1;
  font-weight: 400;
}
.rental-hero-breadcrumbs .breadcrumbs .separator,
.hero-cta-breadcrumbs-wrap .breadcrumbs .separator {
  color: #a1a1a1;
}

/* ============================================================
   Шаблон «Аренда» — отступ под фиксированный хедер
   ============================================================ */

.content-page--rental-hero {
  padding-top: 0.5rem;
}

/* ============================================================
   Галерея / Работы — grid_col-3 + media-grid-item
   (works.php и gallery.php)
   ============================================================ */

/* Сетка: 3 колонки → 2 → 2 узких → 1 */
.grid_col-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media screen and (max-width: 1024px) {
  .grid_col-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .grid_col-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media screen and (max-width: 360px) {
  .grid_col-3 {
    grid-template-columns: 1fr;
  }
}

/* Карточка — ссылка-обёртка */
.media-grid-item {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  aspect-ratio: 4 / 3;
  background: #dfe3e5;
  text-decoration: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@media screen and (max-width: 480px) {
  .media-grid-item {
    border-radius: 0.5rem;
    aspect-ratio: 1 / 1;
  }
}

/* Фото */
.media-grid-item .photo-item {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  -o-object-position: center;
  object-position: center;
  -webkit-transition: -webkit-transform 0.45s ease;
  transition: transform 0.45s ease;
}

.media-grid-item:hover .photo-item {
  -webkit-transform: scale(1.07);
  transform: scale(1.07);
}

/* Затемнение при ховере */
.media-grid-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(21, 20, 22, 0);
  -webkit-transition: background 0.35s ease;
  transition: background 0.35s ease;
  border-radius: inherit;
}

.media-grid-item:hover::after {
  background: rgba(21, 20, 22, 0.18);
}

/* Оверлей для видео (.bg-video — дефисная версия из gallery.php) */
.media-grid-item .bg-video {
  position: absolute;
  inset: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  background: rgba(21, 20, 22, 0.32);
  -webkit-transition: background 0.25s ease;
  transition: background 0.25s ease;
  z-index: 1;
}

.media-grid-item:hover .bg-video {
  background: rgba(21, 20, 22, 0.52);
}

.media-grid-item .bg-video .video-play {
  width: 3.25rem;
  height: 3.25rem;
  -o-object-fit: contain;
  object-fit: contain;
  -webkit-transition: -webkit-transform 0.25s ease;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.media-grid-item:hover .bg-video .video-play {
  -webkit-transform: scale(1.15);
  transform: scale(1.15);
}

@media screen and (max-width: 480px) {
  .media-grid-item .bg-video .video-play {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* Заголовок секции (h2 + линии) — мобильная адаптация */
@media screen and (max-width: 768px) {
  .h2.text-center {
    font-size: 1.5rem;
    line-height: 1.3;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .line {
    width: 40px;
  }
}

/* ============================================================
   Таблица цен — кнопка «Заказ» шире + мобайл
   ============================================================ */

/* Кнопка на всю ширину ячейки, нормальный размер */
.price-table-block__order {
  width: 100%;
  min-width: 7rem;
  padding: 0.5rem 1rem !important;
  font-size: 0.9375rem !important;
  white-space: nowrap;
}

/* Мобайл: таблица скроллируется горизонтально */
@media screen and (max-width: 768px) {
  .price-table-block__scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .price-table-block__scroll::-webkit-scrollbar {
    display: none;
  }

  /* Меньше min-width чтобы таблица уместилась на ≥420px без скролла */
  .price-table-block__table {
    min-width: 26rem;
    font-size: 0.8125rem;
  }

  /* Колонки на мобайле */
  .price-table-block__table thead th:first-child  { width: 36%; }
  .price-table-block__table thead th:nth-child(2) { width: 14%; }
  .price-table-block__table thead th:nth-child(3) { width: 20%; }
  .price-table-block__table thead th:last-child   { width: 30%; }

  .price-table-block__table thead th,
  .price-table-block__table tbody td {
    padding: 0.5rem 0.5rem;
  }

  .price-table-block__order {
    min-width: 5.5rem;
    font-size: 0.8125rem !important;
  }
}

@media screen and (max-width: 420px) {
  .price-table-block__table {
    min-width: 23rem;
  }
}

/* ============================================================
   Карточка выбранного спецэффекта в модалке feedback
   ============================================================ */

.price-order-card {
  display: none; /* управляется через JS slideDown/slideUp */
  margin: 0 1.25rem 1.25rem;
  padding: 0.875rem 1rem;
  background: #f5faf0;
  border: 1.5px solid #7cc95b;
  border-radius: 0.75rem;
  position: relative;
}

.price-order-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5a9940;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.price-order-card__body {
  padding-right: 1.75rem; /* отступ под крестик */
}

.price-order-card__effect {
  font-size: 1rem;
  font-weight: 700;
  color: #151416;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.price-order-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: #394c56;
}

.price-order-card__sep {
  color: #bbb;
}

.price-order-card__price {
  font-weight: 700;
  color: #eb6d02;
}

.price-order-card__reset {
  position: absolute;
  top: 0.625rem;
  right: 0.75rem;
  background: none;
  border: none;
  padding: 0.2rem 0.3rem;
  font-size: 0.875rem;
  color: #9c9c9c;
  cursor: pointer;
  line-height: 1;
  border-radius: 0.25rem;
  -webkit-transition: color 0.2s ease, background 0.2s ease;
  transition: color 0.2s ease, background 0.2s ease;
}

.price-order-card__reset:hover {
  color: #e73434;
  background: rgba(231, 52, 52, 0.08);
}

/* ─── Modal header: scroll + link wrapping ────────────────────────────────── */
/*
  main.css has no max-height/overflow on .modal-header-center, so the popup
  can grow past the viewport with no scroll. Also, @media (max-width: 1560px)
  forces white-space: nowrap on nav links, preventing text from wrapping.
*/

/* Enable scroll when menu content exceeds viewport height */
.modal-header-center {
  max-height: calc(100vh - 76px);
  overflow-y: auto;
}

/* Allow long link titles to wrap to the next line */
#modal-header .modal-header-nav-item a,
#modal-header .modal-header-nav-link,
#modal-header .modal-header-nav-link__sub {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
}

/* ─── Footer global-menu overflow fix ─────────────────────────────────────── */
/*
  .footer-contact is a flex container AND a grid item inside .footer-contact-block.
  CSS Grid items have min-width: auto by default, so they never shrink below their
  content's intrinsic width. This causes .global-menu text to bleed into .footer-map
  at widths < 1160px. Setting min-width: 0 lets the grid item shrink properly.
*/
.footer-contact {
  min-width: 0;
}

@media screen and (max-width: 1160px) {
  /* Ensure flex children of .footer-contact wrap cleanly within the column */
  .footer-contact {
    flex-wrap: wrap;
    overflow: hidden;
  }

  /* Each child (contact-menu-block, global-menu) takes full width when wrapping */
  .footer-contact > div {
    min-width: 0;
    width: 100%;
  }

  /* Prevent long menu link titles from overflowing their grid cell */
  .footer-contact .modal-header-nav-link {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
}
