.mmc-category-hub {
    background: var(--mmc-color-background);
    color: var(--mmc-color-text);
    margin-inline: calc(50% - 50vw);
    max-width: 100vw;
    min-height: 60vh;
    overflow: hidden;
    padding-bottom: calc(var(--mmc-space-xl) * 2);
    width: 100vw;
}

.mmc-category-hub__hero {
    align-items: flex-end;
    background: #071833;
    display: flex;
    min-height: clamp(280px, 38vw, 430px);
    overflow: hidden;
    position: relative;
}

.mmc-category-hub__hero-media {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    inset: 0;
    position: absolute;
}

.mmc-category-hub__hero-image {
    min-width: 0;
    overflow: hidden;
}

.mmc-category-hub__hero-image img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.mmc-category-hub__hero-overlay {
    background:
        linear-gradient(90deg, rgba(7, 24, 51, .88) 0%, rgba(7, 24, 51, .62) 48%, rgba(7, 24, 51, .32) 100%),
        linear-gradient(0deg, rgba(7, 24, 51, .72) 0%, rgba(7, 24, 51, .08) 72%);
    inset: 0;
    position: absolute;
}

.mmc-category-hub__hero-content {
    color: #fff;
    padding-bottom: clamp(34px, 6vw, 68px);
    padding-top: clamp(70px, 10vw, 120px);
    position: relative;
    z-index: 1;
}

.mmc-category-hub__eyebrow {
    color: var(--mmc-color-primary);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .09em;
    margin: 0 0 var(--mmc-space-xs);
    text-transform: uppercase;
}

.mmc-category-hub__hero .mmc-category-hub__eyebrow {
    color: #fff4e6;
}

.mmc-category-hub__hero h1 {
    color: #fff;
    font-size: clamp(2.5rem, 8vw, 4.6rem);
    letter-spacing: -.035em;
    line-height: 1;
    margin: 0;
    text-shadow: 0 4px 22px rgba(7, 24, 51, .42);
}

.mmc-category-hub__hero-content > p:last-child {
    color: rgba(255, 255, 255, .92);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.55;
    margin: var(--mmc-space-md) 0 0;
    max-width: 650px;
    text-shadow: 0 2px 12px rgba(7, 24, 51, .45);
}

.mmc-category-hub__content {
    padding-top: clamp(28px, 4vw, 48px);
}

.mmc-category-hub__macro + .mmc-category-hub__macro {
    margin-top: calc(var(--mmc-space-xl) * 1.7);
}

.mmc-category-hub__macro-heading {
    margin-bottom: clamp(18px, 3vw, 28px);
    max-width: 760px;
}

.mmc-category-hub__macro-heading h2 {
    color: var(--mmc-color-primary-dark);
    font-size: clamp(1.85rem, 5vw, 2.65rem);
    letter-spacing: -.025em;
    line-height: 1.08;
    margin: 0;
}

.mmc-category-hub__macro-heading > p:last-child {
    color: var(--mmc-color-text-muted);
    font-size: 1rem;
    line-height: 1.55;
    margin: var(--mmc-space-sm) 0 0;
}

.mmc-category-hub__department-cards {
    margin-bottom: clamp(24px, 4vw, 42px);
}

.mmc-category-hub__department-cards .mmc-explore-category-card {
    aspect-ratio: 4 / 3;
    flex-basis: min(72vw, 260px);
    max-width: 260px;
}

.mmc-category-hub__department-cards .mmc-explore-category-card__content {
    padding: clamp(16px, 2.5vw, 22px);
}

.mmc-category-hub__departments {
    display: grid;
    gap: clamp(18px, 3vw, 30px);
}

/*
 * I caroselli vivono dentro elementi grid. Senza min-width: 0 il browser può
 * allargare il reparto alla larghezza complessiva delle card; il contenuto
 * viene poi tagliato dal layout della pagina invece di diventare scorrevole.
 */
