/* ==========================================================================
   extra.css — Mountings Pro Theme
   Page-specific styles: hero slider, USP strip, sections, category grid,
   back-to-top, filter chips, product video.

   DEBUG MAP:
   §1  Hero slider        — overflow fix, full-width, slide transitions
   §2  USP strip          — black bar below hero
   §3  Sections (.mi-section) — consistent full-width wrapper
   §4  Category grid      — .mi-category-grid tiles
   §5  Back-to-top        — fixed circle button
   §6  Active filter chips — .mi-chip pills
   §7  Product video      — supplemental to plugin CSS
   ========================================================================== */

/* ─── §1  Hero slider ────────────────────────────────────────────────────── */
/*
   BUG FIXED: width:1920px caused horizontal scroll. Hero must be 100% wide.
   BUG FIXED: h1 had display:none and clamp(12px,1vw,20px) — now correct size.
   overflow:hidden on the section prevents any child from creating x-scroll.
   width:100% + max-width:none ensures full viewport width regardless of
   any parent max-width constraints from main.css.
*/
.mi-hero-slider {
    position: relative;
    /* Full viewport width — overrides any inherited max-width */
    width: 100%;
    max-width: none;
    /* Clip video + slides — critical: prevents x-overflow */
    overflow: hidden;
    min-height: 700px; /* buvo 600px — paaukštinta ~17 %, kad matytųsi daugiau vaizdo įrašo */
    display: flex;
    align-items: center;
    color: #fff;
}

/* Background video — covers full hero area */
.mi-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    /* Prevent video from extending beyond hero */
    pointer-events: none;
}

/* Dark gradient overlay */
.mi-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.28) 100%);
    z-index: 1;
}

/* Each slide — hidden by default, shown via .is-active */
.mi-hero__slide {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .75s ease, transform .75s ease;
    pointer-events: none;
    /* Prevent slide from widening beyond parent */
    width: 100%;
    overflow: hidden;
}
.mi-hero__slide.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Text content inside each slide — aligned with page padding */
.mi-hero__content {
    max-width: 1040px;
    padding: 80px var(--page-pad, clamp(16px, 2.5vw, 40px));
    width: 100%;
}

.mi-hero__kicker {
    display: inline-block;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: rgba(255,255,255,.6);
    margin: 0 0 16px;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 0px;
}

/* BUG FIXED: was display:none + clamp(12px,1vw,20px) — headings were invisible */
.mi-hero__content h1 {
    display: block;
    font-size: clamp(14px, 2vw, 40px);
    line-height: 1.08;
    font-weight: 300;
    margin: 0 0 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #fff;
}

.stock.out-of-stock{
    display: none;
}

.mi-hero__sub {
    font-size: 17px;
    color: rgba(255,255,255,.75);
    margin: 0 0 32px;
    max-width: 520px;
    line-height: 1.65;
}

.mi-hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Stat badges — bottom-right, aligned with page padding */
.mi-hero__badges {
    position: absolute;
    right: var(--page-pad, clamp(16px, 2.5vw, 40px));
    bottom: 44px;
    z-index: 3;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.mi-hero__badge {
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.2);
    padding: 10px 16px;
    color: #fff;
    text-align: center;
}
.mi-hero__badge-num   { display: block; font-size: 20px; font-weight: 800; line-height: 1; }
.mi-hero__badge-label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.55); margin-top: 4px; }

@media (max-width: 768px) {
    .mi-hero-slider       { min-height: 640px; }
    .mi-hero__badges      { left: var(--page-pad, 12px); right: var(--page-pad, 12px); bottom: 18px; gap:5px; }
    .mi-hero__content h1  { font-size: 28px; }
    .mi-hero__sub         { font-size: 15px; }
    .mi-hero__badge{
        padding:8px 10px;
    }
    .mi-hero p { font-size: 12px;}
    .mi-hero__kicker{
        letter-spacing:0.10em!important;
    }
}

