/* ===================================================================
   BRANS° atelier — shop / collection page
   Dark-luxe catalog: filter rail + sortable product grid.
   Shared chrome (tokens, header, footer, toast) comes from site.css.
   =================================================================== */

/* ===================== COLLECTION INTRO ===================== */
.shop-hero {
  padding: 168px 56px 48px;
  border-bottom: 1px solid var(--rule);
  max-width: 760px;
}
.shop-index {
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.shop-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.shop-title em { font-style: italic; font-weight: 400; color: var(--accent); }
.shop-lead {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}

/* ===================== LAYOUT ===================== */
.shop-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 56px;
  padding: 56px 56px 130px;
  align-items: start;
}

/* ----- filter rail ----- */
.filters {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 38px;
}
.filters-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.filters-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 24px;
  margin: 0;
}
.clear-btn {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(241, 236, 226, 0.5);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .15s ease, border-color .15s ease;
}
.clear-btn:hover { color: var(--ink); border-color: var(--accent); }

.filter-group { display: flex; flex-direction: column; }
.filter-label {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(241, 236, 226, 0.5);
  margin-bottom: 16px;
}
.filter-options { display: flex; flex-direction: column; gap: 12px; }

/* custom radio / checkbox rows */
.filter-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(241, 236, 226, 0.62);
  transition: color .15s ease;
}
.filter-opt:hover { color: var(--ink); }
.filter-opt input { position: absolute; opacity: 0; pointer-events: none; }
.filter-opt .box {
  width: 15px; height: 15px;
  flex: none;
  border: 1px solid var(--rule-strong);
  display: grid;
  place-items: center;
  transition: border-color .15s ease, background .15s ease;
}
.filter-opt input[type="radio"] + .box { border-radius: 999px; }
.filter-opt .box::after {
  content: "";
  width: 7px; height: 7px;
  background: var(--accent);
  transform: scale(0);
  transition: transform .15s ease;
}
.filter-opt input[type="radio"] + .box::after { border-radius: 999px; }
.filter-opt input:checked + .box { border-color: var(--accent); }
.filter-opt input:checked + .box::after { transform: scale(1); }
.filter-opt input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-opt.checked { color: var(--ink); }
.filter-opt .count {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ----- toolbar ----- */
.shop-main { min-width: 0; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.result-count {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 9px 14px;
}
/* search field — lives in the toolbar, feeds the same filter pipeline */
.search-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 280px;
  max-width: 38vw;
  padding: 7px 4px;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color .15s ease;
}
.search-field:focus-within { border-color: var(--accent); }
.search-icon { flex: none; color: var(--muted); transition: color .15s ease; }
.search-field:focus-within .search-icon { color: var(--accent); }
#search-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Archivo", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}
#search-input::placeholder { color: var(--muted); letter-spacing: 0.08em; }
#search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: color .15s ease;
}
.search-clear[hidden] { display: none; }
.search-clear:hover { color: var(--ink); }

.sort-field {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sort-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
#sort-select {
  font-family: "Archivo", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  padding: 6px 26px 6px 4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right 8px center, right 3px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .15s ease;
}
#sort-select:hover { border-color: var(--accent); }
#sort-select option { background: var(--bg-2); color: var(--ink); }

/* ----- product grid ----- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}
.product-card {
  display: block;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: card-in .5s ease forwards;
}
@keyframes card-in { to { opacity: 1; transform: none; } }
.pc-figure {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--stage-bg) center / cover no-repeat;
  border: 1px solid var(--rule);
  filter: grayscale(0.15);
  transition: filter .4s ease, transform .4s ease, border-color .4s ease;
  overflow: hidden;
}
.product-card:hover .pc-figure { filter: none; transform: translateY(-4px); border-color: var(--rule-strong); }

/* film — fades in over the still while the card is hovered (or, on touch-only
   screens, while it is on screen). Sits under the ref / wishlist / view chrome. */
