/* ==========================================================================
   Choose Your Floor — finish catalogue (grid, filters, sample modal)
   Scoped entirely to .fc__* so no existing page is affected.

   COLOUR FIDELITY RULE
   The swatch photography is the product. Images must never be altered:
   no filter, no backdrop-filter, no mix-blend-mode, no opacity on the image,
   no background tint showing through. Hover/selection feedback is expressed
   with outline, shadow and transform only. Do not add filters here.
   ========================================================================== */

.cyf-page {
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

/* --------------------------------------------------------------- filter bar */
.fc__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.fc__filter {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.6rem 1.15rem;
  min-height: 2.75rem; /* 44 px tap target (B14, 2026-09-30) */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-fast), border-color var(--transition-fast),
    background var(--transition-fast);
}

.fc__filter:hover {
  color: var(--text-gold);
  border-color: var(--border-gold);
}

.fc__filter[aria-pressed="true"] {
  color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-fill), var(--gold));
  border-color: transparent;
}

.fc__filter-count {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.75;
}

.fc__status {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

/* --------------------------------------------------------------------- grid */
.fc__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem);
}

/* ------------------------------------------------------------------- cards */
.fc__card {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.fc__card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 14px 38px rgba(26, 26, 26, 0.14);
}

.fc__card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.fc__card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-muted), 0 14px 38px rgba(26, 26, 26, 0.12);
}

/* Fixed square ratio for every swatch, so cards stay uniform regardless of
   the source file and the sample is never stretched. */
.fc__card-media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary);
  overflow: hidden;
}

.fc__card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.fc__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1rem 1.1rem;
}

.fc__card-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}

.fc__card-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fc__card-selected {
  position: absolute;
  top: 0.7rem;
  inset-inline-end: 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-gold);
  background: var(--gold-fill);
  border-radius: 2rem;
  padding: 0.28rem 0.6rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.fc__card.is-selected .fc__card-selected {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------- pre-mount skeleton */
/* The catalogue renders from deferred JS, so pages/choose-your-floor.html ships
   inert placeholders that reserve the catalogue area. They reuse the real
   filter/status/card classes, so the reserved height is the mounted height
   rather than a guessed value, and it follows any future card-size change.
   Nothing here alters swatch colour — the placeholders hold no image. */
.fc__card--placeholder,
.fc__filter--placeholder {
  cursor: default;
  pointer-events: none;
}

/* -------------------------------------------------------------------- modal */
.fc__modal[hidden] {
  display: none;
}

.fc__modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.fc__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.72);
}

html.fc-modal-open,
html.fc-modal-open body {
  overflow: hidden;
}

.fc__modal-dialog {
  position: relative;
  z-index: 1;
  width: min(58rem, 100%);
  max-height: min(88vh, 46rem);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.fc__modal-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  z-index: 2;
  appearance: none;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.fc__modal-close svg {
  width: 1.15rem;
  height: 1.15rem;
}

.fc__modal-close:hover {
  color: var(--text-gold);
  border-color: var(--border-gold);
}

.fc__modal-close:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.fc__modal-media {
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary);
  overflow: hidden;
}

.fc__modal-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.fc__modal-info {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
}

.fc__modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 500;
  line-height: 1.12;
  color: var(--text-primary);
}

.fc__modal-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-gold);
}

.fc__modal-supplier {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.fc__modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.fc__modal-select.is-selected {
  /* Confirmed state — styles the control only, never the sample image. */
  opacity: 0.92;
}

.fc__modal-feedback {
  min-height: 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-gold);
}

/* --------------------------------------------------------------- disclaimer */
.fc__disclaimer {
  max-width: 52rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text-muted);
  text-align: center;
}

/* ------------------------------------------------------- tablet and mobile */
@media (max-width: 900px) {
  .fc__modal-dialog {
    grid-template-columns: 1fr;
    max-height: 88vh;
  }
  .fc__modal-media {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 768px) {
  .fc__grid {
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  }
  .fc__card-name {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .fc__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .fc__card-body {
    padding: 0.7rem 0.75rem 0.85rem;
  }
  .fc__filter {
    padding: 0.5rem 0.9rem;
    font-size: 0.75rem;
  }
  .fc__modal-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc__card,
  .fc__card-selected,
  .fc__filter {
    transition: none;
  }
  .fc__card:hover {
    transform: none;
  }
}
