/* ============================================
   MEHER KAKALIA — COLLECTION PAGE STYLES
   Prestige-style collection with filters,
   sort, layout switching, and scroll reveal.
   ============================================ */


/* ============================================
   COLLECTION BANNER
   Full-width hero with parallax image + overlay
   ============================================ */
.coll-banner {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coll-banner-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.coll-banner-media picture,
.coll-banner-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.coll-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coll-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.coll-banner-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: #fff;
  max-width: 700px;
  padding: 0 var(--space-24);
}

.coll-banner-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: var(--space-16);
  color: #fff;
}

.coll-banner-desc {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.coll-banner-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin-top: var(--space-20);
}


/* ============================================
   COLLECTION TOOLBAR
   Sticky bar with Filter, Sort, Count, Layout
   ============================================ */
.coll-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
}

.coll-toolbar-inner {
  max-width: none;
  margin: 0 auto;
  padding: 0 var(--space-48);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 52px;
}

.coll-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0;
  justify-self: start;
}

.coll-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-text);
  cursor: pointer;
  padding: 16px 24px;
  height: 52px;
  transition: background 0.2s ease;
}

.coll-toolbar-btn:hover {
  background: var(--color-off-white);
}

.coll-toolbar-btn i {
  font-size: 0.85rem;
}

.coll-toolbar-count {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-text-light);
  justify-self: center;
}

.coll-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0;
  justify-self: end;
}

.coll-toolbar-right .coll-toolbar-btn {
  border-left: 1px solid var(--color-border);
}

/* Sort Popover */
.coll-sort-wrapper {
  position: relative;
}

.coll-sort-popover {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--color-border-medium);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.coll-sort-popover.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.coll-sort-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.coll-sort-option:hover {
  background: var(--color-off-white);
}

.coll-sort-option.is-active {
  font-weight: 600;
  color: var(--color-primary);
}


/* Layout Switch */
.coll-layout-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coll-layout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.coll-layout-btn:hover {
  color: var(--color-text-light);
}

.coll-layout-btn.is-active {
  color: var(--color-text);
}


/* ============================================
   FILTER DRAWER
   Slide-in from left, Prestige-style
   ============================================ */
.coll-filter-body {
  overflow-y: auto;
}

/* Filter Groups (Accordion) */
.coll-filter-group {
  border-bottom: 1px solid var(--color-border);
}

.coll-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-16) 0;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-text);
  cursor: pointer;
}

.coll-filter-toggle i {
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

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

.coll-filter-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1), padding 0.35s ease;
  padding: 0;
}

.coll-filter-content.is-open {
  max-height: 400px;
  padding: 0 0 var(--space-16);
}

/* Checkboxes */
.coll-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
}

.coll-filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border-dark);
  border-radius: 3px;
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.coll-filter-checkbox input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.coll-filter-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Radio buttons for Categories */
.coll-filter-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border-dark);
  border-radius: 50%;
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.coll-filter-radio input[type="radio"]:checked {
  border-color: var(--color-primary);
}

.coll-filter-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
}

.coll-filter-count {
  margin-left: auto;
  color: var(--color-text-faint);
  font-size: 0.8rem;
}

/* Price Range Slider */
.coll-filter-price-range {
  position: relative;
  height: 24px;
  margin: 8px 0 4px;
}

.coll-filter-range {
  position: absolute;
  width: 100%;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

.coll-filter-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-text-light);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.coll-filter-range:first-child {
  z-index: 3;
}

.coll-filter-price-range::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border-dark);
  transform: translateY(-50%);
}

.coll-filter-price-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* Color Swatches in Filter */
.coll-filter-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coll-filter-color-swatch {
  position: relative;
  cursor: pointer;
}

.coll-filter-color-swatch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.coll-filter-swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-medium);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coll-filter-color-swatch:hover .coll-filter-swatch {
  transform: scale(1.1);
}

.coll-filter-color-swatch input:checked + .coll-filter-swatch {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--color-primary);
}

/* Color swatch tooltip */
.coll-filter-color-swatch[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* Price Range */
.coll-filter-price {
  display: flex;
  align-items: flex-end;
  gap: var(--space-12);
}

.coll-filter-price-field {
  flex: 1;
}

.coll-filter-price-field label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-bottom: 6px;
}

.coll-filter-price-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border-dark);
  border-radius: 4px;
  padding: 0 10px;
  height: 40px;
}

.coll-filter-price-currency {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-right: 4px;
}

.coll-filter-price-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  background: transparent;
}

.coll-filter-price-input::-webkit-outer-spin-button,
.coll-filter-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.coll-filter-price-sep {
  font-size: 1.1rem;
  color: var(--color-text-faint);
  padding-bottom: 8px;
}



/* ============================================
   PRODUCT GRID
   Responsive grid with layout switching
   ============================================ */
.coll-products {
  padding: var(--space-32) 0 var(--space-80);
  background: #fff;
  overflow-x: hidden;
}

.coll-products-container {
  max-width: none;
  margin: 0 auto;
  padding: 0 var(--space-48);
  overflow: hidden;
}

.coll-products-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-48);
  align-items: start;
}

/* Filter Sidebar */
.coll-filter-sidebar {
  position: sticky;
  top: 60px;
  padding-top: var(--space-8);
}

.coll-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-24);
}

.coll-filter-sidebar .coll-filter-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  color: var(--color-text);
  margin-bottom: 0;
}

.coll-filter-header-actions {
  display: none;
  align-items: center;
  gap: var(--space-12);
}

.coll-filter-clear-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-light);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.coll-filter-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 1.1rem;
}

/* Filter Overlay */
.coll-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-overlay-heavy);
  z-index: 300;
}

