/* ---------- Шрифт Gilroy ---------- */
@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Semibold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Extrabold.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ---------- Переменные / фирменный стиль ---------- */
:root {
    --brand: #F08143;
    --brand-dark: #d96a2c;
    --brand-light: #fbe7d8;
    --ink: #2b2b2b;
    --muted: #6b6b6b;
    --line: #ececec;
    --bg: #ffffff;
    --bg-soft: #faf7f4;
    --wa: #25d366;
    --radius: 14px;
    --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Gilroy", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}
.container--narrow { max-width: 820px; }

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 700;
    margin: 0 0 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .2s, color .2s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }

/* ---------- Шапка ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
}
.site-header__logo img { height: 48px; width: auto; }

.site-nav__list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--ink);
    transition: background .15s, color .15s;
}
.site-nav__link:hover { background: var(--brand-light); color: var(--brand-dark); }
.caret { transition: transform .2s; }

/* Выпадающее меню «Продукция» (двухуровневый аккордеон) */
.has-dropdown { position: relative; }
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 340px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s, transform .18s, visibility .18s;
}
.has-dropdown:hover .dropdown,
.has-dropdown.is-open .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Поворот только верхнего «галочка»-индикатора */
.has-dropdown:hover > .site-nav__link .caret,
.has-dropdown.is-open > .site-nav__link .caret { transform: rotate(180deg); }

.dropdown__all {
    display: block;
    padding: 8px 14px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--brand-dark);
    border-radius: 10px;
}
.dropdown__all:hover { background: var(--brand-light); }

.menu-groups { list-style: none; margin: 0; padding: 0; }
.menu-group { border-top: 1px solid var(--line); }
.menu-group:first-child { border-top: 0; }

.menu-group__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    background: none;
    border: 0;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
}
.menu-group__toggle:hover { background: var(--bg-soft); }
.menu-group__toggle .caret { transition: transform .2s; flex: 0 0 auto; }
.menu-group.is-open > .menu-group__toggle .caret { transform: rotate(180deg); }

.menu-group__items { list-style: none; margin: 0; padding: 0; }
/* свёрнуто по умолчанию для категорий; раскрытые группы и «плоские» — видны */
.menu-group:not(.menu-group--plain) > .menu-group__items {
    display: none;
    padding: 2px 0 8px 8px;
}
.menu-group.is-open > .menu-group__items { display: block; }

.dropdown__link {
    display: block;
    padding: 9px 14px;
    border-radius: 10px;
    transition: background .15s;
}
.dropdown__link:hover { background: var(--bg-soft); }
.dropdown__title { display: block; font-weight: 500; }
.dropdown__summary { display: block; font-size: .85rem; color: var(--muted); }

/* Бургер */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
}
.nav-toggle span {
    width: 26px;
    height: 2px;
    background: var(--ink);
    transition: transform .2s, opacity .2s;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(60px, 10vw, 120px) 0;
    background: linear-gradient(180deg, var(--bg-soft), #fff);
    overflow: hidden;
}
.hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .18;
}
.hero__inner { position: relative; max-width: 760px; }
.hero__title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 18px;
}
.hero__subtitle { font-size: clamp(1.05rem, 2.2vw, 1.4rem); color: var(--muted); margin: 0 0 20px; }
.hero__intro { margin-bottom: 28px; }

/* ---------- Преимущества ---------- */
.features { padding: clamp(48px, 8vw, 90px) 0; }
.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}
.feature-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: transform .15s, box-shadow .15s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(240, 129, 67, .14); }
.feature-card__icon { width: 56px; height: 56px; margin-bottom: 14px; }
.feature-card__title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; }
.feature-card__text { margin: 0; color: var(--muted); }

/* ---------- Каталог на главной (сгруппированный) ---------- */
.catalog { padding: clamp(48px, 8vw, 90px) 0; background: var(--bg-soft); }
.catalog-group { margin-bottom: 44px; }
.catalog-group:last-of-type { margin-bottom: 0; }
.catalog-group__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-light);
}
.catalog__more { margin-top: 36px; text-align: center; }

/* ---------- Текстовые / баннеры ---------- */
.text-section { padding: clamp(40px, 6vw, 70px) 0; }
.image-banner { padding: clamp(24px, 4vw, 50px) 0; }
.image-banner__img { width: 100%; border-radius: var(--radius); }
.image-banner__caption { text-align: center; color: var(--muted); margin-top: 12px; }
.rich-text { font-size: 1.05rem; }

