/* ══════════════════════════════════════════════════════════════
   Stitch V2 — Shared Component Library
   Reusable UI patterns derived from Stitch design screens
   ══════════════════════════════════════════════════════════════ */

/* ── CONTAINER ── */
.st-container {
  max-width: var(--st-container);
  margin: 0 auto;
  padding: 0 var(--st-sp-6);
}
.st-container--sm { max-width: var(--st-container-sm); }
.st-container--xs { max-width: var(--st-container-xs); }

/* ── CARDS ── */
.st-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-r-lg);
  padding: var(--st-sp-6);
  transition: border-color var(--st-duration) var(--st-ease),
              box-shadow var(--st-duration) var(--st-ease),
              transform var(--st-duration) var(--st-ease);
}
.st-card:hover {
  border-color: var(--st-border-2);
  box-shadow: var(--st-shadow-card);
}
.st-card--raised {
  box-shadow: var(--st-shadow-raised);
}
.st-card--glow {
  border-color: var(--st-border-glow);
  box-shadow: 0 0 30px rgba(var(--st-red-rgb), 0.08);
}
.st-card--interactive:hover {
  transform: translateY(-2px);
  border-color: var(--st-border-active);
  box-shadow: var(--st-shadow-float);
}

/* ── NEUMORPHIC WELLS ── */
.st-well {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-r-md);
  box-shadow: var(--st-shadow-inset);
  padding: var(--st-sp-4) var(--st-sp-5);
}
.st-well:focus-within {
  border-color: var(--st-red);
  box-shadow: var(--st-shadow-inset), 0 0 0 2px rgba(var(--st-red-rgb), 0.15);
}

/* ── BUTTONS ── */

/* Primary CTA */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--st-sp-2);
  font-family: var(--st-font);
  font-weight: 700;
  font-size: var(--st-fs-body);
  border: none;
  cursor: pointer;
  transition: all var(--st-duration) var(--st-ease);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.st-btn--primary {
  background: var(--st-red-gradient);
  color: #fff;
  padding: var(--st-sp-4) var(--st-sp-8);
  border-radius: var(--st-r-md);
  box-shadow: var(--st-shadow-glow-red);
  position: relative;
  overflow: hidden;
}
.st-btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--st-duration);
}
.st-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(var(--st-red-rgb), 0.45);
}
.st-btn--primary:hover::before { opacity: 1; }
.st-btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--st-shadow-glow-sm);
}

/* Large CTA */
.st-btn--lg {
  padding: var(--st-sp-5) var(--st-sp-10);
  font-size: 17px;
  border-radius: var(--st-r-lg);
}

/* Full Width */
.st-btn--block {
  width: 100%;
}

/* Ghost / Outline */
.st-btn--ghost {
  background: transparent;
  color: var(--st-text-2);
  border: 1px solid var(--st-border-2);
  padding: var(--st-sp-3) var(--st-sp-6);
  border-radius: var(--st-r-md);
}
.st-btn--ghost:hover {
  border-color: var(--st-text-muted);
  background: rgba(255,255,255,0.03);
  color: var(--st-text);
}

/* Icon Button */
.st-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--st-r-round);
  font-size: 20px;
}

/* Pill / Chip */
.st-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--st-r-pill);
  font-size: var(--st-fs-sm);
  font-weight: 600;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-text-2);
  cursor: pointer;
  transition: all var(--st-duration) var(--st-ease);
}
.st-chip:hover,
.st-chip.active {
  border-color: var(--st-red);
  background: var(--st-red-soft);
  color: var(--st-red-light);
}

/* ── BADGES ── */
.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--st-r-pill);
  font-size: var(--st-fs-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.st-badge--success {
  background: var(--st-green-soft);
  color: var(--st-green);
  border: 1px solid rgba(var(--st-green-rgb), 0.2);
}
.st-badge--warning {
  background: var(--st-amber-soft);
  color: var(--st-amber);
  border: 1px solid rgba(var(--st-amber-rgb), 0.2);
}
.st-badge--danger {
  background: var(--st-red-soft);
  color: var(--st-red-light);
  border: 1px solid rgba(var(--st-red-rgb), 0.2);
}
.st-badge--info {
  background: var(--st-blue-soft);
  color: var(--st-blue);
  border: 1px solid rgba(var(--st-blue-rgb), 0.2);
}
.st-badge--live {
  background: var(--st-red);
  color: #fff;
  padding: 3px 8px;
  font-size: var(--st-fs-micro);
  animation: st-pulse-live 2s ease-in-out infinite;
}

@keyframes st-pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── INPUTS ── */
.st-input {
  width: 100%;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-r-md);
  padding: var(--st-sp-4) var(--st-sp-5);
  color: var(--st-text);
  font-family: var(--st-font);
  font-size: var(--st-fs-body);
  box-shadow: var(--st-shadow-inset);
  transition: border-color var(--st-duration), box-shadow var(--st-duration);
  outline: none;
}
.st-input::placeholder {
  color: var(--st-text-muted);
}
.st-input:focus {
  border-color: var(--st-red);
  box-shadow: var(--st-shadow-inset), 0 0 0 3px rgba(var(--st-red-rgb), 0.1);
}

