/* Phone-only presentation; larger screens retain their existing workspace. */
.phone-category, #workspace-cart { display: none; }

@media (max-width: 600px) {
  html { scroll-padding-top: 76px; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .preview-bar { padding: 7px 16px; min-height: 30px; font-size: 10px; line-height: 1.5; }
  .preview-bar > span:first-child, .preview-bar button { display: none; }
  .preview-bar > span:nth-child(2) { display: block; }
  .site-header { height: 64px; padding: 0 16px; gap: 12px; }
  .site-header .brand { gap: 10px; }
  .site-header .brand img { width: 64px; height: 43px; }
  .site-header .brand > span { display: block; font-size: 8px; padding-left: 10px; letter-spacing: 1.4px; }
  .site-header .account-button { min-width: 44px; min-height: 44px; justify-content: center; border: 1px solid #dce6ec; border-radius: 50%; padding: 10px; }
  .site-header .account-button > span, .site-header #open-cart, #mobile-cart { display: none !important; }

  .workspace-mobile { position: fixed; bottom: 0; left: 0; right: 0; z-index: 8; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #d9e6ed; box-shadow: 0 -4px 20px #102c3d08; background: #fff; }
  .workspace-mobile a, .workspace-mobile #workspace-cart { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 56px; min-height: 56px; max-width: none; min-width: 0; padding: 6px 2px; font-size: 10px; line-height: 1.3; font-weight: 600; background: transparent; border-radius: 9px; }
  .workspace-mobile a.nav-active { background: #e7f4f8; color: #176b85; }
  .workspace-mobile svg { width: 21px; height: 21px; }
  .workspace-cart-icon { position: relative; height: 24px; }
  #workspace-cart-count { position: absolute; top: -4px; left: 16px; min-width: 18px; height: 18px; padding: 1px 4px; display: grid; place-items: center; background: #153f51; color: #fff; border: 2px solid #fff; border-radius: 10px; font-size: 9px; }
  body:has(dialog[open]) .workspace-mobile { visibility: hidden; }
  body:has(.mobile-cart:not([hidden])) footer { padding-bottom: 0; }

  .my-wash { padding: 20px 16px 26px; scroll-margin-top: 0; }
  .dash-heading { margin-bottom: 16px; }
  .dash-heading h1 { font-size: 26px; letter-spacing: -.8px; margin: 7px 0; }
  .dash-heading p:not(.eyebrow) { display: none; }
  .dash-welcome-copy { padding: 20px; }
  .dash-welcome .eyebrow, .dash-source.is-generic, .dash-light-link { display: none; }
  .dash-welcome h2 { font-size: 28px; letter-spacing: -.8px; margin: 0 0 10px; }
  .dash-welcome h2 br { display: none; }
  .dash-welcome h2 em::before { content: ' '; }
  .dash-welcome-copy > p:not(.eyebrow) { font-size: 12px; line-height: 1.65; }
  .dash-welcome-actions { margin: 16px 0 0; }
  .dash-welcome-actions > .button { width: 100%; font-size: 12px; min-height: 46px; }
  .dash-welcome .dash-source:not(.is-generic) { margin-top: 12px; }
  .dash-stats { margin: 12px 0 20px; gap: 7px; }
  .dash-stats > button { min-height: 78px; padding: 9px 7px; }
  .dash-stats b { font-size: 22px; margin-bottom: 2px; }
  .dash-stats small { font-size: 9px; }
  .dash-panel { padding: 18px 16px; }
  .dash-panel-heading { margin-bottom: 14px; }
  .dash-panel-heading .eyebrow { display: none; }
  .dash-panel-heading h2 { font-size: 20px; margin-top: 0; }
  .dash-panel-heading > .dash-link { font-size: 11px; }
  .dash-empty, .dash-empty-small { min-height: 0; padding: 10px 0; }
  .dash-empty .empty-illustration { width: 76px; height: 64px; margin-bottom: 10px; }
  .dash-empty > p { margin: 8px auto 14px; line-height: 1.65; }
  .dash-favorite-grid { grid-template-columns: 1fr; gap: 10px; }
  .dash-product { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); }
  .dash-product-image { position: static; height: 100%; min-height: 158px; }
  .dash-product-image > button:first-child { padding: 18px 7px; }
  .dash-product-image img { height: 118px; }
  .dash-product-image .favorite-button { top: 5px; right: 5px; }
  .dash-product-copy { padding: 12px; }
  .dash-product-copy > p, .dash-product h3 { padding-right: 34px; }
  .dash-product h3 { font-size: 15px; }
  .dash-product h3 button { min-height: 34px; }
  .dash-product-copy > small { font-size: 11px; margin: 5px 0 10px; }
  .dash-product-bottom { flex-wrap: nowrap; gap: 6px; padding-top: 9px; }
  .dash-product-bottom > span { font-size: 12px; }
  .dash-product-bottom small { font-size: 9px; line-height: 1.4; }
  .dash-product-bottom .add-button { width: auto; min-width: 64px; font-size: 11px; }

  .hero { margin: 16px 16px 0; min-height: 0; }
  .hero-copy { padding: 25px 22px; }
  .hero-copy h1 { font-size: 39px; letter-spacing: -1.8px; margin: 16px 0; }
  .hero-description { font-size: 13px; line-height: 1.65; margin-bottom: 20px; }
  .hero-art, .hero-footnote { display: none; }
  .benefit-strip { margin: 0 16px; padding: 16px 0; gap: 12px; }
  .catalog-section { padding: 26px 16px 32px; }
  .section-heading { gap: 10px; margin-bottom: 18px; }
  .section-heading h2 { font-size: 26px; }
  .section-heading > p { display: none; }
  .catalog-layout { display: block; }
  .catalog-sidebar { display: none; }
  .lineup-toolbar { gap: 10px; }
  .lineup-tabs { width: 100%; flex-wrap: nowrap; gap: 2px; padding: 3px; }
  .lineup-tabs button { min-height: 44px; flex: 1; padding: 9px 5px; font-size: 11px; gap: 4px; white-space: nowrap; }
  .lineup-tabs svg { width: 14px; height: 14px; }
  .lineup-tabs b { min-width: 17px; font-size: 9px; }
  .restock-launch { width: 100%; font-size: 12px; min-height: 44px; padding: 8px 12px; }
  .lineup-help { font-size: 11px; margin: 10px 0 14px; }
  .catalog-toolbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: end; }
  .catalog-toolbar .search { grid-column: 1 / -1; width: 100%; }
  .search input { font-size: 16px; height: 46px; }
  .phone-category, .sort-control { display: flex; align-items: stretch; flex-direction: column; gap: 6px; font-size: 11px; min-width: 0; }
  .phone-category > span, .sort-control > span { display: block; color: #526f7e; }
  .phone-category select, .sort-control select { width: 100%; min-width: 0; max-width: none; height: 44px; padding: 8px 9px; border: 1px solid #d3e1e8; border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; }
  .catalog-meta { padding: 16px 0 12px; }
  .catalog-meta > span:last-child { display: none; }
  .product-grid { grid-template-columns: 1fr; gap: 12px; }
  .product-card { position: relative; display: grid; grid-template-columns: 94px minmax(0, 1fr); }
  .product-card:hover { transform: none; }
  .product-image-wrap { position: static; background: #edf2f3; }
  .product-image-button { height: 100%; min-height: 174px; padding: 22px 8px; border-radius: 0; }
  .product-image-button img { height: 130px; }
  .product-image-button::after, .product-image-button .image-tag, .product-image-button .image-arrow { display: none; }
  .product-image-wrap .favorite-button { top: 6px; right: 6px; }
  .photo-status { left: 4px; right: 4px; bottom: 6px; padding: 4px 2px; text-align: center; font-size: 9px; }
  .product-body { padding: 14px 12px 12px; min-width: 0; }
  .product-code { font-size: 9px; letter-spacing: .6px; margin: 0 0 6px; padding-right: 33px; }
  .product-title { font-size: 16px; min-height: 0; line-height: 1.3; padding-right: 32px; }
  .product-title button { min-height: 32px; }
  .product-body .tagline { display: none; }
  .pack-label { font-size: 11px; line-height: 1.5; margin: 8px 0 12px; align-items: flex-start; }
  .pack-label svg { display: none; }
  .product-bottom { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px; padding-top: 10px; }
  .quote-price { font-size: 13px; }
  .quote-price small { font-size: 9px; line-height: 1.4; }
  .product-bottom .add-button { width: auto; min-width: 66px; min-height: 44px; margin: 0; padding: 8px; font-size: 12px; gap: 5px; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .skeleton-card { height: 174px; padding: 12px; display: grid; grid-template-columns: 70px 1fr; gap: 15px; }
  .skeleton-card::before { height: 148px; }
  .skeleton-card::after { margin-top: 20px; }

  /* A single scrolling cart avoids two tiny competing scroll regions. */
  .cart-dialog[open] { display: block; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .cart-dialog .dialog-top { position: sticky; top: -18px; background: #fff; z-index: 4; padding: 14px 0; margin: -14px 0 12px; }
  .cart-dialog #cart-content { overflow: visible; min-height: 0; padding: 0; }
  .cart-dialog .cart-bottom { max-height: none; overflow: visible; padding-top: 18px; }
  .cart-row { gap: 12px; }
  .cart-row > img { width: 62px; height: 90px; }
  .cart-row h3 { font-size: 15px; }
  .cart-row p { font-size: 11px; }
  .cart-row-bottom { gap: 6px; }
  .remove-button { font-size: 11px; }
  .cart-bottom .total-row { font-size: 12px; margin: 10px 0; }
  .cart-bottom .totals-help { font-size: 11px !important; }
  .cart-bottom .cart-preview-note { font-size: 9px; line-height: 1.7; }
  .detail-image { min-height: 200px; padding: 20px; }
  .detail-image img { height: 148px; }
  .detail-copy { padding: 22px 18px; }
  .detail-copy h2 { font-size: 27px; }
  .detail-copy p, .detail-copy li { font-size: 13px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .product-card { grid-template-columns: 78px minmax(0, 1fr); }
  .product-body { padding-left: 10px; padding-right: 10px; }
  .product-title { font-size: 15px; }
  .product-code { font-size: 8px; }
  .quote-price { font-size: 12px; }
  .product-bottom .add-button { min-width: 62px; font-size: 11px; }
  .dash-product { grid-template-columns: 68px minmax(0, 1fr); }
  .dash-panel-heading h2 { font-size: 18px; }
  .lineup-tabs button { font-size: 10px; }
  .lineup-tabs svg { display: none; }
}
