/* ═══════════════════════════════════════════════════════════════════════
   Cildim vitrini — ortaq stil

   ⭐ MƏQSƏD: «bu, sayt kimi işlədilən tətbiq deyil, saytdır».
     Ona görə tərtibat qəsdən VEB qaydalarına tabedir:
       · yuxarı sticky naviqasiya (tətbiqdəki alt bar deyil)
       · geniş məzmun sahəsi (1200 px), 4–5 sütunlu grid
       · hover halları, adi keçidlər, seçilə bilən mətn
       · səhifənin altında tam footer

   ⚠ Brend TƏTBİQLƏ EYNİDİR (`lib/theme/app_colors.dart`):
       #D5869D çəhrayı · #241514 mətn · #F9E5E4 fon
     Fərq rəngdə yox, QURULUŞDADIR.

   ⛔ XARİCİ ASILILIQ YOXDUR — nə CDN, nə veb şrifti. Səhifə ani açılır və
     CSP `default-src 'none'` sərt qala bilir.
     ⚠ `Lora` cihazda varsa işlədilir (tətbiqin şrifti), yoxdursa Georgia —
       hər ikisi isti serifdir, brend hissi qorunur.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --pink:        #D5869D;
  --pink-dark:   #B96C83;
  --pink-soft:   #F9E5E4;
  --pink-fill:   #FAD0D2;
  --ink:         #241514;
  --ink-soft:    #7A6664;
  --accent:      #7B3D4A;
  --surface:     #FFFFFF;
  --line:        #EADFDE;
  --sale:        #C0392B;
  --radius:      14px;
  --maxw:        1200px;
  --shadow:      0 1px 2px rgba(36, 21, 20, .06), 0 8px 24px rgba(36, 21, 20, .05);

  --serif: Lora, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--pink-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ───────────────────────── Başlıq ───────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.logo {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent);
  white-space: nowrap;
}
.logo span { color: var(--pink); }

.search {
  flex: 1;
  display: flex;
  max-width: 520px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--pink); }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 11px 18px;
  font: inherit;
  background: transparent;
}
.search button {
  border: 0;
  background: var(--pink);
  color: #fff;
  padding: 0 22px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.search button:hover { background: var(--pink-dark); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-link {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background .15s;
}
.nav-link:hover { background: var(--pink-soft); }
.nav-link.primary { background: var(--ink); color: #fff; }
.nav-link.primary:hover { background: #3a2523; }

/* Kateqoriya zolağı — üfüqi, sürüşən */
.catbar { border-bottom: 1px solid var(--line); background: #fff; }
.catbar-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}
.catbar-row a {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: all .15s;
}
.catbar-row a:hover { background: var(--pink-soft); color: var(--ink); }
.catbar-row a.active { background: var(--pink); color: #fff; }

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

.hero {
  padding: 56px 0 44px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.2;
  margin: 0 0 14px;
}
.hero p {
  max-width: 620px;
  margin: 0 auto 26px;
  color: var(--ink-soft);
  font-size: 17px;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hero-points span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14.5px;
}

/* ───────────────────────── Bölmələr ───────────────────────── */

section { margin-bottom: 52px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 25px;
  margin: 0;
}
.section-head a { color: var(--accent); font-weight: 600; font-size: 15px; }
.section-head a:hover { text-decoration: underline; }

/* ───────────────────────── Məhsul gridi ─────────────────────────
   ⚠ `minmax(196px, 1fr)` — geniş ekranda 5, noutbukda 4, planşetdə 3,
     telefonda 2 sütun. Tətbiqdə həmişə 2-dir; fərq məhz buradan görünür.
   ──────────────────────────────────────────────────────────────── */

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--pink);
}

.card-img {
  position: relative;
  aspect-ratio: 1 / 1;   /* ⚠ şəkillər 1:1 kəsilir (product_image.dart) */
  background: var(--pink-soft);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-soft); font-size: 13px;
}

.badge-sale {
  position: absolute; top: 10px; left: 10px;
  background: var(--sale); color: #fff;
  border-radius: 8px; padding: 3px 9px;
  font-size: 13px; font-weight: 700;
}

