/* =============================================
   skelba.lt — modernus minimalistinis dizainas
   Baltas + teal accent. Mobile-first.
============================================= */

/* ===== CSS RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body {
  background: var(--bg) !important;
  color: var(--text);
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
/* Main turinio container'is — irgi paveldi temą (jei html/body cache'inti) */
main, .container {
  background: transparent;
}
[data-theme="dark"] {
  background: #0f172a;  /* fallback jei var nepasiekiamas */
}
[data-theme="dark"] body {
  background: #0f172a !important;
  color: #f1f5f9 !important;
}
img { max-width: 100%; display: block; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
button { cursor: pointer; border: none; font-family: inherit; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-mute); opacity: 1; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

/* ===== DESIGN TOKENS =====
 * --accent, --accent-dark, --accent-light, --accent-glow
 * INJEKTUOTI is header.php (siteSettings) — admin valdomos
 */
:root {
  --text: #0f172a;
  --text-mute: #64748b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}
/* Fallback jei header.php neset --accent (pvz., demo.html) */
:root {
  --accent: var(--accent, #0d9488);
  --accent-dark: var(--accent-dark, #0f766e);
  --accent-light: var(--accent-light, rgba(13,148,136,.12));
}
/* Dark mode */
[data-theme="dark"] {
  --text: #f1f5f9;
  --text-mute: #94a3b8;
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
  /* Accent fallbacks dark temai — stipresnis kontrastas
     (header.php injektuoja --accent-light kaip rgba 12% — per silpnas dark mode) */
  --accent-light: rgba(20, 184, 166, .18);
}
/* Cat card ikonos dark temoj — šviesesnė accent vietoj accent-dark */
[data-theme="dark"] .cat-card .icon,
[data-theme="dark"] .card-icon {
  background: rgba(20, 184, 166, .15);
  color: #5eead4;  /* šviesi teal — geras kontrastas ant tamsaus surface */
}
[data-theme="dark"] .cat-card:hover .icon {
  background: var(--accent);
  color: #ffffff;
}
/* Cat-pill (navigacijos chips) dark temoj */
[data-theme="dark"] .cat-pill:hover,
[data-theme="dark"] .cat-pill.active {
  background: rgba(20, 184, 166, .2);
  color: #5eead4;
}
/* Search bar fokus dark mode (kad nepalaiktu sviesos baltos) */
[data-theme="dark"] .search-bar { background: var(--bg); }
[data-theme="dark"] .search-bar:focus-within { background: var(--surface); }
[data-theme="dark"] .search-bar input { color: var(--text); }
/* Heading'ai (h1, h2, h3) — paveldi var(--text), bet patvirtinam */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5 { color: var(--text); }
/* Listing kortelės (kai bus skelbimai) */
[data-theme="dark"] .listing-card,
[data-theme="dark"] .seller-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .listing-card .price { color: #5eead4; }
/* Tag'ai (status badges) */
[data-theme="dark"] .tag-green { background: rgba(16, 185, 129, .2); color: #6ee7b7; }
[data-theme="dark"] .tag-yellow { background: rgba(245, 158, 11, .2); color: #fcd34d; }
[data-theme="dark"] .tag-red { background: rgba(239, 68, 68, .2); color: #fca5a5; }
[data-theme="dark"] .tag-blue { background: rgba(59, 130, 246, .2); color: #93c5fd; }
[data-theme="dark"] .tag-gray { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
/* Dark mode flash messages (color contrast) */
[data-theme="dark"] .flash-success { background: rgba(16, 185, 129, .15); color: #6ee7b7; border-color: rgba(16, 185, 129, .3); }
[data-theme="dark"] .flash-error { background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
[data-theme="dark"] .flash-info { background: rgba(59, 130, 246, .15); color: #93c5fd; border-color: rgba(59, 130, 246, .3); }
/* Native browser scrollbars dark mode */
[data-theme="dark"] { color-scheme: dark; }
/* SVG icons (Lucide) — paveldi currentColor, bet kai kuriuose vietose stroke hardcoded */
[data-theme="dark"] svg { color: inherit; }
/* Custom select arrow ikona dark temoj — svies arrow */
[data-theme="dark"] .form-row select,
[data-theme="dark"] select.form-input {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

/* ===== LAYOUT ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* ===== HEADER ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
}
.logo {
  font-size: 1.5rem; font-weight: 800;
  color: var(--accent); letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.logo-text {
  display: inline-flex;
  align-items: baseline;
}

/* ═════════════════ LANG SWITCHER ═════════════════ */
.lang-switcher {
  position: relative;
}
.lang-toggle-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 11px 12px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.lang-toggle-btn .lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}
.lang-toggle-btn .lang-short {
  font-weight: 700;
  font-size: .85rem;
}
.lang-menu {
  /* HIDDEN by default — kontroliuojama klase .show */
  display: none !important;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 6px;
  z-index: 9999;
}
.lang-menu.show {
  display: block !important;
  animation: langMenuFade 0.18s ease-out;
}
@keyframes langMenuFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  transition: background 0.12s;
}
.lang-menu-item:hover {
  background: var(--bg);
}
.lang-menu-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}
.lang-menu-flag {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.lang-menu-name {
  flex: 1;
}

/* Dark theme */
[data-theme="dark"] .lang-menu {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Mobile — full screen left-positioning + content visibility fix */
@media (max-width: 540px) {
  .lang-menu {
    right: -10px;
    min-width: 200px;
    /* Force background — kad nesimaišytu su CSS variable konflikto */
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
  }
  [data-theme="dark"] .lang-menu {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  /* Force VISIBLE content — kad tekstas + flagai matytusi */
  .lang-menu-item {
    color: #0f172a !important;
    background: transparent !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: rgba(16, 185, 129, 0.15);
  }
  [data-theme="dark"] .lang-menu-item {
    color: #f1f5f9 !important;
  }
  .lang-menu-item.active {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
    font-weight: 700 !important;
  }
  .lang-menu-item .lang-menu-flag {
    font-size: 1.4rem !important;
    line-height: 1 !important;
    /* iOS — kartais flag emojis nesirodo. Backup — text fallback */
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    display: inline-block !important;
    min-width: 24px;
  }
  .lang-menu-item .lang-menu-name {
    font-size: 0.95rem !important;
    color: inherit !important;
    display: inline-block !important;
  }
}
.logo::before {
  content: ''; width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 8px;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/></svg>') center/contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/></svg>') center/contain no-repeat;
}
.search-bar {
  flex: 1; display: flex; align-items: center; gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); background: var(--surface); }
.search-bar input {
  flex: 1; padding: 12px 18px; border: 0; background: transparent; outline: none;
}
.search-bar button {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  border-radius: 999px;
  margin: 4px;
  transition: background .2s;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}
.search-bar button svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.search-bar button:hover { background: var(--accent-dark); }

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

/* All button types — icon + text always in one line */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  transition: all .2s;
}
.btn-primary > svg, .btn-secondary > svg, .btn-ghost > svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.btn-primary .btn-text, .btn-secondary .btn-text, .btn-ghost .btn-text {
  display: inline-block;
  line-height: 1;
}

.btn-primary {
  background: var(--accent); color: white;
  padding: 11px 22px; border-radius: 999px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-secondary {
  background: var(--bg); color: var(--text);
  padding: 11px 22px; border-radius: 999px;
  font-weight: 500;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }

.btn-ghost { padding: 8px 14px; border-radius: 8px; color: var(--text-mute); }
.btn-ghost:hover { color: var(--text); background: var(--bg); }

/* ===== CATEGORY NAV ===== */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  display: flex; gap: 4px;
  padding: 10px 16px;
  white-space: nowrap;
}
.cat-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--text-mute);
  font-weight: 500;
  transition: all .15s;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* ===== HERO / CATEGORIES GRID ===== */
.hero {
  padding: 32px 0 24px;
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.hero p { color: var(--text-mute); margin-bottom: 28px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.cat-card .icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border-radius: 14px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 14px;
  color: var(--accent-dark);
  transition: all .2s;
  box-sizing: border-box;
  padding: 0;
}
.cat-card:hover .icon {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}
.cat-card .icon svg {
  width: 28px !important;
  height: 28px !important;
  display: block !important;
  margin: 0 !important;
  vertical-align: middle;
  flex-shrink: 0;
}
.cat-card .name {
  font-weight: 600; font-size: .95rem;
  color: var(--text);
}
.cat-card .count {
  font-size: .8rem; color: var(--text-mute);
  margin-top: 2px;
}

/* ===== SECTION HEAD ===== */
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin: 40px 0 16px;
}
.section-head h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em;
}
.section-head a {
  font-size: .9rem; font-weight: 600; color: var(--accent);
}

/* ===== LISTING GRID (card-based, not list — skiriasi nuo skelbiu.lt) ===== */
.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
@media (min-width: 768px) {
  .listings { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
}

.listing-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.listing-photo {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--bg), var(--border));
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
}
/* No-photo placeholder — Lucide SVG ikona, gražus dizainas */
.listing-photo .no-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--text-mute);
  opacity: .35;
  transition: opacity .2s;
}
.listing-card:hover .no-photo-placeholder { opacity: .55; }
.listing-photo .no-photo-placeholder svg {
  width: 48px; height: 48px;
  stroke-width: 1.5;
}
/* Company logo (kai darbo skelbimas neturi nuotraukos) — su padding, nepilna išplėstis */
.listing-photo .company-logo {
  width: auto !important;
  max-width: 70%;
  max-height: 70%;
  object-fit: contain !important;
  margin: auto;
  padding: 16px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.1));
}
[data-theme="dark"] .listing-photo .company-logo {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)) brightness(.95);
}
/* Subtilus background kai company logo — kad logo neatrodytu „kabantis ore" */
.listing-photo.is-empty {
  background: linear-gradient(135deg, var(--bg), var(--border));
}
[data-theme="dark"] .listing-photo.is-empty {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.listing-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.listing-card:hover .listing-photo img { transform: scale(1.05); }
.listing-fav {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  border: 0;
  color: var(--text-mute);
}
[data-theme="dark"] .listing-fav {
  background: rgba(30, 41, 59, .85);  /* tamsus surface su transparency */
  color: var(--text-mute);
}
[data-theme="dark"] .listing-fav:hover { background: var(--surface); color: var(--danger); }

/* ===== SEARCH AUTOCOMPLETE DROPDOWN ===== */
.search-bar-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-bar-wrap > .search-bar { flex: 1; }
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,.15));
  z-index: 200;
  max-height: 460px;
  overflow-y: auto;
}
.search-suggest-section {
  padding: 6px 0;
}
.search-suggest-section + .search-suggest-section {
  border-top: 1px solid var(--border);
}
.search-suggest-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-mute);
  padding: 8px 14px 4px;
  font-weight: 600;
}
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .12s;
  color: var(--text);
  text-decoration: none;
}
.search-suggest-item:hover,
.search-suggest-item.active {
  background: var(--accent-light);
}
.search-suggest-item .thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  overflow: hidden;
}
.search-suggest-item .thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.search-suggest-item .info {
  flex: 1;
  min-width: 0;
}
.search-suggest-item .label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-suggest-item .label mark {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}
.search-suggest-item .meta {
  font-size: .75rem;
  color: var(--text-mute);
  margin-top: 2px;
  display: flex;
  gap: 8px;
}
.search-suggest-item .meta .price {
  color: var(--accent);
  font-weight: 600;
}
.search-suggest-item.history,
.search-suggest-item.category {
  padding: 7px 14px;
}
.search-suggest-item.history .label {
  color: var(--text-mute);
  font-weight: 400;
}
.search-suggest-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-mute);
  font-size: .85rem;
}
.listing-fav svg { width: 18px; height: 18px; }
.listing-fav:hover { background: var(--surface); transform: scale(1.1); color: var(--danger); }
.listing-fav.active { color: var(--danger); }
.listing-fav.active svg { fill: var(--danger); }
.listing-badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; gap: 4px;
}
.badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
}
.badge-top { background: var(--warning); color: white; }
.badge-new { background: var(--success); color: white; }
.badge-urgent { background: var(--danger); color: white; }

