/* COMPLETE RESPONSIVE FIXES FOR ALL DEVICES */

/* ========== MOBILE (0-768px) ========== */
@media (max-width: 768px) {
  /* 1. FIX BODY AND HTML */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
  }
  
  /* 2. FIX NAVBAR - CRITICAL */
  .navbar {
    flex-wrap: wrap !important;
    padding: 10px 15px !important;
    position: relative !important;
    width: 100% !important;
    z-index: 9999 !important;
  }
  
  .logo {
    order: 1 !important;
    flex: 1 !important;
    z-index: 10001 !important;
    position: relative !important;
  }
  
  .logo a {
    font-size: 20px !important;
  }
  
  .menu-icon {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    order: 2 !important;
    font-size: 24px !important;
    cursor: pointer !important;
    padding: 8px !important;
    background: #f5f5f5 !important;
    border-radius: 4px !important;
    margin-left: 10px !important;
    z-index: 10002 !important;
    position: relative !important;
  }
  
  /* HIDE DESKTOP NAVIGATION */
  .nav-links {
    display: none !important;
    position: fixed !important;
    top: 70px !important;
    left: 0 !important;
    width: 100% !important;
    background: white !important;
    flex-direction: column !important;
    padding: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    z-index: 9998 !important;
    border-top: 1px solid #eee !important;
    margin: 0 !important;
  }
  
  .nav-links.active {
    display: flex !important;
  }
  
  .nav-links li {
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 1px solid #eee !important;
  }
  
  .nav-links li:last-child {
    border-bottom: none !important;
  }
  
  .nav-links a {
    display: block !important;
    padding: 15px !important;
    font-size: 16px !important;
    width: 100% !important;
    text-align: left !important;
  }
  
  /* FIX SEARCH BAR */
  .search-bar {
    order: 3 !important;
    width: 100% !important;
    margin: 10px 0 0 0 !important;
    display: flex !important;
    z-index: 9997 !important;
    position: relative !important;
  }
  
  .search-bar input {
    flex: 1 !important;
    padding: 12px 15px !important;
    font-size: 16px !important;
    border-radius: 8px 0 0 8px !important;
  }
  
  .search-bar button {
    padding: 12px 20px !important;
    font-size: 16px !important;
    border-radius: 0 8px 8px 0 !important;
  }
  
  /* 3. FIX HERO SECTION - SIMPLIFIED WITHOUT SLIDER */
  .hero {
    height: 40vh !important;
    min-height: 250px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 20px !important;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)) !important;
    color: white !important;
  }
  
  .hero-content {
    max-width: 100% !important;
    padding: 20px !important;
  }
  
  .hero-content h1 {
    font-size: 28px !important;
    margin-bottom: 15px !important;
  }
  
  .hero-content p {
    font-size: 16px !important;
    margin-bottom: 20px !important;
  }
  
  .hero-content .btn {
    display: inline-block !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    pointer-events: auto !important;
  }
  
  /* Remove slider-specific styles */
  .hero-slider,
  .slider-container,
  .slider,
  .slide,
  .slide-content,
  .slider-nav,
  .prev-btn,
  .next-btn,
  .dots,
  .dot {
    display: none !important;
  }
  
  /* 4. FIX CATEGORIES SECTION */
  .categories {
    padding: 30px 15px !important;
  }
  
  .categories h2 {
    font-size: 24px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
  }
  
  .category-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 0 !important;
  }
  
  .category-card {
    width: 100% !important;
    margin-bottom: 15px !important;
  }
  
  .category-card img {
    height: 150px !important;
    object-fit: cover !important;
  }
  
  .category-card h3 {
    font-size: 18px !important;
    padding: 10px 15px !important;
  }
  
  /* 5. FIX FEATURED PRODUCTS */
  .featured {
    padding: 30px 15px !important;
  }
  
  .featured h2 {
    font-size: 24px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
  }
  
  .product-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 0 !important;
  }
  
  .product-card {
    width: 100% !important;
    padding: 15px !important;
    margin-bottom: 15px !important;
  }
  
  .product-card img {
    height: 200px !important;
    object-fit: cover !important;
  }
  
  .product-card h3 {
    font-size: 16px !important;
    margin: 10px 0 5px !important;
  }
  
  .product-card .price {
    font-size: 18px !important;
    margin: 5px 0 10px !important;
  }
  
  .product-card .btn {
    width: 100% !important;
    padding: 12px !important;
    font-size: 15px !important;
    margin: 5px 0 !important;
  }
  
  .wishlist-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
    top: 10px !important;
    right: 10px !important;
  }
  
  .small-link {
    display: block !important;
    margin: 10px 0 0 0 !important;
    text-align: center !important;
  }
  
  /* 6. FIX FOOTER */
  .footer-container {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    padding: 30px 15px !important;
  }
  
  .footer-section {
    text-align: center !important;
    padding: 0 !important;
  }
  
  .social-links {
    justify-content: center !important;
  }
  
  .footer-bottom-container {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
  }
  
  .footer-links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 15px !important;
  }
  
  .newsletter-form {
    flex-direction: column !important;
  }
  
  .newsletter-form input,
  .newsletter-form button {
    width: 100% !important;
  }
  
  /* 7. FIX ALL BUTTONS FOR TOUCH */
  button, .btn, a.btn, input[type="submit"] {
    min-height: 44px !important;
    min-width: 44px !important;
    font-size: 16px !important;
    padding: 12px 20px !important;
  }
  
  /* 8. FIX TEXT SIZES */
  h1 { font-size: 28px !important; }
  h2 { font-size: 24px !important; }
  h3 { font-size: 20px !important; }
  p, li, a { font-size: 16px !important; }
  
  /* 9. REMOVE HOVER EFFECTS ON MOBILE */
  @media (hover: none) {
    .btn:hover, button:hover, a:hover, .product-card:hover, .category-card:hover {
      transform: none !important;
      box-shadow: none !important;
    }
  }
}

