/* Digisire mobile product-card text guard (2026-11-04). Mobile + tablet only. */
@media (max-width: 991px) {
    html body #tbay-main-content .products .product-block.product-block,
    html body .elementor-3192 .products .product-block.product-block,
    html body .products .product-block.product-block,
    html body .ds-as-track .product-block.product-block {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    html body #tbay-main-content .products .product-block.product-block .caption,
    html body .products .product-block.product-block .caption,
    html body .ds-as-track .product-block.product-block .caption {
        height: auto !important;
        max-height: none !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    html body #tbay-main-content .products .product-block.product-block .name,
    html body #tbay-main-content .products .product-block.product-block h3.name,
    html body .products .product-block.product-block .name,
    html body .products .product-block.product-block h3.name,
    html body .ds-as-track .product-block.product-block .name,
    html body .ds-as-track .product-block.product-block h3.name {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 2px !important;
        margin: 0 0 6px 0 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    html body #tbay-main-content .products .product-block.product-block .name a,
    html body #tbay-main-content .products .product-block.product-block h3.name a,
    html body .products .product-block.product-block .name a,
    html body .products .product-block.product-block h3.name a,
    html body .ds-as-track .product-block.product-block .name a,
    html body .ds-as-track .product-block.product-block h3.name a,
    html body .products .product-block.product-block .woocommerce-loop-product__title {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 6 !important;
        line-clamp: 6 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        hyphens: none !important;
        line-height: 1.4 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }
    /* 2026-11-19 (owner: the model was cut off on phones): titles show up to 6 lines so the model at the end is always visible; cards in a row stretch to the tallest. */
    html body.tax-product_cat #tbay-main-content .products .product-block.product-block .name a,
    html body.post-type-archive-product #tbay-main-content .products .product-block.product-block .name a,
    html body.tax-product_cat .products .product-block.product-block .name a,
    html body.post-type-archive-product .products .product-block.product-block .name a {
        -webkit-line-clamp: 6 !important;
        line-clamp: 6 !important;
    }
    /* Sliders (home, related products) keep 3 lines: their side arrows sit at mid-card height and would cover a longer title */
    html body .ds-as-track .product-block.product-block .name a,
    html body .ds-as-track .product-block.product-block h3.name a,
    html body .owl-carousel .product-block.product-block .name a {
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
    }
    /* Price and buttons never push outside the card either */
    html body .products .product-block.product-block .price,
    html body .products .product-block.product-block .price-wrapper {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        white-space: normal !important;
        word-break: normal !important;
    }
    /* The homepage auto-slider must not clip the bottom of taller cards */
    html body .ds-as-track {
        align-items: stretch !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* ---- 2026-11-14 (owner: cards look spaced out, small text, duplicate bars) ---- */
@media (max-width: 767px) {
    /* listing cards: the picture box fits the picture instead of leaving an empty band above the name */
    html:not(#cg1):not(#cg2):not(#cg3) body:not(#cg4):not(#cg5):not(.home) .products:not(.ds-as-track) .product-block figure.image {
        height: 128px !important; min-height: 128px !important; max-height: 128px !important; padding-top: 4px !important; padding-bottom: 4px !important; margin-bottom: 4px !important;
    }
    html:not(#cg1):not(#cg2):not(#cg3) body:not(#cg4):not(#cg5):not(.home) .products:not(.ds-as-track) .product-block .block-inner {
        height: auto !important; min-height: 0 !important;
    }
    html:not(#cg1):not(#cg2):not(#cg3) body:not(#cg4):not(#cg5):not(.home) .products:not(.ds-as-track) .product-block figure.image > a.product-image {
        display: flex !important; align-items: center !important; justify-content: center !important; width: 100% !important; height: 100% !important; min-height: 0 !important; max-height: 100% !important; padding: 0 !important;
    }
    html:not(#cg1):not(#cg2):not(#cg3) body:not(#cg4):not(#cg5):not(.home) .products:not(.ds-as-track) .product-block figure.image > a.product-image img {
        width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important;
    }
    /* product page: one sticky buy bar, not two stacked */
    html:not(#cg1):not(#cg2):not(#cg3) body:not(#cg4):not(#cg5).single-product #ds-sticky-mobile-buy-bar { display: none !important; }
    html:not(#cg1):not(#cg2):not(#cg3) body:not(#cg4):not(#cg5).single-product h1.product_title { font-size: 24px !important; line-height: 1.3 !important; font-weight: 800 !important; }
}

/* 2026-11-17 layout stability on the product page (phones): the thumbnail strip (#ds-single-gallery-thumbs) is built by
   script about 3 s after the page shows and pushed the whole product information down by 85px (layout shift 0.34).
   When the gallery has two or more images, the room for the strip is reserved until it exists. */
@media (max-width: 991px) {
  body.single-product .woocommerce-product-gallery:has(.woocommerce-product-gallery__image ~ .woocommerce-product-gallery__image):not(:has(#ds-single-gallery-thumbs)) { padding-bottom: 97px !important; }
}

/* 2026-11-17 layout stability on the home page (phones): the category tiles (8 square tiles, 2 per row) are built by
   script; until then the block was ~345px high and then grew to its real height, pushing the page down (shift 0.17-0.49).
   Real height measured on 320px and 412px screens = 2 x block width + 98px. */
@media (max-width: 767px) {
  body.home .tbay-element-custom-image-list-tags { min-height: calc(200vw + 34px); }
}

/* 2026-11-17 shop page (phones): the share button and the filter drawer are added by script ~5 s in and pushed the product
   grid down by 31px (shift 0.096). Their final height is reserved until the script has marked them. */
@media (max-width: 767px) {
  html body.post-type-archive-product .woocommerce-products-header { min-height: 137px !important; }
  html body.post-type-archive-product .tbay-filter { min-height: 208px !important; }
}
