/* ── Compare page layout ────────────────────────────────────────────────── */
.tih-compare-layout {
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 32px;
  align-items: start;
  padding-block: clamp(32px, 5vw, 56px);
}

/* ── Filter sidebar ──────────────────────────────────────────────────────── */
.tih-compare-sidebar { position: sticky; top: 88px; }
.tih-compare-filters {
  background: var(--tih-surface);
  border: 1px solid var(--tih-border);
  border-radius: var(--tih-radius-lg);
  padding: 20px;
}
.tih-compare-filters__section { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--tih-border); }
.tih-compare-filters__section:last-of-type { border-bottom: none; margin-bottom: 16px; padding-bottom: 0; }
.tih-compare-filters__heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tih-text-muted);
  margin: 0 0 10px;
}
.tih-compare-filters__select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--tih-border);
  border-radius: var(--tih-radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--tih-text);
  background: var(--tih-surface);
  appearance: none;
  cursor: pointer;
}
.tih-compare-filters__select:focus { outline: none; border-color: var(--tih-primary); }
.tih-compare-filters__check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--tih-text);
}
.tih-compare-filters__check input { accent-color: var(--tih-primary); width: 16px; height: 16px; flex-shrink: 0; }
.tih-compare-filters__apply { width: 100%; justify-content: center; padding: 11px; }
.tih-compare-filters__clear {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--tih-text-muted);
  text-decoration: none;
}
.tih-compare-filters__clear:hover { color: var(--tih-primary); }

/* ── Results bar ─────────────────────────────────────────────────────────── */
.tih-compare-results__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tih-compare-results__count { font-size: 0.875rem; font-weight: 600; color: var(--tih-text-muted); margin: 4px 0 0; }
.tih-compare-disclosure { font-size: 0.8rem; flex: 1; }

/* ── Plan cards ──────────────────────────────────────────────────────────── */
.tih-plan-cards { display: flex; flex-direction: column; gap: 16px; }

.tih-plan-card {
  background: var(--tih-surface);
  border: 1.5px solid var(--tih-border);
  border-radius: var(--tih-radius-lg);
  padding: 20px 24px;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}
.tih-plan-card:hover { box-shadow: var(--tih-shadow-md); transform: translateY(-1px); }
.tih-plan-card--promoted { border-color: var(--tih-warning); }
.tih-plan-card--featured  { border-color: var(--tih-success); }

.tih-plan-card__ribbon {
  position: absolute;
  top: -1px;
  right: 20px;
  background: var(--tih-warning);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 0 0 var(--tih-radius-sm) var(--tih-radius-sm);
}

.tih-plan-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.tih-plan-card__logo { max-width: 120px; max-height: 48px; object-fit: contain; }
.tih-plan-card__provider-name { font-weight: 700; font-size: 1.05rem; color: var(--tih-navy); }
.tih-plan-card__plan-name { font-size: 0.8rem; color: var(--tih-text-muted); margin-top: 2px; }

.tih-plan-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.tih-plan-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--tih-bg);
  border-radius: var(--tih-radius-md);
}
.tih-plan-card__stat { display: flex; flex-direction: column; gap: 2px; }
.tih-plan-card__stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tih-text-muted);
}
.tih-plan-card__stat-value { font-size: 0.875rem; font-weight: 600; color: var(--tih-navy); }

.tih-plan-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tih-plan-card__price { display: flex; flex-direction: column; }
.tih-plan-card__price-label { font-size: 0.72rem; color: var(--tih-text-muted); }
.tih-plan-card__price-value { font-size: 1.4rem; font-weight: 700; color: var(--tih-navy); }
.tih-plan-card__cta-arrow { width: 16px; height: 16px; }
.tih-plan-card__disclosure { font-size: 0.72rem; color: var(--tih-text-muted); margin: 8px 0 0; }

/* ── Rating stars ────────────────────────────────────────────────────────── */
.tih-rating { display: inline-flex; align-items: center; gap: 2px; font-size: 0.9rem; }
.tih-rating__star { color: #D1D5DB; }
.tih-rating__star--full, .tih-rating__star--half { color: #F59E0B; }
.tih-rating__score { font-size: 0.8rem; font-weight: 600; color: var(--tih-text-muted); margin-left: 4px; }

/* ── Loading state ───────────────────────────────────────────────────────── */
.tih-plan-cards--loading { opacity: 0.5; pointer-events: none; }

@media (max-width: 900px) {
  .tih-compare-layout { grid-template-columns: 1fr; }
  .tih-compare-sidebar { position: static; }
  .tih-compare-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .tih-compare-filters__section { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
  .tih-compare-filters__apply,
  .tih-compare-filters__clear { grid-column: span 2; }
}
@media (max-width: 480px) {
  .tih-compare-filters { grid-template-columns: 1fr; }
  .tih-compare-filters__apply,
  .tih-compare-filters__clear { grid-column: 1; }
  .tih-plan-card { padding: 16px; }
}
