/* ===================================================
   MOBILE RESPONSIVE CSS - Professional Mobile-First
   Screens: 768px and below
   Desktop: Completely untouched
   =================================================== */

@media (max-width: 768px) {
  /* ====== HEADER & NAVIGATION - MOBILE ====== */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1002;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(10px);
    padding: 0;
    width: 100%;
  }

  .nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0.75rem;
    gap: 0;
  }

  .logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
  }

  /* Hamburger Toggle Button - Top Right, Fully Clickable & Visible on Mobile */
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    z-index: 1003;  /* Always on top */
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Hamburger Icon - 3 Lines */
  .hamburger {
    width: 26px;
    height: 2.5px;
    background: var(--text);
    position: relative;
    transition: all 0.3s ease;
  }

  .hamburger::before,
  .hamburger::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 2.5px;
    background: var(--text);
    left: 0;
    transition: all 0.3s ease;
  }

  .hamburger::before { top: -7px; }
  .hamburger::after { bottom: -7px; }

  /* Hamburger Animation - Transforms to X */
  .nav-toggle.open .hamburger {
    background: transparent;
  }

  .nav-toggle.open .hamburger::before {
    transform: translateY(10px) rotate(45deg);
  }

  .nav-toggle.open .hamburger::after {
    transform: translateY(-10px) rotate(-45deg);
  }

  /* Sidebar Navigation - Hidden by Default, Slides from Right */
  .nav {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;  /* Override inset shorthand from style.css */
    width: 50vw;
    max-width: 280px;
    min-height: 100vh;
    max-height: none !important;  /* Override style.css max-height constraint */
    background: var(--section);
    transform: translateX(100%) !important;  /* Hidden off-screen right */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;  /* Above overlay */
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    will-change: transform;
    pointer-events: auto !important;  /* Ensure all nav items are clickable */
  }

  /* Show sidebar when open */
  .nav.open { 
    transform: translateX(0) !important;
  }

  /* Overlay Backdrop - Semi-Transparent, Covers Full Screen */
  .nav-overlay {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;  /* Behind sidebar */
    opacity: 0;  /* Hidden */
    transition: opacity 0.35s ease;
    pointer-events: none;  /* Not clickable when hidden */
    visibility: hidden;  /* Not visible */
  }

  .nav-overlay.show {
    opacity: 1;  /* Visible */
    pointer-events: auto;  /* Clickable */
    visibility: visible;
  }

  /* Navigation Menu Items - Vertical List */
  .nav ul {
    display: flex !important;
    flex-direction: column !important;
    list-style: none !important;
    padding: 1.5rem 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    width: 100% !important;
    height: auto !important;  /* Ensure all items are visible */
    max-height: none !important;  /* No height constraints */
  }

  .nav li { 
    border-bottom: 1px solid rgba(255,255,255,0.06);
    width: 100% !important;
    height: auto !important;
    pointer-events: auto !important;  /* Ensure all items are clickable */
    display: block !important;
  }

  .nav li:last-child { border-bottom: none; }

  /* Menu Links - Full Width, Proper Padding */
  .nav a {
    display: block !important;
    padding: 1rem 1.5rem !important;
    color: var(--text) !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;  /* Make links fully clickable */
    cursor: pointer !important;
  }

  /* Hover Effect */
  .nav a:hover {
    background: rgba(214,194,168,0.12);
    color: var(--accent);
    padding-left: 1.75rem;
  }

  /* Active Link Style */
  .nav a.active {
    color: var(--accent);
    background: rgba(214,194,168,0.1);
    border-left: 2px solid var(--accent);
    padding-left: 1.48rem;
  }

  /* Body Scroll Lock - Prevents scrolling when menu is open */
  body.nav-open { 
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
  }

  html.nav-open {
    overflow: hidden !important;
  }

  /* ====== HERO SECTION ====== */
  .hero { 
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 0.75rem;
    text-align: center;
  }

  .hero-left { width: 100%; text-align: center; }
  .hero-left h1 { font-size: 1.5rem; line-height: 1.3; font-weight: 800; margin-bottom: 1rem; }
  .hero-left p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; opacity: 0.9; }
  .hero-right { width: 100%; }

  /* ====== PRODUCTS GRID - 2 ITEMS PER ROW ====== */
  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-top: 1rem;
  }

  /* ====== SUBCATEGORY GRID - 2 ITEMS PER ROW ====== */
  .subcategory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-top: 1rem;
  }

  .product, .subcategory-grid .card {
    background: var(--section);
    padding: 0.85rem;
    border-radius: var(--rounded);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    height: 100%;
  }

  .product:hover, .subcategory-grid .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.7);
  }

  .product img, .subcategory-grid .card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
  }

  .product-body h3, .subcategory-grid .card h3 {
    font-size: 0.9rem;
    margin: 0.25rem 0;
    font-weight: 600;
    line-height: 1.2;
  }

  .product .desc { 
    font-size: 0.8rem;
    line-height: 1.4; 
    display: -webkit-box; 
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; 
    overflow: hidden;
  }

  .product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }

  .product-actions .btn { width: 100%; font-size: 0.8rem; padding: 0.5rem 0.75rem; }

  .price { font-weight: 700; color: var(--accent); font-size: 0.9rem; }
  .rating { color: gold; font-size: 0.8rem; }

  /* ====== CATEGORIES GRID - 2 ITEMS PER ROW ====== */
  .categories-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .category-card { 
    min-height: 180px; 
    border-radius: var(--rounded); 
    overflow: hidden;
    height: 100%;
  }
  .category-card h3 { font-size: 0.95rem; font-weight: 600; }
  .category-card img { transition: transform 0.5s ease; }
  .category-card:hover img { transform: scale(1.05); }

  /* ====== TEXT & IMAGE RESPONSIVE ====== */
  img { max-width: 100%; height: auto; display: block; }
  h1,h2,h3,p { word-break: break-word; overflow-wrap: break-word; }

  /* ====== PREVENT HORIZONTAL SCROLL ====== */
  body, html, main { overflow-x: hidden; width: 100%; }

  /* ====== CATEGORY HEADER ====== */
  .category-header { margin: 1.5rem 0 2rem; }
  .category-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
  .category-header p { font-size: 0.95rem; opacity: 0.85; }

  /* ====== BUTTONS ====== */
  button, .btn, a.btn { min-height: 44px; padding: 0.75rem 1.25rem; font-size: 0.95rem; border-radius: 8px; font-weight: 600; transition: all 0.2s ease; }
  .btn { width: 100%; text-align: center; }
  .btn-accent { width: 100%; }
  .button-group { display: flex; flex-direction: column; gap: 0.75rem; }
  .button-group .btn { width: 100%; }

  /* ====== FOOTER ====== */
  .site-footer { padding: 1.5rem 0.75rem; }
  .footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-grid h4, .footer-grid h5 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
  .footer-grid a { display: block; padding: 0.5rem 0; color: rgba(245,245,245,0.8); transition: color 0.2s ease; }
  .footer-grid a:hover { color: var(--accent); }

  .socials { display: flex; justify-content: center; gap: 1.5rem; }
  .socials a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(214,194,168,0.1); transition: all 0.2s ease; }
  .socials a:hover { background: rgba(214,194,168,0.2); transform: translateY(-2px); }
  .copyright { font-size: 0.9rem; text-align: center; opacity: 0.7; margin-top: 1rem; }

  /* ====== PRODUCT DETAIL PAGE ====== */
  .product-main { margin-bottom: 1.5rem; }
  .product-main .product-card { padding: 1rem; }
  .product-main h1 { font-size: 1.3rem; margin-bottom: 0.75rem; }
  .product-main .meta { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .product-main .meta .price { font-size: 1.3rem; }
  .product-main .meta .rating { font-size: 1rem; }
  .product-main .button-group { flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
  .product-main .button-group .btn { width: 100%; padding: 0.75rem 1rem; }

  .product-description { padding: 1.25rem; margin-bottom: 1.5rem; }
  .product-description h2 { font-size: 1.2rem; margin-bottom: 1rem; }
  .description-grid { gap: 1.5rem; }

  .reviews-header { grid-template-columns: 1fr; }
  .review-cards { grid-template-columns: 1fr; gap: 1rem; }
  .bar-row { grid-template-columns: 45px 1fr 55px; }

  .product-hero { margin-bottom: 2rem; }
  .hero-container { gap: 1.5rem; }
  .hero-image img { max-width: 100%; }
  .hero-content { padding: 1.25rem; }
  #product-title { font-size: 1.3rem; }
  .rating-section { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .price-section { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .current-price { font-size: 1.5rem; }

  .similar-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .similar-card { padding: 0.75rem; }
  .similar-card h3 { font-size: 0.85rem; }

  /* ====== NEWSLETTER & WHY-CHOOSE ====== */
  .newsletter { padding: 1.5rem 0.75rem; }
  .newsletter form { max-width: 100%; }
  .newsletter input[type="email"] { padding: 0.6rem 0.85rem; font-size: 1rem; }
  .newsletter .btn { width: 100%; padding: 0.75rem 1rem; }

  .why-grid { grid-template-columns: 1fr; gap: 1rem; }
  .why-card { padding: 1.25rem; }

  /* ====== SMART COVERFLOW CAROUSEL ====== */
  .coverflow-carousel { height: 360px; }
  .coverflow-slide { width: 240px; height: 340px; }
  .coverflow-nav { bottom: 15px; gap: 0.75rem; }
  .coverflow-nav button { width: 36px; height: 36px; font-size: 0.9rem; }

  /* ====== PRODUCT DETAILS ====== */
  .product-detail .product-card-inner { flex-direction: column; }
  .product-detail .product-media { flex: 1 0 100%; text-align: center; }
  .product-detail .product-info { flex: 1 0 100%; }

  /* ====== FORMS & INPUTS ====== */
  input, textarea, select { width: 100%; padding: 0.75rem 0.85rem; border-radius: 8px; font-size: 1rem; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.02); color: var(--text); }
  input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,0.04); }
  
  /* ====== EXTRA SMALL DEVICES (480px - 599px) ====== */
  @media (max-width: 599px) {
    .products-grid, .subcategory-grid, .categories-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.7rem;
    }

    .product, .subcategory-grid .card, .category-card {
      padding: 0.7rem;
    }

    .product-body h3 {
      font-size: 0.85rem;
    }

    .product .desc {
      font-size: 0.75rem;
    }

    .container {
      padding: 0 0.6rem !important;
    }

    .nav-wrap {
      padding: 0.75rem 0.6rem;
    }

    section h2 {
      font-size: 1.25rem;
      margin-bottom: 1.2rem;
    }

    .hero-left h1 {
      font-size: 1.3rem;
      line-height: 1.25;
    }

    button, .btn, a.btn {
      padding: 0.7rem 1.1rem;
      font-size: 0.9rem;
    }

    .product-main h1 { font-size: 1.1rem; }
    .product-main .meta .price { font-size: 1.1rem; }
    #product-title { font-size: 1.1rem; }
    .current-price { font-size: 1.2rem; }

    .newsletter input[type="email"] { font-size: 0.95rem; padding: 0.6rem 0.7rem; }
  }
}

/* ====== DESKTOP OVERRIDE (>768px) ====== */
/* Ensure desktop nav is visible and hamburger is hidden */
@media (min-width: 769px) {
  .nav-toggle {
    display: none !important;
  }
  
  .nav {
    display: flex !important;
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    min-height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  
  .nav ul {
    flex-direction: row !important;
    gap: 1rem !important;
    padding: 0 !important;
  }
  
  .nav li {
    border-bottom: none !important;
    width: auto !important;
  }
  
  .nav a {
    padding: 0.5rem 1rem !important;
    font-size: 1rem !important;
  }
  
  .nav-overlay {
    display: none !important;
  }
}