.listing-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.listing-price { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.listing-price.free { color: var(--success); }
.listing-title {
  font-size: .9rem; font-weight: 500;
  color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em;
}
.listing-meta {
  margin-top: auto;
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--text-mute);
}
.listing-meta span { display: inline-flex; align-items: center; gap: 4px; }
.listing-meta svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== INLINE ICON DEFAULTS ===== */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-stroke { stroke: currentColor; }
button svg, a svg { vertical-align: middle; }

/* ===== FORM ===== */
.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; gap: 6px; }
.form-row label {
  font-weight: 500; font-size: .9rem; color: var(--text);
}
.form-row input,
.form-row textarea,
.form-row select {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all .15s;
  outline: none;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-row .hint { color: var(--text-mute); font-size: .8rem; }
.form-row .error { color: var(--danger); font-size: .8rem; }

/* ===== CARDS / SURFACES ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}
.card-narrow { max-width: 480px; margin: 40px auto; }

/* ===== FLASH MESSAGES ===== */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .9rem;
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ===== FILTERS (sidebar on category page) ===== */
.layout-with-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 0;
}
@media (min-width: 1024px) {
  .layout-with-filters { grid-template-columns: 260px 1fr; }
}
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  position: sticky; top: 80px;
}
.filter-group { margin-bottom: 18px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h4 {
  font-size: .85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-mute); margin-bottom: 8px;
}
.filter-group label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: .9rem; cursor: pointer;
}
.range-inputs { display: flex; gap: 8px; }
.range-inputs input { flex: 1; padding: 8px 10px; }

