/* ═══════════════════════════════════════════
   ZOURÌ — Collection Pages
   Shared by five-wishes & daydream
═══════════════════════════════════════════ */

/* ── COLLECTION HEADER ───────────────────── */
/* Space for fixed nav (banner ~38px + navbar ~76px) */
.collection-header {
  padding: 140px 32px 72px;
  text-align: center;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

.collection-header-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 16px;
}

.collection-header-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 300;
  color: var(--deep-brown);
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.collection-header-desc {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto;
}

/* ── STICKY FILTER BAR ───────────────────── */
.filter-bar {
  position: sticky;
  top: 0; /* sits right below the nav when nav hides; nav handles its own z-index */
  z-index: 400;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

/* When nav is scrolled (white), filter bar sits below it */
/* We use JS to set --nav-height as a CSS var if needed,
   but sticky top:0 works because the nav is fixed, not in flow */

.filter-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 52px;
  max-width: 100%;
}

/* ── FILTER DROPDOWN ─────────────────────── */
.filter-dropdown-wrap {
  position: relative;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--deep-brown);
  letter-spacing: 0.04em;
  padding: 6px 0;
  transition: color 0.2s;
  cursor: pointer;
}

.filter-btn:hover { color: var(--earth); }

.filter-btn-label { min-width: 40px; }

.filter-chevron {
  transition: transform 0.3s ease;
  flex-shrink: 0;
  color: var(--taupe);
}

.filter-btn[aria-expanded="true"] .filter-chevron {
  transform: rotate(180deg);
}

/* Active filter name shown in button */
.filter-btn[aria-expanded="true"] { color: var(--earth); }

/* Dropdown panel */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 160px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(20,12,8,0.12);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.filter-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.filter-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, padding-left 0.25s ease;
  cursor: pointer;
}

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

.filter-option:hover {
  background: var(--warm-white);
  color: var(--earth);
  padding-left: 24px;
}

.filter-option.active {
  color: var(--earth);
  font-weight: 500;
  background: rgba(139,111,78,0.06);
}

/* ── PRODUCT COUNT ───────────────────────── */
.filter-count {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── COLLECTION GRID SECTION ─────────────── */
.collection-grid-section {
  background: var(--cream);
  min-height: 60vh;
  padding-bottom: 80px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

/* ── PRODUCT CARD — matches homepage exactly ─ */
.product-card {
  display: block;
  text-decoration: none;
  background: var(--cream);
  overflow: hidden;
  transition: background 0.3s;
}

.product-card:hover { background: var(--warm-white); }

.product-card-img-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--sand);
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.65s ease;
}

.product-card:hover .product-card-img { transform: scale(1.04); }

.product-card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.product-card-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--deep-brown);
  line-height: 1.3;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-card-colors {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  flex-shrink: 0;
}

.product-card-price {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-light);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SKELETON UI ─────────────────────────── */
.product-skeleton {
  background: var(--cream);
  aspect-ratio: 3/4;
  position: relative;
  overflow: hidden;
}

/* The skeleton is the card-shaped block with shimmer */
.product-skeleton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--warm-white) 0%,
    var(--sand) 40%,
    var(--warm-white) 80%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.6s ease-in-out infinite;
}

/* Bottom text area skeleton lines */
.product-skeleton::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--cream);
  border-top: 1px solid var(--border);
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── EMPTY STATE ─────────────────────────── */
.collection-empty {
  padding: 96px 32px;
  text-align: center;
}

.collection-empty[hidden] { display: none; }

.empty-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 300;
  color: var(--deep-brown);
  margin-bottom: 12px;
}

.empty-sub {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto 32px;
}

/* Active sub-link in drawer */
.drawer-sub-link.active {
  color: var(--earth);
  font-weight: 500;
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 1024px) {
  .collection-header { padding: 130px 40px 60px; }
  .filter-bar-inner { padding: 0 40px; }
  .collection-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .collection-header { padding: 120px 24px 52px; }
  .collection-header-title { font-size: clamp(40px, 10vw, 72px); }
  .collection-header-desc { font-size: 14px; }
  .filter-bar-inner { padding: 0 20px; }
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card-body { padding: 10px 12px 14px; }
}

@media (max-width: 480px) {
  .collection-header { padding: 110px 16px 44px; }
  .collection-header-title { font-size: clamp(36px, 11vw, 56px); }
  .collection-header-desc { font-size: 13px; }
  .filter-bar-inner { padding: 0 16px; height: 48px; }
  .filter-btn { font-size: 12px; gap: 6px; }
  .filter-count { font-size: 12px; }
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card-body { padding: 9px 10px 12px; }
  .product-card-name { font-size: 12px; }
  .product-card-price { font-size: 12px; }

  /* Stack meta on mobile */
  .product-card-meta {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
}