/* Curvbrim — streetwear product grid (works with existing Tailwind markup) */

:root {
  --brand-dark: #111111;
  --brand-light: #F9F9F9;
  --brand-accent: #10B981;
}

/* Reusable grid + card primitives (future pages / refactors) */
.products-grid {
  align-items: stretch;
}

.product-card {
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 1rem;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 40px -12px rgba(17, 17, 17, 0.12),
    0 8px 16px -8px rgba(17, 17, 17, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.product-card .price,
.product-card .product-price {
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}

.product-card .btn-secondary,
#produkter .grid > article.product-card > a[href*="buy.stripe.com"] {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
}

.product-card .btn-secondary:hover,
#produkter .grid > article.product-card:hover > a[href*="buy.stripe.com"] {
  background-color: var(--brand-accent) !important;
  color: var(--brand-dark) !important;
}

#produkter .grid > article.product-card > a[href*="buy.stripe.com"]:active {
  transform: scale(0.98);
}

/* Live homepage grid — mirror hover lift on Tailwind cards */
#produkter .grid > article {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#produkter .grid > article:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 40px -12px rgba(17, 17, 17, 0.12),
    0 8px 16px -8px rgba(17, 17, 17, 0.08);
}

/* Image zoom: direct child imgs only (skip carousel absolute stack) */
#produkter .grid > article .aspect-square > img {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
}

#produkter .grid > article:hover .aspect-square > img {
  transform: scale(1.02);
}

#produkter .grid > article:hover [data-carousel-root] img[aria-hidden="false"],
#produkter .grid > article:hover [data-carousel-root] img.opacity-100:not(.pointer-events-none) {
  transform: scale(1.02);
}

#produkter .grid > article:hover [data-carousel-root] img[aria-hidden="true"],
#produkter .grid > article:hover [data-carousel-root] img.opacity-0 {
  transform: none;
}

/* Aspect-ratio safety on image wrappers */
#produkter .grid > article .aspect-square,
.product-card .aspect-square {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

#produkter .grid > article > a[href*="buy.stripe.com"]:hover {
  background-color: var(--brand-accent) !important;
  color: var(--brand-dark) !important;
}

.sf-colors-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.sf-colors-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
}
.sf-colors-name {
  font-size: 0.8rem;
  color: #4b5563;
}
.sf-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sf-swatch {
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(17, 17, 17, 0.12);
  box-shadow: inset 0 0 0 1.5px #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sf-swatch:hover {
  transform: scale(1.08);
}
.sf-swatch-light {
  border-color: rgba(17, 17, 17, 0.28);
}
.sf-swatch.is-active {
  box-shadow: inset 0 0 0 1.5px #fff, 0 0 0 1.5px #fff, 0 0 0 3px #111;
}
.sf-swatch:focus-visible {
  outline: 2px solid var(--brand-accent, #c9a227);
  outline-offset: 3px;
}
.sf-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
}
.sf-thumb {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  overflow: hidden;
  border-radius: 0.7rem;
  border: 1.5px solid transparent;
  opacity: 0.72;
  cursor: pointer;
  background: #eee;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.sf-thumb:hover {
  opacity: 1;
}
.sf-thumb.is-active {
  opacity: 1;
  border-color: #111;
}
.sf-gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.sf-gal-prev { left: 0.5rem; }
.sf-gal-next { right: 0.5rem; }

.sf-zoom-trigger {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
}
.sf-zoom-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sf-zoom-trigger:hover .sf-zoom-hint,
.sf-zoom-trigger:focus-visible .sf-zoom-hint {
  opacity: 1;
}

#sf-zoom {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 1rem;
}
#sf-zoom[hidden] {
  display: none !important;
}
.sf-zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.88);
}
.sf-zoom-stage {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 920px);
  max-height: 88vh;
}
.sf-zoom-img {
  display: block;
  max-width: min(92vw, 920px);
  max-height: 82vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 1rem;
  background: #e5e5e5;
  cursor: zoom-in;
  transition: transform 0.08s linear;
  transform-origin: center center;
}
.sf-zoom-help {
  margin: 0.75rem 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}
.sf-zoom-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.sf-zoom-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.sf-zoom-prev { left: 0.75rem; }
.sf-zoom-next { right: 0.75rem; }
@media (hover: none) {
  .sf-zoom-hint { opacity: 1; }
  .sf-zoom-help { display: none; }
  .sf-zoom-img { cursor: default; }
}

.pdp-mount {
  display: block;
}
.pdp-card {
  display: grid;
  gap: 1.5rem;
}
.pdp-card:hover {
  transform: none;
  box-shadow:
    0 10px 24px -12px rgba(17, 17, 17, 0.1),
    0 4px 10px -8px rgba(17, 17, 17, 0.06);
}
@media (min-width: 768px) {
  .pdp-card {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 2.5rem;
    align-items: start;
    padding: 1.5rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  #produkter .grid > article,
  #produkter .grid > article .aspect-square > img,
  #produkter .grid > article [data-carousel-root] img {
    transition: none !important;
  }

  .product-card:hover,
  #produkter .grid > article:hover {
    transform: none;
  }

  #produkter .grid > article:hover .aspect-square > img,
  #produkter .grid > article:hover [data-carousel-root] img[aria-hidden="false"] {
    transform: none;
  }
}
