/* ==========================================================================
   PRODUCTS.CSS — Sai Vastragruga Boutique
   Styles scoped to the All Products page ONLY.
   Extends styles.css — uses the same brand tokens (--primary, --accent-gold,
   --color-crimson, --color-green, --radius-*, --shadow-*, --transition-*).
   Header & footer are already styled in styles.css — nothing is repeated here.
   ========================================================================== */

/* ---------- Page Hero ---------- */
.page-hero {
  padding: 100px 0 3rem;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-green-subtle) 0%, var(--bg-main) 45%, var(--bg-crimson-subtle) 100%);
  border-bottom: 1px solid var(--border-light);
}

.page-hero .section-tag { margin-bottom: 0.75rem; }

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.page-hero h1 span {
  color: var(--primary);
}

.page-hero p {
  font-family: var(--font-subheading);
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--accent-gold-dark);
  font-weight: 600;
}

.breadcrumb a:hover { color: var(--primary); }

/* ---------- Page Section / Layout ---------- */
.products-page-section {
  padding: 3.5rem 0 6rem;
  background-color: var(--bg-main);
}

.products-page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.25rem;
  align-items: start;
}

/* ---------- Filter Sidebar ---------- */
.filter-sidebar {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: 110px;
}

.filter-sidebar-header {
  padding: 1.1rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: var(--text-light);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.filter-group {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.filter-group:last-child { border-bottom: none; }

.filter-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
}

.filter-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  cursor: pointer;
  padding: 0.4rem 0;
  user-select: none;
}

.filter-check-item .filter-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
}

.filter-check-item.filter-check-all .filter-check-label {
  font-weight: 700;
  color: var(--text-dark);
}

.filter-check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-check-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold-dark);
  background-color: var(--bg-green-subtle);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.filter-reset-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.filter-reset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Toolbar ---------- */
.products-content {
  display: flex;
  position: sticky;
  top: 200px;
  z-index: 10;
  flex-direction: column;
  gap: 2rem;
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-result-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.toolbar-result-count strong { color: var(--text-dark); }

.search-box-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-dark);
  background-color: var(--bg-main);
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-gold);
  background-color: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

/* ---------- Collection Sections within the listing ---------- */
.collection-section { margin-bottom: 1rem; }

.collection-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-light);
}

.collection-section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-dark);
}

.collection-section-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold-dark);
  background-color: var(--bg-green-subtle);
  border: 1px solid var(--border-gold);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
}

/* Reuses .product-grid / .product-card / .product-thumb / .product-details
   etc. exactly as defined in styles.css so cards look identical across
   the whole site. */

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

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Loading / Empty States ---------- */
.products-state-box {
  text-align: center;
  padding: 5rem 1.5rem;
  color: var(--text-muted);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.products-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.products-state-box h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.products-state-box p {
  font-size: 0.9rem;
}

.products-state-box .btn { margin-top: 1.25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .products-page-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .filter-group {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: 88px 0 2.5rem;
  }

  .page-hero p {
    font-size: 1rem;
  }

  .products-page-section {
    padding: 2rem 0 4rem;
  }

  .products-page-layout {
    gap: 1.5rem;
  }

  .mobile-filter-control {
    display: block;
    position: sticky;
    top: 65px;
    z-index: 11;
  }

  .filter-sidebar {
    position: fixed;
    top: 70px;
    left: 10px;
    right: 10px;
    width: 100%;
    max-height: calc(100vh - 96px);
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: 0 18px 40px rgba(26, 23, 24, 0.18);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 240ms ease, opacity 240ms ease, visibility 240ms ease;
    overflow-y: auto;
    z-index: 1200;
    background-color: var(--bg-main);
  }

  .filter-sidebar.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .filter-sidebar-close {
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.4rem;
  }

  .mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.95rem 1.2rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-dark);
    font-weight: 700;
    transition: var(--transition-fast);
    cursor: pointer;
  }

  .mobile-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
  }

  .products-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box-wrap {
    max-width: 100%;
  }

  .collection-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .page-hero {
  padding: 10px;
  margin-top: 100px;
  
}
  .filter-sidebar-header {
    padding: 0.9rem 1.15rem;
    font-size: 0.9rem;
  }

  .filter-group {
    padding: 0.9rem 1.15rem;
  }

  .products-state-box {
    padding: 3.5rem 1rem;
  }
}
