/* =========================================
   VELMORAS — Phase 3 Advanced Interactions
   Card flip · Color orb · Drag carousel · Horizontal scroll · Sound cues
   ========================================= */

/* ---------- 1. "Quick view" slide-up overlay (replaces 3D flip) ---------- */
.shop-card, .product-card {
  overflow: hidden;
  position: relative;
}
/* flip wrapper is now inert — content just flows */
.pc-flip {
  position: relative;
  width: 100%;
}
.pc-face { width: 100%; }
.pc-face.pc-front { position: relative; }

/* Back face slides up from bottom of the card as a quick-view overlay */
.pc-face.pc-back {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250, 245, 237, 0.98));
  backdrop-filter: blur(8px);
  border-radius: 14px 14px 0 0;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 8px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 -8px 24px -6px rgba(0,0,0,0.15);
  z-index: 3;
}
.shop-card.flipped .pc-face.pc-back,
.product-card.flipped .pc-face.pc-back {
  transform: translateY(0);
}
.pc-back .pcb-header {
  min-width: 0;
}
.pc-back .pcb-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 500;
}
.pc-back h6 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin: 4px 0 0;
  /* clamp to 2 lines with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-back p {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: 0;
  /* clamp to 3 lines with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 0;
}
.pc-back .pcb-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pc-back .pcb-features li {
  font-size: 11px;
  color: var(--ink);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-back .pcb-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}
.pc-back .pcb-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pc-back .pcb-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.pc-back .pcb-actions {
  display: flex; gap: 6px;
}
.pc-back .pcb-btn {
  flex: 1;
  min-width: 0;
  padding: 9px 6px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pc-back .pcb-btn.primary {
  background: var(--green);
  color: #fff;
}
.pc-back .pcb-btn.primary:hover {
  background: var(--green-2);
  transform: translateY(-1px);
}
.pc-back .pcb-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.pc-back .pcb-btn.ghost:hover {
  border-color: var(--ink);
}

/* Mobile — flip works on TAP via .flipped class (added in JS). Also make text sizes fit */
@media (max-width: 900px) {
  .pc-back { padding: 14px; gap: 8px; }
  .pc-back h6 { font-size: 16px; }
  .pc-back p { font-size: 11px; -webkit-line-clamp: 2; }
  .pc-back .pcb-features li { font-size: 10px; }
  .pc-back .pcb-price { font-size: 18px; }
  .pc-back .pcb-btn { font-size: 9px; padding: 8px 4px; }
}

/* ---------- 2. Testimonial horizontal scroller (native, works on touch + mouse) ---------- */
.reviews-carousel {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
  padding: 8px 0 20px;
  margin: 0 -16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.reviews-carousel::-webkit-scrollbar { display: none; }
.reviews-carousel.grabbing { cursor: grabbing; }
.reviews-carousel-track {
  display: flex;
  gap: 20px;
  padding: 0 16px;
  width: max-content;
}
.reviews-carousel .review-card {
  flex: 0 0 340px;
  scroll-snap-align: start;
}
@media (max-width: 640px) {
  .reviews-carousel .review-card { flex: 0 0 82vw; max-width: 340px; }
}
.reviews-carousel::before,
.reviews-carousel::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
}
.reviews-carousel::before { left: 0;  background: linear-gradient(90deg, var(--cream), transparent); }
.reviews-carousel::after  { right: 0; background: linear-gradient(-90deg, var(--cream), transparent); }
/* Drag hint chip */
.drag-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #fff;
  margin-left: 12px;
  animation: dragHintPulse 3.5s ease-in-out infinite;
}
@keyframes dragHintPulse {
  0%, 100% { opacity: 0.6; transform: translateX(0); }
  50%      { opacity: 1;   transform: translateX(4px); }
}
@media (max-width: 640px) {
  .reviews-carousel .review-card { flex: 0 0 88%; }
}

/* ---------- 3. Horizontal scroll section (featured collections) ---------- */
.h-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 28px 20px;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * {
  scroll-snap-align: center;
  flex-shrink: 0;
}

/* ---------- 4. Interactive color orb (product detail) ---------- */
.color-orb {
  position: relative;
  width: 220px; height: 220px;
  margin: 12px 0 6px;
  cursor: grab;
}
.color-orb.grabbing { cursor: grabbing; }
.color-orb-hub {
  position: absolute; inset: 45%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--cream-2));
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.9),
    0 6px 12px rgba(0,0,0,0.08);
}
.color-orb-satellite {
  position: absolute;
  top: 50%; left: 50%;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--orb-c);
  box-shadow:
    inset 0 -6px 10px rgba(0,0,0,0.35),
    inset 0 2px 4px rgba(255,255,255,0.35),
    0 4px 12px rgba(0,0,0,0.15);
  transform: translate(-50%, -50%) rotate(var(--orb-a, 0deg)) translate(80px) rotate(calc(-1 * var(--orb-a, 0deg)));
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.4);
  transition: transform 0.4s cubic-bezier(.34, 1.56, .64, 1);
}
.color-orb-satellite:hover {
  transform: translate(-50%, -50%) rotate(var(--orb-a, 0deg)) translate(80px) rotate(calc(-1 * var(--orb-a, 0deg))) scale(1.2);
  z-index: 3;
}
.color-orb-satellite.on {
  box-shadow:
    inset 0 -6px 10px rgba(0,0,0,0.35),
    inset 0 2px 4px rgba(255,255,255,0.35),
    0 0 0 3px #fff,
    0 0 0 5px var(--green),
    0 10px 20px rgba(0,0,0,0.2);
}

/* ---------- 5. Sound toggle (subtle top-right) ---------- */
.velm-sound-toggle {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 6px 18px rgba(58, 30, 38, 0.15);
  transition: transform 0.25s, background 0.25s;
}
.velm-sound-toggle:hover {
  transform: scale(1.05);
  background: #fff;
}
.velm-sound-toggle svg { width: 18px; height: 18px; }
.velm-sound-toggle .mute-line {
  transform-origin: center;
  transition: transform 0.25s;
  opacity: 0;
}
.velm-sound-toggle.muted .mute-line {
  opacity: 1;
}
@media (max-width: 640px) {
  .velm-sound-toggle { bottom: 14px; right: 14px; width: 38px; height: 38px; }
}

/* ---------- 6. Card back — mobile hides gracefully ---------- */
@media (max-width: 900px) {
  .drag-hint { display: none; }
}

/* ---------- 7. Sticky product image (Apple-style scroll storytelling) ---------- */
@media (min-width: 901px) {
  .pd-wrap {
    align-items: start;
  }
  .pd-gallery {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
  }
  .pd-main-img {
    height: 460px;
  }
}
