/* ============================================================
   Emmanuel Church Merch Shop — page-specific styles
   Loaded AFTER the shared /style.css (root color/font tokens,
   .wrap, .site-header, body reset, .btn-primary, .bubble live there).

   PLACEHOLDER BRANDING: currently reusing Jac'D Up's existing color
   tokens (--navy, --sand, --rose-gold, etc. from /style.css) as a
   starting point. Swap in Emmanuel's actual logo/brand colors once
   provided — same pattern Valley Creek followed.
   ============================================================ */

/* Sits on the light page background (not the dark header, unlike Valley
   Creek's placement), so this uses navy-on-eggshell rather than
   sand-on-navy. */
.countdown-timer {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  background: var(--blush);
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.products-intro {
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 28px;
  max-width: 640px;
}

.products-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.products-main {
  flex: 0 1 900px;
  min-width: 0;
}

.cart-column {
  position: sticky;
  top: 24px;
  flex: 0 0 360px;
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1280px) {
  .cart-column {
    flex: 0 0 300px;
  }
}

.cart-sidebar {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(31, 46, 70, 0.12);
}

/* Product grid — Valley Creek's stylesheet has no equivalent rule for
   this (cards stack full-width there); this is a fresh, deliberate
   responsive grid for Emmanuel rather than a copy of a gap. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  align-items: start;
}

.product-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 20px;
}

.product-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sand);
}

.product-card {
  cursor: default;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 8px;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: 0 4px 16px rgba(31, 46, 70, 0.15);
}

.product-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
}

.product-card .image-wrap {
  position: relative;
  border-radius: 8px 8px 0 0;
  background: var(--eggshell);
}

.product-card .image-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ---- Color swatches ---- */
/* Each swatch shows that color's own product photo as its background
   (cropped to a small square) rather than a flat color chip — always
   accurate to what the customer actually sees, no color-name-to-hex
   lookup table to maintain. */
.color-swatch-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 6px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--sand);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.is-active {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(31, 46, 70, 0.2);
}

.color-swatch:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ---- Size bubbles (shared visual language with Valley Creek) ---- */
.product-card .qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.product-card .qty-row .add-to-cart-btn {
  flex: 1 1 100%;
}

.product-card .card-body .size-row {
  margin-top: auto;
  padding-top: 10px;
}

.bubble-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bubble-row[hidden] {
  display: none;
}

.size-row-youth,
.size-row-toddler {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.bubble {
  border: 1.5px solid var(--sand);
  background: #fff;
  color: var(--ink);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bubble:hover:not(:disabled) {
  border-color: var(--rose-gold);
}

.bubble:active:not(:disabled) {
  transform: scale(0.95);
}

.bubble.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--eggshell);
}

.bubble:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.product-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.product-card .price {
  font-weight: 500;
  color: var(--deep-rose);
  margin: 4px 0;
}

.size-hint {
  font-size: 12px;
  color: var(--ink);
  opacity: 0.6;
}

/* ============================================================
   Mobile overrides — placed at the end deliberately (matches the
   cascade-order convention used in valleycreek.css: later rules here
   must win over the desktop rules above, so keep new additions below
   this block, not mixed in above it).
   ============================================================ */
@media (max-width: 900px) {
  .products-layout {
    flex-direction: column;
  }

  .cart-column {
    position: static;
    width: 100%;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
}