.coll-filter-overlay.is-open {
  display: block;
}

/* Mobile Filter Button — hidden on desktop */
.coll-filter-mobile-btn {
  display: none;
  border-right: 1px solid var(--color-border);
}

.coll-product-grid {
  display: grid;
  gap: var(--space-32) var(--grid-gutter);
  transition: all 0.35s ease;
  min-width: 0;
}

/* Layout modes */
.coll-product-grid[data-layout="medium"] {
  grid-template-columns: repeat(4, 1fr);
}

.coll-product-grid[data-layout="large"] {
  grid-template-columns: repeat(2, 1fr);
}

.coll-product-grid[data-layout="compact"] {
  grid-template-columns: 1fr;
}


/* ============================================
   PRODUCT CARD — Scroll Reveal in Grid
   Reuses .product-card from style.css
   ============================================ */
.coll-product-grid .product-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.coll-product-grid .product-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Compact / List Layout overrides */
.coll-product-grid[data-layout="compact"] .product-card-link {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-24);
  align-items: center;
  padding: var(--space-20) 0;
  border-bottom: 1px solid var(--color-border);
}

.coll-product-grid[data-layout="compact"] .product-card-media {
  aspect-ratio: 1 / 1;
}

.coll-product-grid[data-layout="compact"] .product-card-info {
  text-align: left;
  padding: 0;
  align-items: flex-start;
}

.coll-product-grid[data-layout="compact"] .product-card-atc {
  display: none;
}


/* ============================================
   PAGINATION
   ============================================ */
.coll-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 0 var(--space-48) var(--space-80);
}

.coll-pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.coll-pagination-link:hover {
  border-color: var(--color-border-dark);
}

.coll-pagination-link.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.coll-pagination-next {
  font-size: 1rem;
}


/* ============================================
   RESPONSIVE — TABLET (768px)
   ============================================ */
@media (max-width: 768px) {
  .coll-banner {
    height: 380px;
  }

  .coll-banner-heading {
    font-size: 1.75rem;
  }

  .coll-banner-desc {
    font-size: 0.85rem;
    padding: 0 var(--space-16);
  }

  .coll-toolbar-inner {
    padding: 0 var(--space-16);
    grid-template-columns: 1fr 1fr;
    height: 46px;
  }

  .coll-toolbar-left {
    display: none;
  }

  .coll-toolbar-count {
    justify-self: start;
    font-size: 0.6rem;
  }

  .coll-toolbar-right {
    justify-self: end;
  }

  .coll-toolbar-btn {
    padding: 14px 14px;
    font-size: 0.6rem;
    height: 46px;
  }

  .coll-product-grid[data-layout="medium"] {
    grid-template-columns: repeat(2, 1fr);
  }

  .coll-product-grid[data-layout="large"] {
    grid-template-columns: repeat(2, 1fr);
  }

  .coll-products-container {
    padding: 0 var(--space-16);
  }

  .coll-products {
    padding: var(--space-24) 0 var(--space-48);
  }

  .coll-pagination {
    padding: 0 var(--space-16) var(--space-48);
  }

  .coll-layout-switch {
    display: none;
  }

  .coll-sort-wrapper {
    display: none;
  }

  .coll-toolbar-right .coll-toolbar-btn {
    border-left: none;
  }
}


/* ============================================
   RESPONSIVE — MOBILE (576px)
   ============================================ */
@media (max-width: 576px) {
  .coll-banner {
    height: 340px;
  }

  .coll-banner-heading {
    font-size: 1.5rem;
  }

  .coll-banner-desc {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .coll-toolbar-inner {
    height: 42px;
    grid-template-columns: auto 1fr;
  }

  .coll-toolbar-right {
    display: none;
  }

  .coll-toolbar-btn {
    padding: 12px 10px;
    font-size: 0.55rem;
    gap: 5px;
    height: 42px;
  }

  .coll-toolbar-count {
    font-size: 0.55rem;
    justify-self: end;
  }

  .coll-product-grid[data-layout="medium"],
  .coll-product-grid[data-layout="large"],
  .coll-product-grid[data-layout="compact"] {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-16) var(--space-12);
  }

  .coll-product-grid[data-layout="compact"] .product-card-link {
    display: flex;
    flex-direction: column;
  }

  .coll-product-grid[data-layout="compact"] .product-card-media {
    aspect-ratio: 3 / 4;
  }

  .coll-product-grid[data-layout="compact"] .product-card-info {
    text-align: center;
    align-items: center;
  }

  .coll-pagination-link {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }

  /* Stack layout on mobile */
  .coll-products-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Show toolbar-left again so filter button is visible */
  .coll-toolbar-left {
    display: flex;
  }

  /* Mobile Filter Button */
  .coll-filter-mobile-btn {
    display: flex;
  }

  /* Filter header actions visible on mobile */
  .coll-filter-header-actions {
    display: flex;
  }

  /* Filter sidebar becomes bottom-sheet drawer on mobile */
  .coll-filter-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 92vh;
    background: var(--color-white);
    z-index: 301;
    overflow-y: auto;
    padding: var(--space-24);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .coll-filter-sidebar.is-open {
    transform: translateY(0);
  }
}


/* ============================================
   RESPONSIVE — SMALL PHONES (400px)
   ============================================ */
@media (max-width: 400px) {
  .coll-banner {
    height: 300px;
  }

  .coll-banner-heading {
    font-size: 1.25rem;
  }

  .coll-banner-desc {
    font-size: 0.75rem;
  }

  .coll-product-grid[data-layout="medium"],
  .coll-product-grid[data-layout="large"] {
    gap: var(--space-12) var(--space-8);
  }
}
