/* ==========================================================================
   CONTIGO 16 — Продуктов каталог
   Палитра, извлечена от логото: тъмнозелено, ярко зелено, оранжево.
   ========================================================================== */

:root {
  --g-900:#0f3712; --g-800:#16491a; --g-700:#1f6b22; --g-600:#3f8f24;
  --g-500:#6fb82e; --g-300:#a9d97a; --g-100:#e8f4da; --g-50:#f3f9ec;
  --o-600:#c4440d; --o-500:#e35313; --o-100:#fdeade;

  --ink:#14181c; --ink-2:#39424c; --muted:#6b7684;
  --line:#e3e7e2; --line-2:#eef1ed;
  --bg:#f5f7f3; --surface:#fff;

  --ok:#1f8b3a; --ok-bg:#e7f6ec;
  --warn:#9a6700; --warn-bg:#fdf5e2;
  --out:#98a2b3; --out-bg:#f1f3f5;

  --r-sm:8px; --r:12px; --r-lg:18px;
  --sh-1:0 1px 2px rgba(16,24,40,.05);
  --sh-2:0 4px 16px rgba(16,24,40,.07);
  --sh-3:0 12px 34px rgba(16,24,40,.12);
  --head-h:72px;
}

*,*::before,*::after { box-sizing:border-box; }

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

body {
  margin:0; background:var(--bg); color:var(--ink);
  font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

img { max-width:100%; display:block; }
a { color:inherit; text-decoration:none; }
h1,h2,h3 { margin:0; line-height:1.2; letter-spacing:-.01em; }

.wrap { max-width:1340px; margin-inline:auto; padding-inline:20px; }

/* ── Горна лента ─────────────────────────────────────────────────── */
.topbar { background:var(--g-900); color:#cfe6c2; font-size:12.5px; }
.topbar-in { display:flex; align-items:center; justify-content:space-between; gap:16px; height:36px; }
.topbar-note { opacity:.85; }
.topbar-cta {
  display:inline-flex; align-items:center; gap:6px; font-weight:600; color:#fff;
  background:rgba(255,255,255,.12); padding:5px 12px; border-radius:99px;
  transition:background .15s;
}
.topbar-cta:hover { background:var(--g-500); }

/* ── Хедър ───────────────────────────────────────────────────────── */
.header {
  position:sticky; top:0; z-index:40; background:var(--surface);
  border-bottom:1px solid var(--line); box-shadow:var(--sh-1);
}
.header-in {
  display:grid; grid-template-columns:auto minmax(0,1fr);
  align-items:center; gap:28px; min-height:var(--head-h);
}
.brand { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.brand img { width:auto; height:42px; }
.brand-sub {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); border-left:1px solid var(--line); padding-left:10px;
}

.search { position:relative; display:flex; max-width:620px; width:100%; }
.search input {
  width:100%; height:44px; padding:0 48px 0 16px; font-size:14.5px; color:var(--ink);
  background:var(--bg); border:1.5px solid var(--line); border-radius:99px;
  outline:none; transition:border-color .15s, background .15s, box-shadow .15s;
}
.search input::placeholder { color:var(--muted); }
.search input:focus {
  background:var(--surface); border-color:var(--g-500);
  box-shadow:0 0 0 4px rgba(111,184,46,.15);
}
.search button {
  position:absolute; right:5px; top:5px; width:34px; height:34px;
  display:grid; place-items:center; border:0; border-radius:50%;
  background:var(--g-500); color:#fff; cursor:pointer; transition:background .15s;
}
.search button:hover { background:var(--g-600); }

/* ── Мигновено търсене ───────────────────────────────────────────── */
.suggest {
  position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:60;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--sh-3); overflow:hidden; max-height:60vh; overflow-y:auto;
}
.suggest a { display:flex; align-items:center; gap:12px; padding:9px 12px; border-bottom:1px solid var(--line-2); }
.suggest a:last-child { border-bottom:0; }
.suggest a:hover,.suggest a.is-cursor { background:var(--g-50); }
.suggest img { width:40px; height:40px; aspect-ratio:1/1; object-fit:contain; flex-shrink:0; }
.suggest-name { flex:1; min-width:0; font-size:13.5px; font-weight:600; }
.suggest-name small { display:block; font-weight:400; color:var(--muted); font-size:11.5px; }
.suggest-price { font-weight:700; font-size:13.5px; white-space:nowrap; }
.suggest-all { display:block; text-align:center; padding:10px; font-weight:650; color:var(--g-700); background:var(--g-50); }
.suggest-empty { padding:16px; text-align:center; color:var(--muted); font-size:13.5px; }

/* ── Категорийна лента ───────────────────────────────────────────── */
.catnav { background:var(--surface); border-bottom:1px solid var(--line); }
.catnav-in { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; }
.catnav-in::-webkit-scrollbar { display:none; }
.catnav-link {
  flex-shrink:0; padding:12px 14px; font-size:13.5px; font-weight:600; color:var(--ink-2);
  border-bottom:2.5px solid transparent; white-space:nowrap; transition:color .15s,border-color .15s;
}
.catnav-link:hover { color:var(--g-700); }
.catnav-link.is-active { color:var(--g-700); border-bottom-color:var(--g-500); }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  background:linear-gradient(135deg,var(--g-900) 0%,var(--g-700) 58%,var(--g-600) 100%);
  color:#fff; position:relative; overflow:hidden;
}
.hero::after {
  content:""; position:absolute; right:-140px; top:-120px; width:460px; height:460px;
  background:radial-gradient(circle,rgba(111,184,46,.5),transparent 68%);
}
.hero-in {
  position:relative; z-index:1; padding:40px 20px 44px;
}
.hero-text { max-width:620px; }
.hero h1 { font-size:clamp(26px,4vw,38px); font-weight:780; margin-bottom:20px; }
.hero-search { display:flex; gap:8px; max-width:520px; }
.hero-search input {
  flex:1; height:50px; padding:0 18px; font-size:15px; border:0; border-radius:99px;
  outline:none; box-shadow:var(--sh-2);
}
.hero-search button {
  height:50px; padding:0 26px; border:0; border-radius:99px; cursor:pointer;
  background:var(--o-500); color:#fff; font-size:15px; font-weight:700;
  transition:background .15s;
}
.hero-search button:hover { background:var(--o-600); }