/* ===== DETAIL PAGE ===== */
.detail-layout {
  display: grid; gap: 24px;
  padding: 24px 0;
}
@media (min-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr 360px; }
}
.detail-gallery {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.detail-photo-main {
  aspect-ratio: 4/3; background: var(--bg);
}
.detail-photo-main img { width: 100%; height: 100%; object-fit: contain; }
.detail-photo-thumbs {
  display: flex; gap: 6px; padding: 10px; overflow-x: auto;
}
.detail-photo-thumbs button {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.detail-photo-thumbs button.active { border-color: var(--accent); }
.detail-photo-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-info h1 {
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 4px; letter-spacing: -0.01em;
}
.detail-meta {
  display: flex; gap: 16px; color: var(--text-mute);
  font-size: .85rem; margin-bottom: 16px;
}
.detail-price {
  font-size: 2.2rem; font-weight: 800; color: var(--accent-dark);
  margin: 16px 0;
}
.detail-attrs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  background: var(--bg);
  padding: 16px; border-radius: var(--radius-sm);
  margin: 16px 0;
}
.detail-attr {
  display: flex; flex-direction: column;
  font-size: .85rem;
}
.detail-attr .label { color: var(--text-mute); }
.detail-attr .value { font-weight: 600; }

.seller-card { background: var(--surface); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); position: sticky; top: 80px; }
.seller-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent-dark);
  font-size: 1.2rem;
}
.seller-name { font-weight: 600; }
.seller-meta { font-size: .8rem; color: var(--text-mute); }

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 80px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h5 {
  font-size: .85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 12px;
}
.footer-grid a {
  display: block; padding: 4px 0;
  color: var(--text-mute); font-size: .9rem;
  transition: color .15s;
}
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  color: var(--text-mute);
  font-size: .85rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ===== UTILS ===== */
