/* === Responsive hardening === */
/*
 * MilMit responsive release hardening — v0.36.0
 * Loaded after all feature styles so viewport fixes remain deterministic.
 */

/* Resilient media and long-content defaults. */
body.mm-site :where(img,video,canvas,svg,iframe){max-width:100%}
body.mm-site :where(h1,h2,h3,h4,h5,h6,p,li,td,th,label,.woocommerce-message,.woocommerce-info,.woocommerce-error){overflow-wrap:anywhere}
body.mm-site :where(input,select,textarea,button){max-width:100%}
.mm-main :where(.wp-block-embed,.wp-block-video,.wp-block-image,.wp-block-gallery,figure){max-width:100%}
.mm-main :where(pre,.wp-block-code){max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
.mm-main :where(.wp-block-table){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.mm-main :where(.wp-block-table table){min-width:560px}
.mm-main :where(.mm-home-code,.mm-search-filters,.mm-shop-category-strip,.mm-account-mobile-nav__items,.mm-dokan-dashboard-page .dokan-dash-sidebar ul.dokan-dashboard-menu,.mm-legal-nav nav){-webkit-overflow-scrolling:touch}

/* Prevent min-content sizing from pushing common two-column shells wider than viewport. */
.mm-main :where(
 .mm-home-hero__panel,.mm-home-services,.mm-contact,.mm-shop-layout,.mm-shop-hero,.mm-category-hero,
 .mm-product-hero,.mm-cart-layout,.mm-checkout-content form.woocommerce-checkout,.mm-account-content .woocommerce,
 .mm-auth,.mm-auth-choice__grid,.mm-blog-hero__grid,.mm-blog-featured,.mm-article-layout,.mm-search-hero__grid,
 .mm-404-hero__grid,.mm-services-hero__grid,.mm-service-hero__grid,.mm-services-decision,.mm-service-brief,
 .mm-service-faq,.mm-legal-hero__grid,.mm-legal-layout,.mm-footer__grid
)>*{min-width:0}

@media(max-width:1180px){
 .mm-shell{width:min(calc(100% - 28px),var(--mm-shell))}
 .mm-section{padding-block:84px}
 .mm-page-head{padding-top:76px}
}

@media(max-width:1024px){
 .mm-section{padding-block:76px}
 .mm-section__head{gap:18px}
 .mm-page-head h1{font-size:clamp(2rem,6vw,3.65rem)}
 .mm-cta{padding:28px}
 .mm-empty{padding:44px 28px}

 /* Header/search overlay must fit tablet landscape and browser UI. */
 .mm-search-panel__shell{max-height:100vh;max-height:100dvh}
 .mm-search-command{max-height:min(78vh,680px);max-height:min(78dvh,680px)}
 .mm-mobile__panel{max-height:100vh;max-height:100dvh;overscroll-behavior-y:contain}
}

@media(max-width:860px){
 .mm-section{padding-block:68px}
 .mm-page-head{padding:58px 0 30px}
 .mm-page-head--inside{padding:44px 0 24px}
 .mm-pagination{padding:30px 0 60px}

 /* Avoid tall sticky columns on compact tablets. */
 .mm-legal-nav,.mm-services-decision__copy,.mm-service-brief__copy,.mm-service-faq>header{max-height:none}
}

@media(max-width:767px){
 :root{--mm-r-xl:28px;--mm-r-lg:22px}
 .mm-shell{width:min(calc(100% - 24px),var(--mm-shell))}
 .mm-main{min-height:54vh}
 .mm-section{padding-block:58px}
 .mm-page-head{padding:48px 0 24px}
 .mm-page-head--inside{padding:40px 0 22px}
 .mm-section__head{gap:10px;margin-bottom:22px}
 .mm-section__head h2{font-size:clamp(1.55rem,7vw,2.15rem)}
 .mm-section__head p{margin-top:0}
 .mm-empty{padding:34px 18px;border-radius:20px}
 .mm-pagination{padding:24px 0 48px}
 .mm-pagination .nav-links{justify-content:center}
 .mm-pagination .page-numbers{min-width:44px;height:44px}

 /* iOS/Android form ergonomics: 16px prevents Safari focus zoom. */
 body.mm-site :where(
   input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]),
   select,textarea
 ){font-size:16px!important}
 body.mm-site :where(input,select,textarea){min-width:0}
 body.mm-site textarea{resize:vertical}
 .mm-btn{min-height:46px;white-space:normal;text-align:center}
 .mm-icon-btn{min-width:44px;min-height:44px}

 /* Long inline values must never cause viewport overflow. */
 .mm-price,.woocommerce-Price-amount,.mm-legal-email,.mm-auth-story__footer,.mm-account-profile__text,.mm-search-card__detail{overflow-wrap:anywhere}

 /* Search and drawer respect dynamic viewport + safe area. */
 .mm-search-panel__shell{padding-bottom:max(8px,env(safe-area-inset-bottom))}
 .mm-search-command{max-height:calc(100vh - 76px);max-height:calc(100dvh - 76px);overscroll-behavior:contain}
 .mm-mobile__panel{height:100vh;height:100dvh;padding-bottom:max(16px,env(safe-area-inset-bottom))}

 /* Home visual/code must scroll internally rather than widen the page. */
 .mm-home-browser{max-width:100%}
 .mm-home-browser__body{min-width:0}
 .mm-home-code{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}

 /* Product detail controls are easier to read/tap on phones. */
 .mm-product-spec small,.mm-product-purchase-notice p{font-size:.68rem}
 .mm-product-spec b,.mm-product-market-stat strong{font-size:.74rem}
 .mm-product-resource{min-height:44px}
 .mm-product__details :where(table,.shop_attributes){max-width:100%}

 /* Cart / checkout mobile text was below a professional readable floor. */
 .mm-cart-cell-label,.mm-cart-mobile-bar small,.mm-checkout-mobile-bar small{font-size:.7rem!important}
 .mm-cart-mobile-bar strong,.mm-checkout-mobile-bar strong{font-size:.82rem!important}
 .mm-checkout-item__name{font-size:.76rem!important}
 .mm-checkout-content :where(.woocommerce-message,.woocommerce-info,.woocommerce-error){font-size:.75rem!important}
 .mm-checkout-content :where(label,.form-row label){font-size:.76rem}

 /* Account mobile navigation and metadata. */
 .mm-account-profile__text strong{font-size:.8rem}
 .mm-account-profile__text span{font-size:.68rem}
 .mm-account-mobile-nav summary>span{font-size:.76rem}
 .mm-account-mobile-nav__items a{min-height:44px;font-size:.72rem}
 .mm-account-welcome p,.mm-account-vendor-card__copy p{font-size:.72rem}
 .mm-account-stat small{font-size:.66rem}
 .mm-account-actions-grid strong{font-size:.76rem}
 .mm-account-actions-grid small{font-size:.64rem}

 /* Dokan tables/forms stay inside the seller dashboard. */
 .mm-dokan-dashboard-page .dokan-dashboard-content :where(input,select,textarea){min-width:0;max-width:100%}
 .mm-dokan-dashboard-page .dokan-dashboard-content :where(table,.dokan-table){max-width:100%}
 .mm-dokan-dashboard-page .dokan-dash-sidebar ul.dokan-dashboard-menu{scroll-snap-type:x proximity}
 .mm-dokan-dashboard-page .dokan-dash-sidebar ul.dokan-dashboard-menu>li{scroll-snap-align:start}

 /* Article embeds and wide Gutenberg blocks remain readable. */
 .mm-article-content :where(iframe,video){width:100%}
 .mm-article-content :where(.wp-block-table){margin-inline:0}
 .mm-comments .comment-content{font-size:.9rem}
 .mm-comments label{font-size:.78rem}

 /* Services/legal action bars cannot collide with browser safe area. */
 .mm-service-mobile-cta{bottom:max(10px,env(safe-area-inset-bottom))}
 .mm-legal-nav nav{scroll-snap-type:x proximity}
 .mm-legal-nav nav a{scroll-snap-align:start}

 /* Footer buttons/links wrap cleanly on translated labels. */
 .mm-footer :where(a,button){overflow-wrap:anywhere}
}

