/* Native popups need an explicit colour pair, not just the closed field colour. */
html {
  --native-option-ink: #f1f4f8;
  --native-option-surface: #19212b;
  --native-option-muted: #b8c2cf;
}
html[data-theme="light"] {
  --native-option-ink: #222c38;
  --native-option-surface: #ffffff;
  --native-option-muted: #536172;
}
html select { color-scheme: dark; }
html[data-theme="light"] select { color-scheme: light; }
html select :is(option, optgroup) {
  color: var(--native-option-ink) !important;
  background-color: var(--native-option-surface) !important;
}
html select option:checked { color: HighlightText !important; background-color: Highlight !important; }
html select option:disabled { color: var(--native-option-muted) !important; }
html[data-theme="light"] .detail-doc-links a { color: #af221d !important; }
html .article-content pre { max-width: 100%; overflow-x: auto; }
html .article-table-wrap { max-width: 100%; overflow-x: auto; }
html .ups-selector-dialog { max-width: calc(100vw - 20px); }
html .ups-selector-card { min-width: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; }
html .ups-selector-fields label,
html .ups-selector-fields select { min-width: 0; max-width: 100%; }
html .ups-selector-actions { flex-wrap: wrap; }
html .ups-selector-actions button { min-width: 0; max-width: 100%; white-space: normal; }
@media (forced-colors: active) {
  html select :is(option, optgroup) { color: CanvasText !important; background: Canvas !important; }
  html select option:checked { color: HighlightText !important; background: Highlight !important; }
}

/* Shared mobile chrome. Values are measured once per resize, not on scroll. */
@media (max-width: 860px) {
  :root {
    --mobile-system-font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
    --mobile-bottom-reserve: calc(78px + env(safe-area-inset-bottom, 0px));
    --mobile-buy-reserve: 0px;
    --mobile-vh: 100dvh;
    --mobile-vtop: 0px;
    --mobile-ink: #f1f4f8;
    --mobile-secondary: #b8c2cf;
    --mobile-panel: #19212b;
    --mobile-glass: rgba(25, 33, 43, .88);
    --mobile-border: rgba(255, 255, 255, .19);
    --mobile-accent: #ffc0ba;
    --mobile-accent-fill: rgba(255, 133, 121, .14);
    --mobile-toast: #edf3fa;
    --mobile-toast-ink: #17202c;
  }
  :root[data-theme="light"] {
    --mobile-ink: #222c38;
    --mobile-secondary: #536172;
    --mobile-panel: #fafbfc;
    --mobile-glass: rgba(250, 251, 253, .91);
    --mobile-border: rgba(32, 47, 67, .17);
    --mobile-accent: #a92923;
    --mobile-accent-fill: rgba(185, 44, 34, .08);
    --mobile-toast: #202c3b;
    --mobile-toast-ink: #fff;
  }
  html { scroll-padding-bottom: calc(var(--mobile-bottom-reserve) + var(--mobile-buy-reserve) + 16px); }
  body:not(.cms-page):not(.admin-page) {
    font-family: var(--mobile-system-font) !important;
    padding-bottom: calc(var(--mobile-bottom-reserve) + var(--mobile-buy-reserve) + 16px) !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body:not(.cms-page):not(.admin-page) :is(button, input, select, textarea, dialog, .toast) {
    font-family: var(--mobile-system-font) !important;
    letter-spacing: normal;
  }
  body:not(.cms-page):not(.admin-page) :is(h1, h2, h3, strong, b, button, select) { font-weight: 600; }
  body:not(.cms-page):not(.admin-page) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
    font-size: 16px !important;
    min-height: 44px;
    max-width: 100%;
  }
  :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--mobile-accent); outline-offset: 3px; }
  body:not(.cms-page):not(.admin-page) :is(.primary, .secondary, .icon-button, .product-action-icon, summary) { min-height: 44px; }

  /* Opaque fallback first; blur is an enhancement, never a readability requirement. */
  body:not(.cms-page):not(.admin-page) .mobile-contact-bar,
  body.mobile-app-ready .mobile-contact-bar {
    position: fixed !important;
    inset: auto max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)) !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    width: auto !important;
    height: auto !important;
    min-height: 62px;
    max-width: 600px;
    margin-inline: auto;
    gap: 2px;
    padding: 5px;
    border: 1px solid var(--mobile-border) !important;
    border-radius: 26px !important;
    color: var(--mobile-ink) !important;
    background: var(--mobile-panel) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 28px rgba(0,0,0,.16) !important;
    transform: none !important;
    z-index: 40 !important;
  }
  body:not(.cms-page):not(.admin-page) .mobile-contact-bar :is(a, button),
  body.mobile-app-ready .mobile-contact-bar :is(a, button) {
    position: relative;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 0 !important;
    min-height: 50px !important;
    height: auto !important;
    padding: 4px 2px !important;
    gap: 3px;
    border: 0 !important;
    border-radius: 21px !important;
    color: var(--mobile-ink) !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: none;
    transform: none !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.2;
  }
  body:not(.cms-page):not(.admin-page) .mobile-contact-bar :is(a, button) > span:not(.mobile-action-icon) {
    color: inherit !important;
    font: inherit !important;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .mobile-contact-bar .mobile-action-icon { width: 22px !important; height: 22px !important; }
  .mobile-contact-bar .mobile-action-icon svg { width: 22px; height: 22px; stroke-width: 1.65; }
  body:not(.cms-page):not(.admin-page) .mobile-contact-bar :is([aria-current="page"], [aria-pressed="true"]) {
    color: var(--mobile-accent) !important;
    background: var(--mobile-accent-fill) !important;
  }
  body:not(.cms-page):not(.admin-page) .mobile-contact-bar :is(a, button):active { background: var(--mobile-accent-fill) !important; }
  .mobile-contact-bar b:not([hidden]) { top: 0 !important; right: 8px !important; min-width: 17px; height: 17px; font-size: 10px !important; }

  /* Header and entry: search is the primary route, not a decorative hero. */
  .site-header { z-index: 30 !important; }
  .site-header .header-inner { min-height: 56px !important; padding: 6px 14px !important; gap: 8px !important; }
  .site-header .logo { flex: 1 1 auto; min-width: 0; }
  .site-header .site-logo-img { width: 136px !important; max-width: 100%; height: auto !important; max-height: 38px !important; }
  .site-header .header-actions { display: none !important; }
  .site-header .mobile-header-actions { gap: 4px !important; }
  .site-header .mobile-header-actions :is(a, button) { min-width: 44px !important; min-height: 44px !important; width: 44px !important; height: 44px !important; border-radius: 15px !important; }
  .site-header .header-search-shell { display: block !important; padding: 0 14px 10px !important; height: auto !important; }
  .site-header .header-catalog-search { display: flex !important; min-height: 44px !important; height: auto !important; border-radius: 14px !important; }
  .site-header .header-catalog-search input { min-width: 0; width: 100%; color: var(--mobile-ink) !important; }
  .site-header .header-catalog-search :is(button, svg) { flex-shrink: 0; }
  .site-header .header-catalog-search button { min-width: 44px; min-height: 44px; }
  body:has(.header-search-shell) .mobile-header-search-button { display: none !important; }
  .mobile-global-search { display: none !important; }
  html[data-mobile-interface] body.mobile-app-ready .site-header .header-search-shell .header-catalog-search {
    display: flex !important; width: 100% !important; height: auto !important; min-height: 44px !important;
    color: var(--mobile-ink) !important; background: var(--mobile-panel) !important;
    border: 1px solid var(--mobile-border) !important; padding: 0 4px 0 12px !important;
  }
  html[data-mobile-interface] body.mobile-app-ready .site-header #searchInput {
    display: block !important; flex: 1 1 auto; width: 100% !important; min-width: 0;
    height: 44px !important; min-height: 44px !important; padding: 8px !important;
    border: 0 !important; background: transparent !important; color: var(--mobile-ink) !important;
  }
  html[data-mobile-interface] .header-catalog-search > span { display: none !important; }
  html[data-mobile-interface] .header-catalog-search > label { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0 !important; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  html[data-mobile-interface] body.mobile-app-ready .site-header .header-catalog-search .catalog-search-submit {
    display: grid !important; place-items: center; width: 44px !important; height: 44px !important;
    padding: 8px !important; color: var(--mobile-ink) !important;
  }
  body.mobile-app-ready .hero { padding: 16px 16px 12px !important; min-height: 0 !important; gap: 0 !important; }
  body.mobile-app-ready .hero .hero-visual { display: none !important; }
  body.mobile-app-ready .hero h1 { font-size: 25px !important; line-height: 1.15 !important; letter-spacing: -.025em; font-weight: 650 !important; }
  body.mobile-app-ready .hero h1 > span:last-child { display: none; }
  body.mobile-app-ready .hero .lead { margin-block: 8px 12px !important; font-size: 14px !important; line-height: 1.45; color: var(--mobile-secondary) !important; }
  body.mobile-app-ready .hero .lead { display: none !important; }
  body.mobile-app-ready .hero-actions { gap: 8px !important; }
  body.mobile-app-ready .hero-actions :is(a, button) { font-size: 14px !important; min-height: 44px !important; padding: 10px 12px !important; font-weight: 600 !important; }
  body.mobile-app-ready .catalog-shell { margin-top: 12px !important; }
  body.mobile-app-ready .catalog-controls { padding: 0 !important; gap: 10px !important; border: 0 !important; background: none !important; box-shadow: none !important; }
  .catalog-family-grid { display: flex !important; overflow-x: auto !important; gap: 8px !important; padding-bottom: 6px !important; scroll-snap-type: x proximity; scrollbar-width: thin !important; scrollbar-color: var(--mobile-border) transparent; }
  .catalog-family-grid::-webkit-scrollbar { display: block !important; height: 3px !important; }
  .catalog-family-grid::-webkit-scrollbar-thumb { background: var(--mobile-border); border-radius: 4px; }
  body.mobile-app-ready .catalog-family-card { flex: 0 0 auto !important; width: auto !important; max-width: 180px; min-height: 44px !important; padding: 8px 14px !important; scroll-snap-align: start; }
  body.mobile-app-ready .catalog-family-card strong { font-size: 13px !important; font-weight: 500 !important; white-space: normal !important; line-height: 1.3; }
  body.mobile-app-ready .toolbar-actions { display: flex !important; gap: 8px !important; flex-wrap: wrap; }
  body.mobile-app-ready .sort-control { flex: 1 1 180px !important; min-width: 0 !important; }
  body.mobile-app-ready .sort-control select {
    appearance: none; -webkit-appearance: none;
    font-size: 16px !important; font-weight: 500 !important;
    height: 44px !important; min-height: 44px !important;
    padding: 8px 32px 8px 12px !important;
    color: var(--mobile-ink); background-color: var(--mobile-panel);
    border: 1px solid var(--mobile-border); border-radius: 12px;
    background-image: linear-gradient(45deg, transparent 50%, var(--mobile-secondary) 50%), linear-gradient(135deg, var(--mobile-secondary) 50%, transparent 50%);
    background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
    background-size: 5px 5px; background-repeat: no-repeat;
  }
  body.mobile-app-ready .mobile-filter-toggle { min-height: 44px !important; font-size: 14px !important; padding: 8px 12px !important; }
  .active-filters { flex-wrap: wrap; }
  .active-filter-chip, .active-filter { min-height: 36px; max-width: 100%; white-space: normal; }
  html[data-mobile-interface] .product-grid,
  html[data-mobile-interface] body.mobile-app-ready .product-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html[data-mobile-interface] .product-card {
    overflow: hidden;
    min-width: 0;
    width: 100%;
    max-width: 480px;
    justify-self: center;
  }
  html[data-mobile-interface] .product-card :is(.product-body, .product-heading, .product-commerce, .card-actions) {
    min-width: 0;
    max-width: 100%;
  }
  @media (min-width: 680px) {
    html[data-mobile-interface] .product-grid,
    html[data-mobile-interface] body.mobile-app-ready .product-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 12px;
    }
  }
  .product-card :is(.product-image, .product-media, .product-image-wrap, .product-media-wrap) { height: 180px !important; min-height: 0 !important; max-height: 180px; }
  .product-card :is(.product-image, .product-media) img { width: 100%; height: 100%; object-fit: contain; }
  html[data-mobile-interface] .product-card:has(.product-image img[src*="logos/ermak-logo"]) { grid-template-rows: 100px auto !important; }
  html[data-mobile-interface] .product-card .product-image:has(img[src*="logos/ermak-logo"]) { height: 100px !important; max-height: 100px !important; display: grid; place-items: center; padding: 12px; }
  html[data-mobile-interface] .product-card .product-image img[src*="logos/ermak-logo"] { max-width: 240px; height: 70px !important; }
  .product-card :is(h2, h3, .product-title) { font-size: 19px !important; line-height: 1.25 !important; font-weight: 600 !important; overflow-wrap: anywhere; }
  .product-card .price { font-size: 22px !important; font-weight: 650 !important; }
  .product-card .product-icon-actions { display: grid !important; grid-template-columns: minmax(0,1fr) 66px 66px !important; align-items: stretch; gap: 6px !important; }
  .product-card .product-action-icon { min-width: 0 !important; min-height: 52px !important; height: auto !important; }
  .product-card :is(.compare-card-button, .favorite-card-button) { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 2px !important; }
  .mobile-action-caption { position: static !important; clip: auto !important; clip-path: none !important; width: auto !important; height: auto !important; margin: 0 !important; overflow: visible !important; white-space: normal !important; font-size: 10px !important; font-weight: 500 !important; line-height: 1.2; }
  .product-card .cart-add-area [data-action-label], .product-purchase-panel .cart-add-area [data-action-label] { display: inline !important; }
  .product-card .cart-add-area { min-height: 50px !important; }
  html[data-mobile-interface] .product-card .product-facts { display: block !important; }
  html[data-mobile-interface] .product-card .tags { display: flex !important; flex-wrap: wrap !important; gap: 5px; max-height: none !important; }
  html[data-mobile-interface] .product-card .tag { max-width: 100% !important; width: auto !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; font-size: 11px !important; }
  html[data-mobile-interface] .product-card .spec-mini { margin-top: 6px; font-size: 12px !important; }
  html[data-mobile-interface] .product-card .product-commerce { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 8px !important; }
  html[data-mobile-interface] .product-card .product-commerce > :is(.price, .product-stock, .card-actions) { position: static !important; grid-column: 1/-1 !important; grid-row: auto !important; width: auto !important; max-width: 100% !important; margin: 0 !important; }
  html[data-mobile-interface] .product-card .product-stock { white-space: normal !important; text-align: left !important; font-size: 12px !important; line-height: 1.4; }
  html[data-mobile-interface] .product-card .product-icon-actions { display: grid !important; grid-template-columns: minmax(0,1fr) 66px 66px !important; }
  html[data-mobile-interface] .product-card .mobile-action-caption { position: static !important; clip: auto !important; width: auto !important; height: auto !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; font-size: 10px !important; white-space: normal !important; }
  html[data-mobile-interface] .product-card :is(.compare-card-button, .favorite-card-button) { width: 100% !important; }
  html[data-mobile-interface] .product-card :is(.compare-card-button, .favorite-card-button) [data-action-label] { display: none !important; }
  html[data-mobile-interface] .product-card :is(.compare-card-button, .favorite-card-button)::after { display: block; font-size: 10px; font-weight: 500; line-height: 1.2; text-align: center; }
  .product-card .compare-card-button::after { content: 'Сравнить'; }
  .product-card .compare-card-button[aria-pressed="true"]::after { content: 'В сравнении'; }
  .product-card .favorite-card-button::after { content: 'Сохранить'; }
  .product-card .favorite-card-button[aria-pressed="true"]::after { content: 'Сохранено'; }

  /* Product page: contain portrait products; only padded rack photos use a centre crop. */
  .seo-product-page { padding-inline: 12px !important; }
  .seo-product-hero { padding: 14px !important; gap: 14px !important; }
  .seo-product-hero h1 { margin-block: 8px 14px !important; font-size: 25px !important; line-height: 1.15 !important; font-weight: 650 !important; letter-spacing: -.025em; }
  .mobile-model-secondary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .seo-product-hero .product-code-secondary { margin-block: 6px !important; font-size: 12px !important; line-height: 1.4; color: var(--mobile-secondary) !important; }
  .seo-product-gallery { gap: 6px !important; padding: 8px !important; min-height: 0 !important; }
  .seo-product-gallery .seo-gallery-button:first-child { height: 190px !important; min-height: 0 !important; overflow: hidden; }
  .seo-product-gallery .seo-gallery-button:first-child img { width: 100% !important; height: 100% !important; object-fit: contain; }
  .seo-product-gallery[data-mobile-rack] .seo-gallery-button:first-child { height: 124px !important; }
  .seo-product-gallery[data-mobile-rack] .seo-gallery-button:first-child img { object-fit: cover; transform: scale(1.35); }
  .seo-product-gallery .seo-gallery-button:not(:first-child) { width: 48px !important; height: 44px !important; min-height: 44px !important; }
  .seo-product-gallery .seo-gallery-button:not(:first-child) img { width: 100% !important; height: 100% !important; object-fit: contain; }
  .product-purchase-panel { padding: 12px !important; }
  .product-purchase-panel .detail-actions { gap: 8px !important; }
  .product-purchase-panel .detail-actions > :is(.primary, .secondary) { font-size: 14px !important; padding: 10px 12px !important; }
  .product-purchase-facts { gap: 12px !important; }
  .product-question-section :is(p, label, .form-note), .question-form :is(label, p) { color: var(--mobile-secondary); }
  .specs-table { max-width: 100%; overflow-x: auto; }
  .spec-row, .spec-table-row { min-width: 0; overflow-wrap: anywhere; }

  /* One bottom reserve for navigation, purchase actions, messages and page content. */
  body:not(.cms-page):not(.admin-page) .product-sticky-buybar {
    inset: auto 10px var(--mobile-bottom-reserve) 10px !important;
    width: auto !important; max-width: 600px; margin-inline: auto;
    grid-template-columns: minmax(0,1fr) minmax(108px, .9fr) 58px !important;
    gap: 6px 10px !important; padding: 10px 12px !important;
    border-radius: 20px !important; background: var(--mobile-panel) !important;
    color: var(--mobile-ink) !important; border: 1px solid var(--mobile-border) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.12) !important; z-index: 41 !important;
  }
  .product-sticky-buybar-copy strong { font-size: 20px !important; }
  .product-sticky-buybar-copy span { font-size: 11px !important; color: var(--mobile-secondary) !important; white-space: normal !important; }
  .product-sticky-buybar > .primary { grid-column: auto; min-height: 44px !important; min-width: 44px; padding: 8px 4px !important; font-size: 13px !important; border: 1px solid var(--mobile-border) !important; color: var(--mobile-ink) !important; background: transparent !important; }
  body[data-mobile-buy-visible="false"] .product-sticky-buybar { display: none !important; }
  body:not(.cms-page):not(.admin-page) .toast {
    position: fixed !important; inset: auto 16px calc(var(--mobile-bottom-reserve) + var(--mobile-buy-reserve) + 8px) 16px !important;
    width: auto !important; max-width: 560px; margin-inline: auto; padding: 14px 16px !important;
    color: var(--mobile-toast-ink) !important; background: var(--mobile-toast) !important;
    border: 1px solid var(--mobile-border); border-radius: 17px !important;
    font-size: 14px !important; line-height: 1.45; font-weight: 500 !important;
    white-space: normal !important; overflow-wrap: anywhere; transform: none !important; z-index: 45 !important;
  }
  .cart-added-overlay:not([hidden]) {
    position: fixed !important; inset: auto 12px calc(var(--mobile-bottom-reserve) + var(--mobile-buy-reserve) + 8px) 12px !important;
    display: block !important; width: auto !important; z-index: 44 !important;
  }
  .cart-added-backdrop { display: none !important; }
  .cart-added-overlay .cart-added-dialog { width: 100% !important; margin: 0 !important; max-width: none; padding: 14px !important; border: 1px solid var(--mobile-border); border-radius: 20px !important; background: var(--mobile-panel) !important; color: var(--mobile-ink) !important; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
  .cart-added-copy strong { color: var(--mobile-ink) !important; font-size: 15px !important; }
  .cart-added-copy span { color: var(--mobile-secondary) !important; font-size: 13px !important; }
  .cart-added-prompt-actions :is(a, button) { min-height: 44px !important; white-space: normal; font-size: 13px !important; }
  body[data-mobile-prompt="true"] .toast { visibility: hidden; }
  .cookie-consent { inset: auto 12px calc(var(--mobile-bottom-reserve) + var(--mobile-buy-reserve) + 8px) 12px !important; max-height: calc(var(--mobile-vh) - var(--mobile-bottom-reserve) - var(--mobile-buy-reserve) - 32px); overflow-y: auto; z-index: 46 !important; }

  /* Sheets own the viewport, not the stack of bottom bars. */
  html[data-mobile-interface] body[data-mobile-modal="true"]:not(.cms-page):not(.admin-page) :is(.mobile-contact-bar, .product-sticky-buybar, .cookie-consent),
  html[data-mobile-interface] body[data-mobile-keyboard="true"]:not(.cms-page):not(.admin-page) :is(.mobile-contact-bar, .product-sticky-buybar) { display: none !important; }
  body[data-mobile-modal="true"] { overflow: hidden; }
  .global-search-layer { top: var(--mobile-vtop) !important; bottom: auto !important; height: var(--mobile-vh) !important; z-index: 70 !important; }
  .global-search-dialog { max-height: calc(var(--mobile-vh) - 20px) !important; overflow-y: auto !important; margin: 10px !important; width: auto !important; padding-bottom: max(14px, env(safe-area-inset-bottom,0px)) !important; color: var(--mobile-ink) !important; background: var(--mobile-panel) !important; }
  .global-search-dialog :is(input, button) { min-height: 44px; }
  .global-search-dialog h2 { font-size: 23px !important; }
  .global-search-form { display: flex !important; align-items: center; gap: 8px; flex-wrap: nowrap; }
  .global-search-form label { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
  .global-search-form input { flex: 1 1 auto; min-width: 0 !important; width: 100% !important; }
  .global-search-form button { flex: 0 0 auto; }
  dialog { max-width: calc(100% - 20px) !important; max-height: calc(var(--mobile-vh) - 24px) !important; overflow-y: auto; }
  dialog::backdrop { background: rgba(5,9,15,.6); }
  .quote-dialog-head { position: sticky; top: 0; z-index: 2; padding-block: 10px; background: var(--mobile-panel); border-bottom: 1px solid var(--mobile-border); }
  .quote-dialog-head h2 { font-size: 22px !important; }
  .quote-dialog-head .icon-button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
  .ups-selector-dialog { width: calc(100% - 20px) !important; }
  .ups-selector-card { min-height: 0 !important; max-height: calc(var(--mobile-vh) - 28px) !important; }
  .ups-selector-head h2 { font-size: 23px !important; }
  .ups-selector-progress { padding: 10px 14px !important; }
  .ups-selector-progress li { font-size: 12px !important; }
  .ups-selector-step { padding: 16px !important; min-height: 0 !important; }
  .ups-selector-step-copy h3 { font-size: 24px !important; }
  .ups-selector-fields { gap: 12px !important; margin-top: 18px !important; }
  .ups-selector-fields label { font-size: 14px; }
  .ups-selector-actions { padding: 12px 14px max(12px, env(safe-area-inset-bottom,0px)) !important; flex-wrap: wrap; }
  .ups-selector-result { grid-template-columns: minmax(0,1fr) auto !important; }
  .ups-selector-result-main { grid-column: 1/-1; }
  body.mobile-app-ready.filters-open .filters, body.filters-open .filters {
    position: fixed !important; inset: calc(var(--mobile-vtop) + 8px) 8px auto 8px !important;
    display: flex !important; flex-direction: column; width: auto !important;
    max-height: calc(var(--mobile-vh) - 16px) !important; height: auto !important; padding: 0 !important;
    border-radius: 22px; overflow: hidden !important; z-index: 71 !important;
    transform: none !important; transition: opacity .15s ease !important;
  }
  .filters .filters-head { flex-shrink: 0; }
  .filters .filters-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .filters .filter-close { width: 44px !important; height: 44px !important; min-height: 44px !important; }
  .filters .mobile-filter-apply { position: static !important; display: block !important; flex-shrink: 0; padding: 10px 14px max(14px,env(safe-area-inset-bottom,0px)) !important; background: var(--mobile-panel) !important; }
  .filters .mobile-filter-apply button { width: 100%; min-height: 44px; }
  .filter-backdrop { z-index: 70 !important; }
  .compare-drawer.is-open, .compare-drawer[aria-hidden="false"] { inset: var(--mobile-vtop) 0 auto !important; height: var(--mobile-vh) !important; z-index: 72 !important; }
  .compare-panel { height: 100% !important; max-height: var(--mobile-vh) !important; overflow-y: auto; padding-bottom: max(18px, env(safe-area-inset-bottom,0px)) !important; }
  html[data-mobile-interface] body .compare-drawer[aria-hidden="false"] {
    position: fixed !important; inset: var(--mobile-vtop) 0 auto !important; width: 100% !important;
    height: var(--mobile-vh) !important; padding: 0 !important; opacity: 1 !important;
    transform: none !important; transition: none !important; background: rgba(5,9,15,.6) !important;
  }
  html[data-mobile-interface] body .compare-drawer .compare-panel {
    width: 100% !important; max-width: 100% !important; margin: 0 !important;
    padding: 16px 14px max(18px,env(safe-area-inset-bottom,0px)) !important;
    background: var(--mobile-panel) !important; color: var(--mobile-ink) !important;
    border-radius: 22px 22px 0 0 !important; transform: none !important; opacity: 1 !important;
  }
  .compare-head { flex-wrap: wrap; }
  .compare-tools { flex-wrap: wrap; }
  .compare-tools :is(button, a) { min-height: 44px; font-size: 13px !important; }
  .compare-table { overflow-x: auto; }
  .checkout-compact :is(h1, h2) { line-height: 1.2; }
  .checkout-compact h1 { font-size: 27px !important; }
  .checkout-compact .order-panel { padding: 16px !important; }
  .checkout-compact .checkout-grid { gap: 12px !important; }
  .checkout-compact :is(.form-note, .checkout-next-note, .checkout-delivery-cost) { font-size: 13px !important; line-height: 1.45; color: var(--mobile-secondary); }
  .checkout-compact .check { min-height: 44px; }
  .checkout-compact .checkout-extra summary { padding-block: 10px; }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body:not(.cms-page):not(.admin-page) .mobile-contact-bar {
      background: var(--mobile-glass) !important;
      -webkit-backdrop-filter: blur(20px) saturate(140%);
      backdrop-filter: blur(20px) saturate(140%);
    }
  }
  @media (prefers-reduced-transparency: reduce) {
    body:not(.cms-page):not(.admin-page) .mobile-contact-bar { background: var(--mobile-panel) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    body:not(.cms-page):not(.admin-page) :is(.mobile-contact-bar, .mobile-contact-bar *, .toast, .global-search-layer, .global-search-dialog, .product-sticky-buybar) { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  }
}

/* Catalog density: intrinsic content height and intact, contained product photos. */
html .product-grid .product-card { height: auto; align-self: stretch; }
html .product-grid .product-card :is(.compare-card-button,.favorite-card-button) { width: 44px !important; min-width: 44px !important; }
html body .catalog-family-grid,
html body.mobile-app-ready .catalog-family-grid {
  display: flex !important; flex-wrap: wrap !important; gap: 8px !important;
  overflow: visible !important; padding-bottom: 0 !important;
  max-height: none !important; scroll-snap-type: none !important;
  scrollbar-width: none !important; cursor: default !important;
  padding-right: 0 !important; min-height: 0 !important;
  mask-image: none !important; -webkit-mask-image: none !important;
}
html body .catalog-family-grid::-webkit-scrollbar { display: none !important; }
html body .catalog-family-card,
html body.mobile-app-ready .catalog-family-card {
  flex: 0 1 auto !important; width: auto !important; min-width: 0 !important;
  max-width: 100% !important; min-height: 44px !important; padding: 8px 14px !important;
}
html body .catalog-family-card strong { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
html .catalog-subgroups { display: flex !important; flex-wrap: wrap !important; overflow: visible !important; max-width: 100%; gap: 6px; }
html .catalog-subgroups button { min-height: 44px !important; max-width: 100%; white-space: normal !important; }
.catalog-category-picker { display: none; }
@media (max-width: 860px) {
  html body #catalogStructure[data-category-picker-ready] .catalog-family-grid { display: none !important; }
  html body #catalogStructure[data-category-picker-ready] .catalog-category-picker { display: block; width: 100%; margin: 0; }
  html body .catalog-category-picker select {
    appearance: none; -webkit-appearance: none;
    display: block; width: 100%; min-width: 0; height: 44px; min-height: 44px;
    padding: 8px 36px 8px 12px; font-size: 16px !important;
    color: var(--mobile-ink); background-color: var(--mobile-panel);
    border: 1px solid var(--mobile-border); border-radius: 12px;
    background-image: linear-gradient(45deg,transparent 50%,var(--mobile-secondary) 50%),linear-gradient(135deg,var(--mobile-secondary) 50%,transparent 50%);
    background-position: calc(100% - 17px) 19px,calc(100% - 12px) 19px;
    background-size: 5px 5px; background-repeat: no-repeat;
  }
}
html .catalog-controls .toolbar-actions {
  display: flex !important; flex-wrap: wrap !important;
  align-items: center; gap: 12px !important; min-width: 0;
}
html .catalog-view-toggle { flex: 0 1 auto; max-width: 100%; }
html .sort-control {
  display: flex !important; flex: 1 1 300px !important;
  align-items: center; gap: 12px; min-width: 0 !important;
}
html .sort-control > span { flex: 0 0 auto; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
html .sort-control select { flex: 1 1 220px; min-width: 0 !important; width: 100% !important; max-width: 100%; }
html .product-grid { container: catalog-results / inline-size; }
html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) {
  grid-template-columns: minmax(0,1fr) !important;
  grid-auto-flow: row;
}
html .product-grid .product-card { grid-column: auto !important; grid-row: auto !important; }
@media (min-width: 861px) {
  html .product-grid[data-catalog-view="cards"] { grid-template-columns: repeat(auto-fill,minmax(min(100%,240px),1fr)) !important; }
  html .product-grid[data-catalog-view="cards"] .product-card {
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: 142px auto !important;
    min-height: 0 !important;
  }
  html .product-grid[data-catalog-view="cards"] .product-body {
    display: grid !important; grid-template-columns: minmax(0,1fr) !important;
    min-height: 0 !important;
    grid-template-rows: auto auto auto !important;
    padding: 12px !important;
    gap: 8px !important;
  }
  html .product-grid[data-catalog-view="cards"] .product-image { min-height: 0 !important; height: 142px !important; }
  html .product-grid[data-catalog-view="cards"] .product-image img { max-height: 124px !important; object-fit: contain !important; }
  html .product-grid[data-catalog-view="cards"] .product-heading { display: flex !important; flex-direction: column; grid-column: 1 !important; grid-row: 1 !important; min-width: 0; gap: 4px; }
  html .product-grid[data-catalog-view="cards"] .product-heading h3 { display: block !important; -webkit-line-clamp: unset; max-height: none !important; min-height: 0 !important; margin: 0 !important; overflow: visible !important; white-space: normal !important; overflow-wrap: anywhere; font-size: 17px !important; line-height: 1.3 !important; }
  html .product-grid[data-catalog-view="cards"] .product-heading-meta { display: block !important; margin: 0 !important; }
  html .product-grid[data-catalog-view="cards"] .product-facts { display: block !important; grid-column: 1 !important; grid-row: 2 !important; min-width: 0; }
  html .product-grid[data-catalog-view="cards"] .tags { display: flex !important; flex-wrap: wrap; gap: 4px; }
  html .product-grid[data-catalog-view="cards"] .tag { width: auto !important; max-width: 100%; white-space: normal; }
  html .product-grid[data-catalog-view="cards"] .product-commerce { display: grid !important; grid-column: 1 !important; grid-row: 3 !important; grid-template-columns: minmax(0,1fr) !important; grid-template-rows: auto auto auto !important; gap: 6px !important; min-width: 0; }
  html .product-grid[data-catalog-view="cards"] .product-commerce > :is(.price,.product-stock,.card-actions) { grid-column: 1 !important; width: 100%; min-width: 0; margin: 0 !important; position: static !important; }
  html .product-grid[data-catalog-view="cards"] .product-commerce > .price { grid-row: 1 !important; font-size: 22px !important; }
  html .product-grid[data-catalog-view="cards"] .product-commerce > .product-stock { grid-row: 2 !important; text-align: left; white-space: normal; }
  html .product-grid[data-catalog-view="cards"] .product-commerce > .card-actions { grid-row: 3 !important; }
  html .product-grid[data-catalog-view="cards"] .product-icon-actions { display: grid !important; grid-template-columns: minmax(0,1fr) 44px 44px !important; gap: 6px; }
  html .product-grid[data-catalog-view="cards"] :is(.product-action-icon,.cart-add-area) { min-width: 0 !important; height: 44px; min-height: 44px; padding: 6px !important; }
  html .product-grid[data-catalog-view="compact"] .product-card { grid-template-columns: 128px minmax(0,1fr) !important; grid-template-rows: auto !important; min-height: 0 !important; }
  html .product-grid[data-catalog-view="compact"] .product-image { min-height: 128px !important; }
  html .product-grid[data-catalog-view="table"] .product-card { grid-template-columns: 80px minmax(0,1fr) !important; grid-template-rows: auto !important; min-height: 0 !important; }
  html .product-grid[data-catalog-view="table"] .product-image { min-height: 88px !important; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-card {
    grid-template-columns: 88px minmax(0,1fr) minmax(230px,.8fr) !important;
    grid-template-rows: auto auto !important;
    padding: 12px !important; gap: 8px 16px; align-items: start;
  }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-body { display: contents !important; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-image { grid-column: 1; grid-row: 1 / span 2; min-height: 96px !important; height: 96px; border: 0; border-radius: 8px; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-heading { display: flex !important; flex-direction: column; grid-column: 2; grid-row: 1; min-width: 0; gap: 4px; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-heading h3 { display: block !important; -webkit-line-clamp: unset; margin: 0 !important; min-height: 0 !important; overflow: visible !important; white-space: normal !important; overflow-wrap: anywhere; font-size: 17px !important; line-height: 1.3 !important; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-heading-meta { margin: 0 !important; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-facts { display: block !important; grid-column: 2; grid-row: 2; min-width: 0; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .tags { display: flex !important; flex-wrap: wrap; gap: 4px; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .tag { width: auto !important; max-width: 100%; white-space: normal; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-commerce { display: grid !important; grid-template-columns: minmax(0,1fr) !important; grid-template-rows: auto auto auto !important; grid-column: 3; grid-row: 1 / span 2; gap: 7px !important; min-width: 0; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-commerce > :is(.price,.product-stock,.card-actions) { grid-column: 1 !important; position: static !important; width: 100%; min-width: 0; margin: 0 !important; justify-self: stretch; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-commerce > .price { grid-row: 1 !important; font-size: 22px !important; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-commerce > .product-stock { grid-row: 2 !important; text-align: left; white-space: normal; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-commerce > .card-actions { grid-row: 3 !important; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-icon-actions { display: grid !important; grid-template-columns: minmax(0,1fr) 44px 44px !important; gap: 6px; }
  html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) :is(.product-action-icon,.cart-add-area) { min-width: 0 !important; min-height: 44px; height: 44px; padding: 6px !important; }
  @container catalog-results (max-width: 700px) {
    html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-card { grid-template-columns: 80px minmax(0,1fr) !important; }
    html .product-grid:is([data-catalog-view="table"],[data-catalog-view="compact"]) .product-commerce { grid-column: 1 / -1; grid-row: 3; }
  }
}
@media (max-width: 860px) {
  html[data-mobile-interface] body .product-grid,
  html[data-mobile-interface] body.mobile-app-ready .product-grid { grid-template-columns: minmax(0,1fr) !important; gap: 10px !important; }
  html[data-mobile-interface] body .product-grid .product-card {
    display: grid !important;
    grid-template-columns: clamp(88px, 25vw, 124px) minmax(0,1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: start;
    align-items: start;
    column-gap: 12px;
    row-gap: 8px;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 12px !important;
    border-radius: 12px;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-body { display: contents !important; }
  html[data-mobile-interface] body .product-grid .product-card .product-image {
    grid-column: 1; grid-row: 1 / span 2;
    width: 100% !important; height: 112px !important; max-height: 112px !important;
    min-height: 0 !important; padding: 4px !important;
    border: 0 !important; border-radius: 8px;
    background: #fff;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-image img {
    width: calc(100% - 8px) !important; height: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important; max-height: calc(100% - 8px) !important;
    object-fit: contain !important;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-heading {
    display: flex !important; flex-direction: column; align-items: start;
    grid-column: 2 !important; grid-row: 1 !important;
    gap: 4px !important; min-width: 0;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-heading h3 {
    display: block !important; -webkit-line-clamp: unset;
    min-height: 0 !important; margin: 0 !important;
    font-size: 16px !important; line-height: 1.25 !important;
    overflow: visible !important; white-space: normal !important;
    overflow-wrap: anywhere;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-heading-meta { margin: 0 !important; }
  html[data-mobile-interface] body .product-grid .product-card :is(.sku,.product-code-secondary) { font-size: 11px !important; line-height: 1.3; }
  html[data-mobile-interface] body .product-grid .product-card .product-facts { grid-column: 2 !important; grid-row: 2 !important; margin: 0 !important; }
  html[data-mobile-interface] body .product-grid .product-card .tags { gap: 4px !important; margin: 0 !important; }
  html[data-mobile-interface] body .product-grid .product-card .tag { padding: 2px 6px !important; line-height: 1.3 !important; font-size: 11px !important; }
  html[data-mobile-interface] body .product-grid .product-card .spec-mini { margin: 4px 0 0 !important; font-size: 11px !important; line-height: 1.35 !important; }
  html[data-mobile-interface] body .product-grid .product-card .product-commerce {
    grid-column: 1 / -1 !important; grid-row: 3 !important;
    display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr) !important;
    grid-template-rows: auto auto !important; gap: 8px !important;
    align-items: center; margin: 0 !important;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-commerce > .price {
    grid-column: 1 !important; grid-row: 1 !important;
    font-size: 20px !important; line-height: 1.2 !important;
    white-space: normal; overflow-wrap: anywhere;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-commerce > .product-stock {
    grid-column: 2 !important; grid-row: 1 !important;
    font-size: 11px !important; line-height: 1.35 !important; text-align: right !important;
    justify-self: end; min-height: 0;
  }
  html[data-mobile-interface] body .product-grid .product-card .product-commerce > .card-actions { grid-column: 1 / -1 !important; grid-row: 2 !important; min-height: 44px !important; }
  html[data-mobile-interface] body .product-grid .product-card .product-icon-actions { grid-template-columns: minmax(0,1fr) 44px 44px !important; gap: 6px !important; margin: 0 !important; }
  html[data-mobile-interface] body .product-grid .product-card :is(.product-action-icon,.cart-add-area) { height: 44px !important; min-height: 44px !important; padding: 6px !important; }
  html[data-mobile-interface] body .product-grid .product-card :is(.compare-card-button,.favorite-card-button)::after { display: none !important; }
  html[data-mobile-interface] body .product-grid .product-card .cart-add-area [data-action-label] { font-size: 13px !important; }
  html[data-mobile-interface] body .product-grid[data-catalog-view="table"] .product-card { grid-template-columns: 72px minmax(0,1fr) !important; }
  html[data-mobile-interface] body .product-grid[data-catalog-view="table"] .product-card .product-image { height: 80px !important; max-height: 80px !important; }
}
