/* Tablet-only layout alignment with the approved Vercel reference. */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Shop: reference places the intro above a touch-scroll category row. */
    body.post-type-archive-product .mwd-shop-template .mwd-shop-hero {
        min-height: 0 !important;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-hero-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding: 100px 32px 28px !important;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-intro {
        width: 100% !important;
        min-height: 108px !important;
        padding-top: 4px !important;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-title .elementor-heading-title {
        font-size: 48px !important;
        line-height: .85 !important;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-subtitle {
        max-width: none !important;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-tiles {
        display: flex !important;
        grid-template-columns: none !important;
        align-items: center !important;
        gap: 16px !important;
        overflow-x: auto !important;
        overscroll-behavior-x: contain;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-tiles::-webkit-scrollbar {
        display: none;
    }

    body.post-type-archive-product .mwd-shop-template .mwd-shop-tile {
        flex: 0 0 40vw !important;
        width: 40vw !important;
        min-width: 140px !important;
        max-width: 180px !important;
        height: 22vh !important;
        min-height: 140px !important;
        max-height: 180px !important;
        aspect-ratio: auto !important;
        scroll-snap-align: start;
    }

    /* Footer: reference uses equal two-column blocks on tablet. */
    body .mwd-reference-footer {
        padding-bottom: 32px !important;
    }

    body .mwd-reference-footer .mwd-footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 40px !important;
        align-items: start !important;
    }

    body .mwd-reference-footer .mwd-footer-columns {
        display: contents !important;
    }

    /* Homepage: remove Elementor's extra margins to match reference rhythm. */
    body.home .mw-hero > .elementor-widget-heading {
        width: min(672px, 100%) !important;
    }

    body.home .mw-hero > .elementor-widget-heading .elementor-heading-title {
        margin-bottom: 0 !important;
    }

    body.home .mw-hero > .elementor-widget-text-editor {
        width: min(512px, 100%) !important;
    }

    body.home .mw-hero > .elementor-widget-text-editor p {
        margin-bottom: 0 !important;
        line-height: 28px !important;
    }

    body.home .mw-hero > .mw-hero-actions {
        width: min(672px, 100%) !important;
        padding-top: 8px !important;
    }

    /* Product: reference uses one 600px gallery image without tablet thumbs. */
    html body.single-product .mw-product-template .mwd-gallery-strip {
        display: none !important;
    }

    body.single-product .mw-product-template .mw-product-gallery,
    body.single-product .mw-product-template .mw-product-gallery .woocommerce-product-gallery,
    body.single-product .mw-product-template .mw-product-gallery .flex-viewport,
    body.single-product .mw-product-template .mw-product-gallery .woocommerce-product-gallery__wrapper,
    body.single-product .mw-product-template .mw-product-gallery .woocommerce-product-gallery__image {
        height: 600px !important;
        min-height: 600px !important;
    }

    body.single-product .mw-product-template .mw-product-gallery .woocommerce-product-gallery__image > a {
        width: calc(100vw - 81px) !important;
        height: 600px !important;
    }

    html body.single-product .mw-product-template .mw-product-gallery .woocommerce-product-gallery__image {
        justify-content: flex-start !important;
    }

    html body.single-product .mw-product-template .mw-product-gallery .mwd-gallery-strip-ready .woocommerce-product-gallery__image > a > img {
        width: calc(100vw - 145px) !important;
        height: 536px !important;
        margin: 32px !important;
        padding: 0 !important;
        object-fit: contain !important;
    }

    /* Footer: match the reference logo, hidden tablet socials and row rhythm. */
    body .mwd-reference-footer .mwd-footer-logo {
        width: 96px !important;
        height: 64px !important;
        margin-bottom: 0 !important;
    }

    body .mwd-reference-footer .mwd-footer-logo img {
        width: 96px !important;
        height: 64px !important;
        object-fit: contain !important;
    }

    body .mwd-reference-footer .mwd-footer-socials {
        display: none !important;
    }

    body .mwd-reference-footer .mwd-footer-columns > :nth-child(1) {
        min-height: 129px !important;
    }

    body .mwd-reference-footer .mwd-footer-columns > :nth-child(2),
    body .mwd-reference-footer .mwd-footer-columns > :nth-child(3) {
        min-height: 154px !important;
    }

    body .mwd-reference-footer .mwd-footer-columns > :nth-child(4) {
        min-height: 96px !important;
    }
}
