:root {
    --site-primary: #0d9488;
    --site-heading: #115e59;
    --site-accent-light: #5eead4;
    --site-bg-light: #f0fdfa;
    --site-secondary: #f97316;
    --site-footer-bg: #115e59;
    --site-footer-text: #ccfbf1;
}

.bg-teal-50 {
    background-color: var(--site-bg-light, #f0fdfa);
}

.text-teal-800 {
    color: var(--site-heading, #115e59);
}

.border-teal-300 {
    border-color: var(--site-accent-light, #5eead4);
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.img-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
    .img-hover:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
}

/* Hero image (Шапка) — увеличить размер только в шапке */
@media (min-width: 768px) {
    #home .md\:w-2\/4 {
        width: 58.333333%;
        /* примерно md:w-7/12 */
    }

    #home img.img-hover.max-w-xl {
        max-width: 100%;
    }
}

/* Footer: "Быстрые ссылки" — прижать вправо */
@media (min-width: 768px) {
    footer .md\:grid-cols-4>div:nth-child(2) {
        grid-column: 4 / 5;
        justify-self: end;
        text-align: right;
    }

    footer .md\:grid-cols-4>div:nth-child(2) ul {
        justify-content: flex-end;
    }
}

/* Prices → Team: сократить вертикальный разрыв между секциями */
#prices {
    padding-bottom: 2rem;
}

#team {
    padding-top: 2rem;
}

section.py-20 {
    padding-top: 3.333rem;
    padding-bottom: 3.333rem;
}

.nav-link {
    position: relative;
    white-space: nowrap !important;
    display: inline-block !important;
    word-break: keep-all !important;
    flex-shrink: 0 !important;
}

/* Ensure .hidden class strictly hides elements even if inline-block !important is applied elsewhere */
.hidden,
.nav-link.hidden,
header nav a.hidden,
header .nav-link.hidden,
li.hidden {
    display: none !important;
}

/* ── Prevent multiline menu breaks and enable fluid auto-scaling ───────────── */
header .flex.justify-between,
.header-top-row {
    flex-wrap: nowrap !important;
    align-items: center !important;
}

header .header-top-row>* {
    flex-shrink: 0 !important;
}

header .nav-link,
header nav>a,
header a[href^="tel:"],
header .header-phone-link,
header .header-phone-link span,
header .font-light.text-teal-800 {
    white-space: nowrap !important;
    word-break: keep-all !important;
    flex-shrink: 0 !important;
    flex: 0 0 auto !important;
    width: max-content !important;
    max-width: max-content !important;
}

/* Below 768px: show mobile hamburger button cleanly */
@media (max-width: 767px) {

    header nav.header-desktop-nav,
    header nav.hidden.md\:flex,
    header .header-phone-link {
        display: none !important;
    }

    #mobile-menu-button {
        display: block !important;
    }
}

/* 768px and above: display single horizontal row navbar with responsive clamp scaling */
@media (min-width: 768px) {

    #mobile-menu-button,
    #mobile-menu {
        display: none !important;
    }

    header nav.header-desktop-nav,
    header nav.hidden.md\:flex,
    header nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        gap: clamp(0.85rem, 1.3vw, 1.85rem) !important;
    }

    header nav> :not([hidden])~ :not([hidden]),
    header nav> :not([hidden])+ :not([hidden]) {
        margin-left: clamp(0.75rem, 1.2vw, 1.5rem) !important;
    }

    header .header-phone-link {
        display: flex !important;
    }
}

@media (min-width: 768px) and (max-width: 1300px) {
    header .container {
        padding-left: clamp(0.2rem, 0.8vw, 1.25rem) !important;
        padding-right: clamp(0.2rem, 0.8vw, 1.25rem) !important;
        max-width: 100% !important;
    }

    header nav.header-desktop-nav,
    header nav.hidden.md\:flex,
    header nav {
        gap: clamp(0.6rem, 1vw, 1.25rem) !important;
    }

    header .nav-link {
        font-size: clamp(0.58rem, 0.75vw, 0.95rem) !important;
    }

    header a[href^="tel:"] {
        font-size: clamp(0.58rem, 0.75vw, 0.95rem) !important;
    }

    header a[href^="tel:"] i {
        font-size: clamp(0.6rem, 0.78vw, 0.95rem) !important;
        margin-right: 0.18rem !important;
    }

    header .text-2xl {
        font-size: clamp(0.85rem, 1vw, 1.35rem) !important;
    }

    header .text-teal-600.text-2xl {
        font-size: clamp(0.9rem, 1.05vw, 1.4rem) !important;
    }
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--site-primary, #0d9488);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767px) {
    #map {
        height: 250px;
    }
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background-color: #f0fdfa;
    font-weight: 600;
}

tr:hover {
    background-color: #f9fafb;
}