.mmc-category-hub__content,
.mmc-category-hub__macro,
.mmc-category-hub__departments,
.mmc-category-hub__department,
.mmc-category-hub__type,
.mmc-category-hub__slider {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.mmc-category-hub__department {
    background: var(--mmc-color-surface);
    border: 1px solid var(--mmc-color-border);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(7, 24, 51, .05);
    padding: clamp(16px, 2.8vw, 26px);
}

.mmc-category-hub__department-heading,
.mmc-category-hub__type-heading {
    align-items: center;
    display: flex;
    gap: var(--mmc-space-md);
    justify-content: space-between;
}

.mmc-category-hub__department-heading {
    border-bottom: 1px solid var(--mmc-color-border);
    margin-bottom: clamp(16px, 2.5vw, 24px);
    padding-bottom: 12px;
}

.mmc-category-hub__department-heading h3 {
    color: var(--mmc-color-primary-dark);
    font-size: clamp(1.45rem, 3.5vw, 2.05rem);
    line-height: 1.15;
    margin: 0;
}

.mmc-category-hub__department-banner {
    align-items: flex-end;
    background-color: #0c2442;
    background-image: var(--mmc-category-department-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 16px;
    color: #fff;
    display: flex;
    isolation: isolate;
    margin-bottom: clamp(22px, 3vw, 30px);
    min-height: clamp(150px, 27vw, 210px);
    overflow: hidden;
    padding: clamp(18px, 3vw, 28px);
    position: relative;
    text-decoration: none;
}

.mmc-category-hub__department-banner-overlay {
    background:
        linear-gradient(90deg, rgba(5, 22, 47, .88) 0%, rgba(5, 22, 47, .64) 48%, rgba(5, 22, 47, .18) 100%),
        linear-gradient(0deg, rgba(5, 22, 47, .58) 0%, rgba(5, 22, 47, .05) 72%);
    inset: 0;
    position: absolute;
    z-index: -1;
}

.mmc-category-hub__department-banner-copy {
    display: grid;
    gap: 7px;
    max-width: min(76%, 570px);
    padding-right: 48px;
    text-shadow: 0 2px 12px rgba(3, 17, 36, .64);
}

.mmc-category-hub__department-banner-copy strong {
    color: #fff4e6;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.65rem, 5vw, 2.55rem);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1;
}

.mmc-category-hub__department-banner-copy > span {
    color: rgba(255, 255, 255, .94);
    font-size: clamp(.86rem, 2vw, 1rem);
    font-weight: 650;
    line-height: 1.42;
}

.mmc-category-hub__department-banner-action {
    bottom: 18px;
    position: absolute;
    right: 18px;
}

.mmc-category-hub__department-banner:focus-visible {
    outline: 3px solid #ffd25a;
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .mmc-category-hub__department-banner {
        transition: background-size .28s ease, box-shadow .22s ease, transform .22s ease;
    }

    .mmc-category-hub__department-banner:hover {
        background-size: 103%;
        box-shadow: 0 12px 28px rgba(7, 24, 51, .16);
        transform: translateY(-1px);
    }

    .mmc-category-hub__department-banner:hover .mmc-category-hub__department-banner-action {
        background: rgba(255, 255, 255, .24);
        border-color: rgba(255, 255, 255, .55);
    }

    .mmc-category-hub__department-banner:hover .mmc-category-hub__department-banner-action .mmc-section-action__icon {
        transform: translateX(2px);
    }
}

.mmc-category-hub__department-heading .mmc-section-action {
    flex: 0 0 42px;
}

.mmc-category-hub__type-heading .mmc-section-action {
    flex: 0 0 38px;
}

.mmc-category-hub__type + .mmc-category-hub__type {
    border-top: 1px solid var(--mmc-color-border);
    margin-top: clamp(20px, 3vw, 28px);
    padding-top: clamp(20px, 3vw, 28px);
}

.mmc-category-hub__type-heading {
    margin-bottom: 12px;
}

.mmc-category-hub__type-heading h4 {
    color: var(--mmc-color-primary-dark);
    font-size: clamp(1.12rem, 2.6vw, 1.42rem);
    line-height: 1.2;
    margin: 0;
}

.mmc-category-hub__slider {
    position: relative;
}

.mmc-category-hub__arrow {
    top: 46%;
}

.mmc-category-hub__dots {
    padding-top: 6px;
}

.mmc-category-hub__products {
    box-sizing: border-box;
    display: flex;
    gap: var(--mmc-product-card-gap);
    list-style: none;
    margin: 0 calc(var(--mmc-space-md) * -1) 0 0;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    padding: 2px max(14%, var(--mmc-space-md)) var(--mmc-space-sm) 0;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    touch-action: pan-x pan-y pinch-zoom;
    width: 100%;
}

.mmc-category-hub__products::-webkit-scrollbar {
    display: none;
}

.mmc-category-hub__product {
    display: flex;
    flex: 0 0 var(--mmc-product-card-mobile-width);
    max-width: var(--mmc-product-card-mobile-width);
    min-width: 0;
    scroll-snap-align: start;
}

.mmc-category-hub__product .mmc-product-card {
    flex: 1;
}


.mmc-category-hub__empty {
    background: var(--mmc-color-surface);
    border: 1px solid var(--mmc-color-border);
    border-radius: 22px;
    padding: var(--mmc-space-xl);
    text-align: center;
}

.mmc-category-hub__empty h2 {
    color: var(--mmc-color-primary-dark);
    margin: 0 0 var(--mmc-space-xs);
}

.mmc-category-hub__empty p {
    color: var(--mmc-color-text-muted);
    margin: 0;
}

.mmc-category-hub :is(a, button):focus-visible {
    outline: 3px solid #ffd25a;
    outline-offset: 3px;
}


@media (max-width: 767px) {
    .mmc-category-hub {
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    .mmc-category-hub__hero-media {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    .mmc-category-hub__hero-overlay {
        background:
            linear-gradient(90deg, rgba(7, 24, 51, .86) 0%, rgba(7, 24, 51, .56) 100%),
            linear-gradient(0deg, rgba(7, 24, 51, .78) 0%, rgba(7, 24, 51, .1) 75%);
    }

    .mmc-category-hub__department {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        margin-inline: 0;
        padding: 0;
    }

    .mmc-category-hub__product {
        flex-basis: min(58vw, 240px);
        max-width: min(58vw, 240px);
    }

    .mmc-category-hub__department-heading,
    .mmc-category-hub__type-heading {
        align-items: flex-start;
    }

    .mmc-category-hub__department-banner {
        min-height: 156px;
        padding: 18px;
    }

    .mmc-category-hub__department-banner-copy {
        max-width: 82%;
        padding-right: 42px;
    }

    .mmc-category-hub__department-banner-action {
        bottom: 16px;
        right: 16px;
    }

}

@media (min-width: 768px) {
    .mmc-category-hub__department-cards .mmc-explore-category-card {
        max-width: none;
        width: auto;
    }

    .mmc-category-hub__products {
        margin-right: 0;
        padding: 2px 0 12px;
    }

    .mmc-category-hub__product {
        flex-basis: calc((85% - (2 * var(--mmc-product-card-gap))) / 3);
        max-width: calc((85% - (2 * var(--mmc-product-card-gap))) / 3);
    }
}

@media (min-width: 1024px) {
    .mmc-category-hub__product {
        flex-basis: calc((85% - (3 * var(--mmc-product-card-gap))) / 4);
        max-width: calc((85% - (3 * var(--mmc-product-card-gap))) / 4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mmc-category-hub * {
        scroll-behavior: auto !important;
    }
}
