/* WO-399 — Dude RV Production Polish
   Extends existing Brand Lexicon / store / experience chrome.
   Not a parallel design system.
   WO-399A — iPhone / Safari shared remediations (viewport, overflow, forms, grids). */

/* Secondary shop rail — categories live here, not in primary trip nav */
.drv-shop-rail {
  background: #0a2744;
  border-bottom: 1px solid rgba(245, 179, 1, 0.28);
  color: #e7e5e4;
}

.drv-shop-rail__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.55rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  justify-content: center;
}

.drv-shop-rail__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5b301;
  margin-right: 0.25rem;
}

.drv-shop-rail a {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.82rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.drv-shop-rail a:hover,
.drv-shop-rail a:focus-visible {
  color: #061a33;
  background: #f5b301;
  outline: none;
}

.drv-shop-rail a[aria-current="page"] {
  color: #f5b301;
  box-shadow: inset 0 -2px 0 #f5b301;
}

.drv-shop-rail a[aria-current="page"]:hover {
  color: #061a33;
  box-shadow: none;
}

/* Commerce primary CTA alignment with trip pages */
.drv-links a[href*="paypal.me"] {
  background: #b91c1c;
  color: #fff !important;
  padding: 0.45rem 0.85rem;
  border-radius: 0.55rem;
  font-weight: 900;
}

.drv-links a[href*="paypal.me"]:hover {
  background: #991b1b;
  color: #fff !important;
}

/* Soften machine-facing store copy on light pages */
.ff-intro,
.disclosure.ff-intro {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Product card hover restraint — lift without noisy scale storms */
.product-card {
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.product-card:hover,
.product-card:focus-within {
  border-color: #f5b301;
  box-shadow: 0 12px 28px rgba(6, 26, 51, 0.14);
  transform: translateY(-2px);
}

.product-card:focus-within {
  outline: 2px solid #f5b301;
  outline-offset: 2px;
}

.product-actions a:focus-visible,
.btn:focus-visible,
.exp-hero__cta:focus-visible,
.exp-hero__cta-secondary:focus-visible {
  outline: 3px solid #f5b301;
  outline-offset: 2px;
}

/* Mobile store tools — comfortable tap targets */
@media (max-width: 850px) {
  .store-tools input,
  .store-tools select {
    min-height: 48px;
    font-size: 1rem;
    border-radius: 12px;
  }

  .drv-shop-rail__inner {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.65rem;
  }

  .drv-shop-rail a {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .product-grid {
    gap: 14px;
  }
}

/* Discovery on light trip pages (map / community) */
.site-discover--on-light {
  background: #061a33;
  color: #e2e8f0;
  border-color: rgba(245, 179, 1, 0.45);
}

.site-discover--on-light .site-discover-lead {
  color: #f5b301;
}

.site-discover--on-light a {
  color: #fef3c7;
}

/* Homepage partner bridge — fewer competing CTAs */
.hp-partner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Map page quick guides — invite language */
.map-guide-card a {
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card:hover,
  .drv-shop-rail a {
    transition: none;
    transform: none;
  }
}

/* ========== WO-399A Safari / iPhone shared remediations ========== */

:root {
  --drv-safe-top: env(safe-area-inset-top, 0px);
  --drv-safe-right: env(safe-area-inset-right, 0px);
  --drv-safe-bottom: env(safe-area-inset-bottom, 0px);
  --drv-safe-left: env(safe-area-inset-left, 0px);
  --drv-vvh: 100vh;
  --drv-vvh: 100dvh;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
  padding-left: var(--drv-safe-left);
  padding-right: var(--drv-safe-right);
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* Prevent Safari auto-zoom on focus (<16px) — beat inherit/shorthand later in cascade */
.pe-form input,
.pe-form select,
.pe-form textarea,
.oai-form input,
.oai-form select,
.oai-form textarea,
.store-tools input,
.store-tools select,
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  font-size: 16px;
}

/* Sticky chrome clears notch / Dynamic Island */
.drv-nav,
nav.sticky,
.bi-nav,
.pe-nav,
.oai-nav,
.mk-nav {
  top: 0;
  padding-top: max(0px, var(--drv-safe-top));
}

/* Hero min-heights: prefer dynamic viewport units (Safari toolbar) */
@media (min-width: 900px) {
  .pe-hero,
  .oai-hero {
    min-height: 72vh;
    min-height: 72dvh;
  }
}

@media (max-width: 899px) {
  .pe-hero,
  .oai-hero {
    min-height: 0;
    padding-top: max(2.5rem, calc(1.5rem + var(--drv-safe-top)));
    padding-bottom: max(2rem, calc(1.25rem + var(--drv-safe-bottom)));
  }
}

/* Backdrop-filter fallbacks (older Safari / reduced transparency) */
.exp-hero__scrim,
.hp-hero__scrim,
.bi-nav,
.pe-nav,
.oai-nav,
.mk-nav {
  background-color: rgba(6, 26, 51, 0.92);
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .exp-hero__scrim,
  .hp-hero__scrim {
    background-color: rgba(6, 26, 51, 0.55);
  }
}

/* Product grids — no 3-col overflow on iPhone landscape (~852px) */
.product-grid,
.ff-product-grid,
#ffFeaturedGrid,
#productGrid {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.product-card,
.ff-card {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 920px) {
  .product-grid,
  .ff-product-grid,
  #ffFeaturedGrid.product-grid,
  #productGrid.product-grid,
  .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 921px) and (max-width: 1100px) {
  .product-grid,
  .ff-product-grid,
  #ffFeaturedGrid.product-grid,
  #productGrid.product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Flex children must be allowed to shrink (Safari overflow) */
.drv-nav-inner,
.site-nav-bar-inner,
.wrap,
.section,
.hp-map-frame,
.hp-map-frame__mat,
.hp-map-frame__mount {
  min-width: 0;
  max-width: 100%;
}

/* Responsive media embeds */
.video-bridge iframe,
.ej-video-primary iframe,
.fa-video iframe,
.fly-video iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 180px;
}

/* Touch: disable hover-only lift that can stick after tap */
@media (hover: none) {
  .product-card:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  }

  .product-card:focus-within {
    transform: none;
  }
}

/* Footer / legal links wrap cleanly */
.site-footer-spine,
footer nav {
  max-width: 100%;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