/* Стили для шапки с скрытым текстом */
#home.header-text-hidden .flex.flex-col>div:first-child {
    display: none;
}

#home.header-text-hidden .flex.flex-col>div:last-child {
    width: 100%;
    max-width: 100%;
}

#home.header-text-hidden img.img-hover {
    max-width: 100%;
    width: 100%;
    height: auto;
}

/* Уменьшение отступов в шапке — оставить внутренние расстояния 20px,
   но учитывать высоту фиксированного верхнего меню чтобы изображение
   не заходило под меню */
:root {
    /* При необходимости можно переопределить --site-header-height в других стилях */
    --site-header-height: 64px;
}

#home {
    padding-top: calc(20px + var(--site-header-height, 64px));
    padding-bottom: 13px;
}

#home h1 {
    margin-bottom: 20px;
}

#home p {
    margin-bottom: 20px;
}

#home .md\:w-1\/2 {
    margin-bottom: 0;
}

/* Смещаем внутренний блок вниз на 20px чтобы сохранить расстояние от верхней границы цветной полосы */
#home .relative {
    margin-top: 20px;
}

/* ── Адаптивные отступы секций на мобильных ─────────────────── */

/* sm-брейкпоинт: на телефонах шире 480px — 2 колонки для карточек */
@media (min-width: 480px) and (max-width: 767px) {

    #services .grid-cols-1,
    #team .grid-cols-1,
    #testimonials .grid-cols-1 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {

    section.py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    #home {
        padding-top: calc(12px + var(--site-header-height, 64px));
        padding-bottom: 8px;
    }

    /* Уменьшить отступ между заголовком секции и контентом */
    .text-center.mb-16 {
        margin-bottom: 2rem;
    }

    /* Заголовки секций h2 меньше на мобильных */
    h2.text-3xl {
        font-size: 1.5rem;
    }

    /* Боковые отступы контейнеров меньше */
    .container.mx-auto.px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Карточки услуг: уменьшить высоту картинки */
    #services .h-48 {
        height: 8rem;
    }

    /* Карточки команды: уменьшить высоту картинки */
    #team .h-64 {
        height: 11rem;
    }

    /* Внутренний отступ карточек услуг, команды и отзывов */
    #services .p-6,
    #team .p-6,
    #testimonials .p-8 {
        padding: 1rem;
    }

    /* Отзывы — убрать лишние отступы */
    #testimonials .mb-6 {
        margin-bottom: 0.75rem;
    }

    /* Сетка цен — меньший gap между блоками */
    #prices .gap-8 {
        gap: 1.5rem;
    }

    /* FAQ вопрос — уменьшить отступ кнопки */
    .pm-faq-question {
        padding: 1rem;
    }
}

/* Добавить верхнюю границу контейнеру формы/карты в секции контактов */
#contact .bg-white.rounded-lg.shadow-md {
    border-top: 1px solid #e5e7eb;
}

/* Верхняя граница у карточек отзывов */
#testimonials .bg-white.rounded-lg {
    border-top: 1px solid #e5e7eb;
}

/* Граница у карточек услуг (товаров) */
#services .bg-white.rounded-lg {
    border: 1px solid #e5e7eb;
}

#services .bg-white.rounded-lg .h-48 {
    border: none;
}

/* Одинаковый отступ ниже полоски (совпадает с mb-4 у h2 = 1rem) */
.text-center>p.mt-6,
.text-center>.mt-6 {
    margin-top: 1rem;
}

/* ── Полоса прогресса прокрутки ──────────────────────────────── */
#pm-scroll-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--site-primary, #0d9488), var(--site-accent-light, #5eead4));
    transition: width 0.1s linear;
    pointer-events: none;
    border-radius: 0 2px 2px 0;
}

/* ── Анимация появления секций при прокрутке ─────────────────── */
.pm-fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.pm-fade-in.pm-visible {
    opacity: 1;
    transform: none;
}

/* ── Активный пункт меню при прокрутке ──────────────────────── */
.nav-link.pm-active {
    color: var(--site-primary, #0d9488);
}

.nav-link.pm-active::after {
    width: 100%;
}


/* ── FAQ accordion (CSS-grid анимация, скорость через --faq-speed / --faq-fade) */
.pm-faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--faq-speed, 0.6s) ease,
        opacity var(--faq-fade, 0.6s) ease var(--faq-speed, 0.6s);
    opacity: 0;
}

.pm-faq-answer.pm-faq-open {
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows var(--faq-speed, 0.6s) ease,
        opacity var(--faq-fade, 0.6s) ease var(--faq-speed, 0.6s);
}

.pm-faq-answer-inner {
    overflow: hidden;
    min-height: 0;
}

.pm-faq-icon {
    transition: transform var(--faq-speed, 0.6s) ease;
}