/* ============================================
   SHOP RESPONSIVE STYLES
   ============================================ */

/* Desktop */
@media (min-width: 901px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
    gap: 26px !important;
  }
}

/* Large Screens */
@media (min-width: 1300px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    gap: 30px !important;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  }
  
  .shop-container {
    grid-template-columns: 1fr;
    padding: 0 18px;
  }
  
  .shop-sidebar {
    order: 2;
  }
  
  .shop-products {
    order: 1;
  }
}

/* Mobile */
@media (max-width: 760px) {
  .hero-right {
    flex-basis: 100%;
  }
  
  .shop-hero-img {
    height: 220px;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }
  
  .product-card {
    border-radius: 14px !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  .product-img {
    height: 180px !important;
    border-radius: 14px 14px 0 0 !important;
    width: 100% !important;
    object-fit: cover !important;
  }
  
  .product-body {
    padding: 10px 8px !important;
  }
  
  .product-title {
    font-size: 14px !important;
    line-height: 1.3 !important;
  }
  
  .product-price {
    font-size: 14px !important;
  }
  
  .product-meta {
    font-size: 12px !important;
  }
}

/* Force desktop card consistency */
@media (min-width: 601px) {
  .product-card {
    width: 100% !important;
    border-radius: 16px !important;
  }
  
  .product-img {
    width: 100% !important;
    height: 240px !important;
    object-fit: cover !important;
    border-radius: 16px 16px 0 0 !important;
  }
}

/* ================================
   RESPONSIVE LAYOUT ADJUSTMENTS
================================ */

@media (max-width: 1200px) {
  .shop-container {
    grid-template-columns: 280px 1fr;
    gap: 50px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
  }
}

@media (max-width: 980px) {
  .shop-container {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0 25px;
  }
  
  .shop-sidebar {
    position: static;
    order: 2;
  }
  
  .shop-products {
    order: 1;
  }
  
  .mobile-filter-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #aae6eb, #90d9e0);
    color: #1A365D !important;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(170, 230, 235, 0.3);
    letter-spacing: 0.5px;
  }
  
  .mobile-filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(170, 230, 235, 0.4);
  }
}

@media (max-width: 768px) {
  .shop-top-hero {
    padding: 60px 0 40px;
  }
  
  .shop-hero-title {
    font-size: 2.8rem;
  }
  
  .shop-hero-subtitle {
    font-size: 1.2rem;
  }
  
  .shop-controls {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
  
  .mobile-filter-btn {
    width: 100%;
    justify-content: center;
  }
  
  .sort-wrap {
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
  }
  
  .product-img {
    height: 280px;
  }
  
  .product-body {
    padding: 22px;
  }
  
  .product-title {
    font-size: 1.3rem;
  }
  
  .product-price {
    font-size: 1.4rem;
  }
  
  .shop-hero-title {
    font-size: 2.4rem;
  }
  
  .hero-right {
    flex-basis: 100%;
  }
  
  .shop-hero-img {
    height: 200px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .product-card {
    max-width: 100%;
  }
  
  .shop-hero-title {
    font-size: 2.2rem;
  }
}

/* ================================
   MOBILE NAVIGATION FIXES
================================ */

/* Hide desktop navigation on mobile */
@media (max-width: 900px) {
  #mainNav, .main-nav {
    display: none !important;
  }
  
  /* Show mobile menu button */
  .mobile-menu-btn {
    display: block !important;
  }
  
  /* Adjust header layout for mobile */
  .header-inner {
    padding: 10px 16px !important;
  }
  
  /* Adjust logo size if needed */
  .site-logo {
    max-height: 32px !important;
  }
}

/* For very small screens */
@media (max-width: 480px) {
  .header-inner {
    padding: 8px 12px !important;
  }
  
  .mobile-menu-btn {
    padding: 6px !important;
  }
  
  /* Ensure icons are properly sized */
  .icon-btn {
    font-size: 18px !important;
    padding: 6px !important;
  }
  
  /* Adjust mobile nav position for smaller screens */
  #mobileNav {
    top: 60px;
    height: calc(100vh - 60px);
  }
}

/* For extra small screens */
@media (max-width: 360px) {
  #mobileNav {
    width: 240px;
    right: -240px !important;
  }
  
  #mobileNav.open {
    right: 0 !important;
  }
}

/* ================================
   CATEGORY BAR VISIBILITY FIXES
================================ */

/* Mobile: hide desktop filter list */
@media (max-width: 880px) {
  .shop-sidebar .filter-list {
    display: none !important;
  }
}

/* Desktop: show sidebar filter list */
@media (min-width: 881px) {
  .shop-sidebar .filter-list {
    display: block !important;
  }
}

/* Hide desktop sidebar completely on mobile */
@media (max-width: 900px) {
  .shop-sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
}

/* SHOP MOBILE OPTIMIZATION */
@media (max-width: 600px) {
  .shop-main { 
    padding-top: 12px !important; 
  }
  
  .shop-sidebar {
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 10px !important;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    height: 55px !important;
    margin-bottom: 10px !important;
  }
  
  .shop-sidebar::-webkit-scrollbar { 
    display: none; 
  }
  
  .shop-sidebar h3, .filter-clear, .search-wrap button, .search-wrap .icon-btn { 
    display: none !important; 
  }
  
  .filter-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .filter-list li {
    padding: 6px 14px !important;
    background: #ffffff;
    border: 1px solid #e0f7fa;
    border-radius: 50px;
    font-size: 13px;
    line-height: 1;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .filter-list li.active, 
  .filter-list li.active-filter, 
  .filter-list li:hover {
    background: #edfafc;
    border-color: #aae6eb;
    color: #1A365D;
  }
  
  .shop-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }
  
  .search-wrap, .sort-wrap {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    position: relative !important;
  }
  
  .search-wrap input, .sort-wrap select {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
    background: #ffffffee !important;
    border: 1px solid #e0f7fa !important;
  }
  
  .products-grid { 
    margin-top: 10px; 
  }
}