/* The mobile shell is shared by every storefront template. Desktop is untouched. */
.hdme-app-nav, .hdme-app-menu, .hdme-app-language, .hdme-app-fallback-header { display: none; }
.hdme-mobile-table { display:flow-root;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch; }
.hdme-mobile-table:focus-visible { outline:3px solid #427ed1;outline-offset:2px; }

@media (max-width: 1023px) {
    :root { --hdme-app-header-height: calc(200px + env(safe-area-inset-top, 0px)); --hdme-app-nav-height: calc(66px + env(safe-area-inset-bottom, 0px)); }
    html { scroll-padding-top: calc(var(--hdme-app-header-height) + 16px); scroll-padding-bottom: calc(var(--hdme-app-nav-height) + 16px); }
    body.hdme-scope { padding-top: var(--hdme-app-header-height) !important; padding-bottom: var(--hdme-app-nav-height) !important; }
    /* The announcement moves into the measured mobile header; no extra spacer. */
    body.hdme-scope.woocommerce-demo-store #wrapper { margin-top: 0 !important; }
    body.hdme-scope.admin-bar { --hdme-app-admin-offset: 46px; }
    body.hdme-scope .fusion-header-wrapper {
        position: fixed !important; inset: var(--hdme-app-admin-offset, 0px) 0 auto !important;
        width: 100% !important; z-index: 10000; background: #fff;
        box-shadow: 0 3px 16px #17365714; margin: 0 !important;
    }
    body.hdme-scope .hdme-app-fallback-header { display: block; }
    body.hdme-scope .hdme-app-fallback-header .fusion-standard-logo,
    body.hdme-scope .hdme-app-fallback-header .fusion-standard-logo img { display: block !important; }
    body.hdme-scope .hdme-app-fallback-header :is(.fusion-mobile-logo, .fusion-sticky-logo) { display: none !important; }
    body.hdme-scope .skip-link:focus { z-index: 10020; }
    body.hdme-scope .fusion-header { position: static !important; height: auto !important; padding: 8px 16px 10px !important; }
    body.hdme-scope .fusion-header .fusion-row { width: 100% !important; padding: 0 !important; margin: 0 !important; max-width: none !important; gap: 0 !important; }
    body.hdme-scope .fusion-header .fusion-logo { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 6px !important; width: 100% !important; }
    body.hdme-scope .fusion-header .fusion-logo > .fusion-clearfix,
    body.hdme-scope .fusion-header .fusion-logo::before,
    body.hdme-scope .fusion-header .fusion-logo::after { display: none !important; }
    body.hdme-scope .fusion-header .fusion-logo-link { min-width: 0; max-width: 100%; justify-self: center; grid-column: 1; grid-row: 1; order: 0; }
    body.hdme-scope .fusion-header .fusion-logo-link picture { max-height: none !important; }
    body.hdme-scope .fusion-header .fusion-logo img { width: 280px !important; max-width: 100% !important; max-height: 78px !important; object-fit: contain; height: auto !important; }
    /* Account and Cart remain available in the persistent bottom navigation. */
    body.hdme-scope .fusion-header .hdme-headeractions { display: none !important; }
    body.hdme-scope .fusion-header .hdme-searchbar { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; margin: 0; }
    body.hdme-scope .hdme-searchbar form { border-width: 1px; border-radius: 10px; background: #f5f8fd; }
    body.hdme-scope .hdme-searchbar input[type=search] { padding: 8px 12px !important; height: 38px; min-height: 38px; font-size: 16px !important; line-height: 1.25; }
    body.hdme-scope .hdme-searchbar button { padding: 0 16px !important; font-size: 14px; height: 38px; min-height: 38px; }
    body.hdme-scope .hdme-live-search { max-height: min(55dvh, 420px); left: 0; right: 0; }
    body.hdme-scope .fusion-header .fusion-main-menu,
    body.hdme-scope .fusion-mobile-menu-icons,
    body.hdme-scope .fusion-mobile-nav-holder,
    body.hdme-scope .fusion-sticky-header-wrapper,
    body.hdme-scope .fusion-header-sticky-height,
    body.hdme-scope .hdme-header-nav-placeholder,
    body.hdme-scope .woocommerce-store-notice.demo_store { display: none !important; }

    /* Reuse the existing animated announcement inside the fixed header. Its
       normal-flow height is included by the header ResizeObserver. */
    body.hdme-scope .fusion-header-wrapper > .woocommerce-store-notice.demo_store {
        display: flex !important; position: relative !important; top: 0 !important;
        height: calc(28px + env(safe-area-inset-top, 0px));
        min-height: calc(28px + env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px) !important;
        box-sizing: border-box; font-size: 11px !important;
    }
    body.hdme-scope.hdme-app-has-notice .fusion-secondary-header { padding-top: 0 !important; }

    /* Keep all six utility links available above the logo on touch screens.
       Scroll only this row, not the page; the existing header observer reserves
       its full height for content and focused form fields. */
    body.hdme-scope .fusion-secondary-header {
        display: block !important; min-height: 32px; padding: env(safe-area-inset-top, 0px) 0 0 !important;
        background: var(--hdme-blue-800); border: 0;
    }
    body.hdme-scope .fusion-secondary-header .fusion-row {
        display: block; width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
    }
    body.hdme-scope .fusion-secondary-header :is(.fusion-alignleft, .fusion-alignright) {
        display: block !important; float: none !important; width: 100%; min-width: 0; margin: 0 !important;
    }
    body.hdme-scope .fusion-secondary-header .fusion-secondary-menu {
        display: block !important; float: none; width: 100%; max-width: 100%;
        overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
        scrollbar-width: thin; scrollbar-color: #8aa8cf var(--hdme-blue-800);
        scroll-padding-inline: 12px;
    }
    body.hdme-scope .fusion-secondary-header .fusion-secondary-menu > ul {
        display: flex !important; flex-wrap: nowrap; width: max-content; min-width: 100%;
        margin: 0 !important; padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)) !important;
    }
    body.hdme-scope .fusion-secondary-header .fusion-secondary-menu > ul > li {
        display: block !important; flex: 0 0 auto; float: none; height: 32px !important; margin: 0 !important;
    }
    body.hdme-scope .fusion-secondary-header .fusion-secondary-menu > ul > li > a {
        display: inline-flex !important; align-items: center; white-space: nowrap;
        height: 32px !important; min-height: 32px !important; padding: 6px 12px !important;
        font-size: 13px; line-height: 1.3 !important; color: #fff;
    }
    body.hdme-scope .fusion-secondary-header a:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

    .hdme-app-nav {
        position: fixed; inset: auto 0 0; z-index: 10010;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        padding: 4px max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
        min-height: var(--hdme-app-nav-height); box-sizing: border-box;
        background: #fff; border-top: 1px solid #c8d9ec; box-shadow: 0 -4px 24px #17365712;
    }
    .hdme-app-nav .hdme-app-nav__item {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 5px 2px; min-height: 58px; border-radius: 12px; color: #53657d;
        font: 600 11px/1.2 var(--hdme-font-body); text-decoration: none; -webkit-tap-highlight-color: transparent;
    }
    .hdme-app-nav .hdme-app-nav__item[aria-current=page], .hdme-app-nav .hdme-app-nav__item[aria-expanded=true] { background: #edf3fc; color: #245da6; }
    .hdme-app-nav__icon { position: relative; display: inline-flex; padding: 0 8px; }
    .hdme-app-nav .hdme-cartcount { top: -5px; right: -4px; font-size: 10px; min-width: 17px; height: 17px; line-height: 17px; }
    .hdme-app-nav a:focus-visible, .hdme-app-menu :is(a, button, summary):focus-visible { outline: 3px solid #427ed1; outline-offset: -3px; }
    .hdme-app-menu-open { position: fixed !important; top: var(--hdme-app-scroll) !important; width: 100%; overflow: hidden; }
    .hdme-app-menu[open] {
        display: flex; flex-direction: column; position: fixed; inset: 0; margin: 0 0 0 auto;
        width: min(100%, 480px); max-width: 100%; height: 100vh; height: 100dvh; max-height: 100dvh;
        padding: 0; border: 0; background: #f1f6fd; color: #193b65; box-sizing: border-box;
    }
    .hdme-app-menu::backdrop { background: #102b4f80; }
    .hdme-app-menu__head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 16px; border-bottom: 1px solid #d3e0ef; background: white; }
    .hdme-app-menu__head p { margin: 0 0 4px; color: #5c718c; font-size: 12px; }
    .hdme-app-menu__head h2 { font: 700 22px/1.3 var(--hdme-font-head); margin: 0; color: #193b65; }
    .hdme-app-menu__head button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #ccdaeb; border-radius: 50%; background: #f3f7fc; color: #193b65; cursor: pointer; }
    .hdme-app-menu__body { padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
    .hdme-app-menu h3 { font: 700 17px/1.4 var(--hdme-font-head); color: #193b65; margin: 24px 0 12px; }
    .hdme-app-menu__quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .hdme-app-menu__quick a { display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 68px; border-radius: 12px; background: #285994; color: white; font: 600 14px/1.4 var(--hdme-font-body); }
    .hdme-app-menu__quick svg { flex-shrink: 0; }
    .hdme-app-menu #hdme-app-category-search { width: 100%; height: 46px; padding: 10px 14px; border: 1px solid #afc5e2; background: white; border-radius: 10px; font: 400 16px/1.5 var(--hdme-font-body); color: #193b65; margin-bottom: 12px; }
    .hdme-app-departments, .hdme-app-menu__links { background: white; border: 1px solid #d4e0ef; border-radius: 14px; overflow: hidden; }
    .hdme-app-department + .hdme-app-department, .hdme-app-menu__links a + a { border-top: 1px solid #e4edf7; }
    .hdme-app-menu a { text-decoration: none; }
    .hdme-app-department > a, .hdme-app-department summary, .hdme-app-menu__links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 16px; color: #203f66; font: 500 15px/1.45 var(--hdme-font-body); cursor: pointer; overflow-wrap: anywhere; }
    .hdme-app-department summary { list-style: none; }
    .hdme-app-department summary::-webkit-details-marker { display: none; }
    .hdme-app-department__chevron { font-size: 24px; line-height: 1; transition: transform 150ms; }
    .hdme-app-department details[open] > summary .hdme-app-department__chevron { transform: rotate(90deg); }
    .hdme-app-department.is-current > a, .hdme-app-department.is-current summary { background: #edf3fc; color: #245da6; font-weight: 700; }
    .hdme-app-department ul { list-style: none; padding: 0 12px 12px; margin: 0; background: #f7faff; }
    .hdme-app-department li a { display: flex; align-items: center; min-height: 46px; padding: 10px 12px; color: #355576; font: 400 14px/1.5 var(--hdme-font-body); }
    .hdme-app-department li a[aria-current=page], .hdme-app-department li .hdme-app-department__all { color: #245da6; font-weight: 700; }
    .hdme-app-menu__notice { padding: 16px; font-size: 13px; line-height: 1.6; background: #e2ecf9; border-radius: 12px; margin: 18px 0 0; }
    .hdme-app-menu [hidden] { display: none !important; }

    /* Shared mobile rhythm, with content kept readable instead of clipped. */
    body.hdme-scope .hdme-container { width: calc(100% - 32px); max-width: 100%; padding-inline: 0; }
    body.hdme-scope main.hdme-home > section { margin-inline: 0; padding-inline: 0; }
    body.hdme-scope #main { padding-inline: 0 !important; }
    body.hdme-scope #main > .fusion-row { max-width: 100%; }
    body.hdme-scope #content { min-width: 0; }
    body.hdme-scope .hdme-page-shell { padding-top: 20px !important; }
    body.hdme-scope .hdme-page-hero h1, body.hdme-scope .hdme-archive__title { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; }
    body.hdme-scope .hdme-page-hero nav, body.hdme-scope .hdme-archive__crumbs { font-size: 12px; margin-bottom: 12px; }
    body.hdme-scope .hdme-page-panel { border-radius: 16px; }
    body.hdme-scope .hdme-archive__intro { overflow-wrap: anywhere; }
    body.hdme-scope .hdme-archive__intro :is(.fg-container, .container, img, iframe) { max-width: 100% !important; }
    body.hdme-scope :is(.hdme-page-panel, .hdme-product, .hdme-archive) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]), select, textarea),
    body.hdme-scope .woocommerce :is(input.input-text, select, textarea), body.hdme-scope .nf-form-content :is(input:not([type=submit]), select, textarea) { font-size: 16px !important; max-width: 100%; }
    /* The root scroll padding already reserves the fixed header and bottom nav.
       Repeating those offsets here pushes focused controls under the nav in landscape. */
    body.hdme-scope :is(input, select, textarea, button, a, summary) { scroll-margin-top: 12px; scroll-margin-bottom: 18px; }
    body.hdme-scope .hdme-filter-toggle { min-height: 46px; border-radius: 10px; }
    body.hdme-scope .hdme-archive__body { gap: 16px; }
    /* Tablet shoppers need the same collapsible filters as phone shoppers. */
    body.hdme-scope .hdme-archive__body { grid-template-columns: minmax(0, 1fr); }
    body.hdme-scope .hdme-archive__aside { position:static;max-height:none;overflow:visible;padding:0; }
    body.hdme-scope .hdme-filter-toggle { display: inline-flex; min-height: 44px; margin: 0; }
    body.hdme-scope .hdme-archive__filters { display: none !important; }
    body.hdme-scope .hdme-archive__filters.is-open { display: block !important; margin-top: 16px; }
    body.hdme-scope .hdme-pcard__quick { position:static;opacity:1;pointer-events:auto;transform:none;min-height:44px;width:100%;margin-top:4px;padding:6px;font-size:13px; }
    body.hdme-scope .hdme-pcard__form { grid-template-columns:132px minmax(0,1fr); }
    body.hdme-scope .hdme-pcard__qty-control { width:132px;max-width:100%;grid-template-columns:44px minmax(0,1fr) 44px; }
    body.hdme-scope .hdme-pcard__qty-step { width:44px;min-height:44px; }
    body.hdme-scope .hdme-pcard__qty { width:100%!important;min-height:44px; }
    body.hdme-scope .hdme-hero__viewport { padding-bottom:56px; }
    body.hdme-scope :is(.hdme-hero__nav,.hdme-hero__pause) { width:44px;height:44px;min-width:44px; }
    body.hdme-scope .hdme-product__gallery .flex-direction-nav a { width:44px!important;height:44px!important;line-height:44px; }
    body.hdme-scope.woocommerce-cart .woocommerce-cart-form .quantity { width:134px!important;min-width:134px!important;height:46px; }
    body.hdme-scope.woocommerce-cart .woocommerce-cart-form .quantity :is(.minus,.plus,.qty) { flex:0 0 44px!important;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important; }
    body.hdme-scope.woocommerce-cart .woocommerce-cart-form .product-remove a.remove { width:44px;height:44px; }
    body.hdme-scope .hdme-archive__toolbar { gap: 8px; }
    body.hdme-scope .hdme-archive__count { margin: 0; }
    body.hdme-scope .hdme-archive__toolbar { display: none; }
    .hdme-app-sort { display: block; margin: 0 0 16px; }
    .hdme-app-sort .hdme-archive__count { margin-bottom: 10px; }
    .hdme-app-sort__form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
    .hdme-app-sort label { width: 100%; font-size: 13px; font-weight: 600; color: #3d5876; }
    .hdme-app-sort select { flex: 1; min-width: 0; width: auto; min-height: 44px; padding: 8px 12px; border: 1px solid #b7cce6; border-radius: 10px; background: white; font-size: 16px; }
    .hdme-app-sort button { min-height: 44px; min-width: 58px; padding: 8px 12px; background: #3366ad; border: 0; border-radius: 10px; color: white; font-size: 14px; }
    body.hdme-scope .woocommerce-ordering select { min-height: 44px; font-size: 16px; max-width: 100%; }
    body.hdme-scope :is(.hdme-insurance-form, .hdme-directory__contact, .hdme-contact-form) :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]), textarea, select),
    body.hdme-scope .wpcf7 textarea { font-size: 16px !important; }
    body.hdme-scope .hdra-form :is(input:not([type=checkbox]):not([type=hidden]),textarea,select) { font-size:16px; }
    body.hdme-scope .hdra-upload input::file-selector-button { min-height:44px; }
    body.hdme-scope .hdra-help { top:calc(var(--hdme-app-header-height) + 16px); }
    .hdme-mobile-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hdme-mobile-table:focus-visible { outline: 3px solid #427ed1; }
    body.hdme-scope .hdme-product__tabs .woocommerce-tabs ul.tabs { overflow-x: auto; flex-wrap: nowrap; }
    body.hdme-scope .hdme-sticky-cart { bottom: calc(var(--hdme-app-nav-height) + 8px); z-index: 9995; }
    body.hdme-scope.hdme-sticky-cart-visible { padding-bottom: calc(var(--hdme-app-nav-height) + 88px) !important; }
    body.hdme-scope .hdme-chat-launcher { bottom: calc(var(--hdme-app-nav-height) + 12px) !important; right: 12px; width: 46px; height: 46px; }
    body.hdme-scope.hdme-sticky-cart-visible .hdme-chat-launcher { bottom: calc(var(--hdme-app-nav-height) + 90px) !important; }
    body.hdme-scope .hdme-review-rail { display: none; } /* Reviews remain in the product tabs. */
    body.hdme-scope #toTop { display: none !important; }
    body.hdme-scope :is(#google_language_translator, .goog-te-gadget, .glt-translate-trigger, #glt-translate-trigger) { bottom: calc(var(--hdme-app-nav-height) + 10px) !important; }
    body.hdme-scope.hdme-sticky-cart-visible :is(#google_language_translator, .goog-te-gadget, .glt-translate-trigger, #glt-translate-trigger) { bottom: calc(var(--hdme-app-nav-height) + 90px) !important; }
    body.hdme-scope .hdme-drawer__panel { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
    body.hdme-scope .hdme-drawer__foot { max-height: 45dvh; overflow-y: auto; }
    body.hdme-scope .fusion-footer-widget-area a { display: inline-flex; align-items: center; min-height: 40px; }
    .hdme-app-language { display: block; margin-top: 16px; }
    body.hdme-scope .hdme-app-language #glt-translate-trigger { position: static !important; display: inline-flex; align-items: center; min-height: 44px; margin: 0; border-radius: 10px; box-shadow: none; cursor: pointer; }
    body.hdme-scope.hdme-app-keyboard .hdme-app-nav,
    body.hdme-scope.hdme-app-keyboard .hdme-sticky-cart,
    body.hdme-scope.hdme-app-keyboard .hdme-chat-launcher { visibility: hidden; pointer-events: none; }
}

@media (min-width: 783px) and (max-width: 1023px) {
    body.hdme-scope.admin-bar { --hdme-app-admin-offset: 32px; }
}

@media (max-width: 600px) {
    body.hdme-scope .hdme-section { padding-block: 28px; }
    body.hdme-scope .hdme-section__head { margin-bottom: 20px; }
    body.hdme-scope .hdme-section__title { font-size: 26px; }
    body.hdme-scope .hdme-tile__link { padding: 18px 10px; }
    body.hdme-scope #content.hdme-page-shell { width: calc(100% - 24px) !important; }
    body.hdme-scope .hdme-page-panel { padding: 18px 14px; }
    body.hdme-scope .hdme-page-help { padding: 20px 16px; }
    body.hdme-scope .hdme-category-path a { display: inline-flex; align-items: center; min-height: 44px; }
    body.hdme-scope .hdme-category-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.hdme-scope .hdme-category-tiles__summary { display: none; } /* Names/counts link to the full next level. */
    body.hdme-scope .hdme-category-tiles__title { font-size: 14px; }
    body.hdme-scope .hdme-category-more summary { min-height: 44px; }
    body.hdme-scope .hdme-product__summary { min-width: 0; }
    body.hdme-scope .hdme-product__title { font-size: 26px; overflow-wrap: anywhere; }
    body.hdme-scope .hdme-grid--archive { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    body.hdme-scope .hdme-pcard { min-width: 0; }
    body.hdme-scope .hdme-pcard__media { padding: 8px; }
    body.hdme-scope .hdme-pcard__media img { max-height: 180px; }
    body.hdme-scope .hdme-pcard__body { padding: 0 10px 12px; }
    body.hdme-scope .hdme-pcard__title { font-size: 14px; }
    body.hdme-scope .hdme-pcard__rating { flex-wrap: wrap; gap: 4px; }
    body.hdme-scope .hdme-pcard__actions { padding: 0 10px 12px; }
    body.hdme-scope .hdme-pcard__form { grid-template-columns: 1fr; }
    body.hdme-scope .hdme-pcard__qty-control { width: 100%; grid-template-columns: 44px minmax(0, 1fr) 44px; }
    body.hdme-scope .hdme-pcard__qty-step { width: 44px; }
    body.hdme-scope .hdme-pcard__qty { width: 100% !important; }
    body.hdme-scope .hdme-pcard__quick { position: static; opacity: 1; pointer-events: auto; transform: none; min-height: 44px; width: 100%; margin-top: 4px; padding: 6px; font-size: 13px; }
    body.hdme-scope .hdme-pcard__actions .hdme-btn { min-height: 44px; padding-inline: 6px; font-size: 13px; }
    body.hdme-scope .woocommerce-MyAccount-navigation,
    body.hdme-scope .woocommerce-MyAccount-content { float: none; width: 100%; }
    body.hdme-scope .woocommerce-MyAccount-navigation { margin-bottom: 20px; }
    body.hdme-scope .woocommerce-MyAccount-navigation a { min-height: 46px; }
}

@media (max-width: 359px) {
    body.hdme-scope .hdme-grid--archive { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .hdme-app-department__chevron { transition: none; }
}