/* ========== TABLET (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-grid, .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .hero {
    height: 50vh !important;
  }
  
  .hero-content h1 {
    font-size: 32px !important;
  }
  
  .navbar {
    padding: 15px 20px !important;
  }
}

/* ========== SMALL MOBILE (≤ 480px) ========== */
@media (max-width: 480px) {
  .hero {
    height: 35vh !important;
    min-height: 200px !important;
  }
  
  .hero-content h1 {
    font-size: 24px !important;
  }
  
  .hero-content p {
    font-size: 14px !important;
  }
  
  .categories h2, .featured h2 {
    font-size: 22px !important;
  }
  
  .product-card img {
    height: 180px !important;
  }
}

/* ========== LANDSCAPE MODE ========== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    height: 60vh !important;
  }
  
  .nav-links {
    max-height: 70vh !important;
    overflow-y: auto !important;
  }
  
  .product-grid, .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ========== EMERGENCY FIXES ========== */
/* Prevent horizontal scrolling */
* {
  max-width: 100vw !important;
}

/* Ensure containers don't overflow */
.container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
  .hero {
    height: -webkit-fill-available !important;
  }
}

/* Make all images responsive */
img {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap target sizes */
  button, .btn, a {
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover states */
  .product-card:hover, .category-card:hover {
    transform: none !important;
  }
}

/* SHOP-SPECIFIC RESPONSIVE STYLES - CLEANED UP */
@media (max-width: 768px) {
  .shop-section .container {
    padding: 0 15px !important;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }
  
  .product-card {
    padding: 15px !important;
  }
  
  .product-card img {
    height: 150px !important;
  }
  
  .load-more-container {
    padding: 20px 0 !important;
  }
  
  #loadMoreBtn {
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
  }
  
  /* Remove filter-related styles */
  .filters-panel,
  .filters-overlay,
  .filter-toggle,
  .active-filters,
  .filter-group,
  .filter-options {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr !important;
  }
}

/* CRITICAL FIXES FOR ALL PAGES */
/* Ensure navbar is always clickable on mobile */
@media (max-width: 768px) {
  .navbar > * {
    pointer-events: auto !important;
  }
  
  /* Ensure menu button is always on top */
  .menu-icon {
    z-index: 10004 !important;
  }
}



