/* ============================================
   MARIANN GRAY · The Collection (Chapter V)
   9 categories · all products
   ============================================ */

/* —— INTRO —— */
.collection-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-6);
  position: relative;
  z-index: var(--z-content);
}

.collection-intro-eyebrow {
  font-family: var(--font-script);
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--color-terra);
  margin-bottom: var(--space-2);
}

.collection-intro-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 6vw, 84px);
  color: var(--color-burgundy);
  line-height: 1.05;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
  white-space: pre-line;
}

.collection-intro-body {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.6;
  color: var(--color-ink);
  opacity: 0.85;
  max-width: 580px;
  margin: 0 auto;
}

/* —— TABS NAVIGATION —— */
.collection-tabs-wrap {
  position: sticky;
  top: 80px;
  z-index: 40;
  background: linear-gradient(to bottom, rgba(250, 243, 236, 0.92) 0%, rgba(250, 243, 236, 0.85) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-line-soft);
  border-bottom: 1px solid var(--color-line-soft);
  margin-bottom: var(--space-6);
}

.collection-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--gutter);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  max-width: 1300px;
  margin: 0 auto;
}

.collection-tab {
  flex-shrink: 0;
  padding: 10px 20px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--color-burgundy);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.collection-tab:hover {
  border-color: var(--color-line);
  color: var(--color-terra);
}

.collection-tab[aria-selected="true"] {
  color: var(--color-cream);
  background: var(--color-burgundy);
  border-color: var(--color-burgundy);
}

.collection-tab-count {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.7em;
  color: var(--color-gold);
  margin-left: 6px;
  opacity: 0.8;
}

.collection-tab[aria-selected="true"] .collection-tab-count {
  color: var(--color-rose-soft);
  opacity: 1;
}

/* —— PANELS —— */
.collection-panels {
  position: relative;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-7);
}

.cat-panel {
  display: none;
  animation: panel-fade var(--duration-base) var(--ease-out);
}

.cat-panel.is-active {
  display: block;
}

@keyframes panel-fade {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* —— PANEL HEADER —— */
.cat-panel-header {
  text-align: center;
  margin-bottom: var(--space-6);
  padding: 0 var(--gutter);
}

.cat-panel-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--color-gold);
  letter-spacing: 0.3em;
  margin-bottom: var(--space-2);
}

.cat-panel-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  color: var(--color-burgundy);
  line-height: 1.05;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.cat-panel-secondary {
  font-family: var(--font-serif);
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-terra);
  font-weight: 500;
}

/* —— PRODUCTS GRID —— */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

/* Wider container for the all-products grid (no tabs) */
.products-grid-all {
  max-width: 1300px;
  margin: 0 auto;
  padding: var(--space-4) clamp(24px, 5vw, 64px) var(--space-8);
}

/* Section-level padding fallback — ensures cards never touch edges */
section.collection {
  padding: 0 clamp(20px, 3vw, 48px) var(--space-7);
}

/* —— PRODUCT CARD —— */
.cat-product {
  display: flex;
  flex-direction: column;
  background: rgba(255, 250, 244, 0.55);
  border: 1px solid var(--color-line);
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.cat-product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
  border-color: var(--color-terra);
}

.cat-product-color {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Real product photo overlays the gradient placeholder when available */
.cat-product-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  background: white;
  user-select: none;
  -webkit-user-drag: none;
}

/* —— CAROUSEL ARROWS (left / right on photo) —— */
.cat-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-burgundy);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out),
              visibility 0.25s var(--ease-out),
              background 0.25s ease,
              transform 0.25s var(--ease-out);
  box-shadow: 0 4px 14px rgba(107, 58, 58, 0.15);
  padding: 0 0 4px 0;
}

.cat-arrow-prev { left: 10px; }
.cat-arrow-next { right: 10px; }

.cat-product:hover .cat-arrow {
  opacity: 1;
  visibility: visible;
}

.cat-arrow:hover {
  background: white;
  color: var(--color-terra);
}

.cat-arrow-prev:hover { transform: translateY(-50%) translateX(-2px); }
.cat-arrow-next:hover { transform: translateY(-50%) translateX(2px); }

/* Hide arrows for single-photo products */
.cat-product[data-photos="1"] .cat-arrow,
.cat-product[data-photos="1"] .cat-dots {
  display: none;
}

/* —— DOTS INDICATOR —— */
.cat-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 5px;
  pointer-events: none;
  padding: 4px 8px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
}

.cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.25s ease, width 0.3s var(--ease-out);
}

.cat-dot.is-active {
  background: white;
  width: 18px;
  border-radius: 100px;
}

/* On mobile — hide arrows entirely; swipe handles navigation */
@media (pointer: coarse), (max-width: 700px) {
  .cat-arrow {
    display: none;
  }
}

.cat-product-color::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: multiply;
}

.cat-product-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(48px, 5vw, 72px);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 2;
  line-height: 1;
}

.cat-product:hover .cat-product-mark {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--duration-base) ease;
}

.cat-product-content {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.cat-product-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 1.8vw, 24px);
  color: var(--color-burgundy);
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.cat-product-actives {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-terra);
  opacity: 0.9;
  flex: 1;
}

.cat-product-link {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-line-soft);
  font-family: var(--font-serif);
  font-size: var(--text-2xs);
  color: var(--color-burgundy);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.cat-product-link .arrow {
  transition: transform var(--duration-base) var(--ease-out);
}
.cat-product:hover .cat-product-link .arrow {
  transform: translateX(4px);
}

/* —— PER-CATEGORY COLOR THEMES —— */
.color-blue   { background: linear-gradient(135deg, #d4e4e4, #a8c4c8); }
.color-sage   { background: linear-gradient(135deg, #dfe6cf, #bcc8a4); }
.color-cream  { background: linear-gradient(135deg, #faf3ec, #e2cdb6); }
.color-purple { background: linear-gradient(135deg, #d5d8e8, #aeb4d0); }
.color-pink   { background: linear-gradient(135deg, #fce4d6, #f5b8c8); }
.color-rose   { background: linear-gradient(135deg, #fcd5e0, #e89eaa); }
.color-warm   { background: linear-gradient(135deg, #fce8d0, #e8b890); }
.color-mint   { background: linear-gradient(135deg, #d8e8e0, #a8c8b8); }
.color-gold   { background: linear-gradient(135deg, #f5e6c8, #d4b88a); }

/* —— PANEL CTA (Shop all on WB) —— */
.cat-panel-cta {
  text-align: center;
  margin-top: var(--space-6);
}

.cat-panel-cta a {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--color-burgundy);
  border-bottom: 1px solid var(--color-gold);
  padding-bottom: 4px;
  transition: color var(--duration-fast) ease;
}
.cat-panel-cta a:hover {
  color: var(--color-terra);
}

/* —— ARMENIAN OVERRIDES —— */
html[lang="hy"] .collection-intro-title,
html[lang="hy"] .cat-panel-title,
html[lang="hy"] .cat-product-name {
  font-family: var(--font-armenian);
  font-style: normal;
  font-weight: 500;
}

/* —— RESPONSIVE —— */
@media (max-width: 700px) {
  .collection-tabs {
    justify-content: flex-start;
    padding: var(--space-3) var(--gutter);
  }
  .collection-tabs-wrap {
    top: 60px;
  }
  section.collection {
    padding: 0 8px var(--space-6);
  }
  .products-grid-all {
    padding: var(--space-3) 4px var(--space-6);
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .cat-product-mark {
    font-size: 40px;
  }
  .cat-product-content {
    padding: 10px 10px 8px;
  }
}
