/* =========================================================
   ОБЩАЯ АДАПТИВНАЯ ЛОГИКА
   ========================================================= */

/* header.css */
@media (max-width: 900px) {
    .header-inner {
        gap: 20px;
    }

    .header-search {
        display: none;
    }

    .main-nav {
        gap: 20px;
    }
}

@media (max-width: 650px) {
    .header-inner {
        min-height: auto;

        flex-wrap: wrap;

        padding-top: 14px;
        padding-bottom: 14px;
    }

    .main-nav {
        order: 3;

        width: 100%;

        justify-content: space-between;
    }

    .main-nav__link {
        padding: 8px 0;
    }
}

/* footer.css */
@media (max-width: 1050px) {
    .footer-inner {
        grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.8fr) minmax(240px, 1.2fr);
    }

    .footer-age {
        grid-column: 2 / -1;
        flex-direction: row;
        align-items: center;
        justify-self: center;
        gap: 12px;
    }

    .footer-age__text {
        max-width: 220px;
    }
}

@media (max-width: 700px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 36px;
        padding-bottom: 34px;
    }

    .footer-brand {
        max-width: 100%;
        justify-self: center;
    }

    .footer-age {
        grid-column: auto;
        justify-self: center;
    }

    .footer-bottom__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

/* home.css */
@media (max-width: 1100px) {

    .home-hero__content {
        width: 100%;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }

    .home-hero__visual {
        display: none;
    }

    .home-card-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {

    .home-hero__title {
        font-size: 46px;
    }

    .home-hero__title-line {
        white-space: normal;
    }

    .home-hero__stats {
        grid-template-columns: 1fr;

        gap: 18px;
    }

    .home-stat__value {
        white-space: normal;
    }

    .home-comparison {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media (max-width: 600px) {

    .home-card-grid {
        grid-template-columns: 1fr;
    }

    .home-section__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-hero__description {
        font-size: 15px;
    }

}

/* category-list.css */
@media (max-width: 1100px) {
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .category-page {
        padding-top: 25px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-page__intro {
        font-size: 16px;
    }
}

/* style-list.css */
@media (max-width: 1100px) {

    .style-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 650px) {

    .style-page {
        padding-top: 25px;
    }

    .style-grid {
        grid-template-columns: 1fr;
    }

    .style-page__intro {
        font-size: 16px;
    }

}

/* category-detail.css */
@media (max-width: 850px) {

    .category-detail__hero {
        grid-template-columns: 1fr;

        gap: 32px;
    }


    .category-detail__figure {
        float: none;
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
    }


    .category-detail__media {
        height: 340px;
    }


    .category-style-card {
        grid-template-columns:
            130px
            minmax(0, 1fr)
            42px;

        gap: 18px;
    }


    .category-style-card__media {
        width: 130px;
        height: 120px;
    }

}

@media (max-width: 600px) {

    .category-detail {
        padding-top: 25px;
    }


    .category-detail__media {
        height: 280px;
    }


    .category-style-card {
        grid-template-columns:
            90px
            minmax(0, 1fr);

        gap: 14px;

        min-height: 120px;
    }


    .category-style-card__media {
        width: 90px;
        height: 100px;
    }


    .category-style-card__arrow {
        display: none;
    }


    .category-style-card__description {
        display: none;
    }


    .category-style-card__title {
        font-size: 18px;
    }


    .category-styles__header {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

}

/* style-detail.css */
@media (max-width: 1100px) {

    .style-comparison {
        grid-template-columns: 1fr;
    }


    .style-comparison__items {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }


    .style-comparison__action {
        justify-self: start;
    }


    .style-characteristics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }


    .similar-style-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 760px) {

    .style-hero {
        grid-template-columns: 1fr;
    }


    .style-hero__figure {
        width: 100%;
        max-width: 520px;
    }


    .style-hero__media {
        height: 340px;
    }


    .style-characteristics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .style-content-grid {
        grid-template-columns: 1fr;
    }


    .style-content-card--wide {
        grid-column: auto;
    }


    .style-comparison__items {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 500px) {

    .style-hero__media {
        height: 280px;
    }


    .style-characteristics,
    .style-comparison__items {
        grid-template-columns: 1fr;
    }


    .style-comparison__intro {
        align-items: flex-start;
    }


    .style-comparison__button {
        width: 100%;
    }

}

/* style-comparison.css */
@media (max-width: 900px) {

    .comparison-selector__fields {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 550px) {

    .comparison-selector__fields {
        grid-template-columns: 1fr;
    }


    .comparison-page__intro {
        font-size: 16px;
    }


    .comparison-selector__button {
        width: 100%;
    }

}

/* =========================================================
   MOBILE PASS v1.1 — единая логика после сборки интерфейса
   ========================================================= */

@media (max-width: 1100px) {
    :root {
        --container-padding: 20px;
    }

    .header-search {
        display: flex;
        width: 200px;
    }

    .category-page__title,
    .style-page__title,
    .comparison-page__title,
    .search-page__title {
        font-size: clamp(38px, 6vw, 54px);
    }
}

@media (max-width: 760px) {
    :root {
        --container-padding: 16px;
    }

    /* ---------- Шапка ---------- */
    .header-inner {
        min-height: auto;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
        padding-top: 10px;
        padding-bottom: 12px;
    }

    .header-logo {
        order: 1;
    }

    .header-logo img {
        width: 132px;
    }

    .header-menu-toggle {
        order: 1;
        display: block;
        margin-left: auto;
    }

    .main-nav {
        order: 2;
        width: 100%;
        display: none;
        align-self: auto;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
        padding: 6px 0 4px;
        border-top: 1px solid var(--color-border);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav__link {
        height: auto;
        min-height: 44px;
        padding: 10px 2px;
        font-size: 15px;
    }

    .main-nav__link.is-active::after {
        right: auto;
        width: 34px;
        height: 3px;
    }

    .header-actions {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .header-search {
        display: flex;
        width: 100%;
        height: 44px;
        border-radius: 12px;
        background: #fafafa;
    }

    /* ---------- Общие элементы ---------- */
    .category-page,
    .style-page,
    .category-detail,
    .style-detail,
    .comparison-page,
    .search-page {
        padding-top: 24px;
        padding-bottom: 56px;
    }

    .breadcrumbs {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px 7px;
        font-size: 12px;
        line-height: 1.45;
    }

    .category-page__title,
    .style-page__title,
    .comparison-page__title,
    .search-page__title {
        font-size: clamp(34px, 10vw, 46px);
        line-height: 1.02;
    }

    .category-page__intro,
    .style-page__intro,
    .comparison-page__intro {
        margin-top: 16px;
        font-size: 15px;
        line-height: 1.55;
    }

    /* ---------- Главная ---------- */
    .home-hero__inner {
        min-height: 0;
        padding-top: 34px;
        padding-bottom: 30px;
    }

    .home-hero__content {
        max-width: none;
    }

    .home-hero__title {
        margin-bottom: 18px;
        font-size: clamp(38px, 11vw, 48px);
        line-height: 1;
    }

    .home-hero__accent-word + .home-hero__accent-word {
        margin-left: 8px;
    }

    .home-hero__stats {
        gap: 16px;
        margin-top: 24px;
    }

    .home-section {
        padding-top: 28px;
    }

    /* ---------- Списки ---------- */
    .category-grid,
    .style-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-card,
    .style-card {
        min-height: 126px;
    }

    .category-card__media,
    .style-card__media {
        width: 102px;
        height: 108px;
    }

    .category-card {
        grid-template-columns: 102px minmax(0, 1fr);
    }

    .style-card {
        grid-template-columns: 102px minmax(0, 1fr);
    }

    /* ---------- Detail ---------- */
    .category-detail__hero,
    .style-hero {
        gap: 24px;
    }

    .category-detail__figure,
    .style-hero__figure {
        max-width: 100%;
    }

    .category-detail__media,
    .style-hero__media {
        height: 300px;
    }

    .category-detail__title,
    .style-hero__title {
        font-size: clamp(34px, 10vw, 46px);
    }

    .category-detail__subtitle,
    .style-hero__subtitle {
        font-size: 17px;
    }

    .category-detail__description,
    .style-hero__description {
        font-size: 15px;
    }

    .category-styles__title,
    .style-section__title,
    .comparison-section-title {
        font-size: 25px;
    }

    .style-content-grid,
    .similar-style-grid {
        grid-template-columns: 1fr;
    }

    /* ---------- Сравнение ---------- */
    .comparison-selector {
        padding: 16px;
    }

    .comparison-selector__fields {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .comparison-table-wrapper,
    .comparison-details__wrapper,
    .legal-table-wrap {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* ---------- Поиск ---------- */
    .search-page__header {
        margin-bottom: 26px;
    }

    .search-page__form {
        grid-template-columns: 1fr;
    }

    .search-page__submit {
        width: 100%;
    }

    .search-page__summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 24px;
    }

    .search-result {
        min-height: 0;
        grid-template-columns: 118px minmax(0, 1fr);
    }

    .search-result__media {
        min-height: 150px;
    }

    .search-result__content {
        padding: 18px 16px;
    }

    .search-result__title {
        font-size: 20px;
    }

    .search-result__snippet {
        margin-top: 10px;
        font-size: 14px;
    }

    .search-result__arrow {
        display: none;
    }

    /* ---------- Footer ---------- */
    .site-footer {
        margin-top: 56px;
    }

    .footer-inner {
        gap: 26px;
    }

    .footer-nav {
        width: min(100%, 300px);
        justify-self: center;
    }

    .footer-nav__title {
        text-align: center;
    }

    .footer-bottom__inner {
        text-align: left;
    }
}

@media (max-width: 560px) {
    /* Списки сохраняем компактными, но не ужимаем текст чрезмерно. */
    .category-card,
    .style-card {
        grid-template-columns: 88px minmax(0, 1fr);
        min-height: 110px;
        gap: 11px;
    }

    .category-card__media,
    .style-card__media {
        width: 88px;
        height: 94px;
    }

    .category-card__content,
    .style-card__content {
        padding-top: 7px;
    }

    .category-card__title,
    .style-card__title {
        font-size: 17px;
    }

    /* Категория: карточки входящих стилей. */
    .category-style-card {
        grid-template-columns: 86px minmax(0, 1fr);
        min-height: 108px;
        padding: 8px;
    }

    .category-style-card__media {
        width: 86px;
        height: 92px;
    }

    .category-style-card__description,
    .category-style-card__arrow {
        display: none;
    }

    /* Страница стиля. */
    .style-characteristics,
    .style-comparison__items {
        grid-template-columns: 1fr;
    }

    .style-comparison__button {
        width: 100%;
    }

    /* Сравнение — на маленьком экране селекты идут один под другим. */
    .comparison-selector__fields {
        grid-template-columns: 1fr;
    }

    .comparison-selector__button {
        width: 100%;
    }

    /* Поиск — карточка становится вертикальной. */
    .search-result {
        grid-template-columns: 1fr;
    }

    .search-result__media {
        height: 190px;
        min-height: 190px;
    }

    .search-result__content {
        padding: 17px 16px 19px;
    }

    .search-section + .search-section {
        margin-top: 38px;
    }

    .search-section__title {
        font-size: 24px;
    }

    .search-empty {
        padding: 26px 20px;
    }

    /* Юридические страницы. */
    .legal-page .legal-hero__title {
        font-size: clamp(30px, 8.5vw, 38px);
        line-height: 1.05;
    }

    .legal-table {
        min-width: 560px;
    }
}

@media (max-width: 420px) {
    :root {
        --container-padding: 14px;
    }

    .header-logo img {
        width: 122px;
    }

    .home-hero__title {
        font-size: 36px;
    }

    .home-stat {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .home-stat__icon {
        width: 40px !important;
        height: 40px !important;
    }

    .category-detail__media,
    .style-hero__media {
        height: 260px;
    }

    .category-page__title,
    .style-page__title,
    .comparison-page__title,
    .search-page__title,
    .category-detail__title,
    .style-hero__title {
        font-size: 34px;
    }

    .breadcrumbs {
        font-size: 11px;
    }

    .age-gate {
        padding: 10px;
    }

    .age-gate__dialog {
        max-height: calc(100dvh - 20px);
        padding: 26px 18px 22px;
    }

    .age-gate__mark {
        min-width: 66px;
        min-height: 46px;
        margin-bottom: 16px;
        font-size: 24px;
    }

    .age-gate__text {
        font-size: 14px;
        line-height: 1.55;
    }

    .age-gate__actions {
        margin-top: 22px;
    }
}


/* Юридические страницы: правило находится в responsive.css, который подключается последним. */
.legal-page .legal-hero__title {
    font-size: clamp(36px, 4vw, 48px);
    line-height: 1.05;
}

@media (max-width: 700px) {
    .legal-page .legal-hero__title {
        font-size: clamp(30px, 8.5vw, 38px);
    }
}
