/* =============================================
   HRz PITSTOP – Mobile & Responsive Stylesheet
   Strict Mobile Layout & Zero Horizontal Overflow
   ============================================= */

/* Prevent page zoom-out / horizontal overflow */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ---- Search Panel Defaults ---- */
.search-panel {
  position: fixed;
  z-index: 102;
  left: 50%;
  top: 100px;
  width: min(690px, 92%);
  padding: 32px;
  background: var(--charcoal);
  color: #fff;
  transform: translate(-50%, -30px);
  opacity: 0;
  visibility: hidden;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.search-panel.open {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}
.close-search {
  position: absolute;
  right: 16px;
  top: 16px;
  border: 0;
  background: rgba(255,255,255,0.08);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.close-search:hover { background: rgba(255,255,255,0.2); }

.search-panel label {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--red);
  margin-top: 20px;
  padding-bottom: 4px;
}
.search-panel label span { font-size: 22px; color: var(--red); margin-right: 8px; }
.search-panel input {
  border: 0;
  background: transparent;
  padding: 10px 0;
  width: 100%;
  outline: 0;
  font-size: 17px;
  color: #ffffff;
  font-weight: 500;
}
.search-results {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 14px;
}
.search-results .autocomplete-item {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.search-results .autocomplete-item img { border-radius: 4px; width: 40px; height: 40px; object-fit: cover; }
.search-results .autocomplete-item strong { color: #fff; font-size: 14px; display: block; }
.search-results .autocomplete-item small { color: var(--mute); font-size: 12px; }

/* ---- Mobile Dock Hide on Desktop ---- */
.mobile-dock { display: none; }

@media (min-width: 801px) {
  .mobile-dock { display: none !important; }
}

/* ---- Tablet & Below (≤ 800px) ---- */
@media (max-width: 800px) {
  body { padding-bottom: 66px; }

  .topline {
    font-size: 10px;
    height: 30px;
    padding: 0 4vw;
  }
  .topline span:last-child { display: none; }

  .nav-wrap {
    height: 58px;
    padding: 0 4vw;
    top: 30px;
  }
  .main-nav { display: none; }
  .brand { font-size: 21px; }

  /* Touch Header Actions */
  .nav-actions { gap: 6px; }
  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #ffffff;
  }
  .bag {
    height: 36px;
    padding: 0 12px;
    background: var(--red);
    color: #ffffff;
    border-radius: 99px;
    border: 0;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .bag b {
    width: 18px;
    height: 18px;
    background: #ffffff;
    color: var(--red);
    border-radius: 50%;
    font-size: 10px;
    display: grid;
    place-items: center;
  }

  /* ---- HERO SECTION MOBILE OVERHAUL ---- */
  .hero {
    height: auto;
    min-height: 540px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 4.5vw 20px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .hero > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 82% center; /* Focus on rider on the right side */
    filter: brightness(0.6);
  }
  .hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,12,15,0.92) 0%, rgba(11,12,15,0.45) 45%, rgba(11,12,15,0.95) 100%);
  }

  /* Flow copy container: Top content at top, bike selector card at bottom */
  .hero-copy {
    position: relative;
    z-index: 2;
    left: 0;
    top: 0;
    right: 0;
    transform: none;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    flex: 1;
  }

  .hero-headline-custom {
    font-size: clamp(32px, 8vw, 50px);
    margin-bottom: 8px;
    line-height: 1.05;
  }
  .hero-text {
    font-size: 13px;
    max-width: 100%;
    margin: 6px 0 16px;
    color: #d8d8d4;
    line-height: 1.5;
  }

  /* PIN BIKE SELECTOR CARD TO BOTTOM OF HERO */
  .hero-bike-action-card {
    margin-top: auto; /* Push card to the bottom of the hero element */
    padding: 14px;
    background: rgba(13, 14, 16, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }
  .hero-bike-action-card .active-bike-summary {
    justify-content: center;
  }
  .hero-bike-action-card .button {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    font-size: 13px;
  }

  /* ---- Benefits Strip ---- */
  .benefits { grid-template-columns: 1fr 1fr; padding: 10px 4vw; gap: 0; }
  .benefits > div { padding: 8px 4px; border: 0; min-height: 55px; }

  /* ---- Section Spacing ---- */
  .section { padding: 40px 4vw; }
  .section-head { margin-bottom: 20px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-head h2 { font-size: clamp(32px, 8vw, 44px); }

  /* ---- Category Grid ---- */
  .category-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 160px 160px; gap: 8px; }
  .category.large { grid-row: span 2; }
  .category span { bottom: 10px; left: 10px; right: 10px; font-size: 20px; }

  /* ---- Product Cards & Grid ---- */
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-card-media,
  .product-image { height: 170px; }
  .view:not(#home) .product-card-media,
  .view:not(#home) .product-image { height: 150px; }

  .product-card .quick-button {
    transform: none;
    position: relative;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    padding: 8px;
    margin-top: 6px;
    font-size: 11px;
    border-radius: var(--radius-sm);
  }
  .product-card-content,
  .product-info { padding: 8px 6px; }
  .product-title,
  .product-info h3 { font-size: 14px; }

  /* Filter Pills on Catalog */
  .category-filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-pill { padding: 6px 14px; font-size: 12px; }
  .catalog-header-bar { padding: 0 4vw; flex-direction: column; align-items: stretch; gap: 10px; }

  /* ---- FULL-SCREEN SEARCH PANEL ON MOBILE ---- */
  .search-panel {
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    transform: none !important;
    border-radius: 0;
    padding: 20px 16px;
    background: #0e1014;
    z-index: 102;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .search-panel.open {
    transform: none !important;
    opacity: 1;
    visibility: visible;
  }
  .close-search {
    top: 14px; right: 14px;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.1);
  }

  /* ---- Drawer & Overlay ---- */
  .drawer {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(85vh, 650px);
    transform: translateY(105%);
    border-radius: 18px 18px 0 0;
    z-index: 101;
    box-sizing: border-box;
  }
  .drawer.open { transform: translateY(0); }
  .overlay { z-index: 100; }
  .cart-items { padding: 10px 16px; }
  .cart-summary { padding: 14px 16px 20px; }

  /* ---- Quick View Mobile ---- */
  .quick-view {
    grid-template-columns: 1fr;
    width: 92%;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    z-index: 105;
    box-sizing: border-box;
  }
  .quick-view > img { height: 200px; }
  .quick-view > div { padding: 20px; }

  /* ---- Garage & Modal Mobile ---- */
  .modal-card { width: 92%; max-height: 86vh; }
  .garage-grid { padding: 0 4vw; grid-template-columns: 1fr; }

  /* ---- Product Detail & Checkout Layout ---- */
  .product-detail-layout { grid-template-columns: 1fr; padding: 0 4vw 50px; }
  .checkout-layout { grid-template-columns: 1fr; padding: 0 4vw 50px; }

  /* ---- Statement, Drops, Reviews ---- */
  .statement { grid-template-columns: 1fr; }
  .statement-image { height: 240px; }
  .statement-copy { padding: 36px 4vw; }
  .drop-grid { grid-template-columns: 1fr; }
  .drop-card { height: 260px; }
  .newsletter { padding: 40px 4vw; }
  .service-strip { grid-template-columns: 1fr; padding: 18px 4vw; gap: 14px; }
  .review-window { margin-right: 0; }

  /* ---- MOBILE BOTTOM DOCK (EXACTLY 5 EQUAL ITEMS) ---- */
  .mobile-dock {
    position: fixed;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    height: 60px;
    bottom: 0; left: 0; right: 0;
    width: 100% !important;
    max-width: 100% !important;
    background: #0d0e11;
    backdrop-filter: blur(16px);
    color: #fff;
    z-index: 40;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    overflow: hidden;
  }
  .mobile-dock .dock-item {
    position: relative;
    border: 0;
    background: none;
    color: #8c8e93;
    width: 100%;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 17px;
    text-decoration: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
  }
  .mobile-dock .dock-item span {
    font: 600 9px 'DM Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: .2px;
  }
  .mobile-dock .dock-item.active {
    color: var(--red2);
  }
  .mobile-dock .dock-item i {
    position: absolute;
    top: 3px;
    right: 18%;
    background: var(--red);
    color: #ffffff;
    border-radius: 50%;
    font: 700 9px 'DM Sans';
    font-style: normal;
    min-width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
  }
}

/* ---- Small Mobile (≤ 480px) ---- */
@media (max-width: 480px) {
  .hero-headline-custom { font-size: clamp(28px, 8vw, 42px); }
  .hero-text { font-size: 12px; }
  .hero { min-height: 500px; }

  .category-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 140px 140px;
    gap: 6px;
  }
  .category span { font-size: 17px; }

  .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-card-media,
  .product-image { height: 150px; }
  .product-info h3,
  .product-title { font-size: 13px; }
  
  .review-card { min-width: 100%; padding: 18px; }
  .fit-steps { gap: 4px; }
  .fit-steps span { width: 29vw; height: 80px; padding: 6px; font-size: 15px; }

  .newsletter form { display: flex; flex-direction: column; gap: 8px; }
  .newsletter input { width: 100%; border-right: 1px solid #55585a; }
  .newsletter button { width: 100%; justify-content: center; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
}
