/* mobile: slideshow banner must show in full, no cropping */
@media only screen and (max-width: 767px) {
    .slider-revolution .tp-bgimg.defaultimg {
        background-size: contain !important;
    }
}

/* tablet: bigger, left-aligned logo while the search box is still visible (mobile-header layout, >= 769px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .header-compact .tt-mobile-header .tt-logo-container {
        justify-content: flex-start;
        height: 110px;
    }
    .header-compact .tt-mobile-header .tt-logo-container .tt-retina {
        max-height: 100px !important;
    }
}

/* mobile & tablet: equal-height product cards on home sections, all-sections
   listing, and plain grid rows (home sections without a slideshow render as
   `row row-cols-lg-N`, e.g. Best Seller) */
@media only screen and (max-width: 1024px) {
    .tt-product-listing > .tt-col-item {
        display: flex;
    }

    .tt-carousel-products.slick-slider .slick-track {
        display: flex;
    }

    .tt-carousel-products.slick-slider .slick-slide {
        height: auto;
    }

    /* slick sets the correct pixel width on the slide inline, but the
       Bootstrap col-* class also on that same element (slick adds
       "slick-slide" onto it, it doesn't wrap it) sets a flex-basis
       percentage which, once the track is flex, overrides slick's own
       width and shrinks the card to a fraction of the slide. Make the
       slide fall back to its inline width instead. */
    .tt-carousel-products.slick-slider .slick-slide {
        flex: 0 0 auto !important;
        max-width: none !important;
    }

    .tt-product-listing .tt-product,
    .tt-carousel-products .tt-product,
    [class*="row-cols-lg-"] .tt-product {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
    }

    .tt-product-listing .tt-description,
    .tt-carousel-products .tt-description,
    [class*="row-cols-lg-"] .tt-description {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
    }

    /* theme.css pins .tt-product-inside-hover to a fixed margin-top (0
       !important below 600px, 20px below 1024px) so the add-to-cart row
       sits right after the price block. That's what breaks alignment once
       price height varies (2-line discounted price vs 1-line) — match its
       !important so ours actually wins, and push to the bottom of the now
       flex-column card instead of a fixed offset. */
    .tt-product-listing .tt-product-inside-hover,
    .tt-carousel-products .tt-product-inside-hover,
    [class*="row-cols-lg-"] .tt-product-inside-hover {
        margin-top: auto !important;
    }
}

/* mobile & tablet: carousel prev/next arrows were pinned to the middle of the
   product image, not the card. main.js's alignmentArrowValue() measures
   .tt-image-box height and writes that as an inline `top` on .slick-arrow —
   inline styles beat our CSS unless we go !important, and a fixed px value
   only happens to match the image half-height, not the card's actual middle.
   Force true center of the card and let the browser keep it centered as
   content height changes. */
@media only screen and (max-width: 1024px) {
    .arrow-location-tab .slick-arrow {
        top: 50% !important;
        transform: translateY(-50%);
    }
}

/* mobile: the "SHOP" tab strip (Latest/Popular/Most Visited/Featured) wraps
   onto a ragged two-line grid at narrow widths with no clear active
   indicator besides a faint text-color change. Turn it into a single-row
   scrollable strip with a real active state. */
@media only screen and (max-width: 767px) {
    .tt-tabs-default {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-left: 0;
        padding-bottom: 14px;
        gap: 4px;
    }

    .tt-tabs-default::-webkit-scrollbar {
        display: none;
    }

    .tt-tabs-default li {
        flex: 0 0 auto;
    }

    .tt-tabs-default li > a {
        white-space: nowrap;
        padding: 6px 12px 10px;
        border-bottom: 2px solid transparent;
    }

    .tt-tabs-default li > a.active {
        border-bottom-color: var(--primary-color);
    }
}

/* mobile: theme.css has an unconditional `footer, footer>* { background-color:
   #fff !important }` near the end of the file that clobbers the dark mobile
   footer (.f-mobile-dark) for every store, leaving white-on-white text.
   Beat it with matching !important + higher specificity. */
@media only screen and (max-width: 789px) {
    .f-mobile-dark,
    .f-mobile-dark .tt-footer-col,
    .f-mobile-dark .tt-footer-center {
        background-color: #303030 !important;
    }

    .f-mobile-dark .tt-footer-col,
    .f-mobile-dark .tt-footer-center {
        color: #888888;
    }

    .f-mobile-dark .tt-footer-custom:last-child {
        background-color: #222222 !important;
    }

    .f-mobile-dark .tt-mobile-collapse .tt-collapse-title,
    .f-mobile-dark address span {
        color: #ffffff;
    }
}
