/* ============================================================
   AgroNews — Company Modern (cm-*)
   Self-contained namespace for the imported-profile catalog UI.
   Brand accent: #ea5e00 (kept). Coexists with legacy main.css.
   ============================================================ */

.cm-root {
  --cm-brand:        #ea5e00;
  --cm-brand-dark:   #c75000;
  --cm-brand-soft:   rgba(234, 94, 0, 0.07);
  --cm-brand-line:   rgba(234, 94, 0, 0.25);
  --cm-ink:          #1e1e1e;
  --cm-ink-2:        #2f2f2f;
  --cm-ink-3:        #595959;
  --cm-ink-mute:     #8a8a8a;
  --cm-paper:        #ffffff;
  --cm-paper-2:      #f7f7f7;
  --cm-paper-3:      #f0f0f0;
  --cm-line:         #e2e2e2;
  --cm-line-soft:    #ececec;
  --cm-good:         #2f7a3a;
  --cm-good-soft:    rgba(47, 122, 58, 0.10);
  --cm-warn:         #b5500a;
  --cm-warn-soft:    rgba(181, 80, 10, 0.10);
  --cm-radius:       4px;
  --cm-radius-sm:    3px;
  --cm-shadow:       0 1px 0 rgba(0, 0, 0, 0.04);
  --cm-shadow-hi:    0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --cm-grid-gap:     24px;

  color: var(--cm-ink);
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

/* ─── Layout shell ─────────────────────────────────────────── */

.cm-shell {
  max-width: 1180px;
  margin: 24px auto 80px;
  padding: 0 20px;
}

.cm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--cm-grid-gap);
  align-items: start;
}

@media (max-width: 900px) {
  .cm-grid { grid-template-columns: 1fr; }
}

/* ─── Hero ─────────────────────────────────────────────────── */

.cm-hero {
  position: relative;
  background: var(--cm-paper-3);
  border-radius: var(--cm-radius);
  padding: 24px 28px 22px;
  margin-bottom: var(--cm-grid-gap);
  overflow: hidden;
}

.cm-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--cm-brand);
}

.cm-hero__top {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.cm-hero__logo {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cm-hero__logo img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  display: block;
}

.cm-hero__logo--empty {
  background: var(--cm-paper-2);
  color: var(--cm-ink-mute);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.cm-hero__body {
  flex: 1 1 auto;
  min-width: 0;
}

.cm-hero__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--cm-brand);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.cm-hero__title {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--cm-ink);
  text-transform: none;
}

.cm-hero__tagline {
  font-size: 15px;
  color: var(--cm-ink-3);
  line-height: 1.5;
  margin: 0 0 14px;
  max-width: 70ch;
}

.cm-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 700px) {
  .cm-hero { padding: 24px 22px; }
  .cm-hero__top { flex-direction: column; gap: 18px; }
  .cm-hero__logo { width: 96px; height: 96px; }
}

/* ─── Chips / Badges ───────────────────────────────────────── */

.cm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--cm-ink-2);
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cm-chip--brand {
  background: var(--cm-brand-soft);
  color: var(--cm-brand-dark);
  border-color: var(--cm-brand-line);
}

.cm-chip--filled {
  background: var(--cm-ink);
  color: var(--cm-paper);
  border-color: var(--cm-ink);
}

.cm-chip--good {
  background: var(--cm-good-soft);
  color: var(--cm-good);
  border-color: rgba(47, 122, 58, 0.20);
}

.cm-chip--ghost {
  background: transparent;
  border: 1px dashed var(--cm-line);
  color: var(--cm-ink-3);
}

.cm-chip__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

a.cm-chip:hover { background: var(--cm-paper-3); border-color: var(--cm-ink-mute); }
a.cm-chip--brand:hover { background: var(--cm-brand); color: var(--cm-paper); border-color: var(--cm-brand); }

/* ─── Stats strip ──────────────────────────────────────────── */

.cm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  background: var(--cm-paper);
  margin-bottom: var(--cm-grid-gap);
  overflow: hidden;
}

.cm-stat {
  padding: 14px 18px;
  border-right: 1px solid var(--cm-line-soft);
}

