/**
 * XR Rate Cards — shared price-card system for all tour pricing structures
 * Subject: East African safari packages · Brand: canopy green trail
 * UI stack: 8px grid · 60/30/10 · Manrope + Cormorant · 5-state interactions
 *
 * Signature: a left “trail” edge + large display numerals for the rate.
 * Presentation only — booking JS untouched.
 */

.enhanced-pricing-section,
.tbf {
  --xr-ink: #07140e;
  --xr-canopy: #31964a;
  --xr-canopy-deep: #1f6f35;
  --xr-mist: #f3f7f4;
  --xr-paper: #ffffff;
  --xr-line: rgba(7, 20, 14, 0.1);
  --xr-muted: #5a6f64;
  --xr-radius: 16px;
  --xr-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Card shell ──────────────────────────────────────────────────────── */
.xr-rate-card:not(tr) {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 16px;
  padding: 0;
  background:
    linear-gradient(165deg, #ffffff 0%, #f7faf8 100%);
  border: 1px solid var(--xr-line);
  border-radius: var(--xr-radius);
  box-shadow: 0 1px 2px rgba(7, 20, 14, 0.04);
  overflow: hidden;
  transition:
    border-color 0.2s var(--xr-ease),
    box-shadow 0.2s var(--xr-ease),
    transform 0.2s var(--xr-ease);
}

.xr-rate-card:not(tr)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--xr-canopy), var(--xr-canopy-deep));
  pointer-events: none;
}

.xr-rate-card:not(tr):hover {
  border-color: rgba(49, 150, 74, 0.35);
  box-shadow: 0 8px 24px rgba(7, 20, 14, 0.08);
  transform: translateY(-1px);
}

.xr-rate-card:not(tr):active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(7, 20, 14, 0.06);
}

.xr-rate-card:not(tr):focus-within {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(49, 150, 74, 0.28),
    0 8px 24px rgba(7, 20, 14, 0.08);
}

.xr-rate-card__head {
  padding: 16px 16px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xr-rate-card__title {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--xr-ink);
  letter-spacing: -0.01em;
}

.xr-rate-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--xr-muted);
}

.xr-rate-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xr-rate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--xr-mist);
  border: 1px solid var(--xr-line);
  color: var(--xr-canopy-deep);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}

.xr-rate-card__body {
  padding: 0 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.xr-rate-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid rgba(7, 20, 14, 0.06);
}

.xr-rate-row:first-child {
  border-top: 1px dashed rgba(7, 20, 14, 0.1);
}

.xr-rate-row__label {
  flex: 0 1 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--xr-muted);
}

.xr-rate-row__value {
  flex: 1 1 auto;
  text-align: right;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--xr-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.xr-rate-row__value--accent {
  color: var(--xr-canopy-deep);
}

.xr-rate-row__ccy {
  display: block;
  margin-top: 2px;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--xr-muted);
}

/* ── Desktop table chrome (same tokens) ──────────────────────────────── */
.xr-rate-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--xr-line);
  border-radius: var(--xr-radius);
  overflow: hidden;
  background: var(--xr-paper);
  margin: 0;
}

.xr-rate-table thead th {
  background: var(--xr-mist);
  color: var(--xr-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--xr-line);
}

.xr-rate-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(7, 20, 14, 0.06);
  vertical-align: top;
  color: var(--xr-ink);
}

.xr-rate-table tbody tr:last-child td {
  border-bottom: none;
}

.xr-rate-table tbody tr:hover td {
  background: rgba(49, 150, 74, 0.04);
}

.xr-rate-table .xr-rate-num {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ── Occupancy tiers as rate strips ──────────────────────────────────── */
@media (max-width: 700px) {
  .enhanced-pricing-section .otp-tier-card,
  .tbf .otp-tier-card {
    position: relative;
    border: 1px solid var(--xr-line) !important;
    border-radius: var(--xr-radius) !important;
    border-right: 1px solid var(--xr-line) !important;
    border-bottom: 1px solid var(--xr-line) !important;
    margin-bottom: 12px;
    background: linear-gradient(165deg, #ffffff 0%, #f7faf8 100%) !important;
    box-shadow: 0 1px 2px rgba(7, 20, 14, 0.04);
    padding: 16px 16px 16px 20px !important;
    transition: border-color 0.2s var(--xr-ease), box-shadow 0.2s var(--xr-ease);
  }

  .enhanced-pricing-section .otp-tier-card::before,
  .tbf .otp-tier-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, var(--xr-canopy), var(--xr-canopy-deep));
  }

  .enhanced-pricing-section .otp-tier-pax-num,
  .tbf .otp-tier-pax-num {
    font-family: "Manrope", system-ui, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--xr-ink) !important;
  }

  .enhanced-pricing-section .otp-tier-pax-label,
  .tbf .otp-tier-pax-label {
    font-size: 11px !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--xr-muted) !important;
  }

  .enhanced-pricing-section .otp-tier-price,
  .tbf .otp-tier-price {
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--xr-ink) !important;
  }

  .enhanced-pricing-section .otp-tier-ccy,
  .tbf .otp-tier-ccy {
    font-size: 11px !important;
    color: var(--xr-muted) !important;
  }
}