/* ---------- Заголовок страницы ---------- */
.page-head { padding: clamp(40px, 6vw, 70px) 0 20px; }
.page-head__title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; margin: 0 0 12px; }
.page-head__intro { color: var(--muted); font-size: 1.1rem; max-width: 700px; }
.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.breadcrumbs a:hover { color: var(--brand); }

/* ---------- Список продукции ---------- */
.product-list { padding: 30px 0 80px; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.product-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(0, 0, 0, .1); }
.product-card__media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-soft); }
.product-card__img { width: 100%; height: 100%; object-fit: cover; }
.product-card__img--empty {
    background: repeating-linear-gradient(45deg, #f3f0ec, #f3f0ec 12px, #ece8e3 12px, #ece8e3 24px);
}
.product-card__body { padding: 18px 20px 22px; }
.product-card__title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; }
.product-card__summary { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Карточка продукта ---------- */
.product-cover { padding: 20px 0; }
.product-cover__img { max-width: 100%; height: auto; border-radius: var(--radius); }
.product-body { padding: 10px 0 40px; }

/* Галерея */
.gallery-section { padding: 30px 0; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.gallery-item { margin: 0; }
.gallery-item__img {
    display: block;
    width: 100%;
    height: auto;          /* перебиваем presentational hint height="640" из тега <img>,
                              иначе фиксированная высота отключает aspect-ratio */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
}
.gallery-item__caption { font-size: .85rem; color: var(--muted); margin-top: 8px; }

/* Матричная таблица (печать по плотностям) */
.matrix-table-section { padding: 30px 0; }
.matrix-table__note { color: var(--muted); margin: 0 0 14px; }
.matrix-table__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix-table__scroll table {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
    font-size: .92rem;
}
.matrix-table__scroll th,
.matrix-table__scroll td {
    border: 1px solid var(--line);
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
}
.matrix-table__scroll th { background: var(--brand-light); font-weight: 700; }
.matrix-table__scroll caption { caption-side: bottom; color: var(--muted); font-size: .85rem; padding-top: 8px; }

/* Прайс */
.price-table-section { padding: 30px 0; }
.price-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.price-table td { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.price-table tr:last-child td { border-bottom: 0; }
.price-table__name { font-weight: 500; }
.price-table__note { display: block; font-size: .85rem; color: var(--muted); }
.price-table__price { text-align: right; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }

/* ---------- CTA ---------- */
.cta {
    background: var(--brand-light);
    padding: clamp(40px, 6vw, 70px) 0;
    text-align: center;
    margin-top: 30px;
}
.cta__title { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 22px; }

/* ---------- Подвал ---------- */
.site-footer {
    background: #1f1b18;
    color: #f4efe9;
    padding: clamp(48px, 7vw, 80px) 0 30px;
}
.site-footer__heading { font-size: 1.6rem; margin: 0 0 28px; }
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.footer-contacts__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer-contacts__label {
    min-width: 80px;
    color: #b7a89c;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.footer-contacts__value { font-size: 1.1rem; font-weight: 500; }
a.footer-contacts__value:hover { color: var(--brand); }

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wa);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .9rem;
}
.btn-whatsapp:hover { filter: brightness(1.05); }

.footer-map { min-height: 280px; }
.footer-map iframe {
    width: 100% !important;
    min-height: 300px;
    border: 0;
    border-radius: var(--radius);
}
.footer-map__placeholder {
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #b7a89c;
    background: rgba(255, 255, 255, .05);
    border: 1px dashed rgba(255, 255, 255, .2);
    border-radius: var(--radius);
    padding: 20px;
}
.footer-requisites {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    color: #9a8c7f;
    font-size: .82rem;
}
.site-footer__copy {
    margin: 18px 0 0;
    color: #9a8c7f;
    font-size: .9rem;
    text-align: center;
}

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        padding: 12px 20px 20px;
        display: none;
    }
    .site-nav.is-open { display: block; }
    .site-nav__list { flex-direction: column; align-items: stretch; gap: 4px; }
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        padding: 4px 0;
        width: auto;
        max-height: none;
        overflow: visible;
        display: none;
    }
    .has-dropdown.is-open .dropdown { display: block; }
    /* На мобиле категории крупнее под палец */
    .menu-group__toggle { padding: 14px; }
    .dropdown__link { padding: 12px 14px; }
    .footer-grid { grid-template-columns: 1fr; }
}