@media(max-width:560px){
 .mm-section{padding-block:52px}
 .mm-page-head h1{font-size:clamp(1.9rem,10vw,2.8rem)}
 .mm-actions{gap:9px}

 /* Product cards/specs: two dense columns at ~400px were too cramped. */
 .mm-product-spec-grid{grid-template-columns:1fr!important}
 .mm-product-resource{flex:1 1 100%}

 /* Legal hero and generic CTAs use a single clear action column. */
 .mm-legal-hero .mm-actions,.mm-legal-cta__actions{grid-template-columns:1fr!important;width:100%}
 .mm-legal-hero .mm-btn,.mm-legal-cta__actions .mm-btn,.mm-legal-email{width:100%}

 /* Search filters remain usable without squeezing labels. */
 .mm-search-filters{overflow-x:auto;flex-wrap:nowrap;scroll-snap-type:x proximity}
 .mm-search-filters a{flex:0 0 auto;scroll-snap-align:start;white-space:nowrap}
}

@media(max-width:480px){
 .mm-shell{width:min(calc(100% - 20px),var(--mm-shell))}
 .mm-section{padding-block:48px}
 .mm-btn{width:100%;justify-content:center}
 .mm-actions{display:grid;grid-template-columns:1fr;width:100%}

 /* Keep icon-only header controls compact; they should not inherit full-width buttons. */
 .mm-header :where(.mm-icon-btn,.mm-header-tool,.mm-menu-toggle),
 .mm-mobile :where(.mm-icon-btn,.mm-header-tool,.mm-menu-toggle),
 .mm-feedback :where(button),
 .mm-product-toc :where(button),
 .mm-article-share :where(button),
 .mm-search-card__open{width:auto}

 .mm-auth-card,.mm-auth-story{padding-inline:16px}
 .mm-auth-choice{padding-inline:14px}
 .mm-account-page--guest .mm-account-hero__grid{grid-template-columns:1fr!important}
 .mm-account-page--guest .mm-account-hero__mark{display:none!important}

 .mm-product-market-strip{grid-template-columns:1fr!important}
 .mm-product-mobile-bar__price,.mm-cart-mobile-bar>div,.mm-checkout-mobile-bar>div{min-width:0;overflow:hidden}
 .mm-product-mobile-bar__price,.mm-cart-mobile-bar strong,.mm-checkout-mobile-bar strong{display:block;max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .mm-product-mobile-bar .mm-btn,.mm-cart-mobile-bar .mm-btn,.mm-checkout-mobile-bar .mm-btn{width:auto;flex:0 0 auto}

 .mm-search-card,.mm-search-card--page{min-width:0}
 .mm-search-card__body{min-width:0}

 .mm-service-brief__list li{grid-template-columns:38px minmax(0,1fr)}
 .mm-service-brief__list li>span{width:38px;height:38px}
 .mm-services-decision__items>a{grid-template-columns:42px minmax(0,1fr) 18px;gap:10px}
 .mm-services-decision__items>a>span:first-child{width:42px;height:42px}

 .mm-legal-alert,.mm-legal-note{grid-template-columns:32px minmax(0,1fr);gap:10px}
 .mm-legal-alert>span,.mm-legal-note>span{width:32px;height:32px}
 .mm-legal-block__head{grid-template-columns:30px 36px minmax(0,1fr)}
}

@media(max-width:380px){
 .mm-shell{width:min(calc(100% - 16px),var(--mm-shell))}
 .mm-page-head h1{font-size:1.95rem}
 .mm-home-hero__panel,.mm-services-cta,.mm-service-bottom{border-radius:22px}

 .mm-account-mobile-nav__items{grid-template-columns:1fr}
 .mm-account-stats{grid-template-columns:1fr}
 .mm-account-stat:last-child{grid-column:auto}
 .mm-account-actions-grid{grid-template-columns:1fr}
 .mm-account-actions-grid>a{min-height:104px}

 .mm-cart-mobile-bar,.mm-checkout-mobile-bar,.mm-product-mobile-bar{inset-inline:6px;padding-inline:7px}
 .mm-product-mobile-bar .mm-btn,.mm-cart-mobile-bar .mm-btn,.mm-checkout-mobile-bar .mm-btn{padding-inline:10px;font-size:.72rem}
 .mm-product-mobile-bar__price,.mm-cart-mobile-bar strong,.mm-checkout-mobile-bar strong{max-width:42vw}

 .mm-comment-list .children{padding-inline-start:8px}
}

/* Short landscape screens: sticky sidebars create trapped scrolling. */
@media(max-width:1024px) and (max-height:620px) and (orientation:landscape){
 .mm-product-page--sticky .mm-product-hero__summary,
 .mm-product-page--tabs-sticky .mm-product__details .woocommerce-tabs ul.tabs,
 .mm-checkout-content #order_review,
 .mm-services-decision__copy,.mm-service-brief__copy,.mm-service-faq>header,
 .mm-legal-nav{position:static!important;top:auto!important;max-height:none!important}
 .mm-search-command{max-height:calc(100vh - 28px);max-height:calc(100dvh - 28px)}
}

@media(hover:none) and (pointer:coarse){
 .mm-btn:hover,.mm-product-card:hover,.mm-post-card:hover,.mm-service-card:hover,.mm-search-card:hover{transform:none!important}
}

@media(prefers-reduced-motion:reduce){
 .mm-search-filters,.mm-legal-nav nav,.mm-dokan-dashboard-page .dokan-dash-sidebar ul.dokan-dashboard-menu{scroll-behavior:auto!important}
}

/* === Browser compatibility fallbacks === */
/**
 * MilMit cross-browser compatibility layer — v0.36.0
 * Loaded after responsive styles. Uses capability classes, never user-agent sniffing.
 */
html.mm-no-dialog dialog[open]{display:block;position:fixed;z-index:10020;margin:auto;inset:0}
html.mm-no-dialog .mm-product-video-dialog[open],
html.mm-no-dialog .mm-content-image-dialog[open],
html.mm-no-dialog .mm-feedback__dialog[open]{box-shadow:0 0 0 150vmax rgba(4,10,18,.72),0 30px 100px rgba(0,0,0,.42)}
html.mm-no-dialog .mm-product-toc__dialog[open]{display:block;z-index:10020}
html.mm-no-dialog.mm-toc-open body,
html.mm-no-dialog.mm-video-open body,
html.mm-no-dialog.mm-feedback-open body{overflow:hidden}

html.mm-no-backdrop-filter .mm-search-command,
html.mm-no-backdrop-filter .mm-services-map__node,
html.mm-no-backdrop-filter .mm-auth-benefits>div,
html.mm-no-backdrop-filter .mm-feedback__panel{background:var(--mm-elevated)}
html.mm-no-backdrop-filter .mm-product-video-dialog::backdrop,
html.mm-no-backdrop-filter .mm-content-image-dialog::backdrop,
html.mm-no-backdrop-filter .mm-product-toc__dialog::backdrop,
html.mm-no-backdrop-filter .mm-feedback__dialog::backdrop{background:rgba(4,10,18,.82)}

/* checkout.js mirrors radio state to .is-selected, so :has() is never required. */
html.mm-no-has .mm-checkout-content #payment ul.payment_methods li.is-selected{border-color:rgba(20,157,255,.45);background:linear-gradient(135deg,rgba(20,157,255,.08),rgba(32,213,255,.025))}

@supports (scrollbar-width:thin){
 .mm-product-toc__nav,.mm-search-filters,.mm-legal-nav nav,.mm-dokan-dashboard-page .dokan-dash-sidebar ul.dokan-dashboard-menu{scrollbar-width:thin;scrollbar-color:var(--mm-line-strong) transparent}
}

@media(forced-colors:active){
 html.mm-no-dialog dialog[open]{border:2px solid CanvasText;box-shadow:none}
 .mm-btn,.mm-icon-btn{forced-color-adjust:auto}
}

/* === Accessibility hardening === */
/* MilMit accessibility hardening — v0.37.0
 * WCAG 2.2 AA-oriented safeguards for focus, contrast, touch and assistive technology.
 * Loaded last by design so third-party WooCommerce/Dokan styles cannot silently remove them.
 */
html[data-mm-theme="light"]{
  --mm-focus:#0757E6;
  --mm-blue-text:#0757E6;
  --mm-gold-text:#7A641E;
  --mm-muted:rgba(16,21,28,.62);
  --mm-danger:#B4232F;
  --mm-success:#0F6D4F;
  --mm-gold-dark:#7A641E;
}
html[data-mm-theme="dark"]{
  --mm-focus:#20D5FF;
  --mm-blue-text:#20D5FF;
  --mm-gold-text:#E3C85D;
  --mm-danger:#FF7A84;
  --mm-success:#2FBF8F;
  --mm-gold-dark:#E3C85D;
}

/* A visible, high-contrast keyboard focus indicator across native and plugin controls. */
body.mm-site :where(
  a[href],
  button,
  input:not([type="hidden"]),
  select,
  textarea,
  summary,
  [role="button"],
  [tabindex]:not([tabindex="-1"])
):focus-visible{
  outline:3px solid var(--mm-focus)!important;
  outline-offset:3px!important;
}
body.mm-site :where(input,select,textarea):focus-visible{
  border-color:var(--mm-focus)!important;
}

/* Invalid states must not depend on colour alone: existing text/notices remain visible,
   while this ring gives the control itself a reliable visual state. */
body.mm-site :where(input,select,textarea)[aria-invalid="true"],
body.mm-site .woocommerce-invalid :where(input,select,textarea),
body.mm-site .wpcf7-not-valid{
  border-color:var(--mm-danger)!important;
  box-shadow:0 0 0 2px rgba(180,35,47,.14)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--mm-danger) 14%,transparent)!important;
}
body.mm-site .wpcf7-not-valid-tip,
body.mm-site .woocommerce-error,
body.mm-site .woocommerce-invalid-required-field label,
body.mm-site [role="alert"]{
  color:var(--mm-danger);
}

