/* Merch page — extends global tokens/components from main.css */

/* Visually-hidden utility */
.sr-only {
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* Page hero */
.page-hero.shop-hero {
  padding-block: 32px;
  background: linear-gradient(0deg, rgba(11,11,12,.04), rgba(11,11,12,0));
}
.page-hero__sub { color: var(--text-500); margin: 6px 0 0; }
.shop-hero__note { color: var(--text-500); margin: 6px 0 0; }

.shop-cart-summary {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f6f2ea;
  border-radius: 10px;
  box-shadow: var(--shadow-1);
  display: inline-block;
}

.shop-cart-summary__label {
  font-size: 13px;
  color: var(--text-500);
}

.shop-cart-summary__value {
  font-weight: 700;
  font-size: 18px;
}

.shop-cart-summary__total {
  color: var(--text-600);
  font-size: 14px;
}

/* Toolbar */
.filter-toolbar {
  display:flex; flex-wrap:wrap; gap:16px; align-items:center;
  margin: 10px 0 18px;
}
.filter-fieldset { border:0; margin:0; padding:0; }
.filter-legend { font-size:13px; color: var(--text-500); margin:0 0 6px; }

.filter-tabs {
  display:flex; flex-wrap:wrap; gap:8px;
}
.filter-tab {
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:999px; cursor:pointer;
  border:1px solid #e8e2d7; background:#fff; box-shadow: var(--shadow-1);
  font-weight:600;
}
.sort { margin-left:auto; display:flex; align-items:center; gap:8px; }
.sort__label { font-size:13px; color: var(--text-500); }
.sort select {
  padding:8px 12px; border-radius:999px; border:1px solid #e8e2d7; background:#fff;
}

/* Active tab highlighting (CSS-only via :checked inputs) */
#cat-all:checked ~ .filter-toolbar .tabs--category label[for="cat-all"],
#cat-apparel:checked ~ .filter-toolbar .tabs--category label[for="cat-apparel"],
#cat-accessories:checked ~ .filter-toolbar .tabs--category label[for="cat-accessories"],
#cat-beauty:checked ~ .filter-toolbar .tabs--category label[for="cat-beauty"] {
  border-color: var(--champagne);
  box-shadow: var(--shadow-2);
}

#price-all:checked ~ .filter-toolbar .tabs--price label[for="price-all"],
#price-under40:checked ~ .filter-toolbar .tabs--price label[for="price-under40"],
#price-40-80:checked ~ .filter-toolbar .tabs--price label[for="price-40-80"],
#price-over80:checked ~ .filter-toolbar .tabs--price label[for="price-over80"] {
  border-color: var(--champagne);
  box-shadow: var(--shadow-2);
}

/* Grid (reuses .product-card styles from main.css) */
.shop-grid {
  display:grid; gap:16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px){ .shop-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px){ .shop-grid { grid-template-columns: repeat(3,1fr); } }

/* Badges */
.product-card { position:relative; }
.product-card__badges {
  position:absolute; inset:12px auto auto 12px; display:flex; gap:8px; z-index:2;
}
.badge {
  display:inline-block; padding:4px 10px; border-radius:999px;
  background: rgba(11,11,12,.85); color:#fff; font-size:12px; font-weight:700;
  border:1px solid rgba(255,255,255,.2);
}
.badge--limited { background: var(--champagne); color:#111; }
.badge--back { background: var(--ivory); color:#7a663f; border:1px solid #e8e2d7; }

/* Filter logic (CSS-only):
   Inputs sit before .shop-grid. When a specific radio is checked, hide non-matching cards. */

/* Category filters */
#cat-apparel:checked ~ .shop-grid > .product-card:not([data-category="apparel"]) { display:none; }
#cat-accessories:checked ~ .shop-grid > .product-card:not([data-category="accessories"]) { display:none; }
#cat-beauty:checked ~ .shop-grid > .product-card:not([data-category="beauty"]) { display:none; }
/* (When #cat-all is checked, no category-specific rule hides items) */

/* Price filters */
#price-under40:checked ~ .shop-grid > .product-card:not([data-price="under-40"]) { display:none; }
#price-40-80:checked   ~ .shop-grid > .product-card:not([data-price="40-80"])   { display:none; }
#price-over80:checked  ~ .shop-grid > .product-card:not([data-price="over-80"]) { display:none; }
/* (When #price-all is checked, no price-specific rule hides items) */

.shop-note { margin-top: 16px; color: var(--text-500); font-size: 14px; }

.product-card__image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #f8f5ef;
  margin-bottom: 10px;
  box-shadow: var(--shadow-1);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card__cta {
  flex: 1;
  border: none;
  background: var(--accent-color, #111);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.product-card__cta:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.product-card__wishlist {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e5ded3;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-600);
  transition: border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.product-card__wishlist:hover {
  border-color: var(--accent-color, #111);
  color: var(--accent-color, #111);
  box-shadow: var(--shadow-1);
}

.product-card__wishlist:focus-visible {
  outline: 2px solid var(--accent-color, #111);
  outline-offset: 2px;
}

.product-card__wishlist.is-active {
  background: var(--accent-color, #111);
  color: #fff;
  border-color: var(--accent-color, #111);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-card__wishlist.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.shop-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #111;
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow-3, 0 8px 24px rgba(0,0,0,0.18));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 50;
}

.shop-toast.success {
  background: var(--accent-color, #111);
}

.shop-toast.error {
  background: #b3261e;
}

.shop-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
}
