/* ============================================
   СТИЛИ ДЛЯ СТРАНИЦ УСЛУГ
   santehnik-tbilisi / elektrik-tbilisi / master-na-chas-tbilisi
   ============================================ */

.service-hero {
    position: relative;
    padding: 3rem 5% 8rem;
    text-align: center;
    z-index: 1;
    min-height: 770px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 1.8rem;
    background-color: var(--dark-concrete);
    background-image:
        linear-gradient(rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.9)),
        url('/image/hero-bg.webp');
    background-position: 0 0, center center;
    background-size: 100% 100%, 50%;
    background-repeat: no-repeat;
}

@media (max-width: 768px) {
    .service-hero {
        padding: 2.5rem 4% 3rem;
        min-height: 0;
        background-color: var(--dark-concrete);
        background-image:
            linear-gradient(rgba(10, 10, 10, 0.65), rgba(10, 10, 10, 0.75)),
            url('/image/hero-bg.webp');
        background-position: 0 0, center center;
        background-size: 100% 100%, cover;
        background-repeat: no-repeat;
    }
}

.service-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 4.1vw, 6rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    animation: slideUp 0.8s ease-out 0.2s backwards;
    font-weight: 800;
    color: #d0d0d0;
    min-height: 2.6em;
}

.service-hero .lead {
    font-size: 1.1rem;
    color: #FDB913;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.service-cta-top {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Прайс-таблица */
.price-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(253, 185, 19, 0.15), rgba(253, 185, 19, 0.05));
    border: 3px solid var(--construction-yellow);
    box-shadow: 0 0 30px rgba(253, 185, 19, 0.3), inset 0 0 20px rgba(253, 185, 19, 0.1);
    flex-shrink: 0;
    animation: icon-pulse 3s ease-in-out infinite;
}

.price-icon svg {
    width: 60px;
    height: 60px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.price-table {
    max-width: 700px;
    margin: 3rem auto 3rem;
    padding: 1.5rem; 
    position: relative;
    z-index: 1;
    border-radius: 8px;
    border: 1px solid #FDB913;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.price-table h2 {
    color: var(--construction-yellow);
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95rem;
}

.price-row:last-child {
    border-bottom: none;
}

.price-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.price-name {
    color: rgba(255, 255, 255, 0.85);
}

.price-val {
    color: #FDB913;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 1rem;
}

 @media (max-width: 768px) {
  .price-table {
    margin: 0 4% 3rem;
    padding: 1.5rem 4%;
    margin: 3rem 4% 3rem;
    padding: 1.5rem 4%;
    }
}

/* Районы */
.districts {
    max-width: 900px;
    margin: 0 auto 4rem;
    padding: 2.5rem 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #FDB913;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.districts h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 700;
    color: var(--construction-yellow);
    margin-bottom: 0.3rem;
}

/* ============================================
РАЙОНЫ ТБИЛИСИ — GRID-СЕТКА
============================================ */
.districts-grid {
  display: grid;
  /* 5 колонок = ровно 2 ряда для 10 районов */
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  justify-items: center;
  align-items: center;
}

/* Модификатор: 4 колонки = ровно 2 ряда по 4 (для 8 районов Нови-Сада) */
.districts-grid--4col {
  grid-template-columns: repeat(4, 1fr);
  max-width: 760px;
}

.district-tag {
  width: 100%;
  min-height: 48px;
  padding: 12px 30px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(253, 185, 19, 0.3);
  border-radius: 50px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
}

.district-tag:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--construction-yellow);
  color: var(--construction-yellow);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(253, 185, 19, 0.2);
}

/* Плашка района «скоро» — не кликабельна, приглушена (анонс будущих страниц) */
.district-tag--soon {
  cursor: default;
  opacity: 0.55;
  border-style: dashed;
  border-color: rgba(253, 185, 19, 0.25);
}

.district-tag--soon:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(253, 185, 19, 0.25);
  color: #ccc;
  transform: none;
  box-shadow: none;
}

/* ==== Переключатель города в шапке (хабы) ==== */
/* Стилистически близок к .language-switcher, но с золотой рамкой и иконкой города */
.city-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--dark-concrete);
  padding: 0.4rem 0.5rem;
  border-radius: 25px;
  /* Обводка как у счётчика мастеров: зелёная 2px со свечением */
  border: 2px solid var(--safety-green);
  box-shadow: 0 4px 15px rgba(6, 255, 165, 0.3);
}

/* Иконка «локация» слева от кнопок */
.city-switcher-icon {
  display: flex;
  align-items: center;
  color: var(--construction-yellow);
  margin: 0 0.15rem 0 0.25rem;
}
.city-switcher-icon svg { width: 18px; height: 18px; }

/* Кнопка города */
.city-btn {
  background: transparent;
  border: 1px solid rgba(253, 185, 19, 0.3);
  color: rgba(255, 255, 255, 0.65);
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.city-btn:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
}

/* Активный город */
.city-btn.active {
  background: linear-gradient(135deg, var(--construction-yellow), var(--construction-orange));
  color: var(--dark-concrete);
  border: none;
  box-shadow: 0 4px 15px rgba(253, 185, 19, 0.4);
}

@media (max-width: 600px) {
  .city-btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .city-switcher-icon { display: none; }
}