.cm-stat:last-child { border-right: none; }

.cm-stat__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--cm-ink-mute);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.cm-stat__value {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--cm-ink);
}

.cm-stat__value--mute { color: var(--cm-ink-mute); font-weight: 400; }

/* ─── Card / Section ───────────────────────────────────────── */

.cm-card {
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.cm-card + .cm-card { margin-top: 0; }

.cm-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -20px -22px 16px;
  padding: 10px 22px;
  background: var(--cm-brand);
  color: #fff;
  border-radius: var(--cm-radius) var(--cm-radius) 0 0;
}

.cm-section__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cm-section__count {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
  margin-left: auto;
}

/* ─── About / prose ────────────────────────────────────────── */

.cm-prose {
  font-size: 14px;
  line-height: 1.6;
  color: var(--cm-ink-2);
}

.cm-prose p { margin: 0 0 12px; }
.cm-prose p:last-child { margin-bottom: 0; }

/* ─── Generic flex chip lists ──────────────────────────────── */

.cm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── Offerings grid ───────────────────────────────────────── */

.cm-offerings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.cm-offering {
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm);
  padding: 16px 18px;
  background: var(--cm-paper);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-offering:hover { border-color: var(--cm-brand-line); box-shadow: var(--cm-shadow); }

.cm-offering__type {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cm-brand);
}

.cm-offering__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--cm-ink);
  line-height: 1.3;
}

.cm-offering__descr {
  font-size: 13.5px;
  color: var(--cm-ink-3);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cm-offering__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.cm-offering__price {
  font-weight: 600;
  color: var(--cm-ink);
}

.cm-offering__avail {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cm-good);
}
.cm-offering__avail--out { color: var(--cm-warn); }

/* ─── Locations / map placeholder ──────────────────────────── */

.cm-locations { display: grid; gap: 12px; }

.cm-location {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm);
  background: var(--cm-paper-2);
}

.cm-location__type {
  flex: 0 0 110px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cm-brand);
  padding-top: 2px;
}

.cm-location__body { flex: 1 1 auto; min-width: 0; }

.cm-location__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cm-ink);
  margin-bottom: 4px;
}

.cm-location__addr {
  font-size: 13.5px;
  color: var(--cm-ink-3);
  line-height: 1.4;
}

.cm-location__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  margin-top: 6px;
  color: var(--cm-brand);
  text-decoration: none;
}
.cm-location__link:hover { color: var(--cm-brand-dark); text-decoration: underline; }

/* ─── Evidence (audit) ─────────────────────────────────────── */

.cm-evidence { display: grid; gap: 14px; }

.cm-evidence__item {
  position: relative;
  border-left: 3px solid var(--cm-brand-line);
  padding: 6px 0 6px 18px;
}

.cm-evidence__field {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cm-ink-mute);
  margin-bottom: 4px;
}

.cm-evidence__quote {
  font-size: 14px;
  color: var(--cm-ink-2);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 4px;
}

.cm-evidence__quote::before { content: "“"; color: var(--cm-brand); }
.cm-evidence__quote::after  { content: "”"; color: var(--cm-brand); }

.cm-evidence__source {
  font-size: 12px;
  color: var(--cm-ink-mute);
}

.cm-evidence__source a {
  color: var(--cm-ink-3);
  text-decoration: none;
  border-bottom: 1px dotted var(--cm-line);
}
.cm-evidence__source a:hover { color: var(--cm-brand); border-color: var(--cm-brand-line); }

/* ─── Reviews / rating ─────────────────────────────────────── */

.cm-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cm-paper-2);
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  font-size: 13px;
}

.cm-rating__star {
  color: var(--cm-brand);
  font-size: 14px;
  line-height: 1;
}

.cm-rating__value { font-weight: 600; color: var(--cm-ink); }
.cm-rating__count { color: var(--cm-ink-mute); font-size: 12px; }

/* ─── Sidebar ──────────────────────────────────────────────── */

.cm-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .cm-side { position: static; top: auto; } }

