/* ══════════════════════════════════════════════════════════════
   style.css — Zipper EU Color Catalog v3
   Brand: zipper.lv — dark green header #0d3b0d / #155715
══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: #f4f2ee;
  color: #1c1a17;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
main { flex: 1; }

:root {
  /* Brand greens — matching zipper.lv */
  --g-darkest:  #0a2e0a;
  --g-dark:     #0d3b0d;
  --g-mid:      #155715;
  --g-bright:   #2db82d;
  --g-light:    #4cd94c;
  --g-pale:     #e8f5e8;

  --bg:         #f4f2ee;
  --surface:    #ffffff;
  --border:     #e2ddd6;
  --border-2:   #ccc7bf;
  --text:       #1c1a17;
  --text-2:     #5a5550;
  --text-3:     #8a857e;
  --tag:        #edeae4;
  --radius:     10px;
  --shadow:     0 2px 16px rgba(0,0,0,.09);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.2);
  --mono:       'DM Mono', 'Courier New', monospace;
}

/* ══════════════════════════════════════════════════════════════
   TOP INFO BAR
══════════════════════════════════════════════════════════════ */
.topbar {
  background: var(--g-darkest);
  color: rgba(255,255,255,.72);
  font-size: 11.5px;
  padding: 6px 0;
}
.topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tbi {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: rgba(255,255,255,.72);
  transition: color .15s;
}
.tbi svg { opacity: .65; flex-shrink: 0; }
a.tbi:hover { color: var(--g-light); }
.tbi-site { color: var(--g-light); font-weight: 500; }

@media (max-width: 600px) {
  .topbar-right { display: none; }
  .tbi-addr { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   HEADER — dark green matching zipper.lv
══════════════════════════════════════════════════════════════ */
header {
  background: var(--g-dark);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.hd {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: #fff;
}
.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  /* NO filter — logo already has green butterfly on transparent bg */
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .01em;
}
.brand-sub {
  font-size: 9.5px;
  color: rgba(255,255,255,.5);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Search */
.search-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.28);
  color: #fff;
  font-family: var(--mono);
  font-size: 12.5px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.search-wrap input::placeholder { color: rgba(255,255,255,.38); }
.search-wrap input:focus {
  border-color: var(--g-bright);
  background: rgba(0,0,0,.38);
}
.search-icon {
  position: absolute;
  left: 12px;
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 11.5px;
  padding: 4px;
  line-height: 1;
  transition: color .15s;
}
.search-clear:hover { color: #fff; }

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hd-count {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
}

/* Mobile burger */
.burger {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  padding: 6px;
  align-items: center;
  justify-content: center;
}
.burger:hover { color: #fff; }

/* Mobile search drawer */
.mobile-search {
  background: rgba(0,0,0,.25);
  padding: 10px 24px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.search-wrap-mobile input { background: rgba(0,0,0,.38); }

/* ── Language Switcher ── */
.lang-menu { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px 5px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.08) 100%);
  color: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.lang-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.28);
  background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.1) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 12px 24px rgba(0,0,0,.18);
}
.lang-flag-wrap,
.lflag-wrap {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.lang-flag,
.lflag {
  font-size: 12.5px;
  line-height: 1;
}
.lang-current-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.lang-current {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  color: rgba(255,255,255,.62);
}
.chevron { transition: transform .18s ease; }
.lang-menu.open .chevron { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 202px;
  padding: 7px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(13,59,13,.08);
  border-radius: 14px;
  box-shadow: 0 22px 44px rgba(6, 25, 6, .18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  list-style: none;
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 300;
}
.lang-menu.open .lang-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.lang-dropdown li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text);
  font-size: 12.5px;
  transition: background .14s ease, transform .14s ease, box-shadow .14s ease;
}
.lang-dropdown li a:hover {
  background: linear-gradient(180deg, #fff 0%, var(--tag) 100%);
  transform: translateX(2px);
}
.lang-dropdown li a.active {
  background: linear-gradient(180deg, rgba(99,189,40,.12) 0%, rgba(99,189,40,.22) 100%);
  color: var(--g-mid);
  box-shadow: inset 0 0 0 1px rgba(99,189,40,.18);
}
.llabels {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lname {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}
.lcode {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--text-3);
}
.lang-dropdown li a.active .lcode { color: var(--g-mid); }

@media (max-width: 860px) {
  .lang-current-label { display: none; }
  .lang-btn {
    gap: 7px;
    padding-right: 9px;
  }
}

.lcheck {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.72);
  color: var(--g-mid);
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(13,59,13,.08);
}

/* ══════════════════════════════════════════════════════════════
   FILTER BAR  — pill style like foto1.png
══════════════════════════════════════════════════════════════ */
.filterbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 100;
}
.filterbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-shrink: 0;
  margin-right: 2px;
}