/* The skip target is focused programmatically; it should not draw a second page-sized ring. */
body.mm-site main#main:focus{outline:none!important}

/* WordPress screen-reader text must become visible when it is intentionally focusable. */
body.mm-site .screen-reader-text:focus{
  clip:auto!important;
  clip-path:none!important;
  width:auto!important;
  height:auto!important;
  overflow:visible!important;
  white-space:normal!important;
  position:fixed!important;
  inset-block-start:8px!important;
  inset-inline-start:8px!important;
  z-index:100000!important;
  margin:0!important;
  padding:10px 16px!important;
  border:2px solid var(--mm-focus)!important;
  border-radius:10px!important;
  background:var(--mm-surface)!important;
  color:var(--mm-heading)!important;
  box-shadow:var(--mm-shadow-card)!important;
}

/* Anchored headings should not disappear under the sticky header. */
body.mm-site :where(h1,h2,h3,h4,h5,h6)[id],
body.mm-site :target{
  scroll-margin-block-start:calc(var(--mm-header) + 20px);
}

/* Content images enhanced into lightbox controls need a clear affordance. */
body.mm-site [data-mm-a11y-lightbox="1"]{cursor:zoom-in}
body.mm-site [data-mm-a11y-lightbox="1"]:focus-visible{border-radius:var(--mm-r-sm)}

