/* Mağaza seçici (üst bar) ve Ayarlar > Mağazalarım. ui.css'ten sonra yüklenir; renkler ui.css değişkenleri. */

/* ---------- Üst bar: seçici ---------- */
.sk-store { position: relative; min-width: 0; }
.sk-store-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--sk-line);
  background: var(--sk-surface-2);
  color: var(--sk-fg);
  border-radius: 12px;
  font: 700 14px/1.2 var(--sk-font);
  cursor: pointer;
}
.sk-store-btn:hover, .sk-store-btn[aria-expanded="true"] { border-color: var(--sk-accent); }
.sk-store-btn.is-empty { padding: 7px 12px; color: var(--sk-accent); border-style: dashed; }
.sk-store-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--sk-surface);
  border: 1px solid var(--sk-line);
}
.sk-store-logo.is-initial, .st-logo.is-initial {
  display: grid;
  place-items: center;
  background: var(--sk-accent-soft);
  color: var(--sk-accent);
  font-weight: 800;
  border: 0;
}
.sk-store-logo.is-initial { font-size: 14px; }
.sk-store-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sk-store-caret { color: var(--sk-muted); font-size: 12px; }

.sk-store-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 290px;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--sk-surface);
  border: 1px solid var(--sk-line);
  border-radius: 14px;
  box-shadow: var(--sk-shadow), 0 16px 40px #0000001f;
  padding: 6px;
}
.sk-store-menu-t {
  padding: 8px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sk-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sk-store-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--sk-fg);
  font: 500 14px/1.3 var(--sk-font);
}
.sk-store-item:hover, .sk-store-item:focus-visible { background: var(--sk-surface-2); }
.sk-store-item[aria-checked="true"] { background: var(--sk-accent-soft); }
.sk-store-item-text { display: grid; min-width: 0; flex: 1; }
.sk-store-item-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sk-store-item-text small { color: var(--sk-muted); font-size: 12px; }
.sk-store-check { color: var(--sk-accent); font-weight: 800; width: 16px; text-align: center; }
.sk-store-item.is-add { color: var(--sk-accent); font-weight: 700; }
.sk-store-menu hr { border: 0; border-top: 1px solid var(--sk-line); margin: 6px 4px; }

@media (max-width: 560px) {
  /* Telefon: 1. satır logo + tema + kullanıcı, 2. satır mağaza seçici (tam genişlik, ad okunsun), 3. satır menü */
  .sk-store { order: 3; flex: 1 1 100%; }
  .sk-store-btn { width: 100%; max-width: none; padding-right: 12px; }
  .sk-store-caret { margin-left: auto; }
  .sk-header .nav-tabs.sk-nav { order: 5; }
  .sk-store-menu { left: 0; right: 0; max-width: none; min-width: 0; }
}

/* ---------- Ayarlar > Mağazalarım ---------- */
.st-panel { margin: 4px 0 20px; display: grid; gap: 10px; }
.st-head h3 { margin: 0; font-size: 17px; color: var(--sk-fg); }
.st-row {
  border: 1px solid var(--sk-line);
  border-radius: var(--sk-r);
  background: var(--sk-surface);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}
