/*
 * SORKISTx — WooCommerce single product (Jewel Showcase variant)
 * Enqueued on is_product() when template = jewel-showcase.
 */

/* ─── Layout ─────────────────────────────────────────────────────────────────── */

.jewel-sp-layout { padding-block: var(--space-10); }

.jewel-sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

@media (max-width: 900px) {
  .jewel-sp-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}

/* ─── Visual (left column) ───────────────────────────────────────────────────── */

.jewel-sp-visual {
  position: sticky;
  top: calc(var(--nav-height, 70px) + var(--space-6));
}

.jewel-viewer-main {
  aspect-ratio: 1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, 0.15),
    0 20px 60px rgba(0,0,0,0.5),
    0 0 80px rgba(196, 163, 90, 0.06);
}

/* ─── Details (right column) ─────────────────────────────────────────────────── */

.jewel-price {
  font-size: 2rem;
  font-weight: 800;
  color: #C4A35A;
  margin-block-end: var(--space-5);
}

.jewel-price del { opacity: 0.5; font-size: 0.65em; font-weight: 400; margin-inline-end: var(--space-2); }
.jewel-price ins  { text-decoration: none; }

/* Attribute overview (informational, not interactive) */
.jewel-attrs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-block: var(--space-5);
  padding: var(--space-4);
  background: rgba(196, 163, 90, 0.05);
  border: 1px solid rgba(196, 163, 90, 0.15);
  border-radius: var(--radius-lg);
}

.jewel-attr-row {
  display: flex;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  align-items: baseline;
}

.jewel-attr-name {
  font-weight: 600;
  color: var(--color-text);
  min-width: 90px;
  flex-shrink: 0;
}

.jewel-attr-vals {
  color: var(--color-text-muted);
}

/* ─── CTA row ────────────────────────────────────────────────────────────────── */

.jewel-cta-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-block: var(--space-6);
}

/* WhatsApp button */
.btn--whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn--whatsapp:hover {
  background: #128C7E;
  border-color: #128C7E;
  color: #fff;
}

/* ─── Single product viewer controls on product page ─────────────────────────── */

/* Swatch tooltips flip direction to not go off-screen on product pages */
.jewel-sp-visual .viewer-mat-swatch::after {
  inset-inline-end: auto;
  inset-inline-start: calc(100% + 8px);
}

/* ─── Jewel meta/stock ───────────────────────────────────────────────────────── */

.sp-stock.out-of-stock {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ─── WooCommerce Variation Swatches ────────────────────────────────────────────
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Hidden WooCommerce selects — required by WC's variation JS but not shown */
.jewel-var-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Variation form ─────────────────────────────────────────────────────────── */

.jewel-variations-form {
  margin-block: var(--space-5);
}

/* ─── One attribute row ──────────────────────────────────────────────────────── */

.jewel-var-row {
  margin-block-end: var(--space-5);
}

.jewel-var-label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-block-end: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.jewel-var-chosen {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs, 0.75rem);
}

/* ─── Swatch row ─────────────────────────────────────────────────────────────── */

.jewel-var-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ─── Base swatch ────────────────────────────────────────────────────────────── */

.jewel-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  background: none;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.jewel-swatch:hover {
  transform: scale(1.08);
}

.jewel-swatch.is-active {
  border-color: #C4A35A;
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.25);
}

.jewel-swatch:focus-visible {
  outline: 2px solid #C4A35A;
  outline-offset: 3px;
}

/* ─── Material swatch (metallic circle) ─────────────────────────────────────── */

.jewel-swatch--mat {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.jewel-swatch--mat .jewel-swatch__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.35), inset 0 -2px 4px rgba(0,0,0,0.25);
  background: var(--swatch-color, #C4A35A);
}

/* ─── Stone swatch (emoji / icon button) ─────────────────────────────────────── */

.jewel-swatch--stone {
  width: auto;
  height: 36px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-full, 9999px);
  background: rgba(255,255,255,0.04);
  border-color: rgba(196, 163, 90, 0.25);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  gap: var(--space-1);
  white-space: nowrap;
}

.jewel-swatch--stone:hover {
  border-color: rgba(196, 163, 90, 0.6);
  background: rgba(196, 163, 90, 0.06);
}

.jewel-swatch--stone.is-active {
  background: rgba(196, 163, 90, 0.1);
  color: #C4A35A;
}

/* ─── Style swatch (text pill) ───────────────────────────────────────────────── */

.jewel-swatch--style {
  height: 34px;
  padding-inline: var(--space-4);
  border-radius: var(--radius-full, 9999px);
  background: rgba(255,255,255,0.04);
  border-color: rgba(196, 163, 90, 0.25);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.jewel-swatch--style:hover {
  border-color: rgba(196, 163, 90, 0.6);
  background: rgba(196, 163, 90, 0.06);
}

.jewel-swatch--style.is-active {
  background: rgba(196, 163, 90, 0.12);
  border-color: #C4A35A;
  color: #C4A35A;
  font-weight: 600;
}

/* ─── Live price ─────────────────────────────────────────────────────────────── */

.jewel-var-price {
  font-size: 2rem;
  font-weight: 800;
  color: #C4A35A;
  margin-block: var(--space-4) var(--space-5);
  min-height: 2.5rem;
  transition: opacity 0.2s;
}

.jewel-var-price del  { opacity: 0.5; font-size: 0.6em; font-weight: 400; margin-inline-end: var(--space-2); }
.jewel-var-price ins  { text-decoration: none; }

/* Briefly fade price during update */
.jewel-var-price.is-updating { opacity: 0.4; }

/* ─── Variation separator ────────────────────────────────────────────────────── */

.jewel-var-divider {
  border: none;
  border-top: 1px solid rgba(196, 163, 90, 0.15);
  margin-block: var(--space-4);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */

/* Gold primary button */
.btn--gold {
  background: linear-gradient(135deg, #C4A35A 0%, #a8882a 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(196, 163, 90, 0.35);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn--gold:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(196, 163, 90, 0.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn--gold:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn--gold.disabled,
.btn--gold[disabled] {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

/* Large size */
.btn--lg {
  height: 52px;
  padding-inline: var(--space-7);
  font-size: 1rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .jewel-var-swatches { gap: var(--space-2); }
  .jewel-swatch--mat  { width: 32px; height: 32px; }
  .jewel-swatch--mat .jewel-swatch__dot { width: 24px; height: 24px; }
  .jewel-var-price    { font-size: 1.6rem; }
  .btn--lg            { height: 46px; font-size: 0.9rem; }
}
