/* Shared look for the China catalog and Korea live-lots pages, borrowing the
   auction-stats design language: Manrope headings, 20px+ radii, layered soft
   shadows, the #e3262f accent with a red glow. Tokens follow the cc- prefix the
   China page already uses so both pages share one stylesheet. */

#country-catalog-root {
  --cc-surface: #ffffff;
  --cc-surface-muted: #f1f3f6;
  --cc-border: #e3e6ec;
  --cc-text: #171a21;
  --cc-muted: #6b7280;
  --cc-soft: #9aa1ae;
  --cc-red: #e3262f;
  --cc-red-dark: #bd151e;
  --cc-shadow: 0 18px 40px -26px rgba(20, 22, 28, 0.36);
  --cc-shadow-hover: 0 28px 52px -28px rgba(20, 22, 28, 0.44);
  --cc-glow: 0 14px 26px -16px rgba(227, 38, 47, 0.5);

  position: relative;
  z-index: 2;
  width: calc(100% - 48px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 0 64px;
  color: var(--cc-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] #country-catalog-root {
  --cc-surface: #181a20;
  --cc-surface-muted: #20242c;
  --cc-border: #2b303a;
  --cc-text: #f4f5f7;
  --cc-muted: #9aa1ae;
  --cc-soft: #707786;
  --cc-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.66);
  --cc-shadow-hover: 0 28px 52px -28px rgba(0, 0, 0, 0.75);
}

/* ---- country switcher (calculator-style pills) ---- */
.country-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin: 0 0 18px;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow);
}

.country-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--cc-text);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.country-tabs__item:hover { background: var(--cc-surface-muted); }

.country-tabs__item.is-active {
  background: var(--cc-red);
  color: #ffffff;
  box-shadow: var(--cc-glow);
}

.country-tabs__flag { font-size: 15px; line-height: 1; }

/* ---- Korea sub-switcher (live feed vs sold archive) ---- */
.cc-subtabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  background: var(--cc-surface-muted);
}

.cc-subtab {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--cc-muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cc-subtab:hover { color: var(--cc-text); }

.cc-subtab.is-active {
  background: var(--cc-surface);
  color: var(--cc-text);
  box-shadow: var(--cc-shadow);
}

/* ---- page head ---- */
.cc-head { margin: 0 0 14px; }

.cc-head__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cc-red);
}

.cc-head h1 {
  margin: 0 0 8px;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cc-intro {
  color: var(--cc-muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 780px;
  margin: 0 0 18px;
}

.cc-note {
  font-size: 13px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 18px;
}

[data-theme="dark"] .cc-note {
  color: #fde68a;
  background: rgba(253, 230, 138, 0.08);
  border-color: rgba(253, 230, 138, 0.28);
}

/* ---- filters / toolbar ---- */
.cc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }

.cc-chip {
  border: 1px solid var(--cc-border);
  background: var(--cc-surface);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--cc-text);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cc-chip:hover { border-color: var(--cc-soft); }

.cc-chip.is-active {
  background: var(--cc-text);
  color: var(--cc-surface);
  border-color: var(--cc-text);
}

[data-theme="dark"] .cc-chip.is-active { background: #f4f5f7; color: #171a21; border-color: #f4f5f7; }

.cc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; }

.cc-search,
.cc-select {
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--cc-text);
  background: var(--cc-surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cc-search { flex: 1 1 260px; max-width: 420px; }
.cc-select { flex: 0 1 auto; cursor: pointer; }

.cc-search:focus,
.cc-select:focus {
  outline: none;
  border-color: var(--cc-red);
  box-shadow: 0 0 0 4px rgba(227, 38, 47, 0.12);
}

.cc-count { font-size: 13px; font-weight: 600; color: var(--cc-muted); white-space: nowrap; margin-left: auto; }

/* ---- cards ---- */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.cc-card {
  border: 1px solid var(--cc-border);
  border-radius: 20px;
  padding: 16px;
  background: var(--cc-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--cc-shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cc-card:hover { transform: translateY(-3px); box-shadow: var(--cc-shadow-hover); }

.cc-card[data-priority="0"] { opacity: 0.78; }

.cc-card__media {
  margin: -16px -16px 4px;
  height: 168px;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  background: var(--cc-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- sold-archive card: photo gallery + "sold" stamp ---- */
.cc-gallery { position: relative; }

.cc-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 18, 24, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.cc-gallery:hover .cc-gallery__nav { opacity: 1; }
.cc-gallery__nav:hover { background: rgba(15, 18, 24, 0.8); }
.cc-gallery__nav--prev { left: 8px; }
.cc-gallery__nav--next { right: 8px; }

.cc-gallery__counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 18, 24, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cc-card__sold {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cc-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--cc-glow);
}

.cc-card--sold .cc-card__media { position: relative; }

.cc-card__media-empty {
  color: var(--cc-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cc-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }

.cc-card__title {
  font-family: Manrope, Inter, sans-serif;
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.cc-card__cn { color: var(--cc-soft); font-size: 12px; }

.cc-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.cc-badge--ev { background: #ecfdf5; color: #047857; }
.cc-badge--ice { background: #eff6ff; color: #1d4ed8; }
.cc-badge--out { background: var(--cc-surface-muted); color: var(--cc-muted); }
.cc-badge--warn { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .cc-badge--warn { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }

/* Accent for customs-favourable cars (≤160 л.с. ДВС/гибрид-сумма, ≤80 л.с. EV) */
.cc-card[data-priority="1"] { border-left: 3px solid #10b981; }

.cc-fav {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 3px 10px;
}

[data-theme="dark"] .cc-fav {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .cc-badge--ev { background: rgba(16, 185, 129, 0.14); color: #34d399; }
[data-theme="dark"] .cc-badge--ice { background: rgba(59, 130, 246, 0.14); color: #93c5fd; }

.cc-meta { font-size: 13px; color: var(--cc-muted); }

.cc-price { font-size: 16px; font-weight: 800; font-family: Manrope, Inter, sans-serif; }
.cc-price__rub { font-size: 13px; font-weight: 600; color: var(--cc-muted); }

.cc-note-card { font-size: 12px; color: var(--cc-soft); }

.cc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }

.cc-btn {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--cc-border);
  color: var(--cc-text);
  background: var(--cc-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.cc-btn:hover { border-color: var(--cc-soft); transform: translateY(-1px); }

.cc-btn--primary {
  background: var(--cc-red);
  color: #ffffff;
  border-color: var(--cc-red);
  box-shadow: var(--cc-glow);
}

.cc-btn--primary:hover { background: var(--cc-red-dark); border-color: var(--cc-red-dark); }

.cc-empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--cc-soft);
  border: 1px dashed var(--cc-border);
  border-radius: 16px;
}

/* ---- pagination (Korea live feed) ---- */
.cc-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 26px 0 0; }

.cc-pager__info { font-size: 13px; font-weight: 600; color: var(--cc-muted); min-width: 120px; text-align: center; }

.cc-pager .cc-btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---- phones ---- */
@media (max-width: 560px) {
  #country-catalog-root {
    width: calc(100% - 28px);
    padding: 18px 0 48px;
  }

  /* The country/sub switchers stay on one line and scroll instead of
     overflowing the page (they were inline-flex with no wrap). */
  .country-tabs,
  .cc-subtabs {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .country-tabs::-webkit-scrollbar,
  .cc-subtabs::-webkit-scrollbar { display: none; }

  .country-tabs__item,
  .cc-subtab { flex: 0 0 auto; }

  .cc-count { margin-left: 0; }

  .cc-card__media { height: 200px; }
}
