/* =========================================================
   Prezzomania Home V2
   Coerente con prodotto.asp / categoria.asp
   ========================================================= */
.home-page {
    background: #fff;
}

.pm-home-main {
    background: #fff;
    padding: 1.05rem 0 3.5rem;
}

/* ---------- Hero 1 grande + 2 piccoli ---------- */
.pm-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 2.11fr) minmax(260px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 2.25rem;
}

.pm-home-hero__item {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    border-radius: 1rem;
    background: #f4f4f4;
    text-decoration: none;
}

.pm-home-hero__item--1 {
    grid-row: 1 / span 2;
    aspect-ratio: auto;
    height: 100%;
    align-self: stretch;
}

.pm-home-hero__item--2,
.pm-home-hero__item--3 {
    aspect-ratio: 16 / 9;
}

/* Il banner grande si estende esattamente sull'altezza dei due banner 16:9 + gap.
   Il rapporto 2.11:1 tra le colonne mantiene anche il box grande vicino a 1600x880. */

.pm-home-hero__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.pm-home-hero__item:hover img {
    transform: scale(1.012);
}

/* ---------- Promo row: banner 3-5 di slide3 ---------- */
.pm-home-mid-promos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 2.15rem 0 0.4rem;
}

.pm-home-mid-promo {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 1rem;
    background: #f4f4f4;
    text-decoration: none;
}

.pm-home-mid-promo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .pm-home-mid-promo:hover img {
        transform: scale(1.012);
    }
}

/* ---------- Section heading ---------- */
.pm-home-section,
.pm-home-categories {
    margin-top: 2.4rem;
}

.pm-home-section__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pm-home-section__heading h2,
.pm-home-trending-intro h2 {
    margin: 0;
    color: var(--pm-text);
    font-size: clamp(1.28rem, 2.1vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.pm-home-section__heading a {
    flex: 0 0 auto;
    color: var(--pm-text-secondary);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
}

.pm-home-section__heading a:hover {
    color: var(--pm-primary);
}

/* ---------- Main categories ---------- */
.pm-home-category-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(104px, 1fr);
    gap: 0.7rem;
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.55rem;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.pm-home-category-list::-webkit-scrollbar {
    display: none;
}

.pm-home-category {
    min-width: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 0.45rem 0.75rem;
    color: var(--pm-text);
    text-align: center;
    text-decoration: none;
}

.pm-home-category__icon {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f7f7f7;
    color: #4b4d50;
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.pm-home-category__icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-home-category__name {
    min-height: 2.5em;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
}

.pm-home-category:hover .pm-home-category__icon,
.pm-home-category:focus-visible .pm-home-category__icon {
    background: rgba(var(--pm-primary-rgb), 0.09);
    color: var(--pm-primary);
    transform: translateY(-2px);
}

/* ---------- Product rails ---------- */
.pm-home-rail-wrap {
    position: relative;
}

.pm-home-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 5rem) / 6);
    gap: 1rem;
    overflow-x: auto;
    padding: 0.1rem 0.08rem 0.7rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.pm-home-rail::-webkit-scrollbar {
    display: none;
}

.pm-home-product {
    min-width: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.pm-home-product__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--pm-border);
    border-radius: 0.78rem;
    background: #fff;
}

.pm-home-product__media img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0.55rem;
    object-fit: contain;
    transition: transform 180ms ease;
}

.pm-home-product:hover .pm-home-product__media img {
    transform: scale(1.025);
}

.pm-home-product__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 0.65rem 0.08rem 0;
}

.pm-home-product__brand {
    min-height: 1rem;
    overflow: hidden;
    color: var(--pm-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.025em;
}

.pm-home-product__brand:hover {
    color: var(--pm-primary);
}

.pm-home-product__title {
    display: -webkit-box;
    min-height: 2.62rem;
    margin-top: 0.25rem;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 0.81rem;
    font-weight: 500;
    line-height: 1.45;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pm-home-product__title:hover {
    color: var(--pm-primary);
}

.pm-home-product__price {
    margin-top: auto;
    padding-top: 0.7rem;
    color: var(--pm-text);
    font-size: 1.08rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pm-home-product__shipping {
    margin-top: 0.12rem;
    color: #218739;
    font-size: 0.68rem;
    font-weight: 600;
}

.pm-home-rail-arrow {
    position: absolute;
    top: 38%;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pm-border);
    border-radius: 50%;
    background: rgba(255,255,255,.96);
    color: var(--pm-text);
    box-shadow: 0 4px 18px rgba(0,0,0,.10);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 160ms ease, transform 160ms ease;
}

.pm-home-rail-arrow svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-home-rail-arrow--prev { left: -18px; }
.pm-home-rail-arrow--next { right: -18px; }

.pm-home-rail-arrow:hover {
    color: var(--pm-primary);
    transform: translateY(-50%) scale(1.04);
}

.pm-home-rail-arrow[disabled] {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Trending intro ---------- */
.pm-home-trending-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
    align-items: end;
    gap: 2rem;
    margin-top: 3.2rem;
    padding: 1.35rem 1.5rem;
    border-radius: 1rem;
    background: #f7f7f7;
}

.pm-home-kicker {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--pm-primary);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.pm-home-trending-intro p {
    margin: 0;
    color: var(--pm-text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
}

/* ---------- Benefits ---------- */
.pm-home-value-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--pm-border);
    border-radius: 1rem;
    background: #fff;
}

.pm-home-value-strip__item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.pm-home-value-strip__icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--pm-primary-rgb), 0.08);
    color: var(--pm-primary);
}

.pm-home-value-strip__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-home-value-strip strong,
.pm-home-value-strip small {
    display: block;
}

.pm-home-value-strip strong {
    color: var(--pm-text);
    font-size: 0.86rem;
}