/* ─── §2  USP strip ──────────────────────────────────────────────────────── */
/*
   Black bar immediately below the hero.
   BUG FIXED: inner had max-width:1280px — now uses --max-w and --page-pad
   to match every other section on the site.
*/
.mi-usp-strip {
    background: var(--clr-black, #0a0a0a);
    border-bottom: 1px solid rgba(255,255,255,.06);
    width: 100%;
}
.mi-usp-strip__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Match site max-width — was hardcoded 1280px */
    max-width: var(--max-w, 1920px);
    margin: 0 auto;
    padding: 0 var(--page-pad, clamp(16px, 2.5vw, 40px));
}
.mi-usp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,.07);
}
.mi-usp:last-child { border-right: 0; }
.mi-usp svg        { flex-shrink: 0; color: var(--clr-red, #ff2b1b); }

@media (max-width: 600px) {
    .mi-usp-strip__inner { flex-direction: column; padding: 0 var(--page-pad, 16px); }
    .mi-usp { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); padding: 12px 0; }
    .mi-usp:last-child { border-bottom: 0; }
}

/* ─── §3  Sections (.mi-section) ─────────────────────────────────────────── */
/*
   Generic content block — used for [mi_featured_products], [mi_category_tiles] etc.
   BUG FIXED: max-width was 1280px. Now uses --max-w + --page-pad so all
   homepage sections are exactly the same width as the header and archive.
   Heading gets a decorative extending line to fill the row.
*/
.mi-section {
    width: 100%;
    max-width: var(--max-w, 1920px);
    margin: 0 auto;
    padding: 48px var(--page-pad, clamp(16px, 2.5vw, 40px));
    box-sizing: border-box;
}

.mi-section h2 {
    text-transform: uppercase;
    font-size: clamp(18px, 2.0vw, 26px);
    font-weight: 400;
    margin: 0 0 28px;
    color: var(--clr-black, #0a0a0a);
    display: flex;
    align-items: center;
    gap: 16px;
}
/* Decorative rule extending from heading */
.mi-section h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--clr-border, #e5e5e5);
}

/* ─── §4  Category grid — full-bleed background image cards ─── */
/* ─── §4  Category grid (grid mode) ─────────────────────────── */
.mi-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: var(--max-w, 1920px);
    box-sizing: border-box;
    width: 100%;
}
.mi-category-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #111;
}
.mi-category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
    z-index: 0;
}
.mi-category-card:hover img { transform: scale(1.05); }
.mi-category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.3) 45%, rgba(0,0,0,.05) 100%);
    z-index: 1;
    transition: background .3s;
}
.mi-category-card:hover::after {
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 50%, rgba(0,0,0,.1) 100%);
}
.mi-category-card__body {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 2;
    padding: 0;
}
.mi-category-card__body h3 {
    margin: 0;
    padding: 14px 18px 10px;
    font-size: clamp(12px, 1.2vw, 16px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #fff;
    line-height: 1.2;
}
.mi-category-card__body p {
    margin: 0;
    padding: 7px 18px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--clr-red, #ff2b1b);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mi-category-card__body:not(:has(p)) h3 { padding-bottom: 18px; }

/* ─── §4b  Category slider (slider mode) ────────────────────── */
.mi-cat-slider-section { overflow: hidden; }

.mi-cat-slider-wrap {
    position: relative;
}

.mi-cat-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.mi-cat-slider::-webkit-scrollbar { display: none; }

.mi-cat-slide {
    flex: 0 0 calc(20% - 16px);
    min-width: 220px;
    scroll-snap-align: start;
    background: var(--clr-gray);
    border: 1px solid var(--clr-border);
    display: flex;
    flex-direction: column;
    transition: border-color .18s, box-shadow .18s;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 360px;
}
.mi-cat-slide:hover {
    border-color: #c0c0c0;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

/* Full-bleed background image */
.mi-cat-slide__img-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.mi-cat-slide__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .45s ease;
}
.mi-cat-slide:hover .mi-cat-slide__img-wrap img { transform: scale(1.04); }
.mi-cat-slide__img-wrap--empty { background: var(--clr-gray); }

/* Gradient: white at top fading to transparent at bottom */
.mi-cat-slide__img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,1)   0%,
        rgba(255,255,255,.97) 30%,
        rgba(255,255,255,.7)  55%,
        rgba(255,255,255,0)   100%
    );
    pointer-events: none;
}

/* Text content sits on top of image + gradient */
.mi-cat-slide__top {
    position: relative;
    z-index: 1;
    padding: 22px 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mi-cat-slide__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--clr-black);
    margin: 0 0 10px;
    line-height: 1.3;
}

.mi-cat-slide__desc {
    font-size: 13px;
    color: var(--clr-text);
    line-height: 1.55;
    flex: 1;
}

