/* =========================================================
   3D Showcase CSS
   Romm Coffee — interactive 3D product viewer section.

   A deep-teal stage: the 3D Turkish-coffee bag on one side
   (drag to rotate, auto-rotates gently), story copy on the
   other. model-viewer is loaded only on pages that use it.

   Works with:
   - Pages/Index.cshtml (3D showcase section)
   - wwwroot/lib/model-viewer/model-viewer.min.js
   - wwwroot/models/turk-kahvesi.glb
========================================================= */

.showcase-3d {
  /* Same deep-teal stage language as the footer. */
  background:
    radial-gradient(
      110% 140% at 85% 10%,
      rgba(100, 158, 161, 0.28) 0%,
      rgba(100, 158, 161, 0) 55%
    ),
    linear-gradient(135deg, #05323a, #06515d);
  padding-block: var(--section-padding-lg, clamp(5rem, 9vw, 8rem));
  overflow: hidden;
}

.showcase-3d-inner {
  width: min(var(--container-lg, 1120px), calc(100% - 2rem));
  margin-inline: auto;

  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .showcase-3d-inner {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  }
}

/* ---------- Viewer ---------- */

.showcase-3d-stage {
  position: relative;
  min-height: clamp(22rem, 48vw, 34rem);
}

.showcase-3d-stage model-viewer {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;

  /* Transparent canvas: the teal stage shows through. */
  background: transparent;
  --poster-color: transparent;

  cursor: grab;
  touch-action: pan-y;
}

.showcase-3d-stage model-viewer:active {
  cursor: grabbing;
}

/* Soft ground shadow under the bag. */
.showcase-3d-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(0.5rem, 4vw, 2rem);
  transform: translateX(-50%);

  width: 55%;
  height: 2.25rem;

  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(2, 20, 24, 0.55) 0%,
    rgba(2, 20, 24, 0) 100%
  );
  pointer-events: none;
}

/* ---------- Floating value badges (Grind-style pills) ---------- */

.showcase-3d-badge {
  position: absolute;
  z-index: 2;

  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.5rem 0.95rem;

  font-family: var(--font-body);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--color-primary-dark, #05323a);

  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-full, 999px);
  box-shadow: 0 10px 30px rgba(2, 20, 24, 0.35);
  backdrop-filter: blur(4px);

  /* Gentle bob so they feel alive without spinning with the bag. */
  animation: badge-bob 4.5s ease-in-out infinite;
}

.showcase-3d-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-secondary, #649ea1);
  flex-shrink: 0;
}

.showcase-3d-badge.is-top {
  top: 14%;
  right: 6%;
  animation-delay: 0s;
}

.showcase-3d-badge.is-mid {
  top: 46%;
  left: 2%;
  animation-delay: -1.5s;
}

.showcase-3d-badge.is-bottom {
  bottom: 20%;
  right: 10%;
  animation-delay: -3s;
}

@keyframes badge-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ---------- Rotating brand seal ---------- */

.showcase-3d-seal {
  position: absolute;
  top: -18px;
  left: -10px;
  z-index: 3;

  width: clamp(88px, 12vw, 116px);
  height: clamp(88px, 12vw, 116px);

  animation: seal-spin 18s linear infinite;
}

.showcase-3d-seal svg {
  width: 100%;
  height: 100%;
}

.showcase-3d-seal-text {
  font-family: var(--font-body);
  font-size: 8.2px;
  font-weight: var(--weight-bold, 700);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: #f6f8f8;
}

/* Small coffee-bean glyph in the middle of the seal. */
.showcase-3d-seal-core {
  fill: var(--color-accent, #c79a4b);
}

@keyframes seal-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* "Drag to rotate" hint. */
.showcase-3d-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);

  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.375rem 0.875rem;

  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--weight-medium, 500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);

  background: rgba(2, 20, 24, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full, 999px);

  pointer-events: none;
}

.showcase-3d-hint svg {
  width: 0.875rem;
  height: 0.875rem;
  fill: currentColor;
}

/* ---------- Copy ---------- */

.showcase-3d-copy .section-eyebrow {
  color: var(--color-secondary, #649ea1);
}

.showcase-3d-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, var(--text-3xl, 2.5rem));
  line-height: var(--line-tight, 1.15);
  color: #ffffff;
  text-wrap: balance;
}

.showcase-3d-text {
  margin: var(--space-4, 1rem) 0 0;
  max-width: 46ch;
  font-size: var(--text-md, 1.125rem);
  line-height: var(--line-relaxed, 1.75);
  color: rgba(255, 255, 255, 0.78);
}

.showcase-3d-facts {
  margin: var(--space-6, 2rem) 0 0;
  padding: 0;
  list-style: none;

  display: grid;
  gap: var(--space-3, 0.75rem);
}

.showcase-3d-facts li {
  display: flex;
  align-items: baseline;
  gap: var(--space-3, 0.75rem);

  font-size: var(--text-sm, 0.875rem);
  color: rgba(255, 255, 255, 0.85);
}

/* Small teal tick — consistent with brand, no emoji. */
.showcase-3d-facts li::before {
  content: "—";
  color: var(--color-secondary, #649ea1);
  font-weight: var(--weight-bold, 700);
}

.showcase-3d-actions {
  margin-top: var(--space-6, 2rem);
}

.showcase-3d .btn-outline-custom {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}

.showcase-3d .btn-outline-custom:hover {
  color: var(--color-primary-dark, #05323a);
  background: #ffffff;
  border-color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  /* Auto-rotate is disabled via JS; keep the static pose. */
  .showcase-3d-hint {
    display: none;
  }

  .showcase-3d-badge,
  .showcase-3d-seal {
    animation: none;
  }
}

/* On narrow screens the stage is shorter; tuck the seal in and
   drop the mid badge so nothing overlaps the copy. */
@media (max-width: 560px) {
  .showcase-3d-seal {
    top: -6px;
    left: 2px;
    width: 74px;
    height: 74px;
  }

  .showcase-3d-badge.is-mid {
    display: none;
  }
}
