/* Order summary — shared checkout, payment, and change-booking UI */

.hf-order-summary {
  --hf-os-bg: var(--hf-surface-dim, #f8f9fc);
  --hf-os-surface: var(--hf-surface, #ffffff);
  --hf-os-ink: var(--hf-ink, #0f172a);
  --hf-os-ink-2: var(--hf-ink-secondary, #475569);
  --hf-os-ink-3: var(--muted, #94a3b8);
  --hf-os-border: var(--hf-border, #e2e8f0);
  --hf-os-border-light: #f1f5f9;
  --hf-os-accent: var(--hf-primary, #2563eb);
  --hf-os-accent-glow: rgba(37, 99, 235, 0.1);
  --hf-os-green: #059669;
  --hf-os-green-bg: #ecfdf5;
  --hf-os-green-border: #a7f3d0;
  --hf-os-red: #dc2626;
  --hf-os-red-bg: #fef2f2;
  --hf-os-red-border: #fecaca;
  --hf-os-r-sm: 10px;
  --hf-os-r-lg: 18px;
  --hf-os-r-xl: 22px;
  display: grid;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.hf-order-summary.duffel-receipt {
  padding-left: 0;
}

.hf-order-summary.duffel-receipt::before {
  display: none;
}

.hf-os-price-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 50%, #1a1a2e 100%);
  border-radius: var(--hf-os-r-xl);
  padding: 24px 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hf-os-price-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(
    circle,
    rgba(37, 99, 235, 0.25) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hf-os-price-hero::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hf-os-price-hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
  position: relative;
}

.hf-os-price-hero-amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  position: relative;
}

.hf-os-price-hero-amount .currency {
  font-size: 22px;
  font-weight: 600;
  vertical-align: top;
  margin-right: 2px;
  opacity: 0.7;
}

.hf-os-price-hero-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  position: relative;
}

.hf-os-price-hero-sub .divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.hf-os-price-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(5, 150, 105, 0.2);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 12px;
  position: relative;
}

.hf-os-price-hero-badge svg {
  width: 12px;
  height: 12px;
}

.hf-os-route-card {
  background: var(--hf-os-surface);
  border-radius: var(--hf-os-r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
  border: 1px solid var(--hf-os-border-light);
}

.hf-os-route-card + .hf-os-route-card {
  margin-top: 0;
}

.hf-os-route-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.hf-os-route-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hf-os-route-card-header-left .hf-carrier-logo-slot.hf-os-airline-logo-sm {
  --hf-carrier-logo-size: 36px;
  --hf-carrier-logo-radius: 10px;
  --hf-carrier-logo-shadow: none;
  background: linear-gradient(135deg, #e8ecf4 0%, #d5dbe8 100%);
}

.hf-os-airline-logo-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e8ecf4 0%, #d5dbe8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: #4a5568;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  overflow: hidden;
}

.hf-os-airline-logo-sm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.hf-os-route-card-airline {
  font-size: 14px;
  font-weight: 600;
  color: var(--hf-os-ink);
}

.hf-os-route-card-class {
  font-size: 12px;
  color: var(--hf-os-ink-3);
  margin-top: 1px;
}

.hf-os-route-card-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--hf-os-green);
  background: var(--hf-os-green-bg);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hf-os-route-card-badge.is-stops {
  color: var(--hf-os-ink-2);
  background: var(--hf-os-bg);
}

.hf-os-route-mini {
  display: flex;
  align-items: center;
  gap: 0;
}

.hf-os-route-mini-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hf-os-route-mini-col.right {
  align-items: flex-end;
}

.hf-os-route-mini-code {
  font-size: 22px;
  font-weight: 800;
  color: var(--hf-os-ink);
  letter-spacing: -0.5px;
  line-height: 1;
}

.hf-os-route-mini-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--hf-os-ink-2);
  margin-top: 4px;
}

.hf-os-route-mini-date {
  font-size: 11px;
  color: var(--hf-os-ink-3);
  margin-top: 1px;
}

.hf-os-route-mini-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px;
  min-width: 64px;
}

.hf-os-route-mini-line {
  display: flex;
  align-items: center;
  width: 100%;
}

.hf-os-route-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hf-os-accent);
  box-shadow: 0 0 0 3px var(--hf-os-accent-glow);
  flex-shrink: 0;
}

.hf-os-route-mini-dot.arrival {
  background: var(--hf-os-ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.hf-os-route-mini-track {
  flex: 1;
  height: 2px;
  background: var(--hf-os-border);
  border-radius: 1px;
  margin: 0 4px;
  position: relative;
}

.hf-os-route-mini-track::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--hf-os-accent);
  border-radius: 1px;
}

.hf-os-route-mini-duration {
  font-size: 11px;
  font-weight: 600;
  color: var(--hf-os-ink-3);
  margin-top: 4px;
}

