/* ==========================================================
   merch.css — Colony Creative
   Split layout: product grid (left) | content (right)
   ========================================================== */

/* ---- Section ---- */
.merch {
  position: relative;
  width: 100%;
  padding-top: clamp(100px, 16vh, 200px);
  padding-bottom: clamp(100px, 16vh, 200px);
  background: var(--bg-elevated);
  overflow: hidden;
}

/* ---- Container ---- */
.merch__container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
}

/* ---- Split layout ---- */
.merch__split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: center;
}

/* ---- Products wrapper (holds grid + controls) ---- */
.merch__products-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---- Products grid (left) ---- */
.merch__products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* ---- Content (right) ---- */
.merch__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---- Headline ---- */
.merch__headline {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin: 0;
  will-change: transform, opacity;
}

/* ---- Body text ---- */
.merch__body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0;
  will-change: transform, opacity;
}

/* ---- Card ---- */
.merch__card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.4s ease, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, transform;
}

.merch__card:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
}

/* ---- Card image wrap ---- */
.merch__card-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---- Card tag (pill badge) ---- */
.merch__card-tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: var(--bg);
  padding: 0.25rem 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
  z-index: 1;
}

/* ---- Card image ---- */
.merch__card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s ease;
}

/* When a swatch image is swapped in, keep full-bleed cover */
.merch__card-image.merch__card-image--active {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merch__card:hover .merch__card-image {
  transform: scale(1.04);
}

/* ---- Card info ---- */
.merch__card-info {
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.merch__card-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.merch__card-name {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  margin: 0;
}

.merch__card-price {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.merch__card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

.merch__card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.35rem;
}

/* ---- Swatches ---- */
.merch__swatch-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.merch__swatch {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.merch__swatch:hover {
  transform: scale(1.15);
}

.merch__swatch.is-active {
  box-shadow: 0 0 0 1.5px var(--bg-surface), 0 0 0 2.5px rgba(255, 255, 255, 0.4);
}

/* ---- Card view button (now an <a> link) ---- */
.merch__card-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  background: none;
}

.merch__card:hover .merch__card-view-btn,
.merch__card-view-btn:focus-visible {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.merch__card-view-btn svg {
  transition: transform 0.3s ease;
}

.merch__card:hover .merch__card-view-btn svg {
  transform: translateX(2px);
}

/* ---- Navigation controls (arrows) ---- */
.merch__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ---- Arrows ---- */
.merch__arrows {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.merch__arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.merch__arrow-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ---- Links row ---- */
.merch__links-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Primary pill button (solid) ---- */
.merch__primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--btn-text);
  background: var(--btn-bg);
  padding: 0.875rem 2rem;
  border-radius: 100px;
  letter-spacing: 0.01em;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
}

.merch__primary-btn:hover {
  background: var(--btn-hover-bg);
  transform: translateY(-2px);
}

.merch__primary-btn svg {
  transition: transform 0.3s ease;
}

.merch__primary-btn:hover svg {
  transform: translate(2px, -2px);
}

/* ---- "OR" divider ---- */
.merch__btn-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  user-select: none;
}

.merch__btn-divider::before,
.merch__btn-divider::after {
  content: '';
  display: block;
  width: 8px;
  height: 1px;
  background: var(--border-subtle);
}

/* ---- Ghost pill button (outline) ---- */
.merch__ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  padding: 0.875rem 2rem;
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.01em;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
}

.merch__ghost-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.merch__ghost-btn svg {
  transition: transform 0.3s ease;
}

.merch__ghost-btn:hover svg {
  transform: translate(2px, -2px);
}

/* ==========================================================
   Responsive
   ========================================================== */

/* Tablet / narrow — stack vertically, content FIRST, products SECOND */
@media (max-width: 768px) {
  .merch__split {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3rem);
  }

  /* Content appears first (above products) */
  .merch__content {
    order: 1;
    align-items: center;
    text-align: center;
  }

  /* Products appear second (below content) */
  .merch__products-wrap {
    order: 2;
  }

  .merch__products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .merch__body {
    max-width: 480px;
  }

  .merch__links-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .merch__controls {
    justify-content: center;
  }
}

/* Small mobile */
@media (max-width: 600px) {
  .merch__products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .merch__headline {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .merch__card {
    border-radius: 12px;
  }

  .merch__arrow-btn {
    width: 38px;
    height: 38px;
  }

  .merch__arrow-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .merch__card {
    transition: none;
  }

  .merch__primary-btn {
    transition: none;
  }

  .merch__ghost-btn {
    transition: none;
  }

  .merch__card-image {
    transition: none;
  }

  .merch__swatch {
    transition: none;
  }
}
