/* MON - Homepage sections — only what global.css doesn't cover */

/* Hero title as a link (optional) */
.hero__link,
.hero__link:hover,
.hero__link:focus {
    color: inherit;
    text-decoration: none;
}

/* Rating: stars above the value are dimmed (the design has no empty star) */
.rating__star--empty {
    opacity: .25;
}

/* Product tabs: the visible panel, while the chosen tab is still loading —
   blurred, with the spinner (below) over it */
.mhp-tab-panel.is-switching {
    position: relative;
}

.mhp-tab-panel.is-switching > * {
    filter: blur(4px);
    opacity: .6;
    transition: filter .2s, opacity .2s;
    pointer-events: none;
}

.mhp-empty {
    margin: 0;
    padding: 40px 0;
    text-align: center;
}

/* Product tab still loading (products.tpl, views/js/front.js): the slider's
   height (measured 2026-11-04) so nothing moves when the cards arrive —
   ≥768px: 12 items (2 rows) 772px, 6 items 394px; below, one row ~370px
   and the promo banner moves under it (+~290px) — filled with blurred
   placeholder cards in the slider's columns, a spinner in the middle. */
.mhp-tab-panel--lazy {
    position: relative;
    min-block-size: 772px;
}

.mhp-tab-panel--lazy.mhp-tab-panel--six-items {
    min-block-size: 394px;
}

/* Laid out like the slider it stands in for, so the cards don't jump when
   they arrive: the dots' room left free at the bottom (as .owl-dots in
   global.css: their gap + the 24px row = 31px), the rest split into the
   card rows — 12 items on desktop: (772 − 31 − 15) / 2 = 363px, the real
   cards' height. */
.mhp-skeleton {
    --mhp-dots-room: calc(var(--slider-dots-offset) - (var(--slider-dot-hit-height) - var(--slider-dot-size)) / 2 + var(--slider-dot-hit-height));
    position: absolute;
    inset: 0 0 var(--mhp-dots-room);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 15px;
    overflow: hidden;
    filter: blur(5px);
    opacity: .75;
}

.mhp-skeleton__card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-surface);
}

.mhp-skeleton__image {
    flex: 1 1 auto;
    min-block-size: 0;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-subtle);
}

.mhp-skeleton__line {
    flex: none;
    block-size: 12px;
    border-radius: 6px;
    background-color: var(--color-border);
}

.mhp-skeleton__line--short {
    inline-size: 60%;
}

@media (max-width: 1175.98px) {
    .mhp-skeleton {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* 3 columns × 2 rows (12 items) / × 1 row (6 items) */
    .mhp-skeleton__card:nth-child(n + 7),
    .mhp-tab-panel--six-items .mhp-skeleton__card:nth-child(n + 4) {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .mhp-tab-panel--lazy,
    .mhp-tab-panel--lazy.mhp-tab-panel--six-items {
        min-block-size: 370px;
    }

    .mhp-tab-panel--lazy.mhp-tab-panel--promo,
    .mhp-tab-panel--lazy.mhp-tab-panel--six-items.mhp-tab-panel--promo {
        min-block-size: 660px;
    }

    /* One row of 2 (the slider's mobile view), above the dots; with a
       promo banner the banner's room under it stays empty */
    .mhp-skeleton {
        inset: 0 0 auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: calc(370px - var(--mhp-dots-room));
        gap: 8px;
    }

    .mhp-skeleton__card:nth-child(n + 3),
    .mhp-tab-panel--six-items .mhp-skeleton__card:nth-child(n + 3) {
        display: none;
    }
}

/* Spinner over a loading panel: the header search's arc (global.css 6.5.2)
   in the brand colour, as a mask so it takes var(--color-brand) */
.mhp-tab-panel--lazy::after,
.mhp-tab-panel.is-switching::after {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    z-index: 1;
    inline-size: 40px;
    block-size: 40px;
    margin: -20px 0 0 -20px;
    background-color: var(--color-brand);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none'%3E%3Ccircle cx='11' cy='11' r='8' stroke='%23000' stroke-width='2' opacity='0.2'/%3E%3Ccircle cx='11' cy='11' r='8' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-dasharray='16 60'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none'%3E%3Ccircle cx='11' cy='11' r='8' stroke='%23000' stroke-width='2' opacity='0.2'/%3E%3Ccircle cx='11' cy='11' r='8' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-dasharray='16 60'/%3E%3C/svg%3E") center / contain no-repeat;
    animation: header-search-spin 0.9s linear infinite;
}

/* Mobile with the banner under the slider: the spinner on the cards' row */
@media (max-width: 767.98px) {
    .mhp-tab-panel--lazy.mhp-tab-panel--promo::after {
        inset-block-start: 185px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mhp-tab-panel--lazy::after,
    .mhp-tab-panel.is-switching::after {
        animation: none;
    }
}

/* Still not loaded after the retries (front.js): no spinner going on forever */
.mhp-tab-panel--lazy.is-failed::after {
    content: none;
}
