/**
 * Tablet-only tweaks (768–1024px, incl. iPad Pro portrait) when body.aps-tablet-redesign is set.
 */
@media (min-width: 768px) and (max-width: 1024px) {
    body.aps-tablet-redesign .aps-main-header-wrap--mobile-v2,
    body.aps-tablet-redesign .aps-main-header-wrap--mobile-v2 .aps-main-header {
        background-color: #054f59 !important;
    }

    body.aps-tablet-redesign .aps-main-header-wrap--mobile-v2 {
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    /* Keep compact header visible; desktop header row stays hidden through 1024px */
    body.aps-tablet-redesign .aps-header-desktop-start,
    body.aps-tablet-redesign .aps-header-desktop-actions,
    body.aps-tablet-redesign .top-header-extra-links {
        display: none !important;
    }

    body.aps-tablet-redesign .aps-mobile-header__brand {
        display: flex !important;
    }

    body.aps-tablet-redesign .aps-mobile-header__icon-group {
        display: flex !important;
    }

    /* Full-width white search band; cards narrowed and centered inside */
    body.aps-tablet-redesign .home-search-section {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    body.aps-tablet-redesign .home-search-section .home-search-card,
    body.aps-tablet-redesign .home-search-section #home-search-all-wrap {
        width: min(100% - 2.2rem, 28rem) !important;
        max-width: 28rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
    }

    body.aps-tablet-redesign .home-search-section #home-search-all-wrap .home-search-card--all {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.aps-tablet-redesign .home-hero-trust {
        max-width: 28rem;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Full-width white testimonial band */
    body.aps-tablet-redesign .home-mobile-testimonial.gal-testimonial {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    body.aps-tablet-redesign .home-mobile-testimonial .gal-quote {
        max-width: 22rem;
        margin-left: auto;
        margin-right: auto;
    }

    body.aps-tablet-redesign .home-mobile-testimonial__features {
        max-width: 28rem;
        margin-left: auto;
        margin-right: auto;
    }

    /* Testimonial sits flush against footer — no gradient gap from flex-grow or md:mt-12 */
    body.aps-tablet-redesign.homepage main {
        flex: 0 0 auto !important;
        min-height: 0 !important;
    }

    body.aps-tablet-redesign.homepage .aps-homepage-footer-wrap {
        margin-top: 0 !important;
    }

    /* Story stays on gradient — readable line length only */
    body.aps-tablet-redesign .home-mobile-story {
        max-width: 36rem;
        margin-left: auto;
        margin-right: auto;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        box-sizing: border-box;
    }

    /* Sticky bottom nav — compact viewports; override Tailwind md:hidden on tablet */
    body.aps-tablet-redesign.aps-home-sticky-nav .aps-mobile-bottom-nav {
        display: flex !important;
        max-width: 32rem;
    }

    /* Footer link columns — center the two-stack block (not full-width left offset) */
    body.aps-tablet-redesign .aps-footer__main {
        align-items: center !important;
    }

    body.aps-tablet-redesign .aps-footer__columns {
        justify-content: center !important;
        width: auto !important;
        max-width: min(100%, 40rem);
        margin-left: auto !important;
        margin-right: auto !important;
        gap: 9rem !important;
    }

    body.aps-tablet-redesign .aps-footer__col-stack {
        flex: 0 1 auto !important;
    }

    /* Footer bottom bar — stacked, centered (override desktop row / display:contents) */
    body.aps-tablet-redesign.aps-home-sticky-nav .aps-footer__bottom-wrap {
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.aps-tablet-redesign .aps-footer__bottom-wrap {
        padding-bottom: 0 !important;
    }

    body.aps-tablet-redesign .aps-footer__bottom {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 1.15rem !important;
        padding: 1.25rem 1.25rem 0.5rem !important;
        max-width: none !important;
        text-align: center !important;
    }

    body.aps-tablet-redesign .aps-footer__logo {
        width: 100% !important;
        justify-content: center !important;
    }

    body.aps-tablet-redesign .aps-footer__logos {
        justify-content: center !important;
        gap: 3.75rem !important;
        --aps-footer-logo-height: 3.25rem;
    }

    body.aps-tablet-redesign .aps-footer__logo-urg {
        height: 3.75rem;
    }

    body.aps-tablet-redesign .aps-footer__bottom-meta {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 34rem !important;
        margin: 0 auto !important;
        gap: 0.9rem !important;
        flex: 0 0 auto !important;
        text-align: center !important;
    }

    body.aps-tablet-redesign .aps-footer__copyright {
        text-align: center !important;
        white-space: normal !important;
        font-size: 0.96rem !important;
        line-height: 1.5 !important;
        letter-spacing: 0.03em !important;
    }

    body.aps-tablet-redesign .aps-footer__policy-link {
        font-size: 0.92rem;
        flex-shrink: 0;
        line-height: 1.35;
        padding-left: 0.1rem;
    }

    body.aps-tablet-redesign .aps-footer__bottom-meta-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 auto !important;
        gap: 0.75rem 1.25rem !important;
    }

    body.aps-tablet-redesign .aps-footer__socials {
        transform: none !important;
        padding-right: 0 !important;
    }

    /* Minimal footer — Tailwind md: row at 768px crams links + copyright; keep stacked on tablet */
    body.aps-tablet-redesign.aps-home-sticky-nav .aps-minimal-footer-wrap {
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap {
        padding-bottom: 0 !important;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap > div:first-of-type {
        justify-content: center !important;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap footer > div {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 1.15rem !important;
        margin-top: 1rem !important;
        padding-bottom: 0.5rem !important;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap footer .flex.flex-wrap.items-center {
        justify-content: center !important;
        gap: 0.6rem 1.15rem !important;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap footer .flex.flex-col.items-center.gap-3 {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.85rem !important;
        width: 100%;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap footer .text-sm.leading-relaxed {
        text-align: center !important;
    }

    body.aps-tablet-redesign .aps-minimal-footer-wrap footer .flex.items-center.justify-end.gap-4 {
        justify-content: center !important;
    }

    /* Same Iubenda rule as phone: never force nested [class*="iubenda-uspr"] to fixed */
    body.aps-tablet-redesign a.iubenda-cs-preferences-link,
    body.aps-tablet-redesign button.iubenda-cs-preferences-link,
    body.aps-tablet-redesign a.iubenda-cs-uspr-link,
    body.aps-tablet-redesign button.iubenda-cs-uspr-link,
    body.aps-tablet-redesign #iubenda-cs-banner.iubenda-cs-default-floating,
    body.aps-tablet-redesign .iubenda-tp-btn,
    body.aps-tablet-redesign #iubenda-cs-banner:not(.iubenda-cs-visible) {
        position: fixed !important;
        top: auto !important;
        left: auto !important;
        z-index: 54 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        margin: 0 !important;
        transform: none !important;
    }

    body.aps-tablet-redesign a.iubenda-cs-preferences-link,
    body.aps-tablet-redesign button.iubenda-cs-preferences-link,
    body.aps-tablet-redesign .iubenda-tp-btn,
    body.aps-tablet-redesign #iubenda-cs-banner.iubenda-cs-default-floating,
    body.aps-tablet-redesign #iubenda-cs-banner:not(.iubenda-cs-visible) {
        right: 0.75rem !important;
    }

    /* Icon-only USPR — hide garbled label text; keep CCPA icon */
    body.aps-tablet-redesign a.iubenda-cs-uspr-link,
    body.aps-tablet-redesign button.iubenda-cs-uspr-link,
    body.aps-tablet-redesign [class*="iubenda-uspr-btn"],
    body.aps-tablet-redesign [id^="iubenda-uspr"]:not([id^="iubenda-uspr"] *) {
        right: 3.55rem !important;
        width: 2.5rem !important;
        max-width: 2.5rem !important;
        height: 2.5rem !important;
        padding: 0.2rem !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        font-size: 0 !important;
        line-height: 0 !important;
        color: transparent !important;
        letter-spacing: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    body.aps-tablet-redesign a.iubenda-cs-uspr-link *,
    body.aps-tablet-redesign button.iubenda-cs-uspr-link *,
    body.aps-tablet-redesign [class*="iubenda-uspr"] *,
    body.aps-tablet-redesign [id*="iubenda-uspr"] * {
        position: static !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        float: none !important;
    }

    body.aps-tablet-redesign a.iubenda-cs-uspr-link span,
    body.aps-tablet-redesign button.iubenda-cs-uspr-link span,
    body.aps-tablet-redesign a.iubenda-cs-uspr-link [class*="caption"],
    body.aps-tablet-redesign button.iubenda-cs-uspr-link [class*="caption"],
    body.aps-tablet-redesign a.iubenda-cs-uspr-link [class*="label"],
    body.aps-tablet-redesign button.iubenda-cs-uspr-link [class*="label"],
    body.aps-tablet-redesign a.iubenda-cs-uspr-link [class*="text"],
    body.aps-tablet-redesign button.iubenda-cs-uspr-link [class*="text"],
    body.aps-tablet-redesign [class*="iubenda-uspr"] span,
    body.aps-tablet-redesign [class*="iubenda-uspr"] [class*="caption"],
    body.aps-tablet-redesign [class*="iubenda-uspr"] [class*="label"],
    body.aps-tablet-redesign [class*="iubenda-uspr"] [class*="text"],
    body.aps-tablet-redesign [id*="iubenda-uspr"] span {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        font-size: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        clip: rect(0, 0, 0, 0) !important;
    }

    body.aps-tablet-redesign a.iubenda-cs-uspr-link img,
    body.aps-tablet-redesign button.iubenda-cs-uspr-link img,
    body.aps-tablet-redesign a.iubenda-cs-uspr-link svg,
    body.aps-tablet-redesign button.iubenda-cs-uspr-link svg,
    body.aps-tablet-redesign [class*="iubenda-uspr"] img,
    body.aps-tablet-redesign [class*="iubenda-uspr"] svg,
    body.aps-tablet-redesign [id*="iubenda-uspr"] img,
    body.aps-tablet-redesign [id*="iubenda-uspr"] svg {
        display: block !important;
        width: 1.65rem !important;
        height: 1.65rem !important;
        max-width: 100% !important;
        max-height: 100% !important;
        font-size: initial !important;
        line-height: normal !important;
        color: initial !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        clip: auto !important;
    }

    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible a.iubenda-cs-preferences-link,
    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible button.iubenda-cs-preferences-link,
    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible a.iubenda-cs-uspr-link,
    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible button.iubenda-cs-uspr-link,
    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible #iubenda-cs-banner.iubenda-cs-default-floating,
    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible .iubenda-tp-btn,
    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible #iubenda-cs-banner:not(.iubenda-cs-visible) {
        bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) a.iubenda-cs-preferences-link,
    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) button.iubenda-cs-preferences-link,
    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) a.iubenda-cs-uspr-link,
    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) button.iubenda-cs-uspr-link,
    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) #iubenda-cs-banner.iubenda-cs-default-floating,
    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) .iubenda-tp-btn,
    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) #iubenda-cs-banner:not(.iubenda-cs-visible),
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) a.iubenda-cs-preferences-link,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) button.iubenda-cs-preferences-link,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) a.iubenda-cs-uspr-link,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) button.iubenda-cs-uspr-link,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) #iubenda-cs-banner.iubenda-cs-default-floating,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) .iubenda-tp-btn,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) #iubenda-cs-banner:not(.iubenda-cs-visible) {
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.aps-tablet-redesign #iubenda-cs-banner.iubenda-cs-visible {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        z-index: 70 !important;
        margin: 0 !important;
        transform: none !important;
    }

    body.aps-tablet-redesign.aps-home-sticky-nav.aps-bottom-nav-visible #iubenda-cs-banner.iubenda-cs-visible {
        bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.aps-tablet-redesign.aps-home-sticky-nav:not(.aps-bottom-nav-visible) #iubenda-cs-banner.iubenda-cs-visible,
    body.aps-tablet-redesign:not(.aps-home-sticky-nav) #iubenda-cs-banner.iubenda-cs-visible {
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }
}