/* ── Accommodation stacked rows → rate cards ────────────────────────── */
@media (max-width: 700px) {
  .enhanced-pricing-section .acc-price-table tr.room-pricing-row,
  .tbf .acc-price-table tr.room-pricing-row {
    position: relative;
    margin-bottom: 16px;
    padding: 16px 16px 8px 20px !important;
    border: 1px solid var(--xr-line) !important;
    border-radius: var(--xr-radius) !important;
    background: linear-gradient(165deg, #ffffff 0%, #f7faf8 100%) !important;
    box-shadow: 0 1px 2px rgba(7, 20, 14, 0.04);
  }

  .enhanced-pricing-section .acc-price-table tr.room-pricing-row::before,
  .tbf .acc-price-table tr.room-pricing-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, var(--xr-canopy), var(--xr-canopy-deep));
  }

  .enhanced-pricing-section .acc-price-table td.acc-room-label strong,
  .tbf .acc-price-table td.acc-room-label strong {
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--xr-ink);
  }

  .enhanced-pricing-section .acc-price-table td.acc-col-price::before,
  .tbf .acc-price-table td.acc-col-price::before {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--xr-muted) !important;
  }

  .enhanced-pricing-section .acc-price-table .price-single,
  .enhanced-pricing-section .acc-price-table .price-sharing,
  .enhanced-pricing-section .acc-price-table .price-triple,
  .tbf .acc-price-table .price-single,
  .tbf .acc-price-table .price-sharing,
  .tbf .acc-price-table .price-triple {
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--xr-ink) !important;
  }

  .enhanced-pricing-section .acc-price-table .price-sharing,
  .tbf .acc-price-table .price-sharing {
    color: var(--xr-canopy-deep) !important;
  }
}

/* ── Vehicle stacked fallback ────────────────────────────────────────── */
@media (max-width: 700px) {
  .enhanced-pricing-section .vehicle-price-table tr.vehicle-pricing-row,
  .tbf .vehicle-price-table tr.vehicle-pricing-row {
    position: relative;
    padding: 16px 16px 8px 20px !important;
    border-radius: var(--xr-radius) !important;
    border: 1px solid var(--xr-line) !important;
    background: linear-gradient(165deg, #ffffff 0%, #f7faf8 100%) !important;
    margin-bottom: 16px;
  }

  .enhanced-pricing-section .vehicle-price-table tr.vehicle-pricing-row::before,
  .tbf .vehicle-price-table tr.vehicle-pricing-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, var(--xr-canopy), var(--xr-canopy-deep));
  }
}

/* ── Seasonal cards ──────────────────────────────────────────────────── */
.enhanced-pricing-section .sp-card,
.tbf .sp-card {
  border-radius: var(--xr-radius) !important;
  border: 1px solid var(--xr-line) !important;
  background: linear-gradient(165deg, #ffffff 0%, #f7faf8 100%) !important;
  box-shadow: 0 1px 2px rgba(7, 20, 14, 0.04) !important;
  position: relative;
  overflow: hidden;
}

.enhanced-pricing-section .sp-card::before,
.tbf .sp-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--xr-canopy), var(--xr-canopy-deep));
}

.enhanced-pricing-section .sp-price-value,
.tbf .sp-price-value {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
}

/* ── Group joining rows ──────────────────────────────────────────────── */
.enhanced-pricing-section .gj-table-row,
.tbf .gj-table-row {
  position: relative;
  padding-left: 20px !important;
  transition: background 0.2s var(--xr-ease);
}

.enhanced-pricing-section .gj-table-row:hover,
.tbf .gj-table-row:hover {
  background: rgba(49, 150, 74, 0.04) !important;
}

.enhanced-pricing-section .gj-price,
.tbf .gj-price {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--xr-ink) !important;
}

/* ── Fixed price rows ────────────────────────────────────────────────── */
.fp-price-display {
  border: 1px solid var(--xr-line);
  border-radius: var(--xr-radius);
  background: linear-gradient(165deg, #ffffff 0%, #f7faf8 100%);
  padding: 16px 16px 16px 20px;
  position: relative;
  overflow: hidden;
}

.fp-price-display::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--xr-canopy), var(--xr-canopy-deep));
}

.fp-price-row {
  min-height: 40px;
  align-items: center;
}

.fp-price-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--xr-muted);
}

.fp-price-value {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--xr-ink) !important;
}

/* ── Residency toggle (touch-friendly) ───────────────────────────────── */
.enhanced-pricing-section .residency-selector .btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.enhanced-pricing-section .residency-selector .btn {
  flex: 1;
  min-height: 44px;
  border-radius: 999px !important;
  border: 1px solid var(--xr-line) !important;
  background: var(--xr-paper) !important;
  color: var(--xr-muted) !important;
  font-weight: 650;
  transition: background 0.2s var(--xr-ease), color 0.2s var(--xr-ease), border-color 0.2s var(--xr-ease);
}

.enhanced-pricing-section .residency-selector .btn:hover {
  border-color: rgba(49, 150, 74, 0.4) !important;
  color: var(--xr-canopy-deep) !important;
}

.enhanced-pricing-section .residency-selector .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 150, 74, 0.28);
}

.enhanced-pricing-section .residency-selector .btn.active {
  background: var(--xr-canopy) !important;
  border-color: var(--xr-canopy) !important;
  color: #fff !important;
}

.enhanced-pricing-section .residency-selector .btn:disabled,
.enhanced-pricing-section .residency-selector .btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .xr-rate-card,
  .xr-rate-card:hover,
  .enhanced-pricing-section .otp-tier-card,
  .enhanced-pricing-section .residency-selector .btn {
    transition: none !important;
    transform: none !important;
  }
}
