/* ===== Oaken — Collection & Product pages ===== */
/* (cart + quantity stepper styles live in cart.css) */

/* ===== Breadcrumb ===== */
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumb li { display: flex; align-items: center; color: var(--muted); font-size: 14px; }
.breadcrumb li + li::before {
  content: ""; width: 1px; height: 22px; margin: 0 16px;
  background: #C8C8C8;
}
.breadcrumb a {
  color: var(--ink);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: color 0.3s var(--ease);
}
.breadcrumb a:hover { color: var(--green); }

@media (min-width: 768px) {
  .breadcrumb li { font-size: 16px; }
}

/* ===== Page header (collection) ===== */
.page-head { padding: calc(20px + var(--nav-h) + 20px) var(--pad) 0; }
.page-head__title {
  display: grid; justify-items: center; gap: 16px;
  margin-top: clamp(40px, 4vw, 56px);
  text-align: center;
}
.page-head__title .display { max-width: 700px; }

/* ===== Catalog layout ===== */
.catalog {
  display: grid; align-items: start;
  margin-top: clamp(56px, 6vw, 80px);
  padding: 0 var(--pad);
}

/* filters: drawer on mobile, sticky sidebar on desktop */
.filters {
  position: fixed; inset: 0 auto 0 0; z-index: 120;
  display: flex; flex-direction: column;
  width: min(360px, 88vw);
  padding: 28px 24px 24px;
  background: var(--bg);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.7s var(--ease);
}
.filters.is-open { transform: none; }

.filters__backdrop {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(30, 30, 30, 0.4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}
.filters.is-open + .filters__backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }

.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.filters__title { color: var(--green); font-size: 24px; font-weight: 400; }
.filters__close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--white); }
.filters__close svg { width: 22px; height: 22px; }

.filters__actions {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px;
  margin-top: auto; padding-top: 32px;
}
.filters__actions .btn { padding: 0 16px; }

.filter-group + .filter-group { margin-top: 24px; }
.filter-group__head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding-bottom: 10px;
  border-bottom: 1px solid #C8C8C8;
  font-size: 18px; font-weight: 400; text-align: left;
}
.filter-group__head svg { width: 18px; height: 18px; transition: transform 0.5s var(--ease); }
.filter-group:not(.is-open) .filter-group__head svg { transform: rotate(180deg); }

.filter-group__body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.filter-group.is-open .filter-group__body { grid-template-rows: 1fr; }
.filter-group__body > div { overflow: hidden; }
.filter-group__body ul { display: grid; gap: 4px; padding-top: 14px; }