.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-brand { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.card-title {
  font-size: 15px; font-weight: 600; margin: 0; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-rating { font-size: 13.5px; color: #B8860B; }
.card-rating .muted { color: var(--ink-soft); }
.card-price { margin-top: auto; padding-top: 6px; display: flex; align-items: baseline; gap: 8px; }
.price-now { font-size: 17px; font-weight: 700; }
.price-old { font-size: 14px; color: var(--ink-soft); text-decoration: line-through; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 0;
}

/* Yüklənmə skeleti — boş ekran əvəzinə forma göstərilir */
.skeleton { pointer-events: none; }
.skeleton .card-img,
.skeleton .card-body span {
  background: linear-gradient(90deg, #f3eceb 25%, #fbf6f5 50%, #f3eceb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.skeleton .card-body span { display: block; height: 12px; border-radius: 4px; }
.skeleton .card-body span:first-child { width: 70%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ───────────────────────── Məhsul detalı ───────────────────────── */

.crumbs { font-size: 14px; color: var(--ink-soft); padding: 22px 0 18px; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin: 0 7px; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; gap: 24px; } }

.detail-img {
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }

.detail h1 { font-family: var(--serif); font-size: 30px; margin: 6px 0 10px; line-height: 1.25; }
.detail .brand { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.detail .store { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 16px; }
.detail .store strong { color: var(--ink); }

.price-block { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 6px; }
.price-block .price-now { font-size: 30px; }

.btn-primary, .btn-ghost {
  display: inline-block; border: 0; border-radius: 999px;
  padding: 13px 26px; font: inherit; font-weight: 600; cursor: pointer;
  text-align: center; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #3a2523; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

.detail-actions { display: flex; gap: 10px; margin: 22px 0; flex-wrap: wrap; }

.spec { border-top: 1px solid var(--line); padding: 14px 0; display: flex; gap: 16px; font-size: 15px; }
.spec dt { color: var(--ink-soft); min-width: 150px; }
.spec dd { margin: 0; }

/* ⛔ Etiket bloku — məlumat SERVERDƏN gəlmir, bu yalnız izahdır */
.locked {
  background: #fff;
  border: 1.5px dashed var(--pink);
  border-radius: var(--radius);
  padding: 22px;
  margin: 26px 0;
  text-align: center;
}
.locked h3 { font-family: var(--serif); margin: 0 0 8px; font-size: 19px; }
.locked p { color: var(--ink-soft); margin: 0 0 16px; font-size: 15px; }

/* ───────────────────────── Etiket çipləri ───────────────────────── */

.chip {
  display: inline-block;
  background: var(--pink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  margin: 0 6px 6px 0;
  font-size: 14px;
}
/* ⚠ Alıcının öz allergeni — mütləq seçilməlidir */
.chip-danger { background: #FDECEA; border-color: #E8A9A2; color: #A02A1C; font-weight: 600; }
.chip-ok     { background: #EAF6EF; border-color: #A9D7BC; color: #1D6B42; }

.warn-box {
  background: #FDECEA;
  border: 1.5px solid #E8A9A2;
  color: #A02A1C;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0 0;
  font-size: 15.5px;
}

/* ───────────────────────── Formalar ───────────────────────── */

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  max-width: 520px;
  margin: 32px auto 60px;
  box-shadow: var(--shadow);
}
.form-card h1 { font-family: var(--serif); font-size: 27px; margin: 0 0 6px; }
.form-card .lead { color: var(--ink-soft); margin: 0 0 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  outline: 0;
}
.field input:focus, .field select:focus { border-color: var(--pink); }
.field .hint { font-size: 13px; color: var(--ink-soft); margin-top: 5px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 14.5px; font-weight: 400;
  cursor: pointer; margin: 0; background: #fff;
}
.checks label:hover { border-color: var(--pink); }
.checks input { accent-color: var(--pink); }

.consent { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: 14.5px; }
.consent input { margin-top: 3px; accent-color: var(--pink); }
.consent a { color: var(--accent); text-decoration: underline; }

.form-error {
  background: #FDECEA; border: 1px solid #E8A9A2; color: #A02A1C;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 14.5px;
}
.form-ok {
  background: #EAF6EF; border: 1px solid #A9D7BC; color: #1D6B42;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 14.5px;
}
.btn-block { width: 100%; }
button[disabled] { opacity: .55; cursor: not-allowed; }

/* İki giriş kartı — «Alıcı kimi» / «Satıcı kimi» */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
@media (max-width: 560px) { .role-cards { grid-template-columns: 1fr; } }
.role-card {
  border: 1.5px solid var(--line); border-radius: 16px; padding: 22px;
  background: #fff; text-align: center; transition: all .15s; cursor: pointer;
}
.role-card:hover { border-color: var(--pink); transform: translateY(-2px); }
.role-card h3 { font-family: var(--serif); margin: 0 0 6px; font-size: 19px; }
.role-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ───────────────────────── Giriş pəncərəsi ───────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(36, 21, 20, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff; border-radius: 18px; padding: 30px;
  max-width: 430px; width: 100%; box-shadow: var(--shadow);
}
.modal h2 { font-family: var(--serif); margin: 0 0 10px; font-size: 23px; }
.modal p { color: var(--ink-soft); margin: 0 0 12px; }
.modal-note {
  background: var(--pink-soft); border-radius: 10px;
  padding: 12px 14px; font-size: 14.5px; color: var(--ink) !important;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ───────────────────────── Footer ───────────────────────── */

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 44px 0 28px;
  font-size: 15px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 32px;
  margin-bottom: 30px;
}
.footer-cols h4 { font-family: var(--serif); font-size: 17px; margin: 0 0 12px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 7px; color: var(--ink-soft); }
.footer-cols a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
}

@media (max-width: 640px) {
  .header-row { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 12px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .hero { padding: 36px 0 30px; }
}
