/* Mars 1.6.1 — horizontal overflow / right-shift fix */

/* Keep every newly added home component inside the theme container. */
.mars-home,
.mars-product-section,
.mars-carousel-shell,
.mars-flash-sale,
.mars-flash-sale__head,
.mars-flash-sale__layout,
.mars-flash-featured,
.mars-flash-featured__image,
.mars-flash-featured__content,
.mars-flash-sale__products,
.mars-flash-small-card,
.mars-section-title,
.mars-section-actions{
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
}

/* The featured sale card previously used hard minimum grid widths (260px + 300px).
   Around tablet/desktop breakpoints this could make the grid wider than its parent. */
.mars-flash-featured{
    grid-template-columns:minmax(0,.93fr) minmax(0,1.07fr);
}

/* Ticker content is intentionally wider than the screen; only its viewport may be full width. */
.mars-topbar--ticker,
.mars-topbar-ticker{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow:hidden;
}
.mars-topbar-ticker__track{
    flex:0 0 auto;
}

/* Carousels scroll inside themselves instead of contributing their track width to the page. */
.mars-product-section .mars-carousel-shell,
.mars-flash-sale__products{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-x:contain;
}
.mars-product-section .mars-carousel-shell{
    overflow:hidden!important;
}

/* Long titles/menu labels must shrink or wrap instead of increasing viewport width. */
.mars-section-title>*,
.mars-flash-sale__head>*{
    min-width:0;
}
.mars-section-title h2,
.mars-flash-sale__head h2,
.mars-flash-sale__head p,
.mars-flash-small-card h3,
.mars-flash-featured h3{
    overflow-wrap:anywhere;
}

@media (max-width:1180px){
    .mars-flash-featured{
        grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
    }
    .mars-flash-sale__products{
        width:100%;
        max-width:100%;
    }
}

@media (max-width:700px){
    .mars-flash-featured{
        grid-template-columns:minmax(0,1fr);
    }
    .mars-flash-sale__head{
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        column-gap:10px;
        row-gap:8px;
        width:100%;
    }
    .mars-flash-sale__head-actions{
        min-width:0;
        max-width:100%;
        gap:8px;
    }
    .mars-section-title{
        min-width:0;
        max-width:100%;
    }
}

/* Final viewport guard for third-party/Woo content that may contain a long unbroken value.
   Existing horizontal rails remain independently scrollable. */
html,body{
    max-width:100%;
    overflow-x:hidden!important;
}
