:root {
  --bg: #0b0f14;
  --bg-2: #0f1720;
  --card: #0f1726;
  --muted: #9aa6b2;
  --accent: #00a6ff;
  --accent-2: #285bff;
  --glass: rgba(255,255,255,0.04);
  --radius: 12px;
  --container: 1200px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* FIX: overflow-x:hidden must be on BOTH html AND body — on mobile, overflow on
   body alone doesn't prevent the viewport from being panned horizontally by touch */
html {
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, var(--bg), #06080a 180%);
  color: #e6eef8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  /* FIX: Prevent any child from causing horizontal scroll */
  overflow-x: hidden;
}

/* ===================== CONTAINER ===================== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* FIX: .trust-inner replaces the conflicting .small utility on the trust section.
   .small was colliding with .btn.small — renamed to .btn-small in HTML too. */
.trust-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* ===================== HEADER ===================== */
/* FIX: Header was transparent on scroll — added solid dark background so
   content doesn't bleed through when scrolling past the hero */
.header {
  position: sticky;
  top: 0;
  z-index: 130; /* FIX: Must exceed overlay (110) and nav drawer (120) so hamburger stays clickable */
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
}

/* ===================== DESKTOP NAV ===================== */
.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.nav a:hover {
  color: #fff;
  background: var(--glass);
}

/* ===================== HAMBURGER ===================== */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  gap: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 20px;
  background: var(--accent);
  margin: 3px 0;
  transition: all 0.25s ease;
}

/* ===================== MOBILE NAV DRAWER ===================== */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -340px; /* FIX: Extra offset covers the 30px box-shadow bleed so no sliver shows */
  width: 300px; /* FIX: Reduced from 320px to 300px — prevents overflow on 320px-wide screens */
  max-width: 85vw; /* FIX: Never wider than 85% of the viewport */
  height: 100vh;
  background: linear-gradient(180deg, rgba(6,10,14,0.98), rgba(12,16,20,0.98));
  box-shadow: -30px 0 60px rgba(0,0,0,0.6);
  padding: 80px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: right 0.28s ease, visibility 0.28s ease;
  z-index: 120;
  overflow-y: auto;
  /* FIX: visibility:hidden makes the drawer completely inert and undetectable
     when closed — it can't be swiped into view or accidentally interacted with */
  visibility: hidden;
}
.mobile-nav a {
  color: #e6eef8;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mobile-nav a:last-of-type {
  border-bottom: none;
}
.mobile-nav.open {
  right: 0;
  visibility: visible;
}
.mobile-cart {
  margin-top: auto;
  padding-top: 20px;
}
/* FIX: Cart button inside mobile nav needs explicit dark styling — without a
   variant class (.primary/.ghost) the browser renders a default white button */
.mobile-cart .btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e6eef8;
  width: 100%;
  justify-content: center;
}
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,12,0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 110;
}
.mobile-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ===================== HERO ===================== */
.hero {
  min-height: 72vh;
  display: flex;
  align-items: center;
  position: relative;
  background-size: cover;
  background-position: center;
  margin-top: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2,6,12,0.6) 10%, rgba(2,6,12,0.9) 80%);
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 40px;
  align-items: center;
  padding: 72px 0;
  width: 100%;
}
.hero-copy {
  flex: 1;
  max-width: 640px;
}
.hero-copy h1 {
  font-family: Poppins, Inter;
  font-weight: 700;
  font-size: clamp(26px, 4vw, 44px); /* FIX: Fluid font size — no abrupt jumps between breakpoints */
  margin: 0 0 12px;
  color: #fff;
  line-height: 1.1;
}
.lead {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: clamp(14px, 2vw, 16px); /* FIX: Fluid sizing */
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap; /* FIX: Buttons wrap to next line on very small screens */
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  font-size: 14px;
  white-space: nowrap; /* FIX: Prevent button text wrapping mid-word */
}
.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #031026;
  box-shadow: 0 8px 30px rgba(0,100,255,0.12);
}
.btn.ghost {
  background: transparent;
  color: #dbeeff;
  border: 1px solid rgba(255,255,255,0.06);
}
/* FIX: Renamed from .btn.small to .btn.btn-small to avoid conflict with container .small */
.btn.btn-small {
  padding: 8px 10px;
  font-size: 13px;
}
.btn.icon {
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 16px;
}
.btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #e6eef8;
}
.btn.outline:hover {
  background: var(--glass);
}

