/* ============================================================
   SPOTLESS DUO — animations.css
   Keyframes · Page transitions · Hover effects · Scroll-reveal
   ============================================================ */

/* ── 1. KEYFRAME DEFINITIONS ────────────────────────────────── */

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fade up */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fade down */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide in from left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide out to left (booking step back) */
@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-50px); }
}

/* Slide out to right (booking step next) */
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(50px); }
}

/* Sparkle / twinkle */
@keyframes sparkle {
  0%,  100% { opacity: 1;    transform: scale(1)    rotate(0deg); }
  25%        { opacity: 0.6;  transform: scale(1.15) rotate(8deg); }
  75%        { opacity: 0.8;  transform: scale(0.9)  rotate(-5deg); }
}

/* Pulse (dashed border cards on hover) */
@keyframes dashedPulse {
  0%,  100% { border-color: var(--color-gray-border); }
  50%        { border-color: var(--color-blue-light); }
}

/* Price count-up shimmer */
@keyframes priceUpdate {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); color: var(--color-blue-dark); }
  100% { transform: scale(1); }
}

/* Spin (loading states) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bounce in (success checkmark) */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { transform: scale(1.08); }
  70%  { transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

/* Float (loyalty card decoration) */
@keyframes float {
  0%,  100% { transform: translateY(0); }
  50%        { transform: translateY(-8px); }
}

/* ── 2. PAGE LOAD ────────────────────────────────────────────── */

.animate-fade-in {
  animation: fadeIn 0.6s ease both;
}

.animate-fade-up {
  animation: fadeUp 0.6s ease both;
}

.hero-section {
  animation: fadeIn 0.7s ease both;
}

/* Staggered hero content */
.hero-section .hero__headline    { animation: fadeUp 0.6s 0.1s ease both; }
.hero-section .hero__subheadline { animation: fadeUp 0.6s 0.2s ease both; }
.hero-section .hero__badge       { animation: fadeUp 0.6s 0.3s ease both; }
.hero-section .hero__cta         { animation: fadeUp 0.6s 0.4s ease both; }

/* ── 3. BOOKING STEP TRANSITIONS ────────────────────────────── */

/* Container that clips the sliding steps */
.booking-steps-wrapper {
  overflow: hidden;
  position: relative;
}

/* Default state for a step */
.booking-step {
  width: 100%;
}

/* Entering from right (going forward) */
.step-enter-right {
  animation: slideInRight 0.35s ease both;
}

/* Entering from left (going back) */
.step-enter-left {
  animation: slideInLeft 0.35s ease both;
}

/* Exiting to left (going forward) */
.step-exit-left {
  animation: slideOutLeft 0.25s ease both;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

/* Exiting to right (going back) */
.step-exit-right {
  animation: slideOutRight 0.25s ease both;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

/* ── 4. SPARKLE ICONS ───────────────────────────────────────── */

.sparkle {
  display: inline-block;
  animation: sparkle 2.8s ease-in-out infinite;
}

.sparkle:nth-child(2) { animation-delay: 0.4s; }
.sparkle:nth-child(3) { animation-delay: 0.9s; }
.sparkle:nth-child(4) { animation-delay: 1.4s; }

/* ── 5. DASHED CARD HOVER PULSE ─────────────────────────────── */

.dashed-card:hover {
  animation: dashedPulse 1.2s ease infinite;
}

/* ── 6. PRICE BADGE UPDATE ──────────────────────────────────── */

.price-badge.updating {
  animation: priceUpdate 0.4s ease both;
}

/* ── 7. LOADING SPINNER ─────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-navy {
  border-color: rgba(26, 39, 68, 0.2);
  border-top-color: var(--color-navy);
}

/* ── 8. SUCCESS ANIMATION ───────────────────────────────────── */

.success-icon {
  animation: bounceIn 0.5s ease both;
}

/* ── 9. LOYALTY CARD FLOAT ───────────────────────────────────── */

.loyalty-card {
  animation: float 4s ease-in-out infinite;
}

/* ── 10. SERVICE CARD HOVER (defined in components, enhanced here) */

.service-card,
.service-detail-card {
  will-change: transform;
}

/* ── 11. NAV SCROLL SHADOW ───────────────────────────────────── */

.site-nav {
  transition: box-shadow 0.3s ease;
}

/* ── 12. CTA BUTTON ARROW SHIFT ─────────────────────────────── */

/* Arrow shift already handled via .btn .arrow in components.css */

/* ── 13. SECTION FADE-UP (Intersection Observer targets) ──── */

/* Base state set in components.css (.reveal)
   JS adds .visible class — transition defined there too
   Additional stagger helpers: */

.reveal-grid > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-grid.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.0s; }
.reveal-grid.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.1s; }
.reveal-grid.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.2s; }
.reveal-grid.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.3s; }
.reveal-grid.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 0.4s; }
.reveal-grid.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 0.5s; }
.reveal-grid.visible > *:nth-child(7) { opacity: 1; transform: none; transition-delay: 0.6s; }

/* ── 14. OPTION SELECTION (booking step radio/checkbox) ──── */

.option-item {
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.option-item:hover   { transform: translateX(3px); }
.option-item.selected { transform: none; }

/* ── 15. SMOOTH SCROLL OFFSET (for sticky nav) ───────────────── */

:target::before {
  content: '';
  display: block;
  height: calc(var(--bar-height) + var(--nav-height) + 20px);
  margin-top: calc(-1 * (var(--bar-height) + var(--nav-height) + 20px));
  pointer-events: none;
}
