/**
 * CRO Catalog — корень каталога, разделы, карточки товаров, product detail
 */

/* ── Catalog root hero ── */
.catalog-hero-actions {
    margin-top: 20px;
}

.catalog-commercial-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ui-border, #e8e8ee);
    font-size: 15px;
}

.catalog-commercial-nav a {
    color: var(--ui-primary, #4334A1);
    text-decoration: none;
}

.catalog-commercial-nav a:hover {
    text-decoration: underline;
}

/* ── Category grid /catalog/ ── */
.catalog-categories {
    margin: 8px 0 32px;
}

.catalog-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.catalog-category-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid var(--ui-border, #e8e8ee);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow .25s, border-color .25s, transform .25s;
}

.catalog-category-card:hover {
    border-color: rgba(67, 52, 161, .35);
    box-shadow: var(--ui-shadow-hover, 0 16px 40px rgba(67, 52, 161, .12));
    transform: translateY(-2px);
}

.catalog-category-card-media {
    aspect-ratio: 16 / 10;
    background: var(--ui-bg-soft, #f8f7fc);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.catalog-category-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-category-card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.catalog-category-card-title {
    margin: 0;
    font-size: clamp(20px, 2vw, 24px);
    line-height: 1.25;
    color: var(--ui-text, #1a1a2e);
}

.catalog-category-card-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ui-text-body, #444);
    flex: 1;
}

.catalog-category-card-cta {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-primary, #4334A1);
}

/* ── Section commercial header ── */
.cro-section-page-header.page-header-catalog:not(.hide) {
    overflow: visible;
}

.cro-section-page-header .page-header {
    margin-top: 0;
    overflow: visible;
    padding-top: clamp(28px, 3vw, 40px);
    padding-bottom: clamp(20px, 2.5vw, 28px);
}

.cro-section-page-header .page-header-blocks {
    display: block;
}

.cro-section-page-header .page-header-right {
    display: none;
}

.cro-section-header {
    padding: 0;
}

.cro-section-h1 {
    margin: 0 0 12px;
    font-size: clamp(32px, 3.2vw, 44px);
    line-height: 1.22;
    color: var(--ui-text, #1a1a2e);
}

.cro-section-lead {
    margin: 0 0 20px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ui-text-body, #444);
    max-width: 760px;
}

.cro-section-page-header .cro-section-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
}

.cro-section-page-header .cro-section-header-actions .b-a-btn {
    margin: 0;
}

.cro-section-help {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--ui-bg-soft, #f8f7fc);
    border: 1px solid var(--ui-border, #e8e8ee);
    font-size: 15px;
    line-height: 1.5;
    max-width: 760px;
    margin: 0;
}

.cro-section-help strong {
    font-size: 16px;
    color: var(--ui-text, #1a1a2e);
}

.cro-section-help span {
    color: var(--ui-text-muted, #666);
}

/* ── Filter podbor CTA ── */
.catalog-filter-podbor {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--ui-bg-soft, #f8f7fc);
    border: 1px dashed var(--ui-border, #e8e8ee);
    font-size: 15px;
    line-height: 1.45;
}

.catalog-filter-podbor-text {
    margin: 0 0 6px;
    color: var(--ui-text-body, #444);
}

.catalog-filter-podbor-link {
    font-weight: 600;
    color: var(--ui-primary, #4334A1);
    text-decoration: none;
}

.catalog-filter-podbor-link:hover {
    text-decoration: underline;
}

/* ── Product card commercial layer (catalog grid only) ── */
.catalog-items-list .catalog-item > a.product-item {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.catalog-items-list .catalog-item > a.product-item .catalog-item-info {
    flex: 1 1 auto;
}

.catalog-items-list .catalog-item-footer {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.catalog-item-photo.is-placeholder,
.product-photos-item.is-placeholder > div {
    background: linear-gradient(145deg, #f3f2f8 0%, #eceaf5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.catalog-item-photo.is-placeholder::before,
.product-photos-item.is-placeholder > div::before {
    content: '';
    width: 56px;
    height: 56px;
    opacity: .35;
    background: center / contain no-repeat url('/local/assets/img/no-photo.svg');
}

.catalog-item-photo.is-placeholder img,
.product-photos-item.is-placeholder img {
    display: none;
}

.catalog-item-photo img,
.product-photos-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.catalog-item-brand {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--ui-text-muted, #666);
    margin-bottom: 6px;
}

.catalog-item-props {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.catalog-item-prop {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ui-text-body, #444);
}

.catalog-item-prop-name {
    color: var(--ui-text-muted, #666);
}

.catalog-items-list .catalog-item-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    width: 100%;
}

.catalog-items-list .catalog-item-cta-primary,
.catalog-items-list .catalog-item-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.25;
    cursor: pointer;
    border: none;
    flex: 1 1 140px;
    white-space: normal;
    text-align: center;
}

.catalog-items-list .catalog-item-cta-primary {
    background: var(--ui-primary, #4334A1);
    color: #fff;
}

.catalog-items-list .catalog-item-cta-primary:hover {
    background: var(--ui-primary-light, #5B46D9);
    color: #fff;
}

.catalog-items-list .catalog-item-cta-secondary {
    background: #fff;
    color: var(--ui-primary, #4334A1);
    border: 1px solid rgba(67, 52, 161, .25);
}

.catalog-items-list .catalog-item-cta-secondary:hover {
    border-color: var(--ui-primary, #4334A1);
}

.catalog-items-list .catalog-item-footer .catalog-item-price {
    margin-top: 16px;
}

.catalog-items-list .catalog-item-footer .catalog-item-panel {
    margin-top: 16px;
}

/* ── Product detail CRO ── */
.product-lead-cta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ui-border, #e8e8ee);
}

.product-lead-cta .b-a-btn {
    min-height: 50px;
}

.product-lead-section {
    padding: 40px 0;
    border-top: 1px solid var(--ui-border, #e8e8ee);
}

.product-lead-section h2 {
    font-size: clamp(24px, 2.4vw, 32px);
    margin: 0 0 12px;
}

.product-lead-section p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ui-text-body, #444);
    max-width: 760px;
    margin: 0 0 16px;
}

.product-install-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    max-width: 760px;
}

.product-install-steps li {
    position: relative;
    padding-left: 22px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ui-text-body, #444);
}

.product-install-steps li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ui-primary, #4334A1);
}

.product-faq {
    padding: 48px 0;
    background: var(--ui-bg-soft, #f8f7fc);
}

.product-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 820px;
}

.product-faq-item {
    border: 1px solid var(--ui-border, #e8e8ee);
    border-radius: 14px;
    background: #fff;
    padding: 0 18px;
}

.product-faq-item summary {
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 0;
    list-style: none;
    color: var(--ui-text, #1a1a2e);
}

.product-faq-item summary::-webkit-details-marker {
    display: none;
}

.product-faq-item p {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ui-text-body, #444);
}

.cro-product-cta {
    padding: 48px 0;
}

.catalog-fallback-cta {
    padding: 40px 0 56px;
}

.catalog-fallback-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    border-radius: 18px;
    border: 1px solid var(--ui-border, #e8e8ee);
    background: var(--ui-bg-soft, #f8f7fc);
}

.catalog-fallback-title {
    margin: 0 0 8px;
    font-size: clamp(22px, 2.2vw, 28px);
}

.catalog-fallback-text p {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ui-text-body, #444);
}

.cro-section-layer {
    padding: 40px 0;
    border-top: 1px solid var(--ui-border, #e8e8ee);
}

.cro-section-layer .b-a-actions {
    flex-wrap: wrap;
}

/* ── Mobile ── */
@media (max-width: 1023px) {
    .catalog-categories-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 430px) {
    .cro-section-page-header .page-header {
        padding-top: clamp(20px, 5vw, 28px);
        padding-bottom: 18px;
    }

    .cro-section-page-header .cro-section-header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cro-section-page-header .cro-section-header-actions .b-a-btn {
        width: 100%;
    }

    .catalog-items-list .catalog-item-cta-row {
        flex-direction: column;
    }

    .catalog-items-list .catalog-item-cta-primary,
    .catalog-items-list .catalog-item-cta-secondary {
        width: 100%;
        flex: none;
    }

    .catalog-items-list .catalog-item-footer .catalog-item-price {
        margin-top: 14px;
    }

    .catalog-items-list .catalog-item-footer .catalog-item-panel {
        margin-top: 14px;
    }

    .catalog-fallback-inner {
        padding: 20px;
    }

    .catalog-fallback-inner .b-a-btn {
        width: 100%;
    }

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

    .product-lead-cta .b-a-actions {
        flex-direction: column;
    }

    .product-lead-cta .b-a-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .catalog-category-card-body {
        padding: 16px;
    }
}

.catalog-search-page-lead {
    margin-top: 12px;
    font-size: 17px;
    line-height: 1.5;
    color: #444;
}

.catalog-empty--search {
    padding: 32px 0 48px;
}

.catalog-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
}

@media (max-width: 767px) {
    .catalog-empty-actions .b-a-btn {
        width: 100%;
    }
}
