/* ═══════════════════════════════════════════════════════════════════════════
   Coach Hire Platform — Comparison Page CSS
   Modern premium design: dark cards, glassmorphism accents, crisp images
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --chp-gold:         #F59F00;
  --chp-gold-dark:    #d48a00;
  --chp-gold-light:   #ffc840;
  --chp-dark:         #0d0f14;
  --chp-dark-2:       #141720;
  --chp-dark-3:       #1c202c;
  --chp-dark-4:       #242838;
  --chp-border:       rgba(255,255,255,0.08);
  --chp-border-gold:  rgba(245,159,0,0.3);
  --chp-text:         #e8eaed;
  --chp-text-muted:   #8b929e;
  --chp-radius:       16px;
  --chp-radius-sm:    8px;
  --chp-shadow:       0 8px 32px rgba(0,0,0,0.4);
  --chp-shadow-gold:  0 0 24px rgba(245,159,0,0.15);
  --chp-font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --chp-transition:   all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
#chp-comparison-wrap * {
  box-sizing: border-box;
  font-family: var(--chp-font);
}

#chp-comparison-wrap {
  background: var(--chp-dark);
  min-height: 60vh;
  color: var(--chp-text);
  border-radius: var(--chp-radius);
  overflow: hidden;
}

/* ─── Trip Bar ──────────────────────────────────────────────────────────── */
.chp-trip-bar {
  background: linear-gradient(135deg, var(--chp-dark-3), var(--chp-dark-4));
  border-bottom: 1px solid var(--chp-border);
  padding: 14px 20px;
}

.chp-trip-bar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}

.chp-trip-bar__route {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.chp-trip-bar__from,
.chp-trip-bar__to {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,159,0,0.1);
  border: 1px solid var(--chp-border-gold);
  border-radius: 20px;
  padding: 6px 12px;
  color: var(--chp-gold);
}

.chp-trip-bar__arrow {
  font-size: 20px;
  color: var(--chp-text-muted);
}

.chp-trip-bar__meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--chp-text-muted);
}

.chp-trip-bar__meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chp-trip-bar__edit {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--chp-gold);
  color: #000;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: var(--chp-transition);
  white-space: nowrap;
  margin-left: auto;
}

.chp-trip-bar__edit:hover {
  background: var(--chp-gold-light);
  transform: translateY(-1px);
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
.chp-comparison-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  min-height: 70vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
  gap: 24px;
}

@media (max-width: 900px) {
  .chp-comparison-layout {
    grid-template-columns: 1fr;
  }
  .chp-sidebar {
    order: -1;
  }
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.chp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
  align-self: start;
}

.chp-sidebar__card {
  background: var(--chp-dark-3);
  border: 1px solid var(--chp-border);
  border-radius: var(--chp-radius);
  padding: 20px;
  overflow: hidden;
}

.chp-sidebar__card#chp-route-map {
  padding: 0;
  min-height: 250px;
  border-radius: var(--chp-radius);
}

/* Trip summary inside sidebar */
#chp-trip-summary .chp-summary-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--chp-gold);
  font-weight: 700;
  margin-bottom: 14px;
}

#chp-trip-summary .chp-summary-distance {
  font-size: 28px;
  font-weight: 800;
  color: var(--chp-text);
  line-height: 1;
  margin-bottom: 4px;
}

#chp-trip-summary .chp-summary-distance span {
  font-size: 14px;
  font-weight: 400;
  color: var(--chp-text-muted);
}

#chp-trip-summary .chp-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--chp-border);
  color: var(--chp-text-muted);
}

#chp-trip-summary .chp-summary-row:last-child { border-bottom: none; }
#chp-trip-summary .chp-summary-row strong { color: var(--chp-text); }

/* ─── Controls / Sort Bar ───────────────────────────────────────────────── */
.chp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.chp-results-count {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--chp-text-muted);
}

.chp-badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chp-gold);
  display: inline-block;
  animation: chp-pulse 1.5s ease infinite;
}

@keyframes chp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.chp-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chp-sort-wrap label { color: var(--chp-gold); }

#chp-sort {
  background: var(--chp-dark-3);
  border: 1px solid var(--chp-border);
  color: var(--chp-text);
  padding: 8px 12px;
  border-radius: var(--chp-radius-sm);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

#chp-sort:focus { border-color: var(--chp-gold); }

/* ─── Coach Card ────────────────────────────────────────────────────────── */
#chp-cards-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chp-card {
  background: var(--chp-dark-3);
  border: 1px solid var(--chp-border);
  border-radius: var(--chp-radius);
  display: grid;
  grid-template-columns: 280px 1fr auto;
  overflow: hidden;
  transition: var(--chp-transition);
  position: relative;
}

