/* Saboreo — "One box. Different reasons to send it." gifting occasions section.
   Self-contained: safe to remove this file, its <link>, its <script>, and the
   <section id="gifting-story"> markup block without touching any other section. */

.gifting-story {
  position: relative;
  background: var(--off-black);
  border-top: 1px solid var(--border);
}

/* ===== Desktop: sticky, scroll-driven sequence ===== */

.gifting-desktop-track {
  position: relative;
  height: 450vh;
}

.gifting-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gifting-box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(220px, 22vw, 380px);
  aspect-ratio: 4 / 5;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: transform 800ms cubic-bezier(0.4, 0, 0.2, 1), opacity 800ms ease;
  will-change: transform;
}

.gifting-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 30px 55px rgba(0, 0, 0, 0.55));
}

.gifting-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(17, 16, 14, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 800ms ease;
}

.gifting-copy {
  position: relative;
  z-index: 3;
  width: min(720px, 84vw);
  height: min(320px, 46vh);
}

.gifting-slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.gifting-slide-content.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gifting-headline {
  margin: 0;
}

.gifting-story .section-title {
  color: var(--card) !important;
}

.gifting-cta {
  margin-top: 32px;
}

.gifting-story .btn-primary {
  background: var(--gold);
  color: var(--dark);
  border: 1px solid var(--gold);
}

.gifting-story .btn-primary:hover {
  background: transparent;
  color: var(--card);
  border-color: var(--gold);
}

/* Per-state box choreography */
.gifting-stage[data-state="0"] .gifting-box,
.gifting-stage[data-state="5"] .gifting-box {
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 0.5;
}
.gifting-stage[data-state="0"] .gifting-overlay,
.gifting-stage[data-state="5"] .gifting-overlay {
  opacity: 1;
}
.gifting-stage[data-state="1"] .gifting-box {
  transform: translate(calc(-50% + 16vw), -50%) rotate(5deg) scale(1);
  opacity: 1;
}
.gifting-stage[data-state="2"] .gifting-box {
  transform: translate(calc(-50% - 16vw), -50%) rotate(-5deg) scale(1);
  opacity: 1;
}
.gifting-stage[data-state="3"] .gifting-box {
  transform: translate(-50%, -50%) rotate(2deg) scale(1.08);
  opacity: 1;
}
.gifting-stage[data-state="4"] .gifting-box {
  transform: translate(calc(-50% + 9vw), calc(-50% - 6vh)) rotate(-4deg) scale(1.02);
  opacity: 1;
}

.gifting-controls {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 5vh, 48px);
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}

.gifting-nav-btn {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(251, 247, 240, 0.35);
  color: var(--card);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.gifting-nav-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.gifting-nav-btn:focus-visible,
.gifting-story .btn-primary:focus-visible,
.gifting-story:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gifting-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gifting-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(251, 247, 240, 0.3);
  transition: width 0.3s ease, background 0.3s ease;
}
.gifting-dot.is-active {
  width: 18px;
  border-radius: 3px;
  background: var(--gold);
}

/* ===== Mobile: swipeable, non-sticky sequence ===== */

.gifting-mobile {
  display: none;
}

@media (max-width: 768px) {
  .gifting-desktop-track {
    display: none;
  }

  .gifting-mobile {
    display: block;
    padding: 56px 0 36px;
  }

  .gifting-mobile-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .gifting-mobile-track::-webkit-scrollbar {
    display: none;
  }

  .gifting-mobile-slide {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 28px;
    box-sizing: border-box;
  }

  .gifting-box-mobile {
    width: clamp(140px, 42vw, 220px);
    aspect-ratio: 4 / 5;
    margin-bottom: 32px;
  }
  .gifting-box-mobile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.5));
  }

  .gifting-mobile-slide .hero-tag {
    margin-bottom: 14px;
  }
  .gifting-mobile-slide .section-title {
    color: var(--card) !important;
    font-size: clamp(22px, 6.5vw, 30px);
  }
  .gifting-mobile-slide .gifting-cta {
    margin-top: 24px;
  }

  .gifting-mobile-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 28px;
  }
}

/* ===== Reduced motion: fades only, no float/scale/rotate ===== */
@media (prefers-reduced-motion: reduce) {
  .gifting-box {
    transition: opacity 300ms ease !important;
  }
  .gifting-stage[data-state] .gifting-box {
    transform: translate(-50%, -50%) !important;
  }
  .gifting-overlay {
    transition: opacity 300ms ease !important;
  }
  .gifting-slide-content {
    transition: opacity 300ms ease !important;
  }
  .gifting-dot {
    transition: none !important;
  }
  .gifting-mobile-track {
    scroll-behavior: auto !important;
  }
}