.mi-cat-slide__link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-black);
    text-decoration: none;
    border-bottom: 1.5px solid var(--clr-black);
    padding-bottom: 1px;
    transition: color .13s, border-color .13s;
    align-self: flex-start;
    margin-bottom: 120px; /* space below link before image shows */
}
.mi-cat-slide__link:hover {
    color: var(--clr-red);
    border-color: var(--clr-red);
}

/* Navigation arrows */
.mi-cat-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--clr-border);
    background: #fff;
    color: var(--clr-black);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.mi-cat-slider-btn:hover {
    background: var(--clr-black);
    color: #fff;
    border-color: var(--clr-black);
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.mi-cat-slider-btn--prev { right: 56px; top: auto; bottom: -22px; transform: none; }
.mi-cat-slider-btn--next { right: 4px;  top: auto; bottom: -22px; transform: none; }

/* Responsive */
@media (max-width: 900px) {
    .mi-category-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .mi-category-card { aspect-ratio: 16 / 9; }
    .mi-category-card__body h3 { font-size: 13px; padding: 10px 14px 8px; }
    .mi-category-card__body p { font-size: 10px; padding: 5px 14px 8px; }
    .mi-cat-slide { flex: 0 0 calc(50% - 10px); }
}
@media (max-width: 560px) {
    .mi-category-grid { grid-template-columns: 1fr; gap: 6px; }
    .mi-category-card { aspect-ratio: 16 / 8; }
    .mi-cat-slide { flex: 0 0 calc(85% - 10px); }
}
@media (max-width: 420px) {
    .mi-category-card { aspect-ratio: 4 / 3; }
    .mi-cat-slide { flex: 0 0 calc(90% - 10px); }
}

.mi-category-card:hover img {
    transform: scale(1.05);
}

/* Dark gradient overlay — bottom-weighted */
.mi-category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.82) 0%,
        rgba(0,0,0,.3)  45%,
        rgba(0,0,0,.05) 100%
    );
    z-index: 1;
    transition: background .3s;
}

.mi-category-card:hover::after {
    background: linear-gradient(
        to top,
        rgba(0,0,0,.88) 0%,
        rgba(0,0,0,.4)  50%,
        rgba(0,0,0,.1)  100%
    );
}

/* Text body — sits above overlay at bottom-left */
.mi-category-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 0;
}

.mi-category-card__body h3 {
    margin: 0;
    padding: 14px 18px 10px;
    font-size: clamp(12px, 1.2vw, 16px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #fff;
    line-height: 1.2;
}

/* Description — red strip */
.mi-category-card__body p {
    margin: 0;
    padding: 7px 18px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--clr-red, #ff2b1b);
    line-height: 1.4;
    /* Truncate to one line */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cards without description: no red strip */
.mi-category-card__body:not(:has(p)) h3 {
    padding-bottom: 18px;
}

/* Responsive: 2 cols on tablet, 1 on mobile */
@media (max-width: 900px) {
    .mi-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap:10px!important;
    }
}
@media (max-width: 560px) {
    .mi-category-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .mi-category-card {
        aspect-ratio: 16 / 9;
    }
}
/* ─── §5  Back-to-top button ─────────────────────────────────────────────── */
/* Injected by main.js module 9. Circle, bottom-right. */
.mpt-back-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: var(--clr-black, #0a0a0a);
    color: #fff;
    border: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 888;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, background .18s, transform .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    font-family: inherit;
}
.mpt-back-top.is-visible { opacity: 1; pointer-events: auto; }
.mpt-back-top:hover      { background: var(--clr-red, #ff2b1b); transform: translateY(-2px); }

/* ─── §6  Active filter chips ────────────────────────────────────────────── */
/* Pills shown above product grid when filters are active. Each is a link. */
.mi-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.mi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--clr-gray, #0a0a0a);
    color: black;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 400;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .07em;
    border-radius: 0px;
    transition: background .15s;
    border:1px solid;
    border-color:var(--clr-gray);
}
.mi-chip:hover { background: var(--clr-white, #ff2b1b); }

/* ─── §7  Product video (supplemental) ───────────────────────────────────── */
/* Base styles are in plugin frontend.css — this just adds spacing overrides. */
.mi-video-header { gap: 20px; margin-bottom: 20px; }