/* ===================== HERO VISUAL ===================== */
.hero-visual {
  flex: 0 0 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual img {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2,10,30,0.7);
}

/* ===================== SECTIONS ===================== */
.section {
  padding: 64px 0;
}
.section-title {
  font-family: Poppins;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  font-size: clamp(18px, 3vw, 24px); /* FIX: Fluid section title size */
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 26px;
  padding: 0 16px; /* FIX: Padding prevents text touching edges on mobile */
}
.section-dark {
  background: linear-gradient(180deg, rgba(4,8,12,0.6), rgba(6,10,14,0.6));
  border-top: 1px solid rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.section-dark-alt {
  background: transparent;
}

/* ===================== CATEGORIES ===================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 22px;
}
.cat-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: block;
  text-decoration: none;
  color: inherit;
}
.cat-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transform: scale(1.03);
  transition: transform 0.5s;
}
.cat-card:hover img {
  transform: scale(1.08);
}
.cat-meta {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  color: #fff;
}
.cat-meta h3 {
  margin: 0;
  font-size: 18px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

/* ===================== PRODUCTS ===================== */
/* FIX: products-head now wraps to column on small screens */
.products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap; /* FIX: Allows heading + filters to stack on mobile */
  margin-bottom: 4px;
}

/* FIX: Filters container scrolls horizontally if too wide, never overflows page */
.product-filters-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar on Firefox */
  max-width: 100%;
}
.product-filters-wrap::-webkit-scrollbar {
  display: none; /* Hide scrollbar on Chrome/Safari */
}
.product-filters {
  display: flex;
  gap: 8px;
  padding-bottom: 4px; /* FIX: Space for any residual scrollbar */
  white-space: nowrap; /* FIX: Keep all buttons on one line inside scrollable wrapper */
}
.filter-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 14px;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0; /* FIX: Buttons never shrink */
}
.filter-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.filter-btn.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #031026;
  border: 0;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.product-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.015));
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform 0.28s, box-shadow 0.28s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.product-body {
  padding: 14px;
}
.product-body h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.price {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.card-cta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.products-footer {
  text-align: center;
  margin-top: 28px;
}

/* ===================== DEALS ===================== */
.deals-slider {
  position: relative;
  display: flex;
  gap: 18px;
  margin-top: 18px;
  overflow: hidden;
}
.deal-slide {
  min-width: 100%;
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 22px;
  background: linear-gradient(180deg, rgba(20,28,40,0.6), rgba(10,16,24,0.6));
  border-radius: 12px;
}
.deal-slide img {
  width: 48%;
  min-width: 0; /* FIX: Allow image to shrink on narrow screens */
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 1; /* FIX: Image shrinks proportionally */
}
.deal-info {
  flex: 1;
  color: #eaf6ff;
  min-width: 0; /* FIX: Prevents text from overflowing flex container */
}
.deal-info h3 {
  font-size: clamp(15px, 2.5vw, 20px); /* FIX: Fluid heading in deal card */
  margin: 0 0 8px;
}
.deal-price {
  font-size: clamp(16px, 2.5vw, 20px); /* FIX: Fluid price size */
  margin: 10px 0;
}
.was {
  color: var(--muted);
  margin-left: 8px;
  font-weight: 500;
  text-decoration: line-through;
}
/* FIX: Controls properly centered with flex */
.deals-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

/* ===================== TRUST / WHY SHOP ===================== */
/* FIX: trust-grid uses flex-wrap so cards wrap on small screens
   instead of overflowing with fixed 220px widths */
.trust-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap; /* FIX: Cards wrap to next row on small screens */
  margin-top: 18px;
}
.trust-card {
  background: var(--card);
  padding: 18px 24px;
  border-radius: 12px;
  text-align: center;
  flex: 1 1 200px; /* FIX: Grow/shrink freely, min 200px wide */
  max-width: 280px;
  border: 1px solid rgba(255,255,255,0.04);
}
.trust-card strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
}

