/* Modules PLP hero (V4).
   Layout switches on the banner's own width (container queries), not the viewport,
   so it follows the catalog column. Each layout scales from its mockup width via --u (1 mockup px). */

.modules-hero {
    container: modules-hero / inline-size;
}

.modules-hero-card {
    --modules-hero-sign-color: var(--cc-gray-600);
    overflow: hidden;
    background-color: var(--cc-secondary-bg);
    border: var(--cc-border-width) solid var(--cc-border-color);
    border-radius: var(--cc-border-radius-lg);
}

.modules-hero-title {
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--cc-heading-color);
}

.modules-hero-description {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cc-body-color);
}

/* Copy variants per layout */
.modules-hero-tablet,
.modules-hero-desktop,
.modules-hero-photo,
.modules-hero-equals,
.modules-hero-shop,
.modules-hero-features {
    display: none;
}

/* Build row: module + module + module = */
.modules-hero-build {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    gap: 5px;
}

.modules-hero-build img {
    width: 30px;
    height: auto;
}

.modules-hero-build svg {
    flex-shrink: 0;
    align-self: center;
    width: 10px;
    height: 10px;
    color: var(--modules-hero-sign-color);
}

/* Mobile card */
.modules-hero-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px 20px;
}

.modules-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--cc-body-bg);
    border-top: var(--cc-border-width) solid var(--cc-border-color);
}

.modules-hero-actions .btn-outline-primary {
    --cc-btn-bg: transparent;
    --cc-btn-border-color: transparent;
    --cc-btn-hover-color: var(--cc-primary-text-emphasis);
    --cc-btn-hover-bg: transparent;
    --cc-btn-hover-border-color: transparent;
    --cc-btn-active-color: var(--cc-primary-text-emphasis);
    --cc-btn-active-bg: transparent;
    --cc-btn-active-border-color: transparent;
    --cc-btn-disabled-bg: transparent;
    --cc-btn-disabled-border-color: transparent;
    --cc-btn-padding-x: 0;
    --cc-btn-padding-y: 0;
    --cc-btn-font-size: 13.5px;
    --cc-btn-font-weight: 600;
    --cc-btn-border-radius: 0;
    height: 46px;
    gap: 8px;
}

@container modules-hero (max-width: 639.98px) {
    .modules-hero-actions .btn-outline-primary + .btn-outline-primary {
        border-left: var(--cc-border-width) solid var(--cc-border-color);
    }
}

/* Tablet (mockup 834) */
@container modules-hero (min-width: 640px) {
    .modules-hero-card {
        --u: min(100cqi / 834, 1.15px);
    }

    .modules-hero-card {
        background-color: var(--cc-body-bg);
    }

    .modules-hero-mobile {
        display: none;
    }

    .modules-hero-tablet {
        display: inline;
    }

    .modules-hero-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38%;
        min-height: calc(260 * var(--u));
    }

    .modules-hero-content {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: start;
        align-content: center;
        column-gap: calc(8 * var(--u));
        padding: calc(24 * var(--u)) calc(12 * var(--u)) calc(24 * var(--u)) calc(28 * var(--u));
    }

    /* Text and actions stack in the first column, modules sit in the second */
    .modules-hero-top {
        display: contents;
    }

    .modules-hero-text {
        grid-column: 1;
        width: calc(290 * var(--u));
    }

    .modules-hero-build {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        gap: calc(7 * var(--u));
        padding: 0 calc(8 * var(--u));
    }

    .modules-hero-build img {
        width: calc(36 * var(--u));
    }

    .modules-hero-build svg {
        width: calc(12 * var(--u));
        height: calc(12 * var(--u));
    }

    .modules-hero-equals {
        display: block;
        margin-left: calc(4 * var(--u));
    }

    .modules-hero-title {
        margin-bottom: calc(10 * var(--u));
        font-size: calc(30 * var(--u));
        line-height: 1.08;
        letter-spacing: -0.025em;
    }

    .modules-hero-description {
        font-size: max(13 * var(--u), 12px);
        line-height: 1.45;
    }

    .modules-hero-actions {
        grid-column: 1;
        grid-template-columns: auto auto;
        justify-content: start;
        gap: 10px calc(18 * var(--u));
        margin-top: calc(14 * var(--u));
        background-color: transparent;
        border-top: 0;
    }

    .modules-hero-shop {
        display: inline-flex;
        grid-column: 1 / -1;
        justify-self: start;
        gap: 8px;
        --cc-btn-padding-y: 0;
        --cc-btn-padding-x: 20px;
        --cc-btn-font-weight: 600;
        height: 44px;
    }

    .modules-hero-actions .btn-outline-primary {
        --cc-btn-font-size: 13px;
        height: 24px;
    }

    /* Photo fills its cell without driving the banner height */
    .modules-hero-photo {
        position: relative;
        display: block;
        clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
    }

    .modules-hero-photo img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 50%;
    }

    .modules-hero-features {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        height: 56px;
        margin: 0;
        padding: 0;
        list-style: none;
        background-color: var(--cc-secondary-bg);
        border-top: var(--cc-border-width) solid var(--cc-border-color);
    }

    .modules-hero-features li {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 0 8px;
        color: var(--cc-heading-color);
    }

    .modules-hero-features li + li {
        border-left: var(--cc-border-width) solid var(--cc-border-color);
    }

    .modules-hero-features svg {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        stroke-width: 1.6;
    }

    .modules-hero-features strong {
        display: block;
        font-size: 12.5px;
        font-weight: 500;
        line-height: 1.25;
    }

    .modules-hero-features small {
        display: none;
    }
}