.pc-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000;
  opacity: 0; transition: opacity .45s ease;
  pointer-events: none;
}
.product-card.playing .pc-video { opacity: 1; }
.pc-ref {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(241, 236, 226, 0.7);
  background: rgba(11, 12, 16, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 4px 8px;
}
/* Free pieces wear it plainly. Stacked under the reference chip so it never
   fights the wishlist button, which fades in at the opposite corner. */
.pc-free {
  position: absolute;
  top: 38px; left: 12px;
  font-family: "Archivo", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #0b0c10;
  background: var(--accent);
  padding: 4px 9px;
  border-radius: 999px;
}
.pc-view {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(180deg, transparent, rgba(8, 9, 12, 0.85));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.product-card:hover .pc-view { opacity: 1; transform: none; }

.pc-wish {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink);
  background: rgba(11, 12, 16, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .25s ease, transform .25s ease, color .15s ease;
}
.product-card:hover .pc-wish { opacity: 1; transform: scale(1); }
.pc-wish:hover { color: var(--accent); }
.pc-wish.active { color: var(--accent); opacity: 1; transform: scale(1); }
.pc-wish.active svg { fill: var(--accent); }

.pc-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 6px 16px;
  margin-top: 18px;
}
.pc-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  line-height: 1.1;
}
.pc-price {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  color: var(--accent);
  white-space: nowrap;
}
/* "Free" is a word, not a number — set it like the rest of the meta line
   so it doesn't read as a suspiciously short price */
.pc-price.is-free {
  font-family: "Archivo", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.pc-meta {
  grid-column: 1 / -1;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- add to cart (per card) -----
   Always present rather than hover-revealed: a phone has no hover, and a
   button that appears on hover would resize the card under the cursor. It
   rests as a hairline outline and fills with the accent on hover/press. */
.pc-add {
  margin-top: 14px;
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 14px;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color .28s ease, border-color .28s ease, transform .18s ease;
}
/* the fill sweeps up from the bottom edge instead of just cross-fading */
.pc-add::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
}
.pc-add:hover, .pc-add:focus-visible {
  color: #0b0c10;
  border-color: var(--accent);
  outline: none;
}
.pc-add:hover::before, .pc-add:focus-visible::before { transform: translateY(0); }
.pc-add:active { transform: scale(0.985); }
.pc-add-ico { display: grid; place-items: center; transition: transform .28s ease; }
.pc-add:hover .pc-add-ico { transform: translateY(-1px); }
/* the two non-buyable states read as a quieter link, and their arrow travels */
.pc-add.is-link { border-color: var(--rule); color: var(--muted); letter-spacing: 0.2em; }
.pc-add.is-link:hover { color: #0b0c10; }
.pc-add.is-link:hover .pc-add-ico { transform: translateX(3px); }
/* confirmation state after a piece lands in the bag */
.pc-add.added { color: #0b0c10; border-color: var(--accent); }
.pc-add.added::before { transform: translateY(0); }
.pc-add.added .pc-add-ico { animation: pc-tick .38s cubic-bezier(.22, 1.4, .36, 1); }
@keyframes pc-tick { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ----- empty state ----- */
.empty-state {
  padding: 80px 0;
  text-align: center;
  color: var(--ink-2);
}
.empty-state[hidden] { display: none; }
.empty-state p {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  margin: 0 0 20px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .shop-hero { padding-left: 32px; padding-right: 32px; }
  .shop-layout { padding-left: 32px; padding-right: 32px; gap: 40px; grid-template-columns: 210px 1fr; }
  .shop-title { font-size: 52px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .shop-hero { padding: 130px 20px 36px; }
  .shop-title { font-size: 40px; }
  .shop-layout { grid-template-columns: 1fr; padding: 32px 20px 80px; gap: 0; }

  /* filters collapse into a toggled panel */
  .filters {
    position: static;
    overflow: hidden;
    max-height: 0;
    gap: 0;
    opacity: 0;
    transition: max-height .35s ease, opacity .25s ease, margin .35s ease;
  }
  .filters.open {
    max-height: 1200px;
    opacity: 1;
    margin-bottom: 32px;
    gap: 28px;
  }
  .filter-toggle { display: inline-flex; }
  .toolbar { flex-wrap: wrap; }
  .search-field { order: 3; flex-basis: 100%; width: 100%; max-width: none; }
  .result-count { order: 4; }
  .sort-field { order: 2; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
  .pc-name { font-size: 18px; }
  /* two cards to a row leaves no width for the letterspaced label */
  .pc-add { min-height: 38px; padding: 10px 8px; font-size: 9.5px; letter-spacing: 0.14em; gap: 7px; margin-top: 12px; }
}

@media (max-width: 460px) {
  .shop-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card { animation: none; opacity: 1; transform: none; }
  .pc-add::before { transition: none; }
  .pc-add.added .pc-add-ico { animation: none; }
}