/* Native dialogs provide this behaviour. The fallback needs a reliable stacking context. */
html.mm-no-dialog body.mm-site dialog[open]{display:block}
html.mm-no-dialog body.mm-site dialog[open][aria-modal="true"]{z-index:10020}

/* Coarse-pointer devices deserve comfortable targets even where desktop density is higher. */
@media (pointer:coarse){
  body.mm-site :where(
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    select,
    summary
  ){
    min-block-size:44px;
  }
  body.mm-site :where(
    .mm-icon-btn,
    .mm-circle-link,
    .mm-pagination .page-numbers,
    .page-numbers,
    .mm-cart-qty button,
    .mm-cart-remove,
    .mm-shop-view button,
    .mm-feedback__types button,
    .mm-footer-social a,
    .woocommerce-pagination a,
    .woocommerce-pagination span,
    .dokan-pagination-container a,
    .dokan-pagination-container span
  ){
    min-inline-size:44px;
    min-block-size:44px;
  }
  body.mm-site :where(
    .mm-shop-check,
    .mm-auth-remember,
    .woocommerce-form__label-for-checkbox,
    label.checkbox,
    label[for^="payment_method_"]
  ){
    min-block-size:44px;
    display:flex;
    align-items:center;
  }
}

/* Windows High Contrast / forced-colour users must retain state and focus. */
@media (forced-colors:active){
  body.mm-site :where(
    a[href],button,input:not([type="hidden"]),select,textarea,summary,
    [role="button"],[tabindex]:not([tabindex="-1"])
  ):focus-visible{
    outline:3px solid Highlight!important;
    outline-offset:3px!important;
  }
  body.mm-site :where(input,select,textarea)[aria-invalid="true"],
  body.mm-site .woocommerce-invalid :where(input,select,textarea),
  body.mm-site .wpcf7-not-valid{
    border:2px solid Mark!important;
  }
}