.text-mute { color: var(--text-mute); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.flex { display: flex; } .gap-2 { gap: 8px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.btn-block { width: 100%; justify-content: center; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════
   PROMO PERIODAS (akcija „nemokama iki rugsejo")
   ═══════════════════════════════════════════════════════ */
.promo-price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.promo-price s {
  color: var(--text-mute);
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-size: .92em;
  opacity: .75;
}
.promo-price strong {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.02em;
}
.price-free {
  color: var(--accent);
  font-weight: 700;
}
.price-regular {
  color: var(--text);
  font-weight: 600;
}
.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
  color: #78350f;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(251, 191, 36, .25);
}
.promo-badge-until {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: .85;
}

/* Banner — naudojamas svetaines puslapio virsuje + post formoj */
.promo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, .35);
  box-shadow: 0 2px 8px rgba(251, 191, 36, .15);
  margin-bottom: 16px;
}
.promo-banner-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.promo-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.promo-banner-text strong {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
}
.promo-banner-until {
  font-size: .82rem;
  opacity: .85;
}
.promo-banner-days {
  background: rgba(120, 53, 15, .15);
  color: #78350f;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: .82rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Dark theme */
[data-theme="dark"] .promo-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, .12) 0%, rgba(251, 191, 36, .2) 100%);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, .3);
}
[data-theme="dark"] .promo-banner-days {
  background: rgba(251, 191, 36, .2);
  color: #fbbf24;
}
[data-theme="dark"] .promo-badge {
  background: linear-gradient(135deg, rgba(251, 191, 36, .25) 0%, rgba(251, 191, 36, .4) 100%);
  color: #fbbf24;
}

@media (max-width: 540px) {
  .promo-banner { padding: 12px 14px; gap: 10px; }
  .promo-banner-icon { font-size: 1.4rem; }
  .promo-banner-text strong { font-size: .88rem; }
  .promo-banner-days { padding: 5px 10px; font-size: .76rem; }
}

/* ═══════════════════════════════════════════════════════
   USER MENU DROPDOWN (header)
   ═══════════════════════════════════════════════════════ */
