/* ============ ESIMDB_RU — Vendor page styles ============ */
/* опираемся на переменные из base.css */
:root{
  --vd-bg: var(--esim-bg);
  --vd-surface: var(--esim-surface);
  --vd-border: var(--esim-border);
  --vd-text: var(--esim-text);
  --vd-muted: var(--esim-muted);
  --vd-accent: var(--esim-accent);
  --vd-accent-2: var(--esim-accent-light);
  --vd-radius: var(--esim-radius);
  --vd-shadow: var(--esim-shadow);
}

/* корень vendor-страницы */
.esimdb-ru.esimdb-ru--vendor{
  color:var(--vd-text);
  background:transparent;
  padding-top:8px;
}

/* ---------- Header блока поставщика ---------- */
.esimdb-ru--vendor .vendor-header{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px; flex-wrap:wrap;
  background:linear-gradient(0deg,#fff,#fff),
             radial-gradient(100% 60% at 0% 100%, #eef6ff 0%, transparent 60%) no-repeat;
  border:1px solid var(--vd-border); border-radius:16px;
  padding:18px 20px; box-shadow:var(--vd-shadow);
  margin-bottom:14px;
}
.esimdb-ru--vendor .vendor-header .info{ display:flex; flex-direction:column; gap:6px; min-width:220px; }
.esimdb-ru--vendor .vendor-header h2{
  margin:0; font-size:24px; font-weight:800; letter-spacing:.01em;
  background:linear-gradient(90deg, var(--vd-accent), #60a5fa);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.esimdb-ru--vendor .vendor-header .desc{ color:var(--vd-muted); font-size:14px; line-height:1.5; max-width:560px; }

.esimdb-ru--vendor .vendor-header img{
  width:64px; height:64px; object-fit:contain; border-radius:12px;
  background:#fff; border:1px solid var(--vd-border);
  box-shadow:0 1px 0 rgba(0,0,0,.04);
}

.esimdb-ru--vendor .vendor-header .actions{
  display:flex; gap:10px; align-items:center; margin-left:auto;
}
.esimdb-ru--vendor .vendor-header .actions a{
  text-decoration:none; font-weight:700; white-space:nowrap;
  border-radius:10px; padding:10px 14px; border:1px solid transparent;
  background:var(--vd-accent); color:#fff; box-shadow:0 1px 0 rgba(0,0,0,.06);
  transition:filter .15s, transform .05s;
}
.esimdb-ru--vendor .vendor-header .actions a:hover{ filter:brightness(1.05); }
.esimdb-ru--vendor .vendor-header .actions a:active{ transform:translateY(1px); }

/* ---------- Строка выбора страны ---------- */
.esimdb-ru--vendor .country-select{
  display:flex; align-items:center; gap:8px;
  color:#475569; font-size:14px; margin:10px 0;
}
.esimdb-ru--vendor select{
  border:1px solid #d0d5dd; border-radius:10px; padding:10px 12px; background:#fff; font-size:14px;
  outline:none; transition:border-color .2s, box-shadow .2s;
}
.esimdb-ru--vendor select:focus{
  border-color:var(--vd-accent);
  box-shadow:0 0 0 3px rgba(37,99,235,.18);
}

/* ---------- Таблица ---------- */
.esimdb-ru--vendor .esimdb-ru__wrap{
  background:#fff; border:1px solid var(--vd-border); border-radius:14px; overflow:auto;
  box-shadow:var(--vd-shadow);
}
.esimdb-ru--vendor table.esimdb-ru__table{
  width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed;
  font-variant-numeric:tabular-nums;
}
.esimdb-ru--vendor th, .esimdb-ru--vendor td{
  padding:12px; border-bottom:1px solid #eef0f4; text-align:left;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14px;
}
.esimdb-ru--vendor thead th{
  position:sticky; top:0; z-index:1;
  background:#f6f8fb; color:#667085; text-transform:uppercase; letter-spacing:.02em;
  font-size:12px; font-weight:800;
}
.esimdb-ru--vendor tbody tr:nth-child(odd) td{ background:#fcfdff; }
.esimdb-ru--vendor tbody tr:hover td{ background:#f8fbff; }

/* цена/гб и цена — справа и жирнее */
.esimdb-ru--vendor .td-right{ text-align:right; }
.esimdb-ru--vendor .td-price{ font-weight:800; letter-spacing:.01em; }

/* ---------- Выделенный план ---------- */
.esimdb-ru--vendor tr.is-featured{
  background:#faf5ff;
  box-shadow:0 0 0 2px #a855f7 inset;
  position:relative;
}
.esimdb-ru--vendor tr.is-featured td:first-child{ position:relative; }
.esimdb-ru--vendor tr.is-featured td:first-child::after{
  content:"Вы выбрали этот план";
  position:absolute; top:-8px; left:0;
  font-size:11px; line-height:1; font-weight:700;
  background:#a855f7; color:#fff; border-radius:6px; padding:3px 6px;
}

/* пустые/сервисные строки */
.esimdb-ru--vendor .loading{ text-align:center; color:#98a2b3; padding:18px; }

/* ---------- Mobile карточки ---------- */
@media (max-width:900px){
  .esimdb-ru--vendor thead{ display:none; }
  .esimdb-ru--vendor table, .esimdb-ru--vendor tbody, .esimdb-ru--vendor tr, .esimdb-ru--vendor td{
    display:block; width:100%;
  }
  .esimdb-ru--vendor tbody tr{
    border-bottom:1px solid var(--vd-border);
    padding:10px 12px;
  }
  .esimdb-ru--vendor td{
    border:none; padding:6px 0;
  }
  .esimdb-ru--vendor td::before{
    content:attr(data-label);
    display:inline-block; min-width:46%; color:#667085; margin-right:8px;
  }
  .esimdb-ru--vendor .td-right{ text-align:left; }
}

/* ---------- Dark mode (авто) ---------- */
@media (prefers-color-scheme: dark){
  .esimdb-ru--vendor .vendor-header{
    background:linear-gradient(0deg,#0b1220,#0b1220),
               radial-gradient(100% 60% at 0% 100%, rgba(56,189,248,.12) 0%, transparent 60%) no-repeat;
    border-color:#1f2a44;
  }
  .esimdb-ru--vendor .vendor-header .desc{ color:#cbd5e1; }
  .esimdb-ru--vendor .esimdb-ru__wrap{ background:#0b1220; border-color:#1f2a44; }
  .esimdb-ru--vendor thead th{ background:#0f172a; color:#9fb0ca; border-bottom-color:#1f2a44; }
  .esimdb-ru--vendor tbody tr:nth-child(odd) td{ background:#0c1529; }
  .esimdb-ru--vendor tbody tr:hover td{ background:#0f1a33; }
  .esimdb-ru--vendor th, .esimdb-ru--vendor td{ border-bottom-color:#1f2a44; }
  .esimdb-ru--vendor tr.is-featured{
    background:#1c0f2b; box-shadow:0 0 0 2px #8b5cf6 inset;
  }
}

/* ==== HOTFIX: принудительно светлая тема + нормальный контраст на /vendor ==== */
.esimdb-ru--vendor { color-scheme: light; }

/* убиваем авто-dark: всё светлое даже если у системы тёмная тема */
@media (prefers-color-scheme: dark){
  .esimdb-ru--vendor .vendor-header,
  .esimdb-ru--vendor .esimdb-ru__wrap,
  .esimdb-ru--vendor thead th,
  .esimdb-ru--vendor tbody tr td {
    background: #fff !important;
    color: #0f172a !important;
  }
  .esimdb-ru--vendor th, 
  .esimdb-ru--vendor td { 
    border-bottom-color:#e5e7eb !important; 
  }
}

/* светлый аккуратный header */
.esimdb-ru--vendor .vendor-header{
  background:#ffffff !important;
  border-color:#e5e7eb !important;
  box-shadow:0 2px 6px rgba(16,24,40,.05) !important;
}

/* читаемая таблица */
.esimdb-ru--vendor thead th{
  background:#f8fafc !important;
  color:#475569 !important;
}
.esimdb-ru--vendor tbody tr td{ 
  background:#fff !important; 
}
.esimdb-ru--vendor tbody tr:hover td{ 
  background:#f8fafc !important; 
}

/* выделенный план — заметно, но без «неона» */
.esimdb-ru--vendor tr.is-featured{
  background:#faf5ff !important;
  box-shadow:0 0 0 2px #7c3aed inset !important;
}

/* === Карточки планов на странице vendor === */
.vendor-cards-wrap{
  margin-top:12px;
}
.vendor-cards{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:14px;
}
@media (max-width:1100px){ .vendor-cards{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:640px){  .vendor-cards{ grid-template-columns:1fr; } }

.vendor-card{
  display:flex; flex-direction:column; gap:12px;
  background:#fff; border:1px solid var(--esim-border);
  border-radius:14px; padding:14px; box-shadow:var(--esim-shadow);
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.vendor-card:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 18px rgba(0,0,0,.08);
  border-color:var(--esim-accent);
  background:#fbfdff;
}

/* заголовок и бейдж */
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.plan-name{ font-size:16px; font-weight:800; letter-spacing:.01em; }
.badge-featured{
  display:inline-block; font-size:11px; font-weight:700;
  background:#a855f7; color:#fff; border-radius:999px; padding:4px 8px;
}

/* мета-блок */
.card-meta{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}
@media (max-width:520px){ .card-meta{ grid-template-columns:1fr 1fr; } }
.meta-item{
  background:#f8fafc; border:1px solid var(--esim-border); border-radius:10px;
  padding:10px 12px;
}
.meta-label{ display:block; font-size:12px; color:#667085; margin-bottom:4px; }
.meta-value{ font-size:14px; font-weight:700; }

/* цена и CTA */
.card-price{
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:4px;
}
.price{ font-size:18px; font-weight:900; letter-spacing:.01em; }
.btn-buy{
  text-decoration:none; font-weight:700; white-space:nowrap;
  border-radius:10px; padding:10px 14px; border:1px solid transparent;
  background:var(--esim-accent); color:#fff; box-shadow:0 1px 0 rgba(0,0,0,.06);
  transition:filter .15s, transform .05s;
}
.btn-buy:hover{ filter:brightness(1.05); }
.btn-buy:active{ transform:translateY(1px); }

/* состояние "выбранный план" */
.vendor-card.is-featured{
  box-shadow:0 0 0 2px #7c3aed inset, var(--esim-shadow);
  background:#faf5ff;
}

/* пустые состояния */
.cards-empty{
  grid-column:1/-1; text-align:center; color:#98a2b3;
  background:#fff; border:1px dashed var(--esim-border); border-radius:12px;
  padding:24px;
}

/* принудительно светлая тема (чтобы не было «ночного» контраста) */
.esimdb-ru--vendor { color-scheme: light; }