/* ── Секции ──────────────────────────────────────────────────────── */
.section { padding:36px 20px; }
.section-head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:18px; }
.section-head h2 { font-size:21px; font-weight:730; }

.page-head { margin:6px 0 18px; }
.page-head h1 { font-size:clamp(22px,3vw,30px); font-weight:760; }

.crumbs { display:flex; flex-wrap:wrap; gap:7px; font-size:12.5px; color:var(--muted); padding-top:18px; }
.crumbs a:hover { color:var(--g-700); }
.crumbs-cur { color:var(--ink-2); font-weight:600; }

/* ── Категорийни плочки ──────────────────────────────────────────── */
.cat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px; }
.cat-tile {
  display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); overflow:hidden; box-shadow:var(--sh-1);
  transition:transform .18s, box-shadow .18s, border-color .18s;
}
.cat-tile:hover { transform:translateY(-3px); box-shadow:var(--sh-2); border-color:var(--g-300); }
.cat-tile-img { display:block; aspect-ratio:16/10; background:var(--g-50); overflow:hidden; }
.cat-tile-img img { width:100%; height:100%; object-fit:cover; transition:transform .35s; }
.cat-tile:hover .cat-tile-img img { transform:scale(1.045); }
.cat-tile-body { padding:14px 16px 16px; display:flex; flex-direction:column; gap:3px; }
.cat-tile-body strong { font-size:15.5px; font-weight:700; }
.cat-tile-body small { font-size:12.5px; color:var(--muted); }
.cat-tile-subs { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.cat-tile-subs em {
  font-style:normal; font-size:11px; padding:3px 8px; border-radius:99px;
  background:var(--g-50); color:var(--g-700); border:1px solid var(--g-100);
}

/* ── Подкатегории ────────────────────────────────────────────────── */
.subcats { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.subcat {
  display:inline-flex; align-items:center; gap:6px; padding:7px 13px; font-size:13px; font-weight:600;
  background:var(--surface); border:1px solid var(--line); border-radius:99px; transition:all .15s;
}
.subcat small { color:var(--muted); font-weight:500; }
.subcat:hover { border-color:var(--g-500); color:var(--g-700); background:var(--g-50); }

/* ── Лента с филтри ──────────────────────────────────────────────── */
.toolbar {
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  padding:12px 16px; margin-bottom:18px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
}
.toolbar-count { font-size:13.5px; color:var(--muted); font-weight:600; }
.vat-note { margin-left:10px; padding:3px 9px; font-size:11.5px; font-weight:600;
            color:var(--g-700); background:var(--g-50); border:1px solid var(--g-100);
            border-radius:99px; white-space:nowrap; }
.toolbar-filters { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.chips { display:flex; gap:4px; background:var(--bg); padding:3px; border-radius:99px; }
.chip { padding:6px 14px; font-size:13px; font-weight:600; color:var(--ink-2); border-radius:99px; transition:all .15s; }
.chip:hover { color:var(--g-700); }
.chip.is-on { background:var(--surface); color:var(--g-700); box-shadow:var(--sh-1); }
.sort { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }
.sort select {
  padding:7px 10px; font-size:13px; font-family:inherit; color:var(--ink);
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); cursor:pointer;
}

/* ── Продуктова решетка ──────────────────────────────────────────── */
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(186px,1fr)); gap:14px; }

