/* ==========================================================================
   HAVEN MALL - Products Page
   ========================================================================== */

/* Slimmer sticky chrome on products (header + category bar) */
.products-page .site-header {
  padding: 0.35rem 0;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Keep height stable when scrolled — shrinking created a transparent gap above the cats bar */
.products-page .site-header.island {
  padding: 0.35rem 0;
}

.products-page .nav-wrapper {
  padding: 0.2rem 0.75rem;
  gap: 1rem;
}

.products-page .site-header.island .nav-wrapper {
  padding: 0.2rem 0.75rem;
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}

.products-page .brand-logo {
  gap: 0.4rem;
}

.products-page .brand-logo-img {
  height: 32px;
}

.products-page .brand-logo-svg {
  width: 170px;
  height: 36px;
}

.products-page .brand-logo-text {
  font-size: 36px;
}

.products-page .nav-search-input {
  padding: 0.45rem 1rem 0.45rem 2.5rem;
  font-size: 0.88rem;
}

.products-page .nav-search .nav-search-icon {
  left: 0.95rem;
  font-size: 0.85rem;
}

.products-page .icon-btn {
  width: 38px;
  height: 38px;
}

.products-page-hero {
  background: linear-gradient(135deg, #1f282a 0%, #111827 100%);
  color: #ffffff;
  padding: 0.85rem 0 0.75rem;
  border-bottom: 2px solid var(--sale-orange, #ffa502);
}

.products-hero-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.products-hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.products-hero-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumbs a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--sale-orange, #ffa502);
}

.breadcrumbs .breadcrumb-sep {
  font-size: 0.7rem;
  opacity: 0.6;
}

.breadcrumbs span.current {
  color: var(--sale-orange, #ffa502);
  font-weight: 600;
}

.products-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.products-hero-logo {
  height: 1.15em;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* ─── Sticky category bar ───────────────────────────────────────────────── */
.products-cats-section {
  position: sticky;
  top: 3.2rem; /* flush under frosted header (slight overlap kills hairline) */
  z-index: 90;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding: 0.45rem 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.products-category-pills {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.05rem 0.05rem 0.15rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.products-category-pills::-webkit-scrollbar {
  height: 4px;
}

.products-category-pills::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.products-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.75rem 0.22rem 0.22rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background-color: #ffffff;
  color: var(--text-color, #334155);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.products-pill-btn:hover {
  border-color: #1f282a;
}

.products-pill-btn.active {
  background-color: #1f282a;
  color: #ffffff;
  border-color: #1f282a;
  box-shadow: 0 4px 14px rgba(31, 40, 42, 0.22);
}

.products-pill-thumb,
.products-pill-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  flex-shrink: 0;
}

.products-pill-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.products-pill-icon {
  color: #1f282a;
  font-size: 0.72rem;
}

.products-pill-btn.active .products-pill-icon {
  background: rgba(255, 165, 2, 0.2);
  color: var(--sale-orange, #ffa502);
}

.products-pill-label {
  padding-right: 0.25rem;
}

/* ─── Search / sort ─────────────────────────────────────────────────────── */
.products-filter-section {
  background-color: var(--bg-light, #f8fafc);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.products-filter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.products-search-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.products-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.products-search-box i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted, #64748b);
  font-size: 1.05rem;
}

.products-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  background-color: #ffffff;
}

.products-search-input:focus {
  border-color: #1f282a;
  box-shadow: 0 0 0 4px rgba(31, 40, 42, 0.08);
}

.products-sort-select {
  padding: 0.85rem 2.75rem 0.85rem 1.2rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  font-size: 0.9rem;
  font-weight: 600;
  background-color: #ffffff;
  color: var(--text-color, #1e293b);
  cursor: pointer;
  outline: none;
  min-width: 200px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1.5L6 6.5L11 1.5" stroke="%2364748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 1.15rem center;
  background-size: 12px;
}

/* ─── Catalog grid ──────────────────────────────────────────────────────── */
.products-catalog-section {
  padding: 2rem 0 4.5rem;
  min-height: 50vh;
}

.products-grid {
  /* inherits .items-grid; keep auto-fill for uneven counts */
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 768px) {
  .products-page .site-header,
  .products-page .site-header.island {
    padding: 0.25rem 0;
  }

  .products-page-hero {
    padding: 0.7rem 0 0.6rem;
  }

  .products-cats-section {
    top: 2.95rem;
    padding: 0.35rem 0;
  }

  .products-search-row {
    flex-direction: column;
  }

  .products-sort-select {
    width: 100%;
    min-width: 0;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .products-catalog-section {
    padding: 1.35rem 0 3rem;
  }

  .products-pill-btn {
    padding: 0.18rem 0.65rem 0.18rem 0.18rem;
    font-size: 0.75rem;
  }

  .products-pill-thumb,
  .products-pill-icon {
    width: 24px;
    height: 24px;
  }
}
