/* Shop-only responsive layer. Loaded after page styles; no catalog or behavior changes. */
@media (max-width: 900px) {
  .products-grid,
  .product-detail-wrap,
  .checkout-wrap {
    min-width: 0;
  }

  .products-grid > *,
  .product-detail-wrap > *,
  .checkout-wrap > *,
  .form-row > *,
  .vehicle-grid > *,
  .pbf-grid > * {
    min-width: 0;
  }

  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-width: 0; }
  .product-body { overflow-wrap: anywhere; }
  .product-img img { object-fit: contain; }
  .product-btns { flex-wrap: wrap; }
  .product-btns .btn { min-height: 46px; min-width: 0; text-align: center; }
  .shop-segment-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .shop-segment-head span { line-height: 1.6; }
  .shop-segment-head h2 { overflow-wrap: anywhere; }
  .filter-btn,
  .shop-segment-nav a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }

  /* A drawer must fit a phone without concealing its close control or line items. */
  .cart-drawer { width: min(400px, 100vw); max-width: 100%; }
  .cart-header { gap: 12px; padding-top: max(16px, env(safe-area-inset-top)); }
  .cart-close { width: 44px; height: 44px; flex: 0 0 44px; }
  .cart-body { min-height: 0; overscroll-behavior: contain; overflow-wrap: anywhere; }
  .cart-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .cart-footer .btn { white-space: normal; text-align: center; }
  .cart-body button[onclick^="removeCart"] { min-width: 44px; min-height: 44px; }
  .cart-body input[type="number"] { min-height: 44px; font-size: 16px !important; }
  .cart-fab { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); min-height: 48px; }

  .product-detail-wrap img { max-width: 100%; }
  .pd-left-col,
  .pd-media-gallery { min-width: 0; max-width: 100%; }
  .pd-image img { object-fit: contain; }
  .pd-media-thumbs { max-width: 100%; }
  .pd-media-arrow { width: 44px; height: 44px; }
  .pd-spec-row { gap: 16px; }
  .pd-spec-row span { min-width: 0; overflow-wrap: anywhere; }
  .price-box .pb-row { flex-wrap: wrap; }
  .price-box .pb-amount { white-space: normal; overflow-wrap: anywhere; }
  .price-box .pb-breakdown-row { gap: 12px; }
  .price-box .pb-breakdown-row span:first-child { min-width: 0; overflow-wrap: anywhere; }
  .pd-btns .btn { min-width: 0; min-height: 48px; text-align: center; white-space: normal; }

  /* 16px fields prevent iOS focus zoom; native select and upload behavior stays intact. */
  .section-pad :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea),
  .modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    min-width: 0;
    max-width: 100%;
    /* Existing configurator/vehicle selectors and inline quantity styles are more specific. */
    font-size: 16px !important;
    min-height: 46px;
  }
  .variant-row select,
  .variant-row input[type="text"].other-input,
  .extra-row input[type="text"],
  .extra-row input[type="file"],
  .pinbox-finder-box .pbf-grid :is(select, input),
  #eventModal .modal .form-group :is(input, select, textarea) { font-size: 16px; }
  .weight-mode-toggle label,
  .extra-check-row,
  .form-check { min-height: 44px; }

  .checkout-wrap { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .checkout-box { min-width: 0; }
  .co-row { align-items: flex-start; }
  .co-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
  .co-price { flex-shrink: 0; text-align: right; }
  .co-summary-line { gap: 12px; }
  .co-summary-line > span { min-width: 0; }
  .co-summary-line > span:last-child { text-align: right; }
  .co-summary-line.total { align-items: flex-start; flex-wrap: wrap; }
  .pay-btn { white-space: normal; text-align: center; line-height: 1.5; min-height: 52px; }
  .co-error,
  .legacy-note,
  .install-coordination-note,
  .tech-shop-denied { overflow-wrap: anywhere; }
  .checkout-box input[type="number"] { min-height: 44px; font-size: 16px !important; }
  .checkout-box .form-check label { min-width: 0; }
  .checkout-box .form-check input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; }
  .modal-overlay { padding: 12px; }
  .modal { max-width: 100%; max-height: calc(100dvh - 24px); overscroll-behavior: contain; }
  #eventModal .modal { max-width: 100%; }
}