/* ========== PRODUCT DETAIL PAGE RESPONSIVE STYLES ========== */
@media (max-width: 1024px) {
    .product-detail {
        gap: 30px;
        padding: 25px;
    }
    
    .main-image {
        height: 450px;
    }
    
    .product-title {
        font-size: 1.8rem;
    }
    
    .product-price {
        font-size: 1.6rem;
    }
    
    #productDetailSizeOptionsOnly {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Product Detail Layout */
    .product-detail {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        padding: 20px !important;
    }
    
    .product-detail-container {
        padding: 15px !important;
    }
    
    /* Images */
    .main-image {
        height: 400px !important;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .thumbnail {
        height: 70px !important;
    }
    
    /* Typography */
    .product-title {
        font-size: 1.6rem !important;
    }
    
    .product-price {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .product-description {
        font-size: 0.95rem !important;
        margin-bottom: 20px !important;
    }
    
    /* Selection Controls */
    .color-selection h3,
    .size-selection h3,
    .quantity-selection h3 {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }
    
    #productDetailColorOptionsOnly {
        gap: 10px !important;
    }
    
    .product-detail-color-circle {
        width: 40px !important;
        height: 40px !important;
    }
    
    #productDetailSizeOptionsOnly {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    .product-detail-size-box {
        padding: 10px 6px !important;
        font-size: 13px !important;
        min-width: 45px !important;
    }
    
    /* Bulk Pricing */
    .bulk-pricing-detail {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
    
    .bulk-pricing-detail h3 {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }
    
    .pricing-tier {
        font-size: 0.9rem !important;
        padding: 6px 0 !important;
    }
    
   
    
    /* Tabs */
    .details-tabs {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .tab {
        padding: 8px 15px !important;
        font-size: 0.95rem !important;
    }
    
    /* Navigation Arrows */
    .slideshow-prev,
    .slideshow-next {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    
    .slideshow-prev {
        left: 10px !important;
    }
    
    .slideshow-next {
        right: 10px !important;
    }
    
    /* Touch Targets */
    .product-detail-color-circle,
    .product-detail-size-box,
    .product-detail-quantity-btn,
    .thumbnail,
    .slideshow-prev,
    .slideshow-next,
    .add-to-cart-btn,
    .wishlist-btn,
    .tab {
        min-height: 44px !important;
    }
    
    .product-detail-color-circle {
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    .product-detail-size-box {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

@media (max-width: 576px) {
    .product-detail {
        padding: 15px !important;
        gap: 20px !important;
    }
    
    .product-detail-container {
        padding: 10px !important;
    }
    
    .main-image {
        height: 350px !important;
    }
    
    .product-title {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }
    
    .product-price {
        font-size: 1.4rem !important;
    }
    
    #productDetailColorOptionsOnly {
        gap: 8px !important;
    }
    
    .product-detail-color-circle {
        width: 35px !important;
        height: 35px !important;
        border-width: 2px !important;
    }
    
    #productDetailSizeOptionsOnly {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    
    .product-detail-size-box {
        padding: 8px 4px !important;
        font-size: 12px !important;
        min-width: 40px !important;
    }
    
    #productDetailQuantityControls {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .product-detail-quantity-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
    
    .product-detail-quantity-input {
        width: 60px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
    
    .product-detail-quantity-note {
        font-size: 12px !important;
        display: block !important;
        width: 100% !important;
        margin-top: 5px !important;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    .thumbnail {
        height: 60px !important;
    }
    
    .bulk-pricing-detail {
        padding: 12px !important;
    }
    
    .pricing-tiers {
        gap: 8px !important;
    }
    
    .pricing-tier {
        font-size: 0.85rem !important;
    }
    
    .tab-content {
        font-size: 0.9rem !important;
    }
    
    .slideshow-prev,
    .slideshow-next {
        width: 35px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 400px) {
    .main-image {
        height: 300px !important;
    }
    
    .product-title {
        font-size: 1.3rem !important;
    }
    
    .product-price {
        font-size: 1.2rem !important;
    }
    
    #productDetailSizeOptionsOnly {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .thumbnail {
        height: 50px !important;
    }
    
  
    
}