.hf-os-rules-card,
.hf-os-baggage-card,
.hf-os-breakdown-card {
  background: var(--hf-os-surface);
  border-radius: var(--hf-os-r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
  border: 1px solid var(--hf-os-border-light);
}

.hf-os-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-os-ink-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.hf-os-rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hf-os-rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--hf-os-r-sm);
  border: 1px solid;
}

.hf-os-rule-item.positive {
  background: var(--hf-os-green-bg);
  border-color: var(--hf-os-green-border);
}

.hf-os-rule-item.negative {
  background: var(--hf-os-red-bg);
  border-color: var(--hf-os-red-border);
}

.hf-os-rule-item.neutral {
  background: var(--hf-os-bg);
  border-color: var(--hf-os-border);
}

.hf-os-rule-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hf-os-rule-item.positive .hf-os-rule-icon {
  background: rgba(5, 150, 105, 0.15);
  color: var(--hf-os-green);
}

.hf-os-rule-item.negative .hf-os-rule-icon {
  background: rgba(220, 38, 38, 0.1);
  color: var(--hf-os-red);
}

.hf-os-rule-item.neutral .hf-os-rule-icon {
  background: rgba(148, 163, 184, 0.15);
  color: var(--hf-os-ink-3);
}

.hf-os-rule-icon svg {
  width: 14px;
  height: 14px;
}

.hf-os-rule-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-os-ink);
  line-height: 1.2;
}

.hf-os-rule-sub {
  font-size: 11px;
  color: var(--hf-os-ink-3);
  line-height: 1.2;
}

.hf-os-baggage-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hf-os-baggage-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--hf-os-bg);
  border-radius: var(--hf-os-r-sm);
  border: 1px solid var(--hf-os-border-light);
}

.hf-os-baggage-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.hf-os-baggage-icon.carry {
  background: #eff6ff;
}

.hf-os-baggage-icon.checked {
  background: #fef3c7;
}

.hf-os-baggage-icon.personal {
  background: #f5f3ff;
}

.hf-os-baggage-info {
  flex: 1;
  min-width: 0;
}

.hf-os-baggage-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-os-ink);
}

.hf-os-baggage-detail {
  font-size: 12px;
  color: var(--hf-os-ink-3);
  margin-top: 1px;
}

.hf-os-baggage-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.hf-os-baggage-status.included {
  color: var(--hf-os-green);
  background: var(--hf-os-green-bg);
}

.hf-os-baggage-status.not-included {
  color: var(--hf-os-red);
  background: var(--hf-os-red-bg);
}

.hf-os-breakdown-inner {
  display: flex;
  flex-direction: column;
}

.hf-os-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--hf-os-ink-2);
}

.hf-os-breakdown-row.free {
  color: var(--hf-os-green);
}

.hf-os-breakdown-row.total {
  border-top: 1.5px solid var(--hf-os-border);
  margin-top: 4px;
  padding-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--hf-os-ink);
}

.hf-os-empty {
  display: grid;
  gap: 8px;
  padding: 4px 0;
}

.hf-os-empty strong {
  font-size: 0.95rem;
  color: var(--hf-os-ink);
}

.hf-os-empty span {
  color: var(--hf-os-ink-3);
  font-size: 0.84rem;
  line-height: 1.45;
}

.duffel-summary-text .hf-order-summary {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.duffel-summary-card .hf-order-summary {
  margin-top: 2px;
}

@media (max-width: 480px) {
  .hf-os-price-hero {
    padding: 20px 18px 18px;
  }

  .hf-os-price-hero-amount {
    font-size: 32px;
  }

  .hf-os-rules-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hf-os-price-hero,
  .hf-os-route-card,
  .hf-os-rules-card,
  .hf-os-baggage-card,
  .hf-os-breakdown-card {
    animation: hf-os-slide-up 0.4s ease backwards;
  }

  .hf-os-route-card {
    animation-delay: 0.05s;
  }

  .hf-os-rules-card {
    animation-delay: 0.1s;
  }

  .hf-os-baggage-card {
    animation-delay: 0.15s;
  }

  .hf-os-breakdown-card {
    animation-delay: 0.2s;
  }
}

@keyframes hf-os-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme='dark'] .hf-os-route-card,
[data-theme='dark'] .hf-os-rules-card,
[data-theme='dark'] .hf-os-baggage-card,
[data-theme='dark'] .hf-os-breakdown-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
}

[data-theme='dark'] .hf-os-route-card-airline,
[data-theme='dark'] .hf-os-route-mini-code,
[data-theme='dark'] .hf-os-rule-label,
[data-theme='dark'] .hf-os-baggage-type,
[data-theme='dark'] .hf-os-breakdown-row.total {
  color: var(--ink, #f1f5f9);
}

[data-theme='dark'] .hf-os-baggage-item,
[data-theme='dark'] .hf-os-rule-item.neutral {
  background: rgba(15, 23, 42, 0.5);
}

.post-booking-extras-checkout .hf-order-summary {
  margin-bottom: 8px;
}

.post-booking-extras-checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
