/* =====================================================================
   XTech Elektrik — Sade & minimal beyaz tema
   ===================================================================== */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f7f8fa;
  --line:      #e8eaed;
  --text:      #111827;
  --muted:     #6b7280;
  --accent:    #2563eb;
  --accent-d:  #1d4ed8;
  --ok:        #059669;
  --danger:    #dc2626;
  --radius:    12px;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --max:       1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---- Butonlar ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: #cbd5e1; background: var(--bg-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
.main-nav { display: flex; gap: 22px; margin-left: 8px; }
.main-nav a { color: var(--muted); font-weight: 500; font-size: 14.5px; }
.main-nav a:hover { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; color: var(--text);
}
.icon-btn:hover { background: var(--bg-soft); }
.cart-badge {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.menu-toggle { display: none; }

/* ---- Hero ---- */
.hero { padding: 72px 0 56px; text-align: center; }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto 28px; }
.hero .btn { margin: 0 6px; }

/* ---- Bölüm başlığı ---- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head a { color: var(--accent); font-weight: 600; font-size: 14px; }

/* ---- Ürün grid ---- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 1/1; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card .name { font-weight: 600; font-size: 14.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card .price { font-weight: 800; font-size: 17px; margin-top: auto; }
.card .body .btn { margin-top: 8px; }

/* ---- Kategori çipleri ---- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); background: #fff; }
.chip:hover { border-color: #cbd5e1; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Ürün detay ---- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 0; }
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; gap: 24px; } }
.product-detail .gallery { aspect-ratio: 1/1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.product-detail .gallery img { width: 100%; height: 100%; object-fit: cover; }
.product-detail .price-lg { font-size: 30px; font-weight: 800; margin: 12px 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 40px; height: 44px; border: 0; background: #fff; font-size: 18px; cursor: pointer; color: var(--text); }
.qty input { width: 52px; height: 44px; border: 0; text-align: center; font-size: 15px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.in { background: #ecfdf5; color: var(--ok); }
.badge.out { background: #fef2f2; color: var(--danger); }

/* ---- Tablolar / sepet ---- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; padding: 32px 0; }
@media (max-width: 820px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-row { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-row .ci-img { width: 72px; height: 72px; border-radius: 10px; background: var(--bg-soft); object-fit: cover; flex: none; }
.cart-row .ci-main { flex: 1; }
.summary { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 88px; }
.summary .line { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); }
.summary .total { display: flex; justify-content: space-between; padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--line); font-size: 19px; font-weight: 800; color: var(--text); }

/* ---- Formlar / kutu ---- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.auth-wrap { max-width: 420px; margin: 48px auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px){ .form-row { grid-template-columns: 1fr; } }

/* ---- Flash / uyarılar ---- */
.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14.5px; }
.flash.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash.info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- Boş durum ---- */
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 48px 0 32px; }
@media (max-width: 720px){ .footer-inner { grid-template-columns: 1fr; gap: 24px; } }
.site-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 12px; }
.site-footer a { color: var(--text); display: block; padding: 3px 0; font-size: 14.5px; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- Mobil menü ---- */
@media (max-width: 760px) {
  .main-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff;
    flex-direction: column; gap: 0; padding: 8px 20px 16px; border-bottom: 1px solid var(--line); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: inline-flex; }
}