.chp-card:hover {
  border-color: var(--chp-border-gold);
  box-shadow: var(--chp-shadow-gold);
  transform: translateY(-2px);
}

.chp-card--featured::before {
  content: 'BEST VALUE';
  position: absolute;
  top: 12px;
  left: 0;
  background: var(--chp-gold);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 12px 4px 12px;
  border-radius: 0 4px 4px 0;
  z-index: 2;
}

@media (max-width: 768px) {
  .chp-card {
    grid-template-columns: 1fr;
  }
  .chp-card__gallery-wrap {
    height: 200px;
  }
  .chp-card__pricing {
    border-left: none;
    border-top: 1px solid var(--chp-border);
  }
}

/* Card Gallery */
.chp-card__gallery-wrap {
  position: relative;
  overflow: hidden;
  /* KEY FIX: exact pixel container, no resampling */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.chp-gallery {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
  cursor: grab;
}

.chp-gallery:active { cursor: grabbing; }

.chp-gallery__slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.chp-gallery__slide img {
  width: 100%;
  height: 100%;
  /* CRISP IMAGE FIX: no blur, full resolution */
  object-fit: cover;
  object-position: center;
  display: block;
  /* Force high-quality rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-quality;
  -ms-interpolation-mode: bicubic;
}

/* No image placeholder */
.chp-gallery__no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--chp-dark-4), var(--chp-dark-2));
  color: var(--chp-text-muted);
  font-size: 48px;
}

/* Gallery navigation dots */
.chp-gallery__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.chp-gallery__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--chp-transition);
  border: none;
  padding: 0;
}

.chp-gallery__dot.active,
.chp-gallery__dot:hover {
  background: var(--chp-gold);
  width: 18px;
  border-radius: 3px;
}

/* Gallery arrow controls */
.chp-gallery__prev,
.chp-gallery__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: var(--chp-transition);
  z-index: 2;
}

.chp-gallery__prev { left: 8px; }
.chp-gallery__next { right: 8px; }

.chp-card__gallery-wrap:hover .chp-gallery__prev,
.chp-card__gallery-wrap:hover .chp-gallery__next {
  opacity: 1;
}

/* Card Body */
.chp-card__body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.chp-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chp-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--chp-text);
  margin: 0;
  line-height: 1.3;
}

.chp-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245,159,0,0.12);
  border: 1px solid var(--chp-border-gold);
  color: var(--chp-gold);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.chp-card__meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--chp-text-muted);
  flex-wrap: wrap;
}

.chp-card__meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chp-card__meta-item i { color: var(--chp-gold); width: 14px; }

/* Facilities row */
.chp-card__facilities {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chp-facility-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--chp-dark-4);
  border: 1px solid var(--chp-border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--chp-text-muted);
  white-space: nowrap;
}

.chp-facility-pill i { font-size: 10px; color: var(--chp-gold); }

/* Description expand */
.chp-card__desc {
  font-size: 13px;
  color: var(--chp-text-muted);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.chp-card__desc.open {
  max-height: 300px;
}

.chp-card__more-btn {
  background: none;
  border: none;
  color: var(--chp-gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--chp-transition);
  width: fit-content;
}

.chp-card__more-btn:hover { color: var(--chp-gold-light); }

/* Card Pricing Panel */
.chp-card__pricing {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--chp-border);
  min-width: 220px;
  background: var(--chp-dark-4);
}

/* Standard/Executive tabs */
.chp-price-tabs {
  display: flex;
  border-bottom: 1px solid var(--chp-border);
}

.chp-price-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--chp-text-muted);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--chp-transition);
}

.chp-price-tab.active {
  color: var(--chp-gold);
  border-bottom-color: var(--chp-gold);
  background: rgba(245,159,0,0.05);
}

.chp-price-panel {
  display: none;
  flex-direction: column;
  padding: 20px;
  gap: 14px;
  flex: 1;
}

.chp-price-panel.active { display: flex; }

.chp-price__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--chp-text-muted);
  font-weight: 600;
}

.chp-price__amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--chp-gold);
  line-height: 1;
}

.chp-price__amount.has-discount {
  display: flex;
  flex-direction: column;
}

.chp-price__original {
  font-size: 16px;
  font-weight: 500;
  color: var(--chp-text-muted);
  text-decoration: line-through;
  line-height: 1;
  margin-bottom: 2px;
}

.chp-price__savings {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.2);
  color: #4ade80;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  width: fit-content;
}