@media (max-width: 860px) {
  .product-detail-wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pd-left-col { position: static; }
}

@media (max-width: 600px) {
  .section-pad > .container,
  .page-hero > .container { padding-inline: 16px; }
  .page-hero { padding-block: 32px; }
  .page-hero h1 { font-size: clamp(1.7rem, 7.2vw, 2.3rem); line-height: 1.2; overflow-wrap: anywhere; }
  .page-hero p { font-size: .95rem; line-height: 1.65; }
  .breadcrumb { flex-wrap: wrap; line-height: 1.7; }
  .breadcrumb a { flex-shrink: 0; }
  .breadcrumb span { overflow-wrap: anywhere; min-width: 0; }
  .section-pad { padding-block: 32px; }
  .section-title { font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.25; }
  .section-pad .section-label { font-size: .85rem; letter-spacing: .14em; }
  .how-to-order { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 28px; }
  .order-option { padding: 18px 16px; gap: 12px; }
  .order-option > div:last-child { min-width: 0; }
  .order-icon { font-size: 1.6rem; }
  .filter-bar { gap: 8px; margin-bottom: 22px; }
  .filter-btn { padding: 9px 13px; }
  .shop-segment-nav { gap: 8px; margin-bottom: 26px; }
  .shop-segment-nav a { padding: 9px 12px; }
  .shop-segment { margin-bottom: 36px; scroll-margin-top: 84px; }
  .shop-segment-head { margin-bottom: 18px; }
  .shop-segment-head h2 { font-size: 1.3rem; }
  .products-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
  .product-img { height: auto; aspect-ratio: 4 / 3; }
  .product-body { padding: 18px; }
  .product-body h3 { font-size: 1.08rem; line-height: 1.4; }
  .product-body p { line-height: 1.65; }
  .product-btns .btn { flex-basis: 120px; }
  .cart-header,
  .cart-footer { padding-inline: 16px; }
  .cart-body { padding-inline: 16px; }
  .pd-title { font-size: 1.65rem; line-height: 1.25; }
  .variant-box,
  .extra-box,
  .kit-guide-box,
  .special-order-box,
  .sizing-box,
  .quote-box,
  .pd-kit-includes,
  .pd-specs,
  .price-box { padding: 18px 16px; }
  .pd-btns { flex-direction: column; gap: 10px; }
  .pd-btns .btn { flex: auto; width: 100%; }
  .pd-spec-row { flex-wrap: wrap; gap: 4px 12px; }
  .pd-spec-row span:last-child { margin-left: auto; }
  .pinbox-finder-box .pbf-grid { grid-template-columns: minmax(0, 1fr); }
  .checkout-box { padding: 20px 16px; margin-bottom: 20px; }
  .checkout-wrap .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .co-row { gap: 10px; flex-wrap: wrap; }
  .co-row > div:first-child { flex-basis: 150px !important; }
  .co-price { margin-left: auto; }
  .co-summary-line.total { font-size: 1.05rem; }
  .test-mode-banner { padding: 16px; margin-bottom: 20px; }
  .co-empty,
  .co-success { padding: 32px 16px; }
  .co-empty .btn,
  .co-success .btn,
  .tech-shop-denied .btn { max-width: 100%; white-space: normal; text-align: center; justify-content: center; }
  .tech-shop-denied { padding: 24px 16px; margin-block: 24px; }
  .tech-shop-denied h1 { font-size: 1.6rem; line-height: 1.3; }
  .portal-page-nav { padding: 12px 16px; }
  .portal-page-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .modal { width: 100%; padding: 28px 16px 24px; }
  #eventModal .modal { padding-inline: 16px; }
  .modal .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer,
  .product-img img,
  .filter-btn,
  .pd-media-arrow,
  .pd-media-thumb { transition: none; }
}