/* ===================== CONTACT ===================== */
/* FIX: contact-grid collapses to 1 column at 768px (not just at 720px),
   and the second column is no longer a fixed 360px */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}
.contact-form {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* FIX: Added placeholder color and font-family so inputs look consistent */
.contact-form input,
.contact-form textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #eaf6ff;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted); /* FIX: Placeholder text visible on dark background */
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-info {
  padding: 16px;
}
.contact-info h4 {
  color: #fff;
  margin: 0 0 8px;
}
.contact-info h4 + h4 {
  margin-top: 20px;
}
.contact-info p {
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.6;
}
.contact-info a {
  color: var(--accent);
  text-decoration: none;
}

/* ===================== FOOTER ===================== */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.footer-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; /* FIX: Footer items wrap on mobile */
}
.copyright {
  color: var(--muted);
  font-size: 14px;
}
.socials {
  color: var(--muted);
  font-size: 14px;
}

/* ===================== UTILITIES ===================== */
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ===================== BREAKPOINT: TABLET 1024px ===================== */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr); /* FIX: 4 → 2 cols on tablet */
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr); /* FIX: 3 → 2 cols on tablet */
  }
  .contact-grid {
    grid-template-columns: 1fr; /* FIX: Stack contact form + info on tablet */
  }
  .hero-visual {
    display: none; /* Hide decorative image on smaller screens */
  }
  .hero-copy {
    max-width: 100%;
  }
}

/* ===================== BREAKPOINT: MOBILE 768px ===================== */
/* FIX: Added 768px breakpoint — original only had 720px,
   leaving a gap where issues still occurred */
@media (max-width: 768px) {
  .nav {
    display: none; /* Hide desktop nav */
  }
  .hamburger {
    display: flex; /* Show hamburger */
  }

  .section {
    padding: 48px 0;
  }

  .hero-inner {
    flex-direction: column;
    padding: 48px 0;
  }
  .hero-copy {
    text-align: center;
  }
  .hero-cta {
    justify-content: center;
  }

  /* FIX: products-head stacks heading above filters on mobile */
  .products-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .products-head .section-title {
    text-align: left;
  }
  .product-filters-wrap {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: 1fr; /* FIX: Single column product grid on mobile */
  }

  /* FIX: Deal slide stacks image above text on mobile */
  .deal-slide {
    flex-direction: column;
    gap: 16px;
  }
  .deal-slide img {
    width: 100%;
    height: 200px;
  }

  .trust-grid {
    flex-direction: column;
    align-items: center;
  }
  .trust-card {
    max-width: 100%;
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr); /* FIX: Keep 2 cols on mobile (not 1) */
    gap: 12px;
  }
  .cat-card img {
    height: 160px; /* FIX: Shorter images on mobile for better proportion */
  }
}

/* ===================== BREAKPOINT: SMALL MOBILE 480px ===================== */
/* FIX: New breakpoint — original had nothing for very small screens */
@media (max-width: 480px) {
  .container {
    padding: 0 16px; /* Tighter padding on small screens */
  }

  .categories-grid {
    grid-template-columns: 1fr; /* FIX: Single column on very small screens */
    gap: 10px;
  }

  .hero-cta {
    flex-direction: column; /* FIX: Stack CTA buttons on very small screens */
    align-items: stretch;
  }
  .hero-cta .btn {
    text-align: center;
    justify-content: center;
  }

  .deal-slide {
    padding: 14px;
  }
  .deal-slide img {
    height: 160px;
  }

  .section-title {
    font-size: 18px;
  }

  .product-card img {
    height: 180px;
  }
}