@media (prefers-reduced-motion:reduce){
  body.mm-site :focus{scroll-behavior:auto}
}

/* A few legacy Woo/Auth rules intentionally use `outline:0!important`; beat those exact
   high-specificity selectors without spreading specificity hacks across the theme. */
body.mm-site .mm-checkout-content .form-row input.input-text:focus-visible,
body.mm-site .mm-checkout-content .form-row textarea:focus-visible,
body.mm-site .mm-checkout-content .form-row select:focus-visible,
body.mm-site .mm-account-page--guest .woocommerce .mm-auth-control input.input-text:focus-visible{
  outline:3px solid var(--mm-focus)!important;
  outline-offset:3px!important;
  border-color:var(--mm-focus)!important;
}
body.mm-site .mm-checkout-content .select2-container--focus .select2-selection--single,
body.mm-site .mm-checkout-content .select2-container--open .select2-selection--single{
  border-color:var(--mm-focus)!important;
  box-shadow:0 0 0 3px rgba(7,87,230,.16)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--mm-focus) 16%,transparent)!important;
}

@media (pointer:coarse){
  body.mm-site :where(.mm-auth-tabs a,.mm-search-chips a,.mm-home-keywords a){min-block-size:44px;display:flex;align-items:center}
}

/* Legacy compact search result markup predates the semantic text-colour token. */
html[data-mm-theme="light"] body.mm-site .mm-search-result span{color:var(--mm-blue-text)}

