/* Category Selector */
.category-selector {
  background: #fff;
  border-bottom: 2px solid var(--gray-lighter);
  padding: 20px 0;
  position: sticky;
  top: 90px;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 0;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.category-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  background: var(--light);
  border: 2px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s;
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
}

.category-tab i {
  font-size: 24px;
  color: var(--primary);
}

.category-tab:hover {
  background: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 74, 153, 0.15);
}

.category-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.category-tab.active i {
  color: #fff;
}

/* Products Layout */
.products-layout {
  padding: 40px 0 80px;
  background: #fafafa;
}

.container-fluid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.products-wrapper {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

/* Sidebar */
.products-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 180px;
  align-self: flex-start;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.sidebar-sticky {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-sticky h3 {
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scroll-progress {
  height: 3px;
  background: var(--gray-lighter);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.scroll-progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  color: #555;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
}

.sidebar-nav a::before {
  content: "";
  width: 3px;
  height: 0;
  background: var(--primary);
  position: absolute;
  left: 0;
  border-radius: 0 3px 3px 0;
  transition: height 0.3s;
}

.sidebar-nav a:hover {
  background: var(--light);
  color: var(--primary);
  padding-left: 20px;
}

.sidebar-nav a:hover::before {
  height: 100%;
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--primary), #0066cc);
  color: #fff;
  font-weight: 700;
  padding-left: 20px;
}

.sidebar-nav a.active::before {
  height: 100%;
  background: #fff;
}

.sidebar-nav i {
  font-size: 12px;
  opacity: 0.7;
}

/* Main Content */
.products-content {
  flex: 1;
  min-width: 0;
}

.product-section {
  background: #fff;
  border-radius: 15px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  scroll-margin-top: 200px;
}

.product-section h2 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 25px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--primary);
}

.product-section h2 i {
  font-size: 32px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.product-card {
  background: var(--light);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #0066cc);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 74, 153, 0.15);
  background: #fff;
}

.product-image {
  width: 100%;
  height: 180px;
  background: #e9ecef;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image i {
  font-size: 48px;
  color: var(--primary);
  opacity: 0.3;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card h3 {
  font-size: 16px;
  color: var(--dark);
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.product-card p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.spec-tag {
  background: #fff;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--primary);
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 20px;
  background: var(--primary);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 74, 153, 0.4);
  font-size: 20px;
  cursor: pointer;
  z-index: 998;
  transition: all 0.3s;
}

.mobile-sidebar-toggle:hover {
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 991px) {
  .category-selector {
    top: 70px;
  }

  .category-tabs {
    padding: 5px 10px;
  }

  .category-tab {
    min-width: 110px;
    padding: 12px 15px;
    font-size: 12px;
  }

  .category-tab i {
    font-size: 20px;
  }

  .products-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    width: 280px;
    background: #fff;
    z-index: 9999;
    transition: left 0.3s;
    overflow-y: auto;
    padding-top: 80px;
  }

  .products-sidebar.active {
    left: 0;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
  }

  .sidebar-sticky {
    position: static;
  }

  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .products-content {
    width: 100%;
  }

  .product-section {
    padding: 25px 20px;
  }

  .product-section h2 {
    font-size: 22px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .category-selector {
    top: 60px;
  }

  .products-layout {
    padding: 20px 0 60px;
  }

  .container-fluid {
    padding: 0 15px;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

.sidebar-overlay.active {
  display: block;
}