/* Desktop (mockup 1440) */
@container modules-hero (min-width: 1024px) {
    .modules-hero-card {
        --u: min(100cqi / 1440, 1.15px);
    }

    .modules-hero-tablet {
        display: none;
    }

    .modules-hero-desktop {
        display: inline;
    }

    .modules-hero-main {
        grid-template-columns: minmax(0, 1fr) calc(560 * var(--u));
        min-height: calc(295 * var(--u));
    }

    .modules-hero-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: calc(24 * var(--u)) calc(48 * var(--u)) calc(24 * var(--u)) calc(40 * var(--u));
    }

    .modules-hero-top {
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        gap: calc(40 * var(--u));
        padding: 0;
    }

    .modules-hero-text {
        width: calc(430 * var(--u));
    }

    .modules-hero-build {
        align-self: flex-start;
        gap: calc(12 * var(--u));
        padding: 0;
    }

    .modules-hero-build img {
        width: calc(54 * var(--u));
    }

    .modules-hero-build svg {
        width: calc(16 * var(--u));
        height: calc(16 * var(--u));
    }

    .modules-hero-equals {
        margin-left: calc(8 * var(--u));
    }

    .modules-hero-title {
        margin-bottom: calc(14 * var(--u));
        font-size: calc(46 * var(--u));
        line-height: 1.04;
    }

    .modules-hero-description {
        font-size: max(16 * var(--u), 14px);
        line-height: 1.5;
    }

    .modules-hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: calc(28 * var(--u));
    }

    .modules-hero-shop {
        height: 48px;
        --cc-btn-padding-x: max(20 * var(--u), 16px);
        --cc-btn-font-size: 14px;
    }

    .modules-hero-actions .btn-outline-primary {
        --cc-btn-bg: var(--cc-body-bg);
        --cc-btn-border-color: var(--cc-primary);
        --cc-btn-hover-color: #fff;
        --cc-btn-hover-bg: var(--cc-primary);
        --cc-btn-hover-border-color: var(--cc-primary);
        --cc-btn-active-color: #fff;
        --cc-btn-active-bg: var(--cc-primary);
        --cc-btn-active-border-color: var(--cc-primary);
        --cc-btn-disabled-border-color: var(--cc-primary);
        --cc-btn-padding-x: max(18 * var(--u), 14px);
        --cc-btn-font-size: 14px;
        --cc-btn-border-radius: var(--cc-border-radius-pill);
        height: 48px;
        border-width: 1.5px;
    }

    .modules-hero-photo {
        clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
    }

    .modules-hero-features li {
        gap: 12px;
        justify-content: center;
    }

    .modules-hero-features svg {
        width: 24px;
        height: 24px;
        stroke-width: 1.5;
    }

    .modules-hero-features strong {
        font-size: 13px;
        font-weight: 600;
    }

    .modules-hero-features small {
        display: block;
        font-size: 12px;
        line-height: 1.25;
        color: var(--cc-body-color);
    }
}

/* Wide (mockup 1920) */
@container modules-hero (min-width: 1600px) {
    .modules-hero-card {
        --u: min(100cqi / 1920, 1.15px);
    }

    .modules-hero-main {
        grid-template-columns: minmax(0, 1fr) calc(760 * var(--u));
        min-height: calc(310 * var(--u));
    }

    .modules-hero-content {
        padding: calc(24 * var(--u)) calc(56 * var(--u)) calc(24 * var(--u)) calc(48 * var(--u));
    }

    .modules-hero-top {
        gap: calc(56 * var(--u));
    }

    .modules-hero-text {
        width: calc(520 * var(--u));
    }

    .modules-hero-build {
        gap: calc(14 * var(--u));
        margin-inline: auto;
    }

    .modules-hero-build img {
        width: calc(62 * var(--u));
    }

    .modules-hero-build svg {
        width: calc(18 * var(--u));
        height: calc(18 * var(--u));
    }

    .modules-hero-equals {
        margin-left: calc(10 * var(--u));
    }

    .modules-hero-title {
        margin-bottom: calc(16 * var(--u));
        font-size: calc(54 * var(--u));
    }

    .modules-hero-description {
        font-size: max(17 * var(--u), 15px);
    }

    .modules-hero-shop {
        --cc-btn-padding-x: max(22 * var(--u), 18px);
    }

    .modules-hero-actions .btn-outline-primary {
        --cc-btn-padding-x: max(20 * var(--u), 16px);
    }

    .modules-hero-photo {
        clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
    }

    .modules-hero-features svg {
        width: 26px;
        height: 26px;
    }

    .modules-hero-features strong {
        font-size: 14px;
    }
}
