/* Page wrapper keeps the CLOE content centered and limits its maximum width. */
.cloe-page {
  flex: 1;
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 48px) 64px;
}

/* Introductory collection heading and supporting text. */
.cloe-intro {
  margin: 0 0 34px;
  text-align: center;
}

.cloe-eyebrow {
  margin: 0 0 10px;
  color: #dab88a;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.cloe-intro h1 {
  margin: 0;
  color: #f8e0c8;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.cloe-intro > p:last-child {
  margin: 12px 0 0;
  line-height: 1.5;
}

/* Catalog layout keeps the product section independent from the filter drawer. */
.catalog-layout {
  min-width: 0;
}

/* Filter drawer and backdrop sit above the page while filtering is in progress. */
.filters {
  position: fixed;
  z-index: 1001;
  top: 0;
  right: 0;
  width: min(390px, 100%);
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid #dab88a;
  background-color: #f8e0c8;
  color: #274928;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.3);
  animation: filter-drawer-in 180ms ease-out;
}

/* Hide the filter drawer and backdrop when the drawer is closed. */
.filters[hidden],
.filter-backdrop[hidden] {
  display: none;
}

/* Backdrop dims the page behind the open filter drawer. */
.filter-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  border: 0;
  background: rgba(15, 20, 15, 0.58);
  cursor: pointer;
}

/* Filter drawer heading and close, open, and reset controls. */
.filters-heading,
.catalog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filters-heading {
  margin-bottom: 12px;
}

/* Filter section headings and shared button behavior. */
.filters-heading h2 {
  margin: 0;
  color: #274928;
  font-size: 1.25rem;
}

/* Filter controls use consistent touch targets and keyboard focus indicators. */
.filter-close,
.filter-open,
.filter-reset {
  min-height: 42px;
  border: 1px solid #274928;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

/* Close control is a compact icon button. */
.filter-close {
  width: 42px;
  padding: 0;
  background: transparent;
  color: #274928;
  font-size: 1.6rem;
  line-height: 1;
}

/* Open control places its icon, label, and active-filter count in one row. */
.filter-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8e0c8;
  color: #274928;
  white-space: nowrap;
}

/* Hover, focus, and reset states keep filter controls visibly interactive. */
.filter-open:hover,
.filter-close:hover,
.filter-reset:hover {
  background: #ead0b5;
}

/* Full-width reset action appears above the filter groups. */
.filter-reset {
  width: 100%;
  margin-bottom: 16px;
  padding: 8px 14px;
  background: #274928;
  color: #f8e0c8;
}

.filter-reset:hover {
  background: #1d3920;
  color: #f8e0c8;
}

.filter-open:focus-visible,
.filter-close:focus-visible,
.filter-reset:focus-visible {
  outline: 3px solid #6a5d55;
  outline-offset: 3px;
}

/* Active-filter badge is hidden when no filters are selected. */
.active-filter-count:empty {
  display: none;
}

.active-filter-count:not(:empty) {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #274928;
  color: #f8e0c8;
  font-size: 0.75rem;
}

/* Filter groups and accordion controls organize the available options. */
.filter-group {
  border-top: 1px solid rgba(39, 73, 40, 0.2);
}

.filter-group h3 {
  margin: 0;
  font-size: 1rem;
}

.accordion-btn {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: #274928;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.accordion-btn span {
  color: #6a5d55;
  font-size: 1.3rem;
}

.accordion-btn:focus-visible,
.accordion-content input:focus-visible {
  outline: 3px solid #6a5d55;
  outline-offset: 3px;
}

/* Accordion content shows selectable options with accessible focus states. */
.accordion-content {
  display: grid;
  gap: 12px;
  padding: 4px 0 18px;
}

.accordion-content[hidden] {
  display: none;
}

.accordion-content label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  line-height: 1.3;
}

.accordion-content input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #274928;
}

/* Catalog heading, count, filter action, and availability note. */
.catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.catalog-actions {
  flex: 0 0 auto;
}

.catalog-heading h2 {
  margin: 0;
  color: #dab88a;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.catalog-count {
  flex: 0 0 auto;
  margin: 0 4px 0 0;
  color: #f8e0c8;
}

.catalog-note {
  margin: 8px 0 20px;
  color: #f8e0c8;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Product grid shows exactly three cards per row on desktop screens. */
.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(12px, 1.6vw, 20px);
}

/* Product cards and their visual feedback on hover. */
.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dab88a;
  border-radius: 16px;
  background-color: #f8e0c8;
  color: #274928;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

/* Stretch this link over the card while keeping the appointment action clickable. */
.product-card__details-link {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
}

.product-card__details-link:focus-visible {
  outline: 3px solid #274928;
  outline-offset: -4px;
}

/* Product image area uses a square crop to keep every catalog card consistent. */
.product-visual {
  aspect-ratio: 1;
  overflow: hidden;
  background-color: #f8e0c8;
}

.product-visual__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-visual--rose { background: linear-gradient(145deg, #f4d5d1, #e5b6b0); }
.product-visual--gold { background: linear-gradient(145deg, #f3e4be, #d8bf8a); }
.product-visual--blue { background: linear-gradient(145deg, #d2e0df, #93b7b2); }
.product-visual--green { background: linear-gradient(145deg, #dce4cd, #a8bc8e); }
.product-visual--violet { background: linear-gradient(145deg, #e2d7e9, #b9a3c6); }
.product-visual--brown { background: linear-gradient(145deg, #e5d3bd, #bd9873); }

/* Card details, pricing, and availability link. */
.product-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
}

.brand {
  margin: 0 0 8px;
  color: #6a5d55;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.product-name {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.product-type {
  margin: 0 0 14px;
  color: #5f5b52;
  font-size: 0.9rem;
}

.old-price {
  margin: auto 0 3px;
  color: #6a5d55;
  font-size: 0.9rem;
  text-decoration: line-through;
}

.promo-price {
  margin: 0 0 14px;
  color: #274928;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Availability link provides a clear pointer and keyboard interaction state. */
.product-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  background-color: #6a5d55;
  color: #f8e0c8;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.product-link:hover {
  background-color: #4f443e;
}

.product-link:focus-visible {
  outline: 3px solid #274928;
  outline-offset: 3px;
}

/* Empty state appears when no products match the selected filters. */
.no-products {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #dab88a;
  border-radius: 12px;
  background-color: #f8e0c8;
  color: #274928;
  line-height: 1.5;
}

.no-products[hidden] {
  display: none;
}

/* Use two columns on tablet and narrower desktop screens. */
@media (max-width: 1100px) {
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Stack catalog controls and product cards on narrow mobile screens. */
@media (max-width: 480px) {
  .catalog-heading {
    align-items: flex-start;
  }

  .catalog-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
  }

  .products {
    grid-template-columns: 1fr;
  }

}

/* Respect the visitor's preference for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-link,
  .filters {
    transition: none;
    animation: none;
  }
}

/* Slide the filter drawer into view when it opens. */
@keyframes filter-drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
