@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600&family=Jost:wght@300;400;500&display=swap");

:root {
  --jj-bg: #ffffff;
  --jj-foreground: #2a2824;
  --jj-ink-soft: #4a4740;
  --jj-ink-mute: #7a756c;
  --jj-gold: #b8956c;
  --jj-gold-deep: #8f7048;
  --jj-line: #e2ddd0;
  --jj-black: #141210;
}

* {
  box-sizing: border-box;
}

body.jj-shop-page {
  margin: 0;
  padding-top: var(--jj-header-h);
  background: var(--jj-bg);
  color: var(--jj-foreground);
  font-family: "Jost", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Shared header (same as product page) */
.jj-site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in oklab, var(--jj-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--jj-line) 70%, transparent);
  padding-top: env(safe-area-inset-top, 0px);
}

.jj-site-header__inner {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  height: 84px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.jj-brand {
  position: relative;
  z-index: 2;
  grid-column: 1;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--jj-foreground);
  white-space: nowrap;
  justify-self: start;
}

.jj-nav {
  position: static;
  grid-column: 2;
  justify-self: center;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  width: max-content;
  max-width: none;
  transform: none;
  pointer-events: auto;
}

.jj-nav__link {
  position: relative;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--jj-foreground);
  transition: color 0.3s ease;
}

.jj-nav__link:hover,
.jj-nav__link.is-active {
  color: var(--jj-gold-deep);
}

.jj-nav__link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--jj-gold);
  transition: width 0.35s ease, left 0.35s ease;
}

.jj-nav__link:hover::after,
.jj-nav__link.is-active::after {
  width: 100%;
  left: 0;
}

.jj-header-actions {
  position: relative;
  z-index: 2;
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.jj-icon-btn,
.jj-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--jj-foreground);
  cursor: pointer;
}

.jj-icon-btn svg,
.jj-menu-btn svg {
  width: 20px;
  height: 20px;
}

.jj-notify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid var(--jj-foreground);
  background: transparent;
  font-family: "Jost", sans-serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--jj-foreground);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.jj-notify-btn:hover {
  background: var(--jj-foreground);
  color: var(--jj-bg);
}

.jj-menu-btn {
  display: none;
}

/* Collection header */
.jj-shop-header {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 40px 24px;
  text-align: center;
}

.jj-shop-crumb {
  margin: 0 0 28px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jj-ink-mute);
  text-align: left;
}

.jj-shop-crumb a {
  color: inherit;
  text-decoration: none;
}

.jj-shop-crumb a:hover {
  color: var(--jj-gold-deep);
}

.jj-shop-crumb__sep {
  margin: 0 10px;
  opacity: 0.5;
}

.jj-shop-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--jj-foreground);
}

/* Filter bar */
.jj-shop-filters {
  position: sticky;
  top: calc(72px + env(safe-area-inset-top, 0px));
  z-index: 150;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 40px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.jj-shop-filters__left,
.jj-shop-filters__right {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.jj-shop-sort {
  position: relative;
}

.jj-shop-sort__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--jj-foreground);
  font-family: "Jost", sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.jj-shop-sort__prefix {
  color: var(--jj-ink-mute);
}

.jj-shop-sort__trigger svg {
  width: 10px;
  height: 7px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
  transition: transform 0.25s ease;
}

.jj-shop-sort.is-open .jj-shop-sort__trigger svg {
  transform: rotate(180deg);
}

.jj-shop-sort__trigger:hover,
.jj-shop-sort__trigger:focus-visible {
  color: var(--jj-gold-deep);
}

.jj-shop-sort__trigger:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 6px;
}

.jj-shop-sort__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  width: min(260px, calc(100vw - 40px));
  padding: 8px 0;
  border: 1px solid #e8e3db;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(31, 28, 24, 0.12);
}

.jj-shop-sort__menu[hidden] {
  display: none;
}

.jj-shop-sort__option {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 18px;
  border: 0;
  background: transparent;
  color: var(--jj-foreground);
  font-family: "Jost", sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
}

.jj-shop-sort__option:hover,
.jj-shop-sort__option:focus-visible {
  background: #f7f4ef;
  outline: 0;
}

.jj-shop-sort__check {
  opacity: 0;
  font-size: 13px;
}

.jj-shop-sort__option.is-selected .jj-shop-sort__check {
  opacity: 1;
}

.jj-shop-filter-btn {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: "Jost", sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jj-foreground);
  cursor: pointer;
}

.jj-shop-filter-btn:hover,
.jj-shop-filter-btn.is-active {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--jj-gold-deep);
}

/* Product grid */
.jj-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 56px 28px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.jj-shop-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.jj-shop-card[hidden] {
  display: none;
}

.jj-shop-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #ede8df;
  margin-bottom: 20px;
}

.jj-shop-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Clicks always go to the card link — images never intercept */
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.jj-shop-card__media .jj-shop-card__img--main {
  opacity: 1;
  z-index: 1;
  transition: opacity 120ms ease-out;
}

.jj-shop-card__media .jj-shop-card__img--alt {
  opacity: 0;
  z-index: 2;
  transition: opacity 120ms ease-out;
}

/* Desktop only: swap on the image area. Touch devices skip hover entirely. */
@media (hover: hover) and (pointer: fine) {
  .jj-shop-card.has-hover-alt .jj-shop-card__media:hover .jj-shop-card__img--main {
    opacity: 0;
  }

  .jj-shop-card.has-hover-alt .jj-shop-card__media:hover .jj-shop-card__img--alt {
    opacity: 1;
  }
}

.jj-shop-card__info {
  text-align: center;
}

.jj-shop-card__name {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.jj-shop-card__price {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--jj-ink-mute);
}

.jj-shop-empty {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  color: var(--jj-ink-mute);
}

.jj-shop-empty[hidden] {
  display: none;
}

.jj-shop-footer {
  border-top: 1px solid var(--jj-line);
  background: var(--jj-black);
  color: rgba(247, 244, 239, 0.72);
  padding: 48px 40px;
}

.jj-shop-footer__inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.jj-shop-footer__brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: #f7f4ef;
  text-decoration: none;
}

.jj-shop-footer__copy {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (max-width: 1200px) {
  .jj-shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .jj-site-header__inner {
    height: 72px;
    padding: 0 16px;
    gap: 12px;
  }

  .jj-nav {
    gap: clamp(10px, 2.8vw, 28px);
    max-width: min(46vw, 280px);
  }

  .jj-nav__link {
    font-size: clamp(9px, 2.4vw, 12px);
    letter-spacing: clamp(0.8px, 0.35vw, 1.75px);
  }

  .jj-icon-btn--desktop,
  .jj-menu-btn {
    display: none;
  }

  .jj-shop-filters {
    top: calc(72px + env(safe-area-inset-top, 0px));
    padding: 14px 20px;
  }

  .jj-shop-header,
  .jj-shop-grid {
    padding-left: 20px;
    padding-right: 20px;
  }

  .jj-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
    padding-top: 32px;
  }

  .jj-shop-filters__left,
  .jj-shop-filters__right {
    gap: 16px;
  }
}

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