/* ── Filter bar sticky ── */
.merch-filter-wrap {
  position: sticky;
  top: var(--nav-h);
  background: var(--black);
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

/* ── Product grid ── */
.merch-section {
  padding: clamp(48px, 6vw, 80px) clamp(20px, 4vw, 48px);
}
.merch-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ── Product card ── */
.product-card {
  position: relative;
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-med);
}
.product-card.hidden {
  display: none;
}
.product-card.fading-out {
  transform: scale(0.95);
  opacity: 0;
}
.product-image-wrap {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.product-card:hover .product-image-wrap {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.product-watermark {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--faint);
  letter-spacing: 0.05em;
  user-select: none;
}
.product-diamond {
  color: var(--faint);
  font-size: 24px;
  user-select: none;
}
.product-sold-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,8,8,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-sold-badge {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.product-body {
  padding: 16px 0;
}
.product-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  color: var(--white);
  cursor: pointer;
  transition: color var(--dur-fast);
}
.product-name:hover { color: var(--gold); }
.product-price {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold);
  margin-top: 6px;
}
.product-btn {
  width: 100%;
  padding: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 2px;
  margin-top: 10px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.product-btn:hover:not(:disabled) {
  background: var(--gold);
  color: var(--black);
}
.product-btn:disabled {
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* ── Cart sidebar ── */
#cart {
  position: fixed;
  right: 0; top: 0;
  height: 100vh;
  width: 380px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 400ms var(--ease-out);
  display: flex;
  flex-direction: column;
}
#cart.open { transform: translateX(0); }

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-header-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--white);
}
.cart-close {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 20px;
  transition: color var(--dur-fast);
  border-radius: 2px;
}
.cart-close:hover { color: var(--white); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
}
.cart-empty {
  padding: 48px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--white);
}
.cart-item-size {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.cart-item-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  margin-top: 4px;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qty-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.qty-btn:hover { border-color: var(--gold); color: var(--gold); }
.qty-display {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--white);
  min-width: 20px;
  text-align: center;
}
.cart-item-remove {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  align-self: flex-start;
  transition: color var(--dur-fast);
}
.cart-item-remove:hover { color: var(--red); }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cart-total-label {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
  color: var(--white);
}
.cart-total-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
  color: var(--gold);
}
.cart-checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--black);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.cart-checkout-btn:hover { background: var(--gold-dim); border-color: var(--gold-dim); }

/* ── Product modal ── */
.product-modal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}
.product-modal-img {
  width: 240px; height: 240px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}
.product-modal-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 24px;
  color: var(--white);
  margin-bottom: 8px;
}
.product-modal-price {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 20px;
}
.size-selector {
  margin-bottom: 16px;
}
.size-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.size-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.size-option {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.size-option.active, .size-option:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}
.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.modal-add-btn {
  width: 100%;
  padding: 13px;
  background: var(--gold);
  color: var(--black);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.modal-add-btn:hover { background: var(--gold-dim); border-color: var(--gold-dim); }

/* ── Responsive ── */
@media (max-width: 767px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  #cart { width: 100vw; }
  .product-modal-layout { grid-template-columns: 1fr; }
  .product-modal-img { width: 100%; height: auto; aspect-ratio: 1; }
}
@media (max-width: 399px) {
  .product-grid { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