.pm-home-value-strip small {
    margin-top: 0.12rem;
    color: var(--pm-text-muted);
    font-size: 0.72rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .pm-home-rail {
        grid-auto-columns: calc((100% - 3rem) / 4);
    }
}

@media (max-width: 767.98px) {
    .pm-home-main {
        padding-top: 0.65rem;
    }

    .pm-home-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto;
        gap: 0.55rem;
        margin-bottom: 1.65rem;
    }

    .pm-home-hero__item--1 {
        grid-column: 1 / -1;
        grid-row: auto;
        aspect-ratio: 20 / 11;
    }

    .pm-home-hero__item--2,
    .pm-home-hero__item--3 {
        aspect-ratio: 16 / 9;
    }

    .pm-home-mid-promos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
        gap: 0.6rem;
        overflow: visible;
        margin: 1.55rem 0 0.15rem;
        padding: 0;
    }

    .pm-home-mid-promo {
        min-width: 0;
        border-radius: 0.85rem;
    }

    .pm-home-mid-promo:first-child {
        grid-column: 1 / -1;
    }

    .pm-home-section,
    .pm-home-categories {
        margin-top: 1.8rem;
    }

    .pm-home-section__heading {
        margin-bottom: 0.75rem;
    }

    .pm-home-section__heading h2,
    .pm-home-trending-intro h2 {
        font-size: 1.22rem;
    }

    .pm-home-category-list {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem 0.35rem;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .pm-home-category {
        min-width: 0;
        padding: 0.7rem 0.2rem 0.55rem;
    }

    .pm-home-category__icon {
        width: 64px;
        height: 64px;
    }

    .pm-home-category__icon svg {
        width: 29px;
        height: 29px;
    }

    .pm-home-rail {
        grid-auto-columns: 43vw;
        gap: 0.75rem;
        margin-right: -1rem;
        padding-right: 1rem;
    }

    .pm-home-rail-arrow {
        display: none;
    }

    .pm-home-product__title {
        min-height: 2.5rem;
        font-size: 0.78rem;
    }

    .pm-home-product__price {
        font-size: 1rem;
    }

    .pm-home-trending-intro {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        margin-top: 2.3rem;
        padding: 1.1rem;
    }

    .pm-home-value-strip {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.1rem;
    }
}


@media (max-width: 374.98px) {
    .pm-home-mid-promos {
        grid-template-columns: 1fr;
    }

    .pm-home-mid-promo:first-child {
        grid-column: auto;
    }

    .pm-home-category__icon {
        width: 58px;
        height: 58px;
    }

    .pm-home-category__icon svg {
        width: 27px;
        height: 27px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-home-rail,
    .pm-home-hero__item img,
    .pm-home-product__media img,
    .pm-home-category__icon {
        scroll-behavior: auto;
        transition: none;
    }
}

/* =========================================================
   FIX 6 - slider automatico banner principale (tabella slide)
   ========================================================= */
.pm-home-main-slider {
    isolation: isolate;
}

.pm-home-main-slider__track,
.pm-home-main-slide {
    position: absolute;
    inset: 0;
}

.pm-home-main-slide {
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 420ms ease, visibility 420ms ease;
    text-decoration: none;
}

.pm-home-main-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.pm-home-main-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-home-main-slider__arrow,
.pm-home-main-slider__toggle,
.pm-home-main-slider__dot {
    border: 0;
    cursor: pointer;
}

.pm-home-main-slider__arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #292929;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-50%);
}

.pm-home-main-slider__arrow--prev { left: 0.75rem; }
.pm-home-main-slider__arrow--next { right: 0.75rem; }

.pm-home-main-slider__arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-home-main-slider__controls {
    position: absolute;
    left: 50%;
    bottom: 0.8rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.36rem 0.48rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.11);
    transform: translateX(-50%);
}

.pm-home-main-slider__dots {
    display: flex;
    align-items: center;
    gap: 0.38rem;
}

.pm-home-main-slider__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: #c7c7c7;
}

.pm-home-main-slider__dot.is-active {
    width: 20px;
    border-radius: 999px;
    background: var(--pm-primary);
}

.pm-home-main-slider__toggle {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #3a3a3a;
}

.pm-home-main-slider__toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-home-main-slider__play { display: none; }
.pm-home-main-slider__toggle.is-paused .pm-home-main-slider__pause { display: none; }
.pm-home-main-slider__toggle.is-paused .pm-home-main-slider__play { display: block; }

@media (hover: hover) and (pointer: fine) {
    .pm-home-main-slider__arrow:hover,
    .pm-home-main-slider__toggle:hover {
        color: var(--pm-primary);
    }
}

@media (max-width: 767.98px) {
    .pm-home-main-slider__arrow {
        width: 36px;
        height: 36px;
    }

    .pm-home-main-slider__arrow--prev { left: 0.45rem; }
    .pm-home-main-slider__arrow--next { right: 0.45rem; }
    .pm-home-main-slider__controls { bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pm-home-main-slide {
        transition: none;
    }
}


/* FIX 12 - iOS/Safari: un solo tap sui collegamenti touch */
@media (hover: none), (pointer: coarse) {
    a, button, [role="button"], summary {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .pm-home-hero__item:hover img,
    .pm-home-mid-promo:hover img,
    .pm-home-product:hover .pm-home-product__media img {
        transform: none;
    }

    .pm-home-category:hover .pm-home-category__icon {
        background: var(--pm-surface);
        color: inherit;
        transform: none;
    }

    .pm-home-product__brand:hover,
    .pm-home-product__title:hover,
    .pm-home-section__heading a:hover {
        color: inherit;
    }

    .pm-mobile-menu-button:hover,
    .pm-mobile-action:hover {
        background: transparent;
        color: var(--pm-text-secondary);
    }
}
