/* =============================================================================
   overflow-fix.css — Layout corrections (loads last, wins cascade)
   Covers: overflow-x prevention, hero width, section widths, sidebar collapse
   NOTE: color swatches → shop.css | mobile header → header.css
   ============================================================================= */

/* ─── Global overflow prevention ─────────────────────────────────────────── */
html, body     { overflow-x: hidden; max-width: 100%; }
.mpt-site-main { overflow-x: hidden; width: 100%; }

/* ─── Hero full-width ────────────────────────────────────────────────────── */
.mi-hero-slider,
.mi-hero {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* ─── Section width consistency ──────────────────────────────────────────── */
.mi-section,
.mi-category-grid,
.mi-usp-strip__inner {
    max-width: var(--max-w) !important;
    box-sizing: border-box !important;
}
.mi-products { width: 100%; }

/* ─── Filter panel collapsed state (inner panel only) ────────────────────── */
.mi-filter-panel.is-collapsed .mi-filter-body { display: none !important; }
.mi-filter-panel.is-collapsed .mi-filter-head { justify-content: center; padding: 8px 6px; }
.mi-filter-panel.is-collapsed .mi-filter-head__left { display: none; }
.mi-filter-panel.is-collapsed .mi-filter-head__right .mi-filter-reset { display: none; }
.mi-filter-panel.is-collapsed .mi-filter-collapse__icon { transform: rotate(180deg); }
.mi-filter-panel.is-collapsed { border: 1px solid var(--clr-border, #e5e5e5); }

/* ─── Mobile header final overrides (640px and below) ────────────────────── */
@media (max-width: 640px) {
    .mpt-mainbar__inner { height: 64px !important; display: flex !important; align-items: stretch !important; justify-content: space-between !important; padding: 0 !important; width: 100% !important; overflow: hidden !important; }
    a.mpt-logo { display: flex !important; align-items: center !important; padding-left: 10px !important; margin: 0 !important; flex: 0 0 auto !important; }
    .mpt-logo img, .mpt-logo__img { width: 118px !important; max-width: 118px !important; height: auto !important; display: block !important; }
    .mpt-nav { display: none !important; }
    .mpt-hamburger, .mpt-actions { flex-shrink: 0 !important; }
    .mpt-actions { display: flex !important; margin-left: auto !important; }
    .mpt-hamburger { width: 42px !important; min-width: 42px !important; height: 64px !important; display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: center !important; gap: 5px !important; padding: 0 !important; margin: 0 !important; background: #fff !important; }
    .mpt-hamburger span { width: 22px !important; height: 2px !important; background: #000 !important; display: block !important; }
    .mpt-action-btn { width: 48px !important; min-width: 48px !important; height: 64px !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; color: #000 !important; background: #fff !important; }
    .mpt-action-btn svg, .mpt-action-btn i { width: 20px !important; height: 20px !important; color: #000 !important; stroke: #000 !important; }
    .mpt-action-btn__label { display: none !important; }
    /* Krepšelis telefone: tik ikona + kiekio ženkliukas (suma netelpa) */
    .mpt-cart-btn { width: 56px !important; min-width: 56px !important; background: #000 !important; color: #fff !important; display: flex !important; align-items: center !important; justify-content: center !important; }
    .mpt-cart-btn, .mpt-cart-btn * { color: #fff !important; }
    .mpt-cart-btn svg, .mpt-cart-btn i { color: #fff !important; stroke: #fff !important; fill: none !important; }
    .mpt-cart-btn__icon-wrap { display: flex !important; }
    .mpt-cart-btn__total { display: none !important; }
    .mi-wishlist-count, .mpt-action-btn__badge { transform: scale(.9); }
}

@media (max-width: 400px) {
    a.mpt-logo { padding-left: 12px !important; }
    .mpt-logo img, .mpt-logo__img { width: 104px !important; max-width: 104px !important; }
    .mpt-hamburger { width: 42px !important; min-width: 42px !important; }
    .mpt-action-btn { width: 44px !important; min-width: 44px !important; }
    .mpt-cart-btn { width: 54px !important; min-width: 54px !important; }
}