.user-menu-wrap { position: relative; }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  padding: 8px;
  z-index: 500;
  display: none;
  animation: userMenuFadeIn .18s ease-out;
}
.user-menu-dropdown.open { display: block; }
@keyframes userMenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-avatar-big {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.user-menu-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.user-menu-icon {
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}
.user-menu-item:hover .user-menu-icon { color: var(--accent); }
.user-menu-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-mute);
  background: var(--bg);
  padding: 2px 9px;
  border-radius: 99px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.user-menu-count-alert {
  background: var(--danger);
  color: white;
}
.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.user-menu-item-danger { color: var(--danger); }
.user-menu-item-danger:hover {
  background: rgba(239, 68, 68, .08);
  color: var(--danger);
}
.user-menu-item-danger:hover .user-menu-icon { color: var(--danger); }

/* Dark theme */
[data-theme="dark"] .user-menu-dropdown {
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
}
[data-theme="dark"] .user-menu-count { background: var(--bg); color: var(--text); }

/* Mobile — pilnas plotis nuo apacios (bottom sheet stilius) */
@media (max-width: 540px) {
  .user-menu-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    min-width: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 14px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .2);
    animation: userMenuSlideUp .25s cubic-bezier(.4, 0, .2, 1);
  }
  @keyframes userMenuSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .user-menu-item { padding: 12px 14px; font-size: .95rem; }
}
.user-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 499;
  animation: userMenuBackdropFade .18s ease-out;
}
.user-menu-backdrop.open { display: block; }
@keyframes userMenuBackdropFade {
  from { opacity: 0; } to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE FILTERS DRAWER (kategorijų puslapis + paieška)
   ═══════════════════════════════════════════════════════ */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  white-space: nowrap;
  transition: all .15s;
}
.mobile-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.mobile-filter-btn svg { width: 14px; height: 14px; }
.mobile-filter-btn .count-badge {
  background: var(--accent);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}
.filters-close-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 0;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-mute);
}
.filters-close-mobile:hover { background: var(--border); color: var(--text); }
.filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.filters-backdrop.open {
  opacity: 1;
  visibility: visible;
}
body.filters-open { overflow: hidden; }

@media (max-width: 1023px) {
  .mobile-filter-btn { display: inline-flex; }
  .filters-close-mobile { display: flex; }

  .cat-layout > aside.filters-card {
    position: fixed;
    top: 0; left: 0;
    width: 340px;
    max-width: 88vw;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    border-radius: 0;
    overflow-y: auto;
    box-shadow: 6px 0 30px rgba(0, 0, 0, .25);
  }
  .cat-layout > aside.filters-card.open {
    transform: translateX(0);
  }
  .cat-layout > aside.filters-card .filters-card-header {
    position: sticky;
    top: 0;
    z-index: 5;
  }
}