.cm-side__card {
  background: var(--cm-paper-3);
  border-radius: var(--cm-radius);
  padding: 16px 18px;
}

.cm-side__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cm-ink-3);
  margin: 0 0 12px;
}

.cm-list-clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

.cm-list-clean a, .cm-list-clean span.cm-list-clean__val {
  color: var(--cm-ink-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  word-break: break-word;
}

.cm-list-clean a:hover { color: var(--cm-brand); }

.cm-list-clean__icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--cm-ink-mute);
}

a.cm-list-clean:hover .cm-list-clean__icon,
.cm-list-clean a:hover .cm-list-clean__icon { color: var(--cm-brand); }

/* CTA button — matches .conversion-button family */
.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--cm-brand);
  color: var(--cm-paper);
  font-weight: 400;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--cm-radius);
  border: 1px solid var(--cm-brand);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-transform: none;
}
.cm-btn:hover { background: var(--cm-brand-dark); border-color: var(--cm-brand-dark); color: var(--cm-paper); }
.cm-btn i, .cm-btn .fa { color: #fff !important; font-size: 14px; }
.cm-btn--ghost i, .cm-btn--ghost .fa { color: var(--cm-ink-2) !important; }
.cm-btn--ghost:hover i, .cm-btn--ghost:hover .fa { color: #fff !important; }
.cm-btn--brand-ghost i, .cm-btn--brand-ghost .fa { color: var(--cm-brand) !important; }
.cm-btn--brand-ghost:hover i, .cm-btn--brand-ghost:hover .fa { color: #fff !important; }

.cm-btn--ghost {
  background: var(--cm-paper);
  color: var(--cm-ink-2);
  border: 1px solid #595959;
}
.cm-btn--ghost:hover { background: var(--cm-brand); border-color: var(--cm-brand); color: var(--cm-paper); }

.cm-btn--online { position: relative; }
.cm-btn--online::after {
  content: "online";
  position: absolute;
  top: -8px; right: -8px;
  background: #2f7a3a;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 2px;
  text-transform: lowercase;
}

/* Social grid */
.cm-social {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 8px;
}

.cm-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--cm-line);
  border-radius: 8px;
  color: var(--cm-ink-3);
  text-decoration: none;
  transition: all 0.15s;
}
.cm-social a:hover { background: var(--cm-brand); color: var(--cm-paper); border-color: var(--cm-brand); }
.cm-social svg { width: 16px; height: 16px; }

/* Opening hours */
.cm-hours { display: grid; gap: 4px; font-size: 13px; color: var(--cm-ink-3); }
.cm-hours__row { padding: 2px 0; border-bottom: 1px dashed var(--cm-line-soft); }
.cm-hours__row:last-child { border-bottom: none; }

/* ─── Listing page ─────────────────────────────────────────── */

.cm-list-shell { max-width: 1180px; margin: 24px auto 80px; padding: 0 20px; }

.cm-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--cm-line);
}

.cm-list-head__h1 {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--cm-ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cm-list-head__sub { font-size: 14px; color: var(--cm-ink-mute); }

.cm-list-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--cm-grid-gap);
}

@media (max-width: 900px) { .cm-list-grid { grid-template-columns: 1fr; } }

/* Filters */
.cm-filters {
  background: var(--cm-paper-3);
  border-radius: var(--cm-radius);
  padding: 16px 18px;
  align-self: start;
  position: sticky;
  top: 20px;
}
@media (max-width: 900px) {
  .cm-filters {
    position: static;
    top: auto;
    padding: 12px 14px;
  }
}

.cm-filters__group { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #d8d8d8; }
.cm-filters__group:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.cm-filters__h {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--cm-ink-3);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.cm-filters__opt {
  display: block;
  font-size: 13.5px;
  color: var(--cm-ink-2);
  padding: 4px 0;
  text-decoration: none;
}

.cm-filters__opt:hover { color: var(--cm-brand); }

.cm-filters__opt--on {
  color: var(--cm-brand);
  font-weight: 600;
}

.cm-filters__opt--on::before {
  content: "•";
  margin-right: 6px;
  color: var(--cm-brand);
}

.cm-filters__count {
  color: var(--cm-ink-mute);
  font-size: 11.5px;
  margin-left: 4px;
}

.cm-filters__reset {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--cm-ink-mute);
  text-decoration: underline;
}
.cm-filters__reset:hover { color: var(--cm-brand); }

