/* Каталог: общие стили и страница категории. */

.catalog-page {
    min-width: 0;
    color: var(--color-text, #1f2933);
    background: #fff;
}

.catalog-page *,
.catalog-page *::before,
.catalog-page *::after {
    box-sizing: border-box;
}

.catalog-page img {
    display: block;
    max-width: 100%;
}

.catalog-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 28px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.catalog-breadcrumbs a {
    color: #52606d;
    text-decoration: none;
}

.catalog-breadcrumbs a:hover,
.catalog-breadcrumbs a:focus-visible {
    color: var(--color-primary, #e31e24);
}

.catalog-breadcrumbs span[aria-current="page"] {
    color: #111827;
}

.catalog-hero {
    padding: 40px 0 52px;
    background: linear-gradient(135deg, #f6f8fa, #fff);
    border-bottom: 1px solid #e5e7eb;
}

.catalog-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
    align-items: center;
    gap: 48px;
}

.catalog-hero__content {
    min-width: 0;
}

.catalog-title {
    max-width: 900px;
    margin: 0;
    color: #18212b;
    font-size: clamp(34px, 4vw, 56px);
    font-weight: 700;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.catalog-lead {
    max-width: 760px;
    margin-top: 22px;
    color: #52606d;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.65;
}

.catalog-hero__media {
    min-height: 280px;
    overflow: hidden;
    background: #edf1f4;
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(31, 41, 51, 0.12);
}

.catalog-hero__media img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    max-height: 410px;
    object-fit: cover;
}

.catalog-section {
    padding: 64px 0;
}

.catalog-section + .catalog-section {
    border-top: 1px solid #edf0f2;
}

.catalog-section--products {
    background: #f7f8fa;
}

.catalog-section__title {
    margin: 0 0 30px;
    color: #18212b;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.2;
}

.catalog-category-grid,
.catalog-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.catalog-category-card,
.catalog-product-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e8eb;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(31, 41, 51, 0.07);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.catalog-category-card:hover,
.catalog-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px rgba(31, 41, 51, 0.12);
}

.catalog-category-card__link {
    display: flex;
    height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.catalog-category-card__media,
.catalog-product-card__media {
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background: #f0f3f5;
}

.catalog-category-card__media {
    aspect-ratio: 16 / 10;
}

.catalog-product-card__media {
    aspect-ratio: 4 / 3;
    border-bottom: 1px solid #edf0f2;
}

.catalog-category-card__media img,
.catalog-product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.catalog-category-card:hover img,
.catalog-product-card:hover img {
    transform: scale(1.035);
}

.catalog-card__placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #9aa5b1;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, #f4f6f8, #e8edf1);
}

.catalog-category-card__body,
.catalog-product-card__body {
    padding: 24px;
}

.catalog-category-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.catalog-category-card__title {
    color: #18212b;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.catalog-category-card__text,
.catalog-product-card__text {
    color: #65717d;
    font-size: 15px;
    line-height: 1.6;
}

.catalog-category-card__text {
    margin-top: 12px;
}

.catalog-category-card__more {
    margin-top: auto;
    padding-top: 20px;
    color: var(--color-primary, #e31e24);
    font-size: 15px;
    font-weight: 700;
}

.catalog-category-card__more::after {
    content: " →";
}

.catalog-product-card {
    display: flex;
    flex-direction: column;
}

.catalog-product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.catalog-product-card__article {
    color: #7b8794;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.catalog-product-card__title {
    margin: 10px 0 0;
    font-size: 21px;
    line-height: 1.35;
}

.catalog-product-card__title a {
    color: #18212b;
    text-decoration: none;
}

.catalog-product-card__title a:hover,
.catalog-product-card__title a:focus-visible {
    color: var(--color-primary, #e31e24);
}

.catalog-product-card__text {
    margin-top: 14px;
}

.catalog-product-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 24px;
}

.catalog-product-card__price {
    color: #18212b;
    font-size: 19px;
    font-weight: 700;
}

.catalog-product-card__button,
.product-summary__order {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: var(--color-primary, #e31e24);
    border: 1px solid var(--color-primary, #e31e24);
    border-radius: 8px;
    cursor: pointer;
}

.catalog-product-card__button:hover,
.catalog-product-card__button:focus-visible,
.product-summary__order:hover,
.product-summary__order:focus-visible {
    color: #fff;
    background: #bd171c;
    border-color: #bd171c;
}

.catalog-empty {
    padding: 28px;
    color: #65717d;
    font-size: 17px;
    line-height: 1.6;
    text-align: center;
    background: #f7f8fa;
    border: 1px dashed #cbd2d9;
    border-radius: 14px;
}

.catalog-content {
    max-width: 980px;
    color: #384452;
    font-size: 17px;
    line-height: 1.75;
}

.catalog-content > :first-child {
    margin-top: 0;
}

.catalog-content > :last-child {
    margin-bottom: 0;
}

.catalog-content h2,
.catalog-content h3,
.catalog-content h4 {
    color: #18212b;
    line-height: 1.25;
}

.catalog-content p,
.catalog-content ul,
.catalog-content ol,
.catalog-content table {
    margin: 0 0 1.15em;
}

.catalog-content a {
    color: var(--color-primary, #e31e24);
}

.catalog-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.catalog-content th,
.catalog-content td {
    padding: 10px 14px;
    border: 1px solid #dfe3e6;
}

.catalog-content iframe,
.catalog-content video {
    max-width: 100%;
}

/* Конец части 1. */

/* Карточка товара. */

.product-section {
    padding: 40px 0 64px;
}

.product-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.05fr)
        minmax(340px, 0.95fr);
    align-items: start;
    gap: clamp(36px, 6vw, 76px);
}

.product-gallery {
    min-width: 0;
}

.product-gallery__main {
    display: flex;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background: #f3f5f7;
    border: 1px solid #e1e6ea;
    border-radius: 18px;
}

.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-gallery__main:hover img {
    transform: scale(1.02);
}

.product-gallery__placeholder {
    color: #9aa5b1;
    font-size: clamp(32px, 6vw, 58px);
    font-weight: 700;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, #f4f6f8, #e8edf1);
}

.product-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.product-gallery__thumb {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f5f7;
    border: 1px solid #dfe4e8;
    border-radius: 9px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.product-gallery__thumb:hover,
.product-gallery__thumb:focus-visible {
    border-color: var(--color-primary, #e31e24);
    box-shadow: 0 0 0 2px rgba(227, 30, 36, 0.12);
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-summary {
    position: sticky;
    top: 24px;
    min-width: 0;
    padding: clamp(26px, 4vw, 42px);
    background: #f7f8fa;
    border: 1px solid #e3e7ea;
    border-radius: 18px;
}

.product-summary__article {
    color: #7b8794;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.product-summary__title {
    margin: 12px 0 0;
    color: #18212b;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.product-summary__excerpt {
    margin-top: 22px;
    color: #52606d;
    font-size: 17px;
    line-height: 1.7;
}

.product-summary__price {
    margin-top: 28px;
    color: #18212b;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.2;
}

.product-summary__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-top: 32px;
}

.product-summary__order {
    min-height: 50px;
    padding: 13px 26px;
}

.product-summary__back {
    color: #52606d;
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #bcc4cb;
    text-underline-offset: 4px;
    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

.product-summary__back:hover,
.product-summary__back:focus-visible {
    color: var(--color-primary, #e31e24);
    text-decoration-color: currentcolor;
}

.product-description {
    background: #f7f8fa;
}

.product-characteristics__table {
    max-width: 920px;
    overflow: hidden;
    border: 1px solid #dfe4e8;
    border-radius: 14px;
}

.product-characteristics__row {
    display: grid;
    grid-template-columns:
        minmax(220px, 0.8fr)
        minmax(0, 1.2fr);
    min-width: 0;
}

.product-characteristics__row
    + .product-characteristics__row {
    border-top: 1px solid #dfe4e8;
}

.product-characteristics__name,
.product-characteristics__value {
    min-width: 0;
    padding: 15px 20px;
    overflow-wrap: anywhere;
}

.product-characteristics__name {
    color: #52606d;
    background: #f5f7f9;
    border-right: 1px solid #dfe4e8;
}

.product-characteristics__value {
    color: #18212b;
    font-weight: 600;
    background: #fff;
}

.product-characteristics__unit {
    color: #65717d;
    font-weight: 400;
}

/* Конец части 2. */

/* Адаптивность каталога. */

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

    .product-layout {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(320px, 0.9fr);
        gap: 32px;
    }

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

@media (max-width: 900px) {
    .catalog-hero__grid,
    .product-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .catalog-hero__grid {
        gap: 30px;
    }

    .catalog-hero__media {
        min-height: 240px;
    }

    .catalog-hero__media img {
        min-height: 240px;
        max-height: 360px;
    }

    .product-summary {
        position: static;
    }
}

@media (max-width: 700px) {
    .catalog-hero,
    .product-section {
        padding-top: 28px;
        padding-bottom: 42px;
    }

    .catalog-section {
        padding: 46px 0;
    }

    .catalog-breadcrumbs {
        margin-bottom: 22px;
        font-size: 13px;
    }

    .catalog-category-grid,
    .catalog-product-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .catalog-category-card__body,
    .catalog-product-card__body {
        padding: 20px;
    }

    .catalog-product-card__footer {
        align-items: stretch;
    }

    .catalog-product-card__button {
        width: 100%;
    }

    .product-gallery__thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .product-summary {
        padding: 24px;
    }

    .product-summary__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .product-summary__order {
        width: 100%;
    }

    .product-summary__back {
        text-align: center;
    }

    .product-characteristics__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-characteristics__name {
        padding-bottom: 8px;
        border-right: 0;
    }

    .product-characteristics__value {
        padding-top: 8px;
    }
}

@media (max-width: 480px) {
    .catalog-hero__media {
        min-height: 200px;
        border-radius: 14px;
    }

    .catalog-hero__media img {
        min-height: 200px;
    }

    .catalog-category-card,
    .catalog-product-card,
    .product-gallery__main,
    .product-summary {
        border-radius: 12px;
    }

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

    .product-summary {
        padding: 20px;
    }

    .product-characteristics__name,
    .product-characteristics__value {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* Конец части 3. */
