/* Velorin Tech — Store (B2C) Theme
 * Phase 8 — themes tablosu CSS variable'ları (--color-*) ile derive edilir.
 * /api/theme/active.css :root'a --color-* set eder; aşağıdaki --st-* fallback'leri
 * tema yüklenmeden önce de çalışır (default Velorin renkleri). */

:root {
  --st-bg:           var(--color-bg-2,   #fafafb);
  --st-surface:      var(--color-bg,     #ffffff);
  --st-border:       var(--color-border, #e6e8ee);
  --st-text:         var(--color-text,   #1a1c25);
  --st-text-2:       var(--color-text-2, #5b6072);
  --st-text-3:       var(--color-text-3, #9aa0b3);
  --st-primary:      var(--color-primary, #6366f1);
  --st-primary-hover: var(--color-primary-2, #4f52d4);
  --st-accent:       var(--color-accent,  #ec4899);
  --st-success:      var(--color-success, #10b981);
  --st-danger:       var(--color-danger,  #ef4444);
  --st-shadow-sm:    var(--shadow-sm, 0 1px 2px rgba(15,18,27,0.04));
  --st-shadow:       var(--shadow-md, 0 4px 14px rgba(15,18,27,0.06));
  --st-radius:       var(--radius-lg, 14px);
  --st-radius-sm:    var(--radius,    8px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --st-bg: #0a0c14;
    --st-surface: #11141f;
    --st-border: rgba(255,255,255,0.08);
    --st-text: #e8eaf0;
    --st-text-2: #a8acc0;
    --st-text-3: #6b7080;
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--st-text);
  background: var(--st-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--st-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Header ──────────────────────────── */
.st-header {
  background: var(--st-surface);
  border-bottom: 1px solid var(--st-border);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
}
.st-header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
}
.st-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--st-text);
}
.st-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--st-primary), var(--st-accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}
.st-search {
  flex: 1; max-width: 600px;
  position: relative;
}
.st-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--st-border);
  border-radius: 999px;
  background: var(--st-bg);
  color: var(--st-text);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.st-search input:focus { border-color: var(--st-primary); }
.st-search::before {
  content: '🔍';
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: 0.5;
}
.st-header-actions { display: flex; align-items: center; gap: 14px; }
.st-icon-btn {
  position: relative;
  background: transparent; border: 0;
  color: var(--st-text-2);
  padding: 8px; border-radius: 8px;
  cursor: pointer;
  font-family: inherit; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.st-icon-btn:hover { background: var(--st-bg); color: var(--st-text); }
.st-cart-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--st-accent);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px; text-align: center;
  line-height: 1.2;
}

/* ── Categories nav ─────────────────── */
.st-cats-bar {
  background: var(--st-surface);
  border-bottom: 1px solid var(--st-border);
  padding: 8px 0;
  overflow-x: auto;
}
.st-cats-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  display: flex; gap: 6px;
  flex-wrap: nowrap;
}
.st-cat-link {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--st-text-2);
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
}
.st-cat-link:hover {
  background: var(--st-bg);
  color: var(--st-text);
  text-decoration: none;
}
.st-cat-link.st-active {
  background: var(--st-primary);
  color: white;
}

/* ── Container ───────────────────────── */
.st-container {
  max-width: 1280px; margin: 0 auto;
  padding: 28px 24px;
}
.st-grid-2 { display: grid; grid-template-columns: 280px 1fr; gap: 28px; }
@media (max-width: 900px) { .st-grid-2 { grid-template-columns: 1fr; } }

/* ── Hero / Banners ─────────────────── */
.st-hero {
  background: linear-gradient(135deg, var(--st-primary) 0%, var(--st-accent) 100%);
  color: white;
  border-radius: var(--st-radius);
  padding: 48px 32px;
  margin-bottom: 28px;
  text-align: center;
}
.st-hero h1 { font-size: 32px; margin: 0 0 10px; font-weight: 700; }
.st-hero p { font-size: 16px; margin: 0; opacity: 0.9; }

/* ── Section ─────────────────────────── */
.st-section { margin-bottom: 36px; }
.st-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.st-section-head h2 { font-size: 20px; margin: 0; font-weight: 700; }
.st-section-head a { font-size: 13px; color: var(--st-text-2); }

/* ── Product Card ───────────────────── */
.st-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.st-product-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex; flex-direction: column;
}
.st-product-card:hover {
  border-color: var(--st-primary);
  box-shadow: var(--st-shadow);
  transform: translateY(-2px);
}
.st-product-img {
  aspect-ratio: 1;
  background: var(--st-bg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.st-product-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.st-product-img-placeholder {
  font-size: 60px; opacity: 0.3;
}
.st-product-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--st-accent);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 4px 8px; border-radius: 999px;
}
.st-product-info {
  padding: 14px;
  flex: 1;
  display: flex; flex-direction: column;
  gap: 6px;
}
.st-product-brand {
  font-size: 11px; color: var(--st-text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.st-product-name {
  font-size: 14px; font-weight: 600;
  color: var(--st-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.st-product-price-row {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.st-product-price {
  font-size: 16px; font-weight: 700;
  color: var(--st-text);
}
.st-product-price-old {
  font-size: 12px;
  color: var(--st-text-3);
  text-decoration: line-through;
}

/* ── Sidebar (Filtre) ───────────────── */
.st-sidebar {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 20px;
  align-self: start;
  position: sticky; top: 80px;
}
.st-filter-group { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--st-border); }
.st-filter-group:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.st-filter-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--st-text-3); margin: 0 0 10px; font-weight: 600; }
.st-filter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-filter-list a {
  display: block;
  font-size: 13px;
  color: var(--st-text-2);
  padding: 4px 0;
}
.st-filter-list a:hover { color: var(--st-primary); }
.st-filter-list a.st-active { color: var(--st-primary); font-weight: 600; }

/* ── Buttons ─────────────────────────── */
.st-btn {
  background: var(--st-primary); color: white; border: 0;
  padding: 10px 18px; border-radius: var(--st-radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.st-btn:hover { background: var(--st-primary-hover); text-decoration: none; color: white; }
.st-btn-secondary { background: transparent; color: var(--st-primary); border: 1px solid var(--st-primary); }
.st-btn-secondary:hover { background: var(--st-primary); color: white; }
.st-btn-ghost { background: transparent; color: var(--st-text-2); border: 1px solid var(--st-border); }
.st-btn-ghost:hover { background: var(--st-bg); color: var(--st-text); }
.st-btn-block { width: 100%; justify-content: center; }
.st-btn-lg { padding: 14px 24px; font-size: 16px; }

/* ── Footer ─────────────────────────── */
.st-footer {
  background: var(--st-surface);
  border-top: 1px solid var(--st-border);
  padding: 32px 0;
  margin-top: 60px;
  font-size: 13px; color: var(--st-text-2);
}
.st-footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px;
}
.st-footer-col h4 { font-size: 13px; color: var(--st-text); margin: 0 0 12px; }
.st-footer-col a { display: block; padding: 4px 0; color: var(--st-text-2); font-size: 13px; }
.st-footer-bottom {
  max-width: 1280px; margin: 0 auto; padding: 20px 24px 0;
  border-top: 1px solid var(--st-border);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--st-text-3);
}

/* ── Toolbar (kategori sayfası) ────── */
.st-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.st-toolbar-info { font-size: 13px; color: var(--st-text-2); }
.st-sort-select {
  padding: 8px 12px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  font-family: inherit; font-size: 13px;
}

/* ── Empty / Loading ────────────────── */
.st-empty {
  text-align: center; padding: 60px 30px;
  color: var(--st-text-3);
}
.st-empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.st-loading { text-align: center; padding: 30px; color: var(--st-text-3); }

/* ── Breadcrumb ─────────────────────── */
.st-breadcrumb {
  font-size: 12px; color: var(--st-text-3);
  margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.st-breadcrumb a { color: var(--st-text-3); }
.st-breadcrumb a:hover { color: var(--st-text-2); }

/* ── Product detail ─────────────────── */
.st-product-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
}
@media (max-width: 800px) { .st-product-detail { grid-template-columns: 1fr; } }
.st-pd-gallery {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.st-pd-main-img {
  aspect-ratio: 1;
  background: var(--st-bg);
  border-radius: var(--st-radius-sm);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.st-pd-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.st-pd-thumb {
  width: 72px; height: 72px;
  background: var(--st-bg);
  border: 2px solid var(--st-border);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
}
.st-pd-thumb.active { border-color: var(--st-primary); }
.st-pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-pd-info h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.st-pd-brand { color: var(--st-text-3); font-size: 13px; }
.st-pd-price { font-size: 32px; font-weight: 700; color: var(--st-text); margin: 18px 0 4px; }
.st-pd-price-old { font-size: 16px; color: var(--st-text-3); text-decoration: line-through; }
.st-pd-kdv { font-size: 12px; color: var(--st-text-3); margin-bottom: 18px; }
.st-pd-actions { display: flex; gap: 10px; margin: 24px 0; }
.st-qty-row { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.st-qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  overflow: hidden;
}
.st-qty button {
  background: transparent; border: 0;
  padding: 8px 14px;
  font-size: 16px; cursor: pointer;
  color: var(--st-text-2);
}
.st-qty input {
  border: 0; outline: 0; text-align: center;
  width: 50px;
  font-family: inherit;
  font-size: 14px;
  background: transparent;
  color: var(--st-text);
}
.st-pd-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--st-border);
  margin: 28px 0 18px;
}
.st-pd-tab {
  padding: 10px 16px;
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--st-text-2);
  font-family: inherit; font-size: 13px;
  cursor: pointer;
}
.st-pd-tab.active { color: var(--st-primary); border-bottom-color: var(--st-primary); font-weight: 600; }
.st-pd-attrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.st-pd-attr-row {
  display: flex; justify-content: space-between;
  padding: 10px 14px;
  background: var(--st-bg);
  border-radius: var(--st-radius-sm);
  font-size: 13px;
}
.st-pd-attr-label { color: var(--st-text-3); }

/* ── Cart ───────────────────────────── */
.st-cart-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
@media (max-width: 900px) { .st-cart-grid { grid-template-columns: 1fr; } }
.st-cart-item {
  display: flex; gap: 14px; padding: 16px;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  margin-bottom: 10px;
}
.st-cart-item-img {
  width: 100px; height: 100px;
  background: var(--st-bg);
  border-radius: var(--st-radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}
.st-cart-item-info { flex: 1; }
.st-cart-summary {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 24px;
  position: sticky; top: 80px;
  align-self: start;
}
.st-cart-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.st-cart-row strong { font-size: 16px; }
.st-cart-total { border-top: 1px solid var(--st-border); margin-top: 12px; padding-top: 12px; font-size: 18px; font-weight: 700; }