/* Result grid */
.cm-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.cm-result-card {
  display: flex;
  flex-direction: column;
  background: var(--cm-paper-3);
  border-radius: var(--cm-radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.cm-result-card:hover {
  background: var(--cm-paper);
  box-shadow: var(--cm-shadow-hi);
}
.cm-result-card:hover .cm-result-card__title { color: var(--cm-brand); }

/* Featured ("selected") and paid placements — paid is the stronger highlight */
.cm-result-card--selected {
  border-color: var(--cm-brand);
  box-shadow: inset 0 0 0 1px var(--cm-brand-line);
  background: #fffaf3;
}
.cm-result-card--selected::after {
  content: "★";
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--cm-brand);
  font-size: 15px;
  line-height: 1;
}
.cm-result-card--paid {
  border-color: var(--cm-brand);
  background: #fffaf3;
}
.cm-result-card--paid .cm-result-card__title { color: var(--cm-ink); }
.cm-result-card--paid:hover { background: #fff5e8; }

.cm-result-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.cm-result-card__logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cm-result-card__logo img { max-width: 88%; max-height: 88%; object-fit: contain; }
.cm-result-card__logo--empty {
  color: var(--cm-ink-mute);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.cm-result-card__country {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cm-ink-mute);
  margin-bottom: 4px;
}

.cm-result-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cm-ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.cm-result-card__tagline {
  font-size: 13px;
  color: var(--cm-ink-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 12px;
}

.cm-result-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.cm-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--cm-ink-mute);
  border: 1px dashed var(--cm-line);
  border-radius: var(--cm-radius);
}

.cm-empty__title { font-size: 18px; color: var(--cm-ink-2); margin-bottom: 6px; }
.cm-empty__sub { font-size: 14px; }

/* ─── Pagination (basic, blends with legacy) ───────────────── */

.cm-pager { margin-top: 28px; display: flex; justify-content: center; }

/* ─── Misc ─────────────────────────────────────────────────── */

.cm-divider {
  height: 1px;
  background: var(--cm-line);
  margin: 18px 0;
}

.cm-flag {
  width: 18px;
  height: 13px;
  display: inline-block;
  background: var(--cm-paper-3);
  border-radius: 2px;
  position: relative;
  font-size: 0;
  vertical-align: middle;
}

.cm-flag::before {
  content: attr(data-iso);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--cm-ink-2);
  letter-spacing: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Verified pill (data quality) ─────────────────────────── */

.cm-verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cm-good);
  background: var(--cm-good-soft);
  border: 1px solid rgba(47, 122, 58, 0.20);
  padding: 3px 9px;
  border-radius: 999px;
}
.cm-verified__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cm-good);
  box-shadow: 0 0 0 2px rgba(47, 122, 58, 0.18);
}

/* ─── Restored legacy widgets, harmonized ──────────────────── */