.chp-price__breakdown-toggle {
  font-size: 11px;
  color: var(--chp-text-muted);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  transition: var(--chp-transition);
}

.chp-price__breakdown-toggle:hover { color: var(--chp-text); }

.chp-price__breakdown {
  display: none;
  background: var(--chp-dark-3);
  border-radius: var(--chp-radius-sm);
  padding: 12px;
  font-size: 11px;
  color: var(--chp-text-muted);
}

.chp-price__breakdown.open { display: block; }

.chp-price__breakdown table {
  width: 100%;
  border-collapse: collapse;
}

.chp-price__breakdown td {
  padding: 3px 0;
}

.chp-price__breakdown td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--chp-text);
}

/* CTA Buttons */
.chp-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.chp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--chp-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--chp-transition);
  text-decoration: none;
  border: none;
  white-space: nowrap;
  font-family: var(--chp-font);
}

.chp-btn--primary {
  background: var(--chp-gold);
  color: #000;
}

.chp-btn--primary:hover {
  background: var(--chp-gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,159,0,0.4);
}

.chp-btn--outline {
  background: transparent;
  border: 1px solid var(--chp-border);
  color: var(--chp-text-muted);
}

.chp-btn--outline:hover {
  border-color: var(--chp-gold);
  color: var(--chp-gold);
}

.chp-btn--ghost {
  background: rgba(255,255,255,0.05);
  color: var(--chp-text-muted);
  font-size: 12px;
  padding: 8px 12px;
}

.chp-btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--chp-text);
}

.chp-btn--sm {
  padding: 8px 14px;
  font-size: 12px;
}

.chp-btn--full { width: 100%; }

/* ─── Skeleton Loaders ──────────────────────────────────────────────────── */
.chp-skeleton {
  background: linear-gradient(90deg, var(--chp-dark-4) 25%, var(--chp-dark-3) 50%, var(--chp-dark-4) 75%);
  background-size: 200% 100%;
  animation: chp-shimmer 1.5s ease infinite;
  border-radius: 4px;
}

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

.chp-skeleton--image {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.chp-skeleton--title { height: 22px; width: 80%; margin-bottom: 10px; }
.chp-skeleton--line  { height: 14px; width: 100%; margin-bottom: 8px; }
.chp-skeleton--price { height: 40px; width: 60%; margin-bottom: 12px; }
.chp-skeleton--btn   { height: 42px; width: 100%; border-radius: 8px; }

.chp-card--skeleton {
  pointer-events: none;
  opacity: 0.7;
  grid-template-columns: 280px 1fr 220px;
}

.chp-card--skeleton .chp-card__gallery-wrap {
  min-height: 200px;
}

.chp-card--skeleton .chp-card__body,
.chp-card--skeleton .chp-card__pricing {
  padding: 22px 20px;
}

/* ─── Card Enter Animation ──────────────────────────────────────────────── */
.chp-card--enter {
  animation: chp-card-in 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes chp-card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Empty / Error States ──────────────────────────────────────────────── */
.chp-empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--chp-text-muted);
}

.chp-empty-state .chp-empty-icon {
  font-size: 64px;
  color: var(--chp-gold);
  margin-bottom: 20px;
  opacity: 0.6;
}

.chp-empty-state h2 {
  font-size: 28px;
  color: var(--chp-text);
  margin-bottom: 12px;
}

.chp-no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--chp-dark-3);
  border-radius: var(--chp-radius);
  border: 1px solid var(--chp-border);
}

.chp-no-results i {
  font-size: 48px;
  color: var(--chp-text-muted);
  margin-bottom: 16px;
  display: block;
}

.chp-no-results h3 {
  color: var(--chp-text);
  margin-bottom: 8px;
}

/* ─── Popup ─────────────────────────────────────────────────────────────── */
.chp-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.chp-popup__inner {
  background: var(--chp-dark-3);
  border: 1px solid var(--chp-border);
  border-radius: var(--chp-radius);
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  position: relative;
}

.chp-popup__inner i {
  font-size: 48px;
  color: var(--chp-gold);
  margin-bottom: 16px;
  display: block;
}

.chp-popup__inner h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--chp-text);
}

.chp-popup__inner p {
  color: var(--chp-text-muted);
  margin-bottom: 24px;
}

.chp-popup__inner .chp-btn + .chp-btn { margin-top: 10px; }

.chp-popup__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--chp-text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: var(--chp-transition);
}

.chp-popup__close:hover { color: var(--chp-text); }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .chp-trip-bar__meta { display: none; }
  .chp-card__pricing { min-width: 0; }
  .chp-price__amount { font-size: 26px; }
  .chp-comparison-layout { padding: 12px; }
}