/* ============================================
АДАПТИВ
============================================ */
/* Планшет: 3 колонки */
@media (max-width: 1024px) {
  .districts-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
  }
}

/* Мобильный: 1 колонка */
@media (max-width: 768px) {
  .districts {
    padding: 1.5rem 1rem;
    max-width: 100%;
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .districts-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
  }
  .district-tag {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 52px;
    border: 1px solid rgba(253, 185, 19, 0.3);
    color: rgba(255, 255, 255, 0.85);
  }

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .districts-grid {
    max-width: 100%;
    padding: 0 1rem;
  }
  .district-tag {
    border-radius: 5px;
  }
}
}

/* Убрать фоновую картинку футера на мобильных — только сервисные страницы */
@media (max-width: 968px) {
    .footer-cta {
        background: transparent;
    }
}

@media (max-width: 1200px) {
    .price-icon {
        width: 80px !important;
        height: 80px !important;
    }
    .price-icon svg {
        width: 40px !important;
        height: 40px !important;
    }
}

/* ============================================================
   ДЕСКТОП: ВЫБОР ГОРОДА — ВЫПАДАЮЩИЙ СПИСОК
   ============================================================

   Было: обе кнопки городов видны сразу, плашка росла с каждым
   новым городом. Стало: видна только текущая, остальные — в
   списке по клику. При добавлении городов ширина не меняется.

   Разметка та же (.city-switcher > .city-btn), меняем только
   отображение — HTML 228 страниц править не потребовалось.
   Раскрытием управляет класс .is-open (ставит script.js).

   Мобильная версия (<769px) не затронута: там правила ниже
   не действуют, кнопки остаются в ряд как были. */
@media (min-width: 769px) {

  .city-switcher {
    position: relative;
    /* Ширина равна плашке «Для мастеров» над ней — задаётся
       переменной, которую считает скрипт после отрисовки шрифтов. */
    width: var(--city-switcher-w, auto);
    /* Контент по центру, как у соседних плашек шапки */
    justify-content: center;
    padding-right: 2.2rem;   /* место под стрелку справа */
    padding-left: 2.2rem;    /* столько же слева — чтобы текст был по центру */
    cursor: pointer;
    /* Плашка в потоке всегда 52px: раскрывающаяся часть уходит в
       абсолютное позиционирование (ниже), поэтому шапка не двигается. */
    overflow: visible;
    transition: box-shadow 0.28s ease;
  }

  /* Иконка «локация» — слева, поверх padding-слота */
  .city-switcher > .city-switcher-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }

  /* Текущий город — по центру плашки */
  .city-switcher > .city-btn.active {
    background: none;
    box-shadow: none;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0;
    text-align: center;
    pointer-events: none;   /* клик обрабатывает вся плашка */
  }

  /* ── Выпадающая часть ─────────────────────────────────────────
     Абсолютная, поэтому НЕ меняет высоту плашки и не двигает шапку.
     Визуально продолжает плашку: та же рамка и фон, скруглены только
     нижние углы, верх состыкован встык. */
  .city-switcher .city-btn:not(.active) {
    position: absolute;
    left: -2px;                       /* компенсация рамки плашки */
    width: calc(100% + 4px);
    box-sizing: border-box;
    background: var(--dark-concrete);
    border: 2px solid var(--safety-green);
    border-top: none;                 /* стык с плашкой без двойной линии */
    border-radius: 0 0 16px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 0.7rem 1rem;
    /* Позиция: вплотную под плашкой.
       top:100% — это низ PADDING-box, а внешний край плашки ниже на
       padding-bottom (0.4rem) + border (2px). Опускаем список на эту
       величину и поднимаем на толщину рамки, чтобы его верхняя грань
       легла на нижнюю рамку плашки, а не оставила щель.
       Итого: +0.4rem. --i задаёт скрипт (0, 1, 2…). */
    top: calc(100% + 0.4rem + var(--i, 0) * 2.6rem);
    /* Подъём на толщину рамки: верхняя грань списка должна лечь НА
       нижнюю рамку плашки. Без этого между ними остаётся тёмная щель
       в 2–5px (её ширина плавает из-за дробного devicePixelRatio на
       экранах с масштабом 125–150%), и линии визуально не сходятся.
       Перекрываем с запасом — лишнее скрывается под рамкой плашки. */
    margin-top: -5px;
    /* Скрыта до клика */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 200;
  }

  .city-switcher.is-open .city-btn:not(.active) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Пока открыто — у плашки скруглён только верх, чтобы стык
     со списком выглядел одним элементом */
  .city-switcher.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  /* Наведение: без заливки — только подсветка текста */
  .city-switcher .city-btn:not(.active):hover {
    color: var(--construction-yellow);
  }

  /* Стрелка ⌄ справа — рисуем псевдоэлементом, чтобы не трогать HTML */
  .city-switcher::after {
    content: '';
    position: absolute;
    right: 1.1rem;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--construction-yellow);
    border-bottom: 2px solid var(--construction-yellow);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.25s ease;
    pointer-events: none;
  }

  .city-switcher.is-open::after {
    transform: translateY(-30%) rotate(-135deg);
  }

  /* ── Выравнивание пар: город = «Для мастеров», язык = счётчик ──
     Ширины задаёт скрипт в переменных, здесь только их применяем. */
  .language-switcher {
    width: var(--lang-switcher-w, auto);
    justify-content: space-evenly;
  }
}
