/* =========================================================================
   Mobile overflow fixes (2026-11-09)
   Sitewide scan at 375px found content wider than the screen and cut off
   by body { overflow-x: clip }: long buttons, blog tables, a fixed-width
   video, grid cards that could not shrink. Loaded after main.css.
   Same file in both themes (kawaii-teddy / kawaii-merchandise).
   ========================================================================= */

/* Grid / flex children may shrink below their content width (the default
   min-width:auto lets one wide image or word push a 1fr column off screen). */
.wsa-cta-card > *,
.wsa-cta-card__gallery > *,
.dp-cta-block > *,
.km-shipping-page [style*="grid"] > * { min-width: 0; }

/* Media never wider than its column */
.entry-content img,
.blog-post__content img,
.policy-article img,
.page-content img { max-width: 100% !important; height: auto; } /* !important: some posts carry inline max-width:600px */

.entry-content iframe, .entry-content video, .entry-content embed, .entry-content object,
.blog-post__content iframe, .blog-post__content video,
.policy-article iframe, .policy-article video { max-width: 100%; }

.entry-content iframe[src*="youtube"], .entry-content iframe[src*="youtu.be"], .entry-content iframe[src*="vimeo"],
.blog-post__content iframe[src*="youtube"], .blog-post__content iframe[src*="youtu.be"], .blog-post__content iframe[src*="vimeo"],
.policy-article iframe[src*="youtube"], .policy-article iframe[src*="youtu.be"], .policy-article iframe[src*="vimeo"] {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

@media (max-width: 767px) {
    /* Buttons: wrap long labels instead of running off the screen */
    .btn {
        white-space: normal;
        max-width: 100%;
        text-align: center;
        justify-content: center;
        line-height: 1.3;
    }

    /* Wide tables in articles and pages scroll sideways inside their own box */
    .entry-content table,
    .blog-post__content table,
    .page-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.92em;
    }
    .entry-content table th, .entry-content table td,
    .blog-post__content table th, .blog-post__content table td,
    .page-content table th, .page-content table td { min-width: 96px; }

    /* Kawaii Merchandise shipping page: inline 2- and 3-column card grids */
    .km-shipping-page [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* Size-guide landing pages (giant / medium / small stuffed animals): the CTA strip's one
   column was forced wider than the card by two no-wrap buttons side by side, and the card's
   overflow:hidden cut off the text and the second button. (2026-11-10) */
@media (max-width: 1024px) {
    .gsa-cta-strip, .msa-cta-strip, .ssa-cta-strip { grid-template-columns: minmax(0, 1fr) !important; }
    .gsa-cta-strip__btns, .msa-cta-strip__btns, .ssa-cta-strip__btns { flex-wrap: wrap; }
    .gsa-cta-strip .btn-w, .gsa-cta-strip .btn-ow,
    .msa-cta-strip .btn-w, .msa-cta-strip .btn-ow,
    .ssa-cta-strip .btn-w, .ssa-cta-strip .btn-ow { white-space: normal; }
}
@media (max-width: 479px) {
    .gsa-cta-strip__btns > a, .msa-cta-strip__btns > a, .ssa-cta-strip__btns > a { flex: 1 1 100%; }
}

/* Landing-page sticky "Shop Now" bars: buttons had a coloured inline background but kept the
   default dark-brown .btn--primary text (contrast 1.1–3.4:1). White text, and a deeper shade
   of the page colour where white would not reach 4.5:1. Kawaii's gradient buttons already
   use white text, so this is a no-op there. (2026-11-10) */
#gsa-sticky-bar a.btn, #msa-sticky-bar a.btn, #ssa-sticky-bar a.btn, #dp-sticky-bar a.btn,
#rp-sticky-bar a.btn, #cap-sticky-bar a.btn, #cp-sticky-bar a.btn, #gcsa-sticky-bar a.btn { color: #fff !important; }
body:not(.theme-kawaii-merchandise) #ssa-sticky-bar a.btn[style*="background"] { background: #c2410c !important; border-color: #c2410c !important; }
body:not(.theme-kawaii-merchandise) #dp-sticky-bar a.btn[style*="background"]  { background: #15803d !important; border-color: #15803d !important; }
body:not(.theme-kawaii-merchandise) #rp-sticky-bar a.btn[style*="background"]  { background: #6d28d9 !important; border-color: #6d28d9 !important; }
body:not(.theme-kawaii-merchandise) #cp-sticky-bar a.btn[style*="background"]  { background: #be185d !important; border-color: #be185d !important; }

/* Product-page breadcrumb stays on ONE line on phones (2026-11-15). It fitted on one line in the
   fallback font but wrapped to two once Montserrat loaded, pushing the whole product down 28px
   (CLS 0.245 on the Giant Wolf page). Long product names are cut with an ellipsis instead. */
@media (max-width: 768px) {
    body.single-product .product-breadcrumb__list { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
    body.single-product .product-breadcrumb__item { flex: 0 0 auto; }
    body.single-product .product-breadcrumb__item:last-child { flex: 0 1 auto; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; }
}

/* Product page (all screen sizes): the selected variation's price now shows in the top price row
   (single-product.php, 2026-11-15), so hide WooCommerce's duplicate price under the dropdowns.
   Kept in the DOM (GA4 reads it). Quick view (.qv-atc-wrap) still shows it. */
.product-details .product-actions .woocommerce-variation-price { display: none; }
.product-details__price .kt-price-from { font-size: .55em; font-weight: 600; opacity: .75; margin-right: .15em; vertical-align: middle; }