.st-row.is-selected { border-color: var(--sk-accent); box-shadow: 0 0 0 3px var(--sk-accent-soft); }
.st-row-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; border: 1px solid var(--sk-line); }
.st-logo.is-initial { font-size: 18px; }
.st-row-info { flex: 1 1 220px; min-width: 0; display: grid; gap: 2px; }
.st-row-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--sk-fg); }
.st-badge { background: var(--sk-accent-soft); color: var(--sk-accent); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.st-row-meta { color: var(--sk-muted); font-size: 13px; }
.st-row-hint { color: var(--sk-muted); font-size: 12px; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-panel .st-actions .btn-secondary,
.st-panel .st-actions .btn-primary,
.st-panel .st-add { padding: 8px 12px; font-size: 14px; border-radius: 10px; width: auto; }
.st-panel .st-actions .is-quiet { color: var(--sk-muted); }
.st-add { justify-self: start; }
.st-copy {
  background: var(--sk-warn-soft);
  color: var(--sk-fg);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.st-form {
  border: 1px dashed var(--sk-line);
  border-radius: var(--sk-r);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  background: var(--sk-surface-2);
}
.st-form-hint { margin: 0; color: var(--sk-muted); font-size: 13px; }
.st-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-form .form-group { margin: 0; }
.st-form input[readonly] { opacity: .7; }
.st-msg { font-size: 13px; color: var(--sk-muted); }
.st-msg:empty { display: none; }
.st-msg.is-bad, .st-copy .is-bad { color: var(--sk-bad); }
.st-hidden { font-size: 13px; color: var(--sk-muted); background: var(--sk-surface-2); border-radius: 10px; padding: 10px 12px; }
.st-hidden p { margin: 0; }
.st-hidden p + p { margin-top: 4px; }
.st-empty { margin: 0; color: var(--sk-muted); }
/* Pazaryeri: mağaza satırındaki etiket ve yeni mağaza formundaki seçim */
.st-market-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--sk-line); color: var(--sk-muted); }
.st-market-tag.is-trendyol { color: #f27a1a; border-color: rgba(242, 122, 26, .45); }
.st-market-tag.is-hepsiburada { color: #ff6000; border-color: rgba(255, 96, 0, .45); }
.st-market { display: flex; gap: 8px; flex-wrap: wrap; }
.st-market-opt {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--sk-line); border-radius: 10px; padding: 6px 12px;
  background: var(--sk-surface); color: var(--sk-fg); font-size: 14px; font-weight: 600;
}
.st-market-opt:has(input:checked) { border-color: var(--sk-accent); box-shadow: 0 0 0 3px var(--sk-accent-soft); }
.st-form-fields { display: grid; gap: 10px; }

/* Artık kullanılmayan eski bölüm (ör. Ayarlar'daki "Hepsiburada API · Yakında" kutusu) */
.sk-retired { display: none !important; }

/* Hepsiburada mağazası seçiliyken yalnızca Trendyol'a ait bölümler gizlenir; Hepsiburada notu görünür (js/magaza.js) */
html[data-sk-market="hepsiburada"] .sk-only-trendyol { display: none !important; }
.sk-only-hepsiburada { display: none; }
html[data-sk-market="hepsiburada"] .sk-only-hepsiburada { display: block; }

@media (max-width: 720px) {
  .st-form-grid { grid-template-columns: minmax(0, 1fr); }
  .st-row .st-actions { width: 100%; }
}

@media (max-width: 360px) {
  /* Çok dar telefon: 1. satırda logo, tema ve kullanıcı sığsın */
  .sk-brand span { display: none; }
}

/* ---------- Mağaza geçiş perdesi ---------- */
/* Yeni sayfa boyanmadan önce: index.html'deki satır içi betik html'e data-sk-switch koyar, magaza.js yerine
   ilerleme çubuklu perdeyi kurar. Böylece eski mağazanın ekranı ya da Hesapla sekmesi bir an bile görünmez. */
html[data-sk-switch]::before {
  content: attr(data-sk-switch);
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--sk-bg, #f7f4f1);
  color: var(--sk-fg, #231c16);
  font: 600 16px/1.4 var(--sk-font, system-ui, sans-serif);
}
.sk-veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--sk-bg);
  color: var(--sk-fg);
  transition: opacity .25s ease;
}
.sk-veil.is-out { opacity: 0; pointer-events: none; }
.sk-veil-card { display: grid; justify-items: center; gap: 8px; width: min(360px, calc(100vw - 48px)); text-align: center; }
.sk-veil-logo { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; border: 1px solid var(--sk-line); margin-bottom: 6px; }
.sk-veil-logo.is-initial { display: grid; place-items: center; background: var(--sk-accent-soft); color: var(--sk-accent); font: 800 22px var(--sk-font); border: 0; }
.sk-veil-t { font-size: 15px; font-weight: 700; color: var(--sk-muted); }
.sk-veil-name { font-size: 20px; font-weight: 800; }
.sk-veil-track { width: 100%; height: 8px; margin-top: 10px; border-radius: 999px; background: var(--sk-surface-2); border: 1px solid var(--sk-line); overflow: hidden; }
.sk-veil-bar { height: 100%; width: 0; border-radius: 999px; background: var(--sk-accent); transition: width .12s linear; }
.sk-veil-hint { font-size: 13px; color: var(--sk-muted); }

/* Başka sekmede mağaza değiştirildi notu */
.sk-store-note {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: min(640px, calc(100vw - 32px));
  padding: 10px 12px;
  background: var(--sk-surface);
  color: var(--sk-fg);
  border: 1px solid var(--sk-accent);
  border-radius: 12px;
  box-shadow: var(--sk-shadow), 0 16px 40px #0000001f;
  font: 500 14px/1.4 var(--sk-font);
}
.sk-store-note-btn { border: 0; background: var(--sk-accent); color: var(--sk-on-accent); font: 700 13px var(--sk-font); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.sk-store-note-x { border: 0; background: none; color: var(--sk-muted); font-size: 16px; cursor: pointer; padding: 2px 6px; }

/* API bilgisi kabul edilmeyen mağaza (js/magazaUyari.js üst uyarı; js/magaza.js satır notu) */
.sk-api-uyari {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: -6px auto 16px;
  max-width: var(--sk-max);
  width: calc(100% - 32px);
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--sk-bad);
  background: var(--sk-bad-soft);
  color: var(--sk-fg);
  font-size: 14px;
}
.sk-api-uyari[hidden] { display: none; }
.sk-api-uyari .btn-secondary { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.st-row-alert { margin-top: 6px; font-size: 13px; color: var(--sk-bad); }