/* Cross-links row: products / demand / vacancies */
.cm-xlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.cm-xlinks a {
  flex: 1 1 0;
  min-width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  color: var(--cm-ink-2);
  text-align: center;
  padding: 10px 12px;
  min-height: 56px;
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
  border-radius: var(--cm-radius);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cm-xlinks a:hover { background: var(--cm-brand); color: #fff; border-color: var(--cm-brand); }
.cm-xlinks a i { flex: 0 0 auto; color: var(--cm-brand); font-size: 15px; }
.cm-xlinks a:hover i { color: #fff; }

/* Constructor site CTA */
.cm-btn--brand-ghost {
  background: var(--cm-paper);
  color: var(--cm-brand);
  border: 1px solid var(--cm-brand);
}
.cm-btn--brand-ghost:hover { background: var(--cm-brand); color: #fff; }

/* Phone show-more reveal */
.cm-phones-more {
  margin-top: 10px;
  display: inline-block;
  font-size: 13px;
  color: var(--cm-brand);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dotted var(--cm-brand-line);
  user-select: none;
}
.cm-phones-more:hover { color: var(--cm-brand-dark); }
.cm-phones-more i { margin-left: 4px; }
.cm-phone-hidden,
.cm-email-hidden { display: none; }

.cm-list-divider {
  list-style: none;
  height: 1px;
  background: var(--cm-line);
  margin: 10px -2px 8px;
  padding: 0;
}

a.cm-phones-more,
a.cm-emails-more {
  color: var(--cm-brand) !important;
  font-size: 13px;
  text-decoration: none;
}
a.cm-phones-more i,
a.cm-emails-more i { margin-left: 4px; font-size: 11px; transition: transform 0.2s; }
a.cm-phones-more.active i,
a.cm-emails-more.active i { transform: rotate(180deg); }

/* Banner slots in cm-* context — keep ad markup intact, just spacing */
.cm-side .banner,
.cm-filters + .banner,
.cm-shell > .banner,
.cm-list-shell > .banner { margin: 0 0 16px; }

/* Company news / similar / keywords sections inside main column */
.cm-related-news {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.cm-related-news a {
  display: block;
  padding: 10px;
  background: var(--cm-paper-3);
  border-radius: var(--cm-radius);
  text-decoration: none;
  color: var(--cm-ink-2);
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.cm-related-news a:hover { background: var(--cm-brand); color: #fff; }

.cm-similar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.cm-similar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 10px;
  background: var(--cm-paper-3);
  border-radius: var(--cm-radius);
  text-decoration: none;
  color: var(--cm-ink-2);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.cm-similar a:hover { background: var(--cm-paper); box-shadow: var(--cm-shadow-hi); color: var(--cm-brand); }
.cm-similar img { max-width: 60px; max-height: 60px; object-fit: contain; margin-bottom: 6px; }

/* Association membership pill (legacy info-single-block__association) */
.cm-assoc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cm-paper-3);
  color: var(--cm-ink-2);
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  margin: 3px 5px 3px 0;
}
.cm-assoc i { color: var(--cm-brand); }

/* Online dot for chat status */
.cm-online-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2f7a3a;
  box-shadow: 0 0 0 2px rgba(47,122,58,0.2);
  margin-right: 5px;
  vertical-align: middle;
}

/* Section subtitle inside .cm-card (replaces side__title inside main column) */
.cm-subhead {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--cm-ink-3);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

/* List card hover: keep brand link color on the title */
.cm-result-card__country { color: var(--cm-ink-mute); }

/* Footer meta strip (added date / aproved) */
.cm-meta-strip {
  margin-top: 18px;
  padding: 12px 0 0;
  border-top: 1px solid var(--cm-line);
  font-size: 12px;
  color: var(--cm-ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.cm-meta-strip img { vertical-align: middle; }

/* Print fallback */
@media print {
  .cm-side, .cm-filters, .cm-btn { display: none !important; }
  .cm-card { break-inside: avoid; }
}

/* ============================================================
   Rubrics index page (/catalog/companies)
   Builds on existing tokens; no override of core rules.
   ============================================================ */

/* Hero variant for rubric index (lighter than single hero) */
.cm-hero--rubrics {
  background: var(--cm-paper-3);
  padding: 22px 26px 20px;
  margin-bottom: var(--cm-grid-gap);
}
.cm-hero--rubrics .cm-hero__title {
  font-size: clamp(22px, 2.6vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cm-hero--rubrics .cm-hero__meta {
  margin-top: 6px;
  gap: 10px;
}
.cm-hero__cta {
  width: auto;
  padding: 8px 14px;
  font-size: 13.5px;
}

/* Sidebar toggle pills (Companies / Associations) */
.cm-rubric-side { display: flex; flex-direction: column; gap: 16px; }

.cm-rubric-toggle {
  display: flex;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  overflow: hidden;
  background: var(--cm-paper);
}
.cm-rubric-toggle__btn {
  flex: 1 1 0;
  text-align: center;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cm-ink-3);
  text-decoration: none;
  background: var(--cm-paper);
  transition: background 0.15s, color 0.15s;
}
.cm-rubric-toggle__btn + .cm-rubric-toggle__btn {
  border-left: 1px solid var(--cm-line);
}
.cm-rubric-toggle__btn:hover { background: var(--cm-paper-3); color: var(--cm-brand); }
.cm-rubric-toggle__btn--on {
  background: var(--cm-brand);
  color: #fff;
}
.cm-rubric-toggle__btn--on:hover { background: var(--cm-brand-dark); color: #fff; }

/* Top companies sidebar list */
.cm-rubric-top { background: var(--cm-paper); border: 1px solid var(--cm-line); padding: 14px 16px; }
.cm-rubric-top__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cm-rubric-top__item {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--cm-line-soft);
}
.cm-rubric-top__item:last-child { border-bottom: none; padding-bottom: 0; }
.cm-rubric-top__item--accent { background: #fffaf3; border-radius: var(--cm-radius-sm); padding: 8px 8px 10px; margin: -2px -4px; }

.cm-rubric-top__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--cm-ink);
  text-decoration: none;
  line-height: 1.3;
  margin-bottom: 4px;
}
.cm-rubric-top__name:hover { color: var(--cm-brand); }

.cm-rubric-top__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 11.5px;
  color: var(--cm-ink-mute);
}
.cm-rubric-top__sub a {
  color: var(--cm-ink-3);
  text-decoration: none;
}
.cm-rubric-top__sub a:hover { color: var(--cm-brand); }
.cm-rubric-top__sub span { color: var(--cm-ink-mute); }

/* Main column — category cards grid */
.cm-rubric-main { min-width: 0; }

.cm-rubric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.cm-rubric-card {
  display: flex;
  flex-direction: column;
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cm-rubric-card:hover {
  border-color: var(--cm-brand);
  box-shadow: var(--cm-shadow-hi);
}

.cm-rubric-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--cm-paper-3);
  border-bottom: 1px solid var(--cm-line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}
.cm-rubric-card:hover .cm-rubric-card__head { background: var(--cm-brand); }
.cm-rubric-card:hover .cm-rubric-card__title { color: #fff; }
.cm-rubric-card:hover .cm-rubric-card__count {
  color: #fff;
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.cm-rubric-card__title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0;
  color: var(--cm-ink);
  line-height: 1.3;
  text-transform: none;
  flex: 1 1 auto;
  min-width: 0;
}

.cm-rubric-card__count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--cm-ink-mute);
  background: var(--cm-paper);
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cm-rubric-card__kids {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  display: grid;
  gap: 6px;
}
.cm-rubric-card__kids li { margin: 0; }
.cm-rubric-card__kids a {
  display: block;
  font-size: 13px;
  color: var(--cm-ink-2);
  text-decoration: none;
  line-height: 1.4;
  padding: 2px 0;
}
.cm-rubric-card__kids a:hover { color: var(--cm-brand); }

.cm-rubric-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -2px 16px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cm-brand);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 6px 0;
  min-height: 28px;
}
.cm-rubric-card__more:hover { color: var(--cm-brand-dark); }
.cm-rubric-card__more::-webkit-details-marker { display: none; }
.cm-rubric-card__more i { font-size: 10px; transition: transform 0.2s; }

.cm-rubric-card__expand[open] .cm-rubric-card__more i { transform: rotate(180deg); }
.cm-rubric-card__expand[open] .cm-rubric-card__more-open { display: none; }
.cm-rubric-card__expand:not([open]) .cm-rubric-card__more-close { display: none; }

.cm-rubric-card__kids--rest {
  margin: 0 16px 8px;
  padding: 0;
  border-top: 1px dashed var(--cm-line);
  padding-top: 8px;
}

.cm-rubric-card__viewall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 16px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cm-brand);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--cm-brand-line);
  border-radius: var(--cm-radius);
  background: var(--cm-brand-soft);
}
.cm-rubric-card__viewall:hover { background: var(--cm-brand); color: #fff; border-color: var(--cm-brand); }

@media (max-width: 900px) {
  .cm-rubric-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Top companies sidebar — compact (rubrics page)
   Smaller, denser "directory listing" feel; single-line title.
   ============================================================ */

.cm-rubric-top { padding: 12px 14px; }
.cm-rubric-top .cm-side__title { margin: 0 0 10px; }
.cm-rubric-top__list { gap: 0; }
.cm-rubric-top__item {
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px dashed var(--cm-line-soft);
}
.cm-rubric-top__item:first-child { padding-top: 0; }
.cm-rubric-top__item--accent {
  background: #fffaf3;
  border-radius: var(--cm-radius-sm);
  padding: 8px 8px;
  margin: 0 -6px;
  border-bottom-style: dashed;
}
.cm-rubric-top__name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.cm-rubric-top__sub {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.cm-rubric-top__sub a {
  display: inline;
  overflow-wrap: anywhere;
  white-space: normal;
}
.cm-rubric-top__sub span { display: inline; }

/* ============================================================
   MOBILE RESPONSIVE — comprehensive overhaul
   Fixes sticky sidebars, hero stacking, cramped padding, grids,
   hospitality chips, social block, touch targets.
   ============================================================ */

/* ─── Tablet & smaller (≤900px) ──────────────────────────── */
@media (max-width: 900px) {
  /* Layout shell */
  .cm-shell,
  .cm-list-shell { margin: 16px auto 60px; padding: 0 14px; }

  /* Grid stacking already covered; make sure gap shrinks too */
  .cm-grid,
  .cm-list-grid { gap: 18px; }

  /* Filters above results, sidebar above main on rubrics */
  .cm-filters,
  .cm-rubric-side { order: -1; }

  /* Card padding shrink */
  .cm-card { padding: 16px 18px; margin-bottom: 14px; }
  .cm-section__head { margin: -16px -18px 14px; padding: 9px 18px; }

  /* List head: stack and tighten */
  .cm-list-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
  }

  /* Stats strip — wrap to multi-row by switching to flex/auto cols */
  .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-stat { padding: 12px 14px; }
  .cm-stat:nth-child(2n) { border-right: none; }
  /* Reset 4th element's bottom-row border-right that may now be wrong */
  .cm-stat:last-child { border-right: none; }

  /* Locations: stack type above body */
  .cm-location { flex-direction: column; gap: 4px; padding: 12px 14px; }
  .cm-location__type { flex: 0 0 auto; }

  /* Cross-links: still equal width but allow wrap with breathing room */
  .cm-xlinks a { min-height: 48px; font-size: 12.5px; padding: 8px 10px; }

  /* Filters: collapsible accordion on mobile (no JS, native <details>) */
  .cm-filters > details.cm-filters-mob { margin: 0; }
  .cm-filters > details.cm-filters-mob > summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--cm-ink-2);
    padding: 4px 0 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .cm-filters > details.cm-filters-mob > summary::-webkit-details-marker { display: none; }
  .cm-filters > details.cm-filters-mob > summary::after {
    content: "▾";
    margin-left: 8px;
    color: var(--cm-brand);
    transition: transform 0.2s;
  }
  .cm-filters > details.cm-filters-mob[open] > summary::after { transform: rotate(180deg); }
}
@media (min-width: 901px) {
  /* Above mobile: hide the summary toggle — the <details> stays open (HTML attr)
     so the inner filter groups are always visible. */
  .cm-filters > details.cm-filters-mob > summary { display: none; }
}

/* ─── Phone (≤600px) — denser, single-column ───────────── */
@media (max-width: 600px) {
  .cm-shell,
  .cm-list-shell { margin: 12px auto 48px; padding: 0 12px; }

  /* Hero shrink */
  .cm-hero { padding: 18px 16px 16px; margin-bottom: 16px; }
  .cm-hero--rubrics { padding: 16px 16px 14px; }
  .cm-hero__top { flex-direction: column; gap: 14px; }
  .cm-hero__logo { width: 80px; height: 80px; }
  .cm-hero__logo--empty { font-size: 32px; }
  .cm-hero__title { font-size: 22px; }
  .cm-hero__tagline { font-size: 14px; margin-bottom: 12px; }
  .cm-hero__meta { gap: 6px; }

  /* Stats — single column on tiny phones to avoid cramped */
  .cm-stats { grid-template-columns: 1fr 1fr; }
  .cm-stat { padding: 10px 12px; }
  .cm-stat__value { font-size: 15px; }
  .cm-stat__label { font-size: 10.5px; }

  /* Card padding tighten further */
  .cm-card { padding: 14px 14px; }
  .cm-section__head { margin: -14px -14px 12px; padding: 8px 14px; }
  .cm-section__title { font-size: 14px; }

  /* Results grid: single column with no minmax stretching weirdness */
  .cm-results { grid-template-columns: 1fr; gap: 12px; }
  .cm-result-card { padding: 14px 14px; }
  .cm-result-card__head { gap: 12px; margin-bottom: 10px; }
  .cm-result-card__logo { flex: 0 0 48px; width: 48px; height: 48px; }

  /* Rubric grid: single column */
  .cm-rubric-grid { gap: 12px; }
  .cm-rubric-card__head { padding: 10px 14px; }
  .cm-rubric-card__kids { padding: 10px 14px; }
  .cm-rubric-card__more { margin: -2px 14px 10px; }

  /* Offerings: single column */
  .cm-offerings { grid-template-columns: 1fr; gap: 10px; }
  .cm-offering { padding: 12px 14px; }

  /* Cross-links: 3-up small, wrap is fine */
  .cm-xlinks { gap: 6px; }
  .cm-xlinks a { font-size: 12px; padding: 8px 6px; min-height: 44px; min-width: 80px; }

  /* Social: inline flex wrap rather than grid (avoids huge gaps) */
  .cm-social { display: flex; flex-wrap: wrap; gap: 6px; }
  .cm-social a { width: 40px; height: 40px; flex: 0 0 auto; }

  /* Sidebar contacts list */
  .cm-list-clean a { font-size: 13.5px; padding: 4px 0; }

  /* Chips slightly smaller */
  .cm-chip { font-size: 11.5px; padding: 3px 8px; }
  /* Hospitality emoji chips: keep emoji-readable, prevent wrap mid-chip */
  .cm-result-card__badges .cm-chip { white-space: nowrap; }

  /* Filter chips/options: touch target */
  .cm-filters__opt { padding: 8px 0; font-size: 14px; min-height: 36px; line-height: 1.3; }

  /* Top-companies: even tighter on phone */
  .cm-rubric-top__name { font-size: 12.5px; }
  .cm-rubric-top__sub { font-size: 10.5px; }

  /* Related news & similar */
  .cm-related-news { grid-template-columns: 1fr 1fr; }
  .cm-similar { grid-template-columns: 1fr 1fr; }

  /* Meta strip wrap */
  .cm-meta-strip { gap: 8px 12px; font-size: 11.5px; }

  /* Pager */
  .cm-pager { margin-top: 20px; }

  /* Locations addr smaller */
  .cm-location__title { font-size: 14px; }
  .cm-location__addr { font-size: 12.5px; }

  /* Buttons */
  .cm-btn { padding: 11px 14px; font-size: 14.5px; min-height: 44px; }
  .cm-btn--ghost { min-height: 44px; }
}

/* ─── Tiny phones (≤380px, e.g. iPhone SE) ───────────── */
@media (max-width: 380px) {
  .cm-shell,
  .cm-list-shell { padding: 0 10px; }
  .cm-hero__title { font-size: 20px; }
  .cm-hero__logo { width: 72px; height: 72px; }
  .cm-stats { grid-template-columns: 1fr; }
  .cm-stat { border-right: none; border-bottom: 1px solid var(--cm-line-soft); }
  .cm-stat:last-child { border-bottom: none; }
  .cm-xlinks a { min-width: 0; flex: 1 1 30%; }
}

/* ─── Touch / no-hover devices ─────────────────────────── */
@media (hover: none) {
  .cm-result-card:hover { transform: none; box-shadow: none; }
  .cm-offering:hover { box-shadow: none; }
  .cm-rubric-card:hover { box-shadow: none; }
}