/* Pills wrap — wraps to next line on small screens */
.fbtn-scroll {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Filter pill button — matches foto1.png style exactly */
.fbtn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  line-height: 1.35;
  transition: all .14s;
  display: flex;
  align-items: center;
  gap: 0;
}
.fbtn:hover {
  border-color: var(--g-mid);
  color: var(--g-mid);
  background: var(--g-pale);
}
.fbtn.active {
  background: var(--text);  /* black pill like foto1 */
  border-color: var(--text);
  color: #fff;
}
/* Short label inside button — e.g. "Белый / Жёлтый" after "A · " */
.fbtn-name { /* populated by JS */ }

/* ══════════════════════════════════════════════════════════════
   MAIN
══════════════════════════════════════════════════════════════ */
main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  width: 100%;
}

/* Group section heading — like foto1: "A · БЕЛЫЙ, БЕЖЕВЫЙ, ЖЁЛТЫЙ   15 ЦВЕТОВ" */
.gsec { margin-bottom: 4px; }
.gtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-2);
}
.gtitle-badge {
  background: var(--tag);
  color: var(--text-3);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-family: var(--mono);
}

/* Grid */
.cgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

/* Card */
.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform .14s, box-shadow .14s, border-color .14s;
  outline: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}
.card:focus-visible { outline: 2px solid var(--g-mid); outline-offset: 2px; }
.card img { width: 100%; aspect-ratio: 2/1; object-fit: cover; display: block; }
.card-info { padding: 5px 6px 6px; text-align: center; }
.card-num { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--text); }

/* Empty */
.empty { text-align: center; padding: 80px 20px; color: var(--text-3); }
.empty svg { margin: 0 auto 14px; }
.empty p { font-size: 12.5px; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
footer {
  background: var(--g-darkest);
  color: rgba(255,255,255,.75);
  margin-top: auto;
}
.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px 24px 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}
.footer-brand img { height: 36px; width: auto; }
.footer-brand-text { display: flex; flex-direction: column; gap: 3px; }
.footer-brand-text strong { font-size: 14px; font-weight: 600; color: #fff; }
.footer-brand-text span { font-size: 10.5px; color: rgba(255,255,255,.45); }

.footer-grid {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}
.footer-col { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.footer-col h4 {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g-light);
  margin-bottom: 4px;
}
.footer-col span, .footer-col a {
  font-size: 12.5px;
  color: rgba(255,255,255,.6);
  line-height: 1.55;
  transition: color .15s;
}
.footer-col a:hover { color: var(--g-light); }
.iban { font-family: var(--mono); font-size: 11px !important; letter-spacing: .02em; word-break: break-all; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  max-width: 1360px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: rgba(255,255,255,.3);
}

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--g-dark);
  color: #fff;
  border: 1px solid var(--g-bright);
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: var(--mono);
  opacity: 0;
  pointer-events: none;
  z-index: 500;
  transition: opacity .18s, transform .18s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); cursor: pointer; }
.lb-box {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  width: min(440px, 92vw);
  box-shadow: var(--shadow-lg);
  animation: lb-in .17s ease;
}
@keyframes lb-in { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lb-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.4);
  color: #fff;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .14s;
}
.lb-close:hover { background: rgba(0,0,0,.65); }
.lb-box > img { width: 100%; aspect-ratio: 3/1; object-fit: cover; }
.lb-info { padding: 14px 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lb-meta { display: flex; flex-direction: column; gap: 2px; }
.lb-num { font-family: var(--mono); font-size: 24px; font-weight: 500; color: var(--text); }
.lb-group { font-size: 11.5px; color: var(--text-3); }
.lb-copy {
  padding: 8px 18px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 12.5px;
  color: var(--text);
  transition: all .14s;
  white-space: nowrap;
}
.lb-copy:hover { background: var(--g-mid); border-color: var(--g-mid); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
}

@media (max-width: 720px) {
  .hd { height: 54px; gap: 8px; }
  .hd-count { display: none; }
  .filterbar { top: 54px; }
  .search-wrap { display: none; }
  .burger { display: flex; }
  .brand-sub { display: none; }
}

@media (max-width: 560px) {
  .topbar-inner { padding: 0 16px; }
  .filterbar-inner { padding: 8px 16px; }
  /* On very small screens: horizontal scroll for filter pills */
  .filterbar-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filterbar-inner::-webkit-scrollbar { display: none; }
  .filter-label { flex-shrink: 0; }
  .fbtn-scroll { flex-wrap: nowrap; }
  .fbtn { white-space: nowrap; }
  main { padding: 16px 16px 48px; }
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; }
  .footer-inner { padding: 24px 16px 20px; }
  .footer-grid { gap: 20px; }
}

@media (max-width: 380px) {
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
  .brand-name { font-size: 14px; }
}

@media print {
  .topbar, header, .filterbar, .toast, .lightbox, footer { display: none !important; }
  .cgrid { grid-template-columns: repeat(8,1fr); gap: 4px; }
  .card { break-inside: avoid; }
  main { padding: 0; }
}

@media (max-width: 720px) {
  .lang-btn {
    min-height: 34px;
    padding: 4px 9px 4px 6px;
    gap: 7px;
  }
  .lang-current-label { display: none; }
  .lang-dropdown { min-width: 176px; }
}