.st-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.st-label {
  display: block;
  font-size: var(--st-fs-xs);
  font-weight: 600;
  color: var(--st-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

/* ── TOGGLE SWITCH ── */
.st-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  appearance: none;
  background: var(--st-surface-2);
  border: 1px solid var(--st-border);
  border-radius: 13px;
  cursor: pointer;
  transition: all var(--st-duration);
  outline: none;
}
.st-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--st-text-muted);
  transition: all var(--st-duration) var(--st-ease-bounce);
}
.st-toggle:checked {
  background: var(--st-red);
  border-color: var(--st-red);
}
.st-toggle:checked::before {
  transform: translateX(22px);
  background: #fff;
}

/* ── SECTION HEADERS ── */
.st-section {
  padding: var(--st-sp-20) 0;
}
.st-section-header {
  margin-bottom: var(--st-sp-10);
}
.st-section-title {
  font-family: var(--st-font-display);
  font-size: var(--st-fs-h2);
  font-weight: 800;
  color: var(--st-text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.st-section-title span { color: var(--st-red); }
.st-section-sub {
  color: var(--st-text-3);
  font-size: var(--st-fs-body);
  margin-top: var(--st-sp-3);
}

/* ── TRUST PILLS ── */
.st-trust-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--st-sp-4);
  margin: var(--st-sp-10) 0;
}
.st-trust-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-r-pill);
  color: var(--st-text-2);
  font-size: var(--st-fs-sm);
  font-weight: 600;
  box-shadow: var(--st-shadow-raised);
  transition: all var(--st-duration);
}
.st-trust-pill i {
  font-size: 18px;
  color: var(--st-text-3);
}
.st-trust-pill:hover {
  border-color: var(--st-border-2);
  transform: translateY(-2px);
}

/* ── FEATURE CARDS (Smarter Way) ── */
.st-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--st-sp-6);
}
.st-feature-card {
  padding: var(--st-sp-8);
}
.st-feature-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--st-r-md);
  background: var(--st-red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--st-red);
  margin-bottom: var(--st-sp-5);
  box-shadow: var(--st-shadow-raised);
}
.st-feature-card__title {
  font-family: var(--st-font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--st-sp-3);
}
.st-feature-card__desc {
  color: var(--st-text-3);
  font-size: var(--st-fs-sm);
  line-height: 1.6;
}

/* ── DESTINATION CARDS ── */
.st-dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--st-sp-6);
}
.st-dest-card {
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.st-dest-card__img {
  aspect-ratio: 4 / 3;
  border-radius: var(--st-r-md);
  overflow: hidden;
  margin-bottom: var(--st-sp-3);
}
.st-dest-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--st-ease);
}
.st-dest-card:hover .st-dest-card__img img {
  transform: scale(1.08);
}
.st-dest-card__name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
}
.st-dest-card__meta {
  font-size: var(--st-fs-xs);
  color: var(--st-text-muted);
}
.st-dest-card__price {
  color: var(--st-red);
  font-weight: 700;
}

/* ── HORIZONTAL SCROLL SECTION (Mobile Carousels) ── */
.st-hscroll {
  display: flex;
  gap: var(--st-sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--st-sp-2);
}
.st-hscroll::-webkit-scrollbar { display: none; }
.st-hscroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ── MOBILE BOTTOM NAVIGATION ── */
.st-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--st-bottom-nav-h);
  background: var(--st-surface);
  border-top: 1px solid var(--st-border);
  display: none; /* Shown via media query */
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--st-sp-4);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: var(--st-z-fixed);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.st-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--st-text-muted);
  font-size: var(--st-fs-micro);
  font-weight: 600;
  transition: color var(--st-duration);
  padding: 8px 12px;
}
.st-bottom-nav__item i {
  font-size: 22px;
  transition: color var(--st-duration);
}
.st-bottom-nav__item.active,
.st-bottom-nav__item:hover {
  color: var(--st-red);
}
.st-bottom-nav__item.active i { color: var(--st-red); }

