/* ═══════════════════════════════════
   PRICES BY BOOKING CHANNEL (demo)
   Uses the page's CSS variables (--primary, --border, …).
═══════════════════════════════════ */
.channels {
  background:
    radial-gradient(ellipse 70% 60% at 85% 0%, rgba(124,58,237,0.06) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
}

.ch-demo {
  max-width: 840px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--gradient-soft);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 4px 6px -1px rgba(79,70,229,0.07),
    0 10px 30px -5px rgba(79,70,229,0.12);
  overflow: hidden;
}

.ch-demo [hidden] { display: none !important; }

.ch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}

.ch-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.ch-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.ch-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid #fde68a;
  border-radius: 99px;
  background: var(--amber-light);
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Night strip ── */
.ch-nights {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 24px 10px;
}

.ch-night {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.ch-night:hover { border-color: #c7d2fe; }

.ch-dow {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

.ch-day {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ch-night.is-weekend { background: #f5f3ff; border-color: #ddd6fe; }
.ch-night.is-weekend .ch-dow { color: #7c3aed; }

.ch-night.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-color);
}

.ch-night.is-selected .ch-dow { color: rgba(255,255,255,0.8); }
.ch-night.is-selected .ch-day { color: #fff; }
.ch-night:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-light); }

.ch-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #fff;
}

.ch-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.ch-legend-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

/* ── Selected night ── */
.ch-panel {
  padding: 18px 24px 20px;
  border-top: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-alt) 0%, #fff 60%);
}

.ch-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.ch-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ch-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ch-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.ch-summary.is-alert .ch-summary-icon { background: var(--red-light); color: #dc2626; box-shadow: inset 0 0 0 1px #fecaca; }
.ch-summary.is-ok .ch-summary-icon { background: var(--green-light); color: #059669; box-shadow: inset 0 0 0 1px #a7f3d0; }

.ch-rows { list-style: none; }

.ch-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 56px 232px;
  align-items: center;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 10px;
}

.ch-row + .ch-row { margin-top: 2px; }
.ch-row.is-site { background: var(--primary-50); }

.ch-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ch-row.is-site .ch-name { color: var(--primary-dark); }

.ch-bar {
  position: relative;
  height: 10px;
  border-radius: 99px;
  background: var(--bg-subtle);
}

.ch-bar::after {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: calc(50% - 1px);
  width: 2px;
  border-radius: 1px;
  background: var(--primary);
  opacity: 0.45;
}

.ch-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  transition: left 0.35s ease, width 0.35s ease, background-color 0.35s ease;
}

.ch-fill.is-below { border-radius: 4px 0 0 4px; }
.ch-fill.is-above { border-radius: 0 4px 4px 0; background: #94a3b8; }
.ch-fill.is-near { background: var(--amber); }
.ch-fill.is-alert { background: var(--red); }

.ch-site-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px #fff;
}

.ch-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ch-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ch-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.ch-tag.is-cheapest { background: #e0e7ff; color: var(--primary-dark); }
.ch-tag.is-alert { background: var(--red-light); color: #dc2626; }

.ch-delta {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ch-axis {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 56px 232px;
  gap: 16px;
  padding: 6px 12px 0;
}

.ch-axis-scale {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.ch-axis-scale span:first-child { text-align: left; }
.ch-axis-scale span:last-child { text-align: right; }

.ch-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .ch-head { padding: 16px; }
  .ch-nights { gap: 4px; padding: 16px 16px 8px; }
  .ch-night { padding: 8px 0 7px; border-radius: 10px; }
  .ch-dow { font-size: 11px; }
  .ch-day { font-size: 15px; }
  .ch-dot { top: -3px; right: -3px; width: 8px; height: 8px; }
  .ch-legend { padding: 0 16px 14px; }
  .ch-panel { padding: 16px 12px 18px; }
  .ch-panel-head { padding: 0 4px; }

  .ch-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name price"
      "bar bar"
      "tags tags";
    gap: 6px 12px;
    padding: 10px;
  }

  .ch-name { grid-area: name; }
  .ch-price { grid-area: price; }
  .ch-bar { grid-area: bar; }
  .ch-tags { grid-area: tags; }
  .ch-tags:empty { display: none; }

  .ch-axis { grid-template-columns: 1fr; padding: 6px 10px 0; }
  .ch-axis > span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-fill, .ch-night { transition: none; }
}
