/* ============================================================
   AREA 3020 — MOBILE FIXES
   Add link to this file in ALL html pages, after styles.css:
   <link rel="stylesheet" href="css/mobile-fixes.css">
   ============================================================ */

/* -------------------------------------------------------
   NAVBAR LAYOUT ON MOBILE
------------------------------------------------------- */
@media (max-width: 767px) {

  .nav-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  .logo { order: 1; }

  .nav-right {
    order: 2;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Hide search/login/signup from top bar on mobile */
  .nav-right .search-wrapper,
  .nav-right .login-btn,
  .nav-right .signup-btn {
    display: none;
  }

  .nav-right .cart-icon {
    display: flex;
  }

  /* Hamburger — always visible */
  .hamburger {
    display: flex !important;
    order: 3;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    transition: background 0.3s;
    flex-shrink: 0;
  }

  .hamburger:hover { background: rgba(255,255,255,0.25); }

  .hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
  }

  .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
  .hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }
}

/* -------------------------------------------------------
   SLIDE-OUT DRAWER
   z-index: 1001 so it's ABOVE the overlay (999)
   but nav links inside it must be clickable
------------------------------------------------------- */
@media (max-width: 767px) {

  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1c1c1c, #2a2a2a);
    flex-direction: column;
    padding: 75px 0 30px;   /* no horizontal padding — let links fill full width */
    gap: 0;
    transition: left 0.35s ease;
    z-index: 1001;           /* above overlay */
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.6);
    list-style: none;
    pointer-events: auto;    /* make sure links are tappable */
  }

  .nav-links.active { left: 0; }

  .nav-links li {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 18px 25px;
    font-size: 16px;
    color: #f2f2f2;
    text-decoration: none;
    transition: background 0.2s, padding-left 0.2s;
    cursor: pointer;
    pointer-events: auto;    /* critical — ensure taps register */
  }

  .nav-links a:hover,
  .nav-links a:active {
    background: rgba(255,255,255,0.1);
    padding-left: 35px;
    color: white;
  }

  .nav-links a::after { display: none; }

  /* Overlay — sits BEHIND the drawer */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 999;            /* below drawer (1001) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;    /* not active when hidden */
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;    /* only intercepts taps when visible */
  }
}

/* -------------------------------------------------------
   CONTENT SPACING — stop sections sliding under navbar
------------------------------------------------------- */
@media (max-width: 767px) {

  /* Shop page */
  .shop-section {
    padding-top: 40px;
  }

  /* Home hero */
  .cta-split {
    padding-top: 50px;
  }

  /* Contact hero */
  .contact-hero {
    padding-top: 50px;
  }

  /* Track / Checkout */
  .track-layout,
  .checkout-container {
    margin-top: 20px;
  }

  /* Product grid — 2 columns on mobile, 1 on very small */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card {
    padding: 12px;
  }

  .product-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
  }

  .product-card h3 {
    font-size: 13px;
  }

  .product-card .price {
    font-size: 14px;
  }

  .product-card select {
    font-size: 12px;
    padding: 6px;
  }

  .product-card button {
    font-size: 12px;
    padding: 10px;
  }

  /* Checkout two-column → single column */
  .checkout-container {
    grid-template-columns: 1fr;
    width: 95%;
  }

  /* Track two-column → single column */
  .track-layout {
    grid-template-columns: 1fr;
    width: 95%;
  }

  /* Footer single column */
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 25px;
  }

  .social-icons {
    justify-content: center;
  }

  .footer a:hover {
    transform: none; /* disable horizontal slide on mobile */
  }

  /* Cart items stack vertically */
  .item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-img {
    width: 100%;
    max-width: 180px;
    height: auto;
  }

  /* Contact wrapper single column */
  .contact-wrapper {
    grid-template-columns: 1fr;
    width: 95%;
    margin: 30px auto;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------
   VERY SMALL PHONES (≤ 480px)
------------------------------------------------------- */
@media (max-width: 480px) {

  .navbar { padding: 10px 14px; }

  .logo img { width: 90px; }

  .nav-right { gap: 6px; }

  .cart-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .hamburger { padding: 7px; }
  .hamburger span { width: 22px; }

  /* Single column product grid on tiny phones */
  .product-grid {
    grid-template-columns: 1fr;
  }

  /* Hero text size */
  .cta-right h2 { font-size: 26px; }
  .hero-content h1 { font-size: 36px; }

  /* Shop title */
  .shop-title { font-size: 24px; }
}