@media (max-width: 768px) {
  .st-bottom-nav { display: flex; }
}

/* ── ACCORDION / FAQ ── */
.st-accordion {
  border: 1px solid var(--st-border);
  border-radius: var(--st-r-md);
  overflow: hidden;
  margin-bottom: var(--st-sp-3);
}
.st-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--st-sp-5) var(--st-sp-6);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--st-fs-body);
  color: var(--st-text);
  background: var(--st-surface);
  transition: background var(--st-duration);
  list-style: none;
}
.st-accordion summary::-webkit-details-marker { display: none; }
.st-accordion summary::after {
  content: '⌄';
  font-size: 18px;
  color: var(--st-text-muted);
  transition: transform var(--st-duration);
}
.st-accordion[open] summary::after {
  transform: rotate(180deg);
}
.st-accordion summary:hover {
  background: var(--st-surface-2);
}
.st-accordion__body {
  padding: 0 var(--st-sp-6) var(--st-sp-5);
  color: var(--st-text-3);
  font-size: var(--st-fs-sm);
  line-height: 1.7;
}

/* ── FLIGHT CARD (Search Results) ── */
.st-flight-card {
  display: flex;
  align-items: center;
  gap: var(--st-sp-6);
  padding: var(--st-sp-6);
  position: relative;
}
.st-flight-card__airline-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--st-r-round);
  background: var(--st-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.st-flight-card__airline-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.st-flight-card__time {
  font-family: var(--st-font-display);
  font-size: 18px;
  font-weight: 700;
}
.st-flight-card__route {
  color: var(--st-text-3);
  font-size: var(--st-fs-sm);
}
.st-flight-card__price {
  font-family: var(--st-font-display);
  font-size: 22px;
  font-weight: 800;
  margin-left: auto;
}
.st-flight-card__actions {
  display: flex;
  gap: var(--st-sp-3);
  margin-top: var(--st-sp-4);
}

/* ── AI INSIGHT STRIP ── */
.st-ai-insight {
  display: flex;
  align-items: flex-start;
  gap: var(--st-sp-4);
  padding: var(--st-sp-5) var(--st-sp-6);
  background: linear-gradient(135deg, var(--st-surface), var(--st-surface-2));
  border: 1px solid var(--st-border);
  border-left: 3px solid var(--st-purple);
  border-radius: var(--st-r-md);
  margin: var(--st-sp-4) 0;
}
.st-ai-insight__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--st-r-sm);
  background: var(--st-purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.st-ai-insight__title {
  font-weight: 700;
  font-size: var(--st-fs-body);
  margin-bottom: 4px;
}
.st-ai-insight__text {
  color: var(--st-text-3);
  font-size: var(--st-fs-sm);
  line-height: 1.6;
}

/* ── BOOKING STATUS CARD ── */
.st-booking-card {
  padding: var(--st-sp-6);
}
.st-booking-card__row {
  display: flex;
  gap: var(--st-sp-6);
  margin-bottom: var(--st-sp-4);
}
.st-booking-card__label {
  font-size: var(--st-fs-xs);
  color: var(--st-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.st-booking-card__value {
  font-family: var(--st-font-display);
  font-size: 20px;
  font-weight: 800;
}

/* ── LOADING SKELETON ── */
.st-skeleton {
  background: linear-gradient(90deg,
    var(--st-surface) 25%,
    var(--st-surface-2) 50%,
    var(--st-surface) 75%
  );
  background-size: 200% 100%;
  animation: st-shimmer 1.5s infinite;
  border-radius: var(--st-r-sm);
}

@keyframes st-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── UTILITY CLASSES ── */
.st-text-red { color: var(--st-red) !important; }
.st-text-green { color: var(--st-green) !important; }
.st-text-amber { color: var(--st-amber) !important; }
.st-text-muted { color: var(--st-text-muted) !important; }
.st-bg-surface { background: var(--st-surface) !important; }
.st-gap-4 { gap: var(--st-sp-4) !important; }
.st-gap-6 { gap: var(--st-sp-6) !important; }
.st-mt-4 { margin-top: var(--st-sp-4) !important; }
.st-mt-8 { margin-top: var(--st-sp-8) !important; }
.st-mb-6 { margin-bottom: var(--st-sp-6) !important; }
.st-p-6 { padding: var(--st-sp-6) !important; }

/* ── Reveal Animations (fallback for Motion.dev) ── */
[data-st-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--st-ease), transform 0.7s var(--st-ease);
}
[data-st-reveal].st-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Generic IntersectionObserver init ── */