.card {
  display:flex; flex-direction:column; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
  transition:transform .16s, box-shadow .16s, border-color .16s;
}
.card:hover { transform:translateY(-2px); box-shadow:var(--sh-2); border-color:var(--g-300); }
/* Всички продуктови снимки се показват в квадрат 500×500.
   Оригиналът не се реже — CSS го вписва в кутията (object-fit:contain),
   така редовете са равни независимо от размерите на изходния файл. */
.card-media { position:relative; display:block; aspect-ratio:1/1; background:#fff; padding:12px; }
.card-media img { width:100%; height:100%; max-width:500px; max-height:500px;
                  object-fit:contain; object-position:center; margin-inline:auto; }

.tag {
  position:absolute; top:8px; left:8px; padding:3px 8px; font-size:10.5px; font-weight:750;
  text-transform:uppercase; letter-spacing:.04em; border-radius:5px; color:#fff;
}
.tag-new { background:var(--o-500); }
.tag-out { background:var(--out); left:auto; right:8px; }
.tag-back { background:var(--warn); left:auto; right:8px; }

.card-body { display:flex; flex-direction:column; gap:4px; padding:10px 12px 12px; flex:1; border-top:1px solid var(--line-2); }
.card-sku { font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
.card-title { font-size:13px; font-weight:600; line-height:1.35;
              min-height:calc(2 * 1.35em); }   /* два реда винаги → еднакви карти */
.card-title a { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-title a:hover { color:var(--g-700); }
.card-foot { margin-top:auto; padding-top:8px; display:flex; align-items:flex-end; justify-content:space-between; gap:8px; }
.price { display:flex; flex-direction:column; line-height:1.25; }
.price-main { font-size:17px; font-weight:780; letter-spacing:-.02em; }
.price-pack { font-size:11px; color:var(--muted); }
.price-ask { font-size:12.5px; color:var(--muted); font-style:italic; }
.dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; margin-bottom:5px; }
.dot-in { background:var(--ok); }
.dot-out { background:var(--out); }
.dot-back { background:var(--warn); }

/* ── Странициране ────────────────────────────────────────────────── */
.pager { display:flex; justify-content:center; align-items:center; gap:6px; flex-wrap:wrap; margin-top:32px; }
.pager-link {
  min-width:38px; height:38px; padding:0 12px; display:inline-flex; align-items:center; justify-content:center;
  font-size:13.5px; font-weight:600; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r-sm); transition:all .15s;
}
.pager-link:hover { border-color:var(--g-500); color:var(--g-700); }
.pager-link.is-on { background:var(--g-700); border-color:var(--g-700); color:#fff; }
.pager-gap { color:var(--muted); padding:0 2px; }

/* ── Продуктова страница ─────────────────────────────────────────── */
.product { display:grid; grid-template-columns:minmax(0,500px) minmax(0,1fr); gap:36px; margin:20px 0 8px; }
.product-media {
  position:relative; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:28px; display:grid; place-items:center;
  aspect-ratio:1/1; max-width:500px;
}
.product-media img { width:100%; height:100%; object-fit:contain; object-position:center; }
.product-info h1 { font-size:clamp(20px,2.6vw,28px); font-weight:760; margin-bottom:12px; }
.product-meta { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; font-size:13px; color:var(--muted); }
.meta-sku strong { color:var(--ink); font-variant-numeric:tabular-nums; }
.badge { padding:4px 11px; border-radius:99px; font-size:12px; font-weight:700; }
.badge-in { background:var(--ok-bg); color:var(--ok); }
.badge-out { background:var(--out-bg); color:var(--out); }
.badge-back { background:var(--warn-bg); color:var(--warn); }

.price-box { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:4px 18px 14px; margin-bottom:20px; }
.price-row { display:flex; align-items:baseline; justify-content:space-between; gap:16px; padding:12px 0; border-bottom:1px solid var(--line-2); }
.price-row-alt { border-bottom:0; }
.price-label { font-size:13.5px; color:var(--muted); font-weight:600; }
.price-row .price-value { font-size:24px; font-weight:800; letter-spacing:-.02em; }
.price-row-alt .price-value { font-size:18px; font-weight:700; color:var(--ink-2); }
.price-note { margin:10px 0 0; font-size:11.5px; color:var(--muted); line-height:1.5; }

.product-short { font-size:14.5px; color:var(--ink-2); margin-bottom:20px; }
.product-short p { margin:0 0 8px; }
.product-cats { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:18px; font-size:12.5px; color:var(--muted); }
.product-cats a { padding:4px 10px; background:var(--surface); border:1px solid var(--line); border-radius:99px; font-weight:600; color:var(--ink-2); }
.product-cats a:hover { border-color:var(--g-500); color:var(--g-700); }

.product-desc { margin:38px 0 8px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:24px 26px; }
.product-desc h2 { font-size:17px; font-weight:730; margin-bottom:12px; }
.product-desc div { font-size:14.5px; color:var(--ink-2); }

/* ── Бутони ──────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:42px; padding:0 20px; font-size:14px; font-weight:650; font-family:inherit;
  background:var(--surface); color:var(--ink); border:1px solid var(--line);
  border-radius:var(--r-sm); cursor:pointer; transition:all .15s;
}
.btn:hover { border-color:var(--g-500); color:var(--g-700); }
.btn-primary { background:var(--g-700); border-color:var(--g-700); color:#fff; }
.btn-primary:hover { background:var(--g-800); border-color:var(--g-800); color:#fff; }
.btn-lg { height:52px; padding:0 32px; font-size:15.5px; }

/* ── Празно състояние ────────────────────────────────────────────── */
.empty { text-align:center; padding:56px 20px; background:var(--surface); border:1px dashed var(--line); border-radius:var(--r-lg); }
.empty p { margin:0 0 16px; color:var(--muted); }

/* ── Подвал ──────────────────────────────────────────────────────── */
.footer { background:var(--g-900); color:#b9d4ab; margin-top:52px; }
.footer-in { display:flex; justify-content:space-between; gap:48px; flex-wrap:wrap; padding:44px 20px 32px; }
.footer-brand { max-width:360px; }
.footer-brand img { height:40px; width:auto; margin-bottom:14px; background:#fff; padding:6px 10px; border-radius:var(--r-sm); }
.footer-brand p { margin:0; font-size:13px; line-height:1.65; }
.footer-cols { display:flex; gap:56px; flex-wrap:wrap; }
.footer-cols h3 { font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#fff; margin-bottom:12px; }
.footer-cols ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.footer-cols a { font-size:13.5px; }
.footer-cols a:hover { color:var(--g-300); }
.footer-bottom {
  display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap;
  padding:16px 20px; border-top:1px solid rgba(255,255,255,.1); font-size:12px; opacity:.75;
}

/* ── Адаптивност ─────────────────────────────────────────────────── */
@media (max-width:1040px) {
  .product { grid-template-columns:1fr; gap:24px; }
  .product-media { max-width:500px; }
}
@media (max-width:760px) {
  .header-in { grid-template-columns:auto 1fr; gap:12px; padding:10px 0; }
  .brand-sub { display:none; }
  .brand img { height:34px; }
  .search { grid-column:1/-1; }
  .topbar-note { display:none; }
  .topbar-in { justify-content:flex-end; }
  .grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
  .cat-grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; }
  .hero-in { padding:32px 20px 36px; }
  .section { padding:26px 20px; }
  .toolbar { padding:10px 12px; }
  .toolbar-filters { width:100%; justify-content:space-between; }
  .price-main { font-size:15.5px; }
}
@media (max-width:420px) {
  .grid { grid-template-columns:repeat(2,1fr); }
  .hero-search { flex-direction:column; }
  .hero-search input,.hero-search button { width:100%; border-radius:var(--r); }
}

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