/* ═══════════════════════════════════════════════════════
   MOBILE — pagrindiniai puslapiai (<=767px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* HEADER — telefonai */
  .header-inner {
    gap: 8px;
    padding: 10px 0;
    flex-wrap: wrap;
    align-items: center;
  }
  .header-actions { gap: 4px; margin-left: auto; }
  .header-actions .btn-text { display: none; }
  .header-actions .btn-primary,
  .header-actions .btn-secondary { padding: 9px 11px; }
  .logo { font-size: 1.15rem; flex-shrink: 0; }
  /* Search bar — visada savo eilutej ant mobile */
  .search-bar-wrap, .header-inner > .search-bar {
    flex-basis: 100%;
    order: 99;
    margin-top: 4px;
  }
  .search-bar { font-size: .9rem; }
  .search-bar input { padding: 10px 14px; }
  .search-bar button { padding: 10px 14px; }
  .search-bar button span { display: none; }

  /* CATEGORY NAV — horizontal scroll */
  .cat-nav-inner {
    gap: 6px;
    padding: 8px 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .cat-nav-inner::-webkit-scrollbar { display: none; }
  .cat-pill { padding: 6px 12px; font-size: .82rem; white-space: nowrap; }

  /* HERO */
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: .9rem; }

  /* LISTINGS GRID — 2 col mobile */
  .listings {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .listing-title { font-size: .88rem; }
  .listing-price { font-size: .98rem; }
  .listing-meta { font-size: .72rem; gap: 4px; flex-wrap: wrap; }

  /* CATEGORY page header */
  .cat-header { padding: 16px 0 12px; }
  .cat-header h1 { font-size: 1.3rem; }
  .breadcrumb { font-size: .8rem; }

  /* RESULTS BAR */
  .results-bar {
    padding: 10px 12px;
    gap: 10px;
  }
  .results-count { font-size: .88rem; }
  .sort-select { font-size: .82rem; padding: 8px 28px 8px 12px; }

  /* SEARCH AUTOCOMPLETE DROPDOWN — mobile fullwidth */
  .search-suggest {
    border-radius: 12px;
    max-height: 70vh;
  }
  .search-suggest-item { padding: 10px 14px; }
  .search-suggest-item .thumb { width: 44px; height: 44px; }

  /* LISTING DETAIL */
  .detail-info h1 { font-size: 1.2rem; }
  .detail-price { font-size: 1.5rem; margin: 12px 0; }
  .detail-attrs {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    gap: 8px;
  }
  .detail-photo-thumbs button { width: 56px; height: 56px; }
  .seller-card { position: static; }
  .detail-layout { gap: 16px; padding: 12px 0; }

  /* INDEX kategorijų korteles — 3 col mobile */
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .cat-card { padding: 14px 8px; }
  .cat-card .icon { width: 42px; height: 42px; margin-bottom: 8px; border-radius: 10px; }
  .cat-card .icon svg { width: 20px; height: 20px; }
  .cat-card .name { font-size: .82rem; line-height: 1.2; }
  .cat-card .count { font-size: .72rem; }

  /* POST FORM */
  .fields-grid { grid-template-columns: 1fr !important; }
  .checkbox-grid { grid-template-columns: 1fr !important; }

  /* SECTION HEAD */
  .section-head h2 { font-size: 1.15rem; }

  /* CARD */
  .card { padding: 14px; }

  /* ACCOUNT page — user card su avatar + buttons */
  /* avatar+name eilute, buttons savo eiluteje full-width */
  .card .flex.gap-4.items-center.justify-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .card .flex.gap-4.items-center.justify-between > .flex.gap-4.items-center {
    align-self: flex-start;
    width: 100%;
  }
  .card .flex.gap-4.items-center.justify-between > .flex.gap-2 {
    width: 100%;
    flex-direction: column;
    gap: 8px !important;
  }
  .card .flex.gap-4.items-center.justify-between > .flex.gap-2 > a {
    width: 100%;
    justify-content: center;
    padding: 11px 14px;
    font-size: .9rem;
    white-space: nowrap;
    box-sizing: border-box;
  }

  /* Account header h1 */
  .card h1 { font-size: 1.1rem !important; }
  .seller-meta { font-size: .78rem; line-height: 1.4; word-break: break-word; }

  /* Account tabs nav — scrollable */
  .cat-nav { overflow: hidden; }
  .cat-nav-inner { overflow-x: auto; flex-wrap: nowrap; padding: 4px !important; }
  .cat-nav-inner .cat-pill { flex-shrink: 0; }

  /* Empty state padding mazinti */
  .card.text-center { padding: 40px 16px !important; }

  /* Reduce excessive top/bottom padding all over */
  div[style*="padding: 24px 0"] { padding: 14px 0 !important; gap: 16px !important; }

  /* FORMS */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="number"], input[type="tel"],
  textarea, select {
    font-size: 16px;  /* iOS neestelina zoom */
  }

  /* FOOTER */
  .site-footer { margin-top: 32px; padding: 28px 0 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
  .footer-grid h5 { font-size: .82rem; margin-bottom: 10px; color: var(--text); }
  .footer-grid a { padding: 5px 0; font-size: .88rem; }
  .footer-bottom { flex-direction: column; gap: 4px; text-align: center; padding-top: 14px; }

  /* CONTAINER padding */
  .container { padding: 0 14px; }

  /* MAIN section */
  main { padding-top: 12px !important; padding-bottom: 24px !important; }

  /* Pagination */
  .pagination-bar { flex-wrap: wrap; gap: 6px; }
  .page-btn { font-size: .85rem; padding: 0 10px; min-width: 36px; height: 36px; }
}

/* Maziausi telefonai */
@media (max-width: 480px) {
  .listings { grid-template-columns: 1fr; gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.3rem; }
  /* Slėpti TIK button'u tekstą — bet NE lang-menu dropdown'o teksto! */
  .header-actions > a:not(.btn-primary) > span:not(.lang-flag):not(.lang-short) { display: none; }
  /* Index kategorijos — 2 col ant mazo */
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  /* Search-bar-wrap jau full-width nuo 767px (zr. virsuje) */
  /* Slepti kai kuriuos header'io mygtukus kad telpu */
  .header-actions .btn-secondary[title*="Žinutės"],
  .header-actions .btn-secondary[title*="messages"] {
    /* paliekam matoma — tik svarbus */
  }
}
