/* ===================================================================
   Sistemi i dizajnit — tokenë, komponentë, layout
   Pa emoji, pa ilustrime dekorative. Hierarkia ndërtohet me hapësirë.
   =================================================================== */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ed;
  --text: #1c1b18;
  --muted: #6b6760;
  --primary: #2f4f33;
  --primary-hover: #26412a;
  --on-primary: #ffffff;
  --accent: #8a6d1f;
  --verified: #1f5d54;
  --danger: #9b2c22;
  --border: #e2ded4;
  --ring: #2f4f3355;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 27, 24, .06), 0 4px 14px rgba(28, 27, 24, .05);
  --maxw: 1180px;
  --space: 8px;
}

:root[data-theme="dark"],
html:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14150f;
    --surface: #1c1d17;
    --surface-2: #232419;
    --text: #eceade;
    --muted: #a7a396;
    --primary: #8fb389;
    --primary-hover: #a3c49c;
    --on-primary: #10150f;
    --accent: #d8b85f;
    --verified: #79c3b3;
    --danger: #e4796c;
    --border: #32332a;
    --ring: #8fb38955;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14150f;
  --surface: #1c1d17;
  --surface-2: #232419;
  --text: #eceade;
  --muted: #a7a396;
  --primary: #8fb389;
  --primary-hover: #a3c49c;
  --on-primary: #10150f;
  --accent: #d8b85f;
  --verified: #79c3b3;
  --danger: #e4796c;
  --border: #32332a;
  --ring: #8fb38955;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(22px, 4vw, 30px); }
h2 { font-size: clamp(19px, 3vw, 23px); }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: 13.5px; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; vertical-align: -3px; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 10px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* ------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.head-row { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.head-search { flex: 1; display: flex; gap: 6px; max-width: 460px; }
.head-search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.head-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link { padding: 8px 10px; border-radius: var(--radius-sm); font-size: 15px; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 860px) {
  .head-nav .nav-link, .head-nav .btn-primary span { display: none; }
  .head-search { max-width: none; }
  .brand { font-size: 16px; }
}

/* ------------------------------------------------------------ butonat */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-icon { min-width: 44px; padding: 0 10px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------ format */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-size: 14.5px; font-weight: 550; margin-bottom: 6px; }
.field .hint { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number],
input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
textarea { min-height: 130px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .row, .row-3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }

/* ------------------------------------------------------------- karta */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.card-tight { padding: 14px; }
.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { font-size: 14.5px; color: var(--muted); }

/* --------------------------------------------------------- njoftimet */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.lcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s;
}
.lcard:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.lcard a:hover { text-decoration: none; }
.lcard-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: block; }
.lcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lcard-noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13.5px; }
.lcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lcard-title { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.lcard-price { font-size: 19px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.lcard-meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 100px; border: 1px solid var(--border); color: var(--muted);
  background: var(--surface-2);
}
.badge-featured { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.badge-verified { color: var(--verified); border-color: color-mix(in srgb, var(--verified) 40%, var(--border)); }
.badge-trader { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.badge-status { text-transform: none; }

/* ------------------------------------------------------- gjendje bosh */
.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; color: var(--muted); background: var(--surface);
}
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ------------------------------------------------------------ alerte */
.alert {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 16px 0; background: var(--surface); font-size: 15px;
}
.alert-success { border-left-color: var(--primary); }
.alert-error { border-left-color: var(--danger); }
.alert-info { border-left-color: var(--accent); }

/* ------------------------------------------------------------ tabela */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- misc */
.stack > * + * { margin-top: 14px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.price-big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { font-size: 13.5px; color: var(--muted); padding: 5px 11px; border-radius: 100px; border: 1px solid var(--border); }
.step-on { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.step-done { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }

.gallery { display: grid; gap: 10px; }
.gallery-main img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs img { width: 92px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.on { border-color: var(--primary); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.sticky-side { position: sticky; top: 78px; }

.search-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .search-layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 78px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); border-radius: 100px; padding: 7px 13px; font-size: 14.5px;
  background: var(--surface); color: var(--text); display: inline-flex; gap: 6px; align-items: center;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.msg-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.msg-mine { margin-left: auto; background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.msg time { display: block; font-size: 12px; opacity: .75; margin-top: 4px; }

.fee-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.fee-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.fee-total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 18px; }

.thumbs-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.thumb-edit { position: relative; }
.thumb-edit img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); }
.thumb-edit form { position: absolute; top: 6px; right: 6px; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 24px 0; }
.pagination a, .pagination span { padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14.5px; }
.pagination .on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* --------------------------------------------------- tabbar (mobile) */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 0 7px; font-size: 11.5px; color: var(--muted);
  }
  .tabbar a:hover { text-decoration: none; }
  .tab-main { color: var(--primary); font-weight: 600; }
  body { padding-bottom: 68px; }
  .sticky-side, .filters { position: static; }
}

/* ------------------------------------------------------------ footer */
.site-foot { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 20px; background: var(--surface); }
.foot-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.foot-grid a { display: block; font-size: 14.5px; color: var(--muted); padding: 3px 0; }
.foot-h { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.foot-brand { font-weight: 700; }
.foot-bottom { padding-top: 18px; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