.check {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.check:hover { color: var(--green); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  display: grid; place-items: center; flex: none;
  width: 20px; height: 20px;
  border: 1px solid #C8C8C8; border-radius: 5px;
  background: var(--white);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.check__box svg { width: 14px; height: 14px; color: var(--white); opacity: 0; transform: scale(0.6); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.check input:checked + .check__box { background: var(--green); border-color: var(--green); }
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 2px solid var(--green); outline-offset: 2px; }

/* toolbar: floating bar */
.catalog__main { min-width: 0; display: flex; flex-direction: column; }

.toolbar {
  position: sticky; bottom: 12px; z-index: 20;
  order: 1;
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.toolbar__filter {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px;
  border-radius: 12px;
  background: var(--bg);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.toolbar__filter svg { width: 20px; height: 20px; }
.toolbar__filter:hover { background: var(--ink); color: var(--white); }

.toolbar__count { display: none; color: var(--muted); }

.sort {
  position: relative;
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 44px 0 16px;
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.sort__label { color: var(--muted); }
.sort select {
  appearance: none; -webkit-appearance: none;
  border: 0; background: none;
  font: inherit; color: var(--ink);
  cursor: pointer;
}
.sort select:focus { outline: none; }
.sort:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.sort select { flex: 1; min-width: 0; padding-right: 44px; margin-right: -44px; }
.sort__caret { position: absolute; right: 16px; width: 20px; height: 20px; pointer-events: none; }

/* active filter chips */
.chips-active { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.chips-active:empty { margin: 0 0 16px; }
.chips-active li { animation: chip-in 0.5s var(--ease); }
.chips-active button {
  display: inline-flex; align-items: center; gap: 14px;
  height: 40px; padding: 0 10px 0 8px;
  border-radius: 8px;
  background: var(--white);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.chips-active button svg { width: 18px; height: 18px; }
.chips-active button:hover { background: var(--ink); color: var(--white); }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } }

/* grid */
.catalog__grid { display: grid; gap: 20px; }
.catalog__grid .product { width: auto; }
.catalog__grid .product[hidden] { display: none; }

.catalog__empty {
  display: grid; justify-items: center; gap: 24px;
  padding: 80px 20px;
  border-radius: var(--radius-lg);
  background: var(--white);
  text-align: center; color: var(--muted);
}
.catalog__empty[hidden] { display: none; }

@media (min-width: 600px) {
  .catalog__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .catalog { grid-template-columns: 300px 1fr; gap: 40px; }

  .filters {
    position: sticky; inset: auto; top: 20px; z-index: 1;
    width: auto; max-height: calc(100vh - 40px);
    padding: 12px 0 0;
    background: none;
    transform: none; transition: none;
  }
  .filters__backdrop, .filters__close, .filters__actions, .toolbar__filter { display: none; }
  .filters__head { margin-bottom: 40px; }

  .toolbar {
    top: calc(var(--nav-h) + 32px); bottom: auto;
    order: 0; justify-content: space-between;
    margin: 0; padding: 12px 0;
    border-radius: 0;
    background: var(--bg);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: none;
    transition: top 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  }
  .nav-hidden .toolbar { top: 0; }
  .toolbar__count { display: block; }
  .sort { flex: none; width: 300px; height: 56px; padding-left: 24px; background: var(--white); }
}

/* ===== Product hero ===== */
.pd-hero { padding: calc(20px + var(--nav-h) + 20px) var(--pad) 0; }

.pd-hero__grid {
  display: grid; gap: 32px;
  margin-top: 36px;
}

.pd-hero__media { background: #DFDFDF; }
.pd-hero__media img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8% 12%;
}

.pd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); }
.pd-meta a {
  color: var(--ink);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: color 0.3s var(--ease);
}
.pd-meta a:hover { color: var(--green); }
.pd-meta__dot { width: 4px; height: 4px; margin: 0 12px; border-radius: 50%; background: var(--muted); }

.pd-title {
  margin-top: clamp(8px, 1.2vw, 16px);
  font-size: clamp(32px, 4.4vw + 10px, 72px);
  line-height: 1;
  letter-spacing: -0.01em;
}

.pd-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px clamp(24px, 3vw, 40px); margin-top: clamp(20px, 3vw, 40px); }
.pd-price { color: var(--green); font-size: clamp(28px, 2vw + 20px, 48px); font-weight: 400; line-height: 1; }


.pd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd-actions.hero__btn { width: auto; margin-top: clamp(20px, 2vw, 28px); }
.pd-actions .btn { padding: 0 16px; }


@media (min-width: 600px) {
  .pd-actions { display: flex; }
  .pd-actions .btn { width: 215px; }
}

@media (min-width: 1024px) {
  .pd-hero__grid {
    grid-template-columns: minmax(0, 700px) 1fr;
    gap: 80px;
    align-items: start;
    margin-top: 36px;
  }
  /* info glides down with the scroll while the image stays put */
  .pd-hero__info { position: sticky; top: 120px; padding-top: 8px; }
}

/* ===== Sticky buy bar ===== */
.buybar {
  position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 80;
  transform: translateY(calc(100% + 20px));
  transition: transform 0.8s var(--ease);
}
.buybar.is-visible { transform: none; }

.buybar__inner {
  display: grid; gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
.buybar__info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.buybar__thumb {
  flex: none; width: 64px; height: 64px;
  padding: 6px; border-radius: 12px;
  object-fit: contain;
  background: linear-gradient(180deg, #E1E1E1 0%, #B6B6B6 100%);
}
.buybar__name { font-size: 18px; font-weight: 400; line-height: 1.3; }
.buybar__price { color: var(--green); font-size: 20px; font-weight: 400; line-height: 1.3; }
.buybar__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.buybar__actions .btn { height: 44px; padding: 0 12px; font-size: 14px; }

@media (min-width: 768px) {
  .buybar {
    left: 50%; right: auto; bottom: 20px;
    width: min(960px, calc(100% - 40px));
    transform: translate(-50%, calc(100% + 30px));
  }
  .buybar.is-visible { transform: translate(-50%, 0); }
  .buybar__inner { grid-template-columns: 1fr auto; align-items: center; padding: 16px 16px 16px 18px; }
  .buybar__thumb { width: 72px; height: 72px; }
  .buybar__name, .buybar__price { font-size: 22px; }
  .buybar__actions { display: flex; }
  .buybar__actions .btn { height: 48px; padding: 0 24px; font-size: 16px; }
}

/* ===== Product details + sticky gallery ===== */
.pd-details {
  display: grid; gap: 56px;
  padding: clamp(80px, 10vw, 200px) var(--pad) 0;
}

.pd-block + .pd-block { margin-top: clamp(56px, 6vw, 90px); }
.pd-block h2 { margin-bottom: 16px; font-size: 20px; font-weight: 400; }
.pd-block p { color: var(--muted); }
.pd-block p + p { margin-top: 1.5em; }

.pd-specs { display: grid; gap: 20px 40px; }
.pd-specs dt { color: var(--muted); }
.pd-specs dd { margin-top: 4px; }

.pd-list { display: grid; gap: 12px; }
.pd-list li { position: relative; padding-left: 24px; color: var(--muted); }
.pd-list li::before {
  content: ""; position: absolute; left: 8px; top: 0.7em;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--ink);
}
.pd-list strong { margin-right: 4px; color: var(--ink); font-weight: 400; }

.pd-gallery { order: -1; }
.pd-gallery__frame {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #DFDFDF;
}
.pd-gallery__frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; filter: blur(12px); transform: scale(1.06);
  transition: opacity 0.9s var(--ease), filter 0.9s var(--ease), transform 1.2s var(--ease);
}
.pd-gallery__frame img:first-child { object-fit: contain; padding: 8% 12%; }
.pd-gallery__frame img.is-active { opacity: 1; filter: blur(0); transform: none; }

.pd-gallery__bar { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.pd-gallery__count { color: var(--muted); }
.pd-gallery__count [data-gallery-current] {
  color: var(--ink); font-size: 24px;
}
.pd-gallery__nav { display: flex; gap: 8px; }
.pd-gallery__nav button {
  display: grid; place-items: center;
  width: 52px; height: 40px;
  border-radius: 10px;
  background: var(--white);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.pd-gallery__nav button:hover { background: var(--ink); color: var(--white); }
.pd-gallery__nav svg { width: 22px; height: 22px; }

@media (min-width: 600px) {
  .pd-specs { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .pd-details { grid-template-columns: minmax(0, 800px) minmax(0, 480px); justify-content: space-between; align-items: start; gap: 80px; }
  .pd-block p, .pd-specs { max-width: 800px; }
  /* gallery stays in view while the details scroll */
  .pd-gallery { order: 0; position: sticky; top: 110px; }
}

/* ===== Related products ===== */
.related { padding: clamp(100px, 12vw, 200px) 10px 0; }

.related__card {
  display: grid; gap: 32px;
  padding: 40px 0 40px 20px;
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}
.related__intro { display: grid; justify-items: start; gap: 32px; padding-right: 20px; }
.related__title { max-width: 480px; }
.related__btn { display: none; }
.related__btn--mobile { display: inline-flex; justify-self: start; width: 200px; }

.related__track .product { scroll-snap-align: start; }

@media (min-width: 768px) {
  .related { padding-left: 20px; padding-right: 20px; }
  .related__card { padding: 40px 0 40px 40px; }
}

@media (min-width: 1024px) {
  .related__card { grid-template-columns: minmax(0, 590px) 1fr; gap: 40px; }
  .related__intro { align-self: end; gap: 40px; padding: 0 0 40px; }
  .related__btn { display: inline-flex; width: 200px; }
  .related__btn--mobile { display: none; }
}
