/* GreenStyle — цветы и растения */

:root {
  --bg: #f4f8f5;
  --surface: #ffffff;
  --surface-muted: #eaf2ec;
  --text: #152419;
  --muted: #5a6e60;
  --border: rgba(21, 36, 25, 0.10);

  --accent: #2a8f5c;
  --accent-dark: #1f6f47;
  --accent-light: #dff0e6;
  --sage: #4a7d5c;
  --sage-light: #e4efe8;
  --gold: #8fa86e;
  --danger: #c44536;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(21, 36, 25, 0.07);
  --shadow-lg: 0 12px 40px rgba(21, 36, 25, 0.10);

  --container: 1200px;
  --gap: clamp(16px, 2.5vw, 24px);
  --header-h: 64px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t: 200ms;

  --footer-bg: #0f1f14;
  --footer-text: #e6f2ea;
  --footer-muted: #8fb59a;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(900px 460px at 12% -8%, rgba(42, 143, 92, 0.10) 0%, transparent 62%),
    radial-gradient(820px 420px at 92% 2%, rgba(74, 125, 92, 0.12) 0%, transparent 58%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--accent-dark); }
button { font: inherit; cursor: pointer; border: none; background: none; }

button, a, .btn, .cat-pill, .cat-nav-link, .qtybtn, .btn-icon, .custom-select-trigger,
.custom-select-option, .mobile-cat-link, .mobile-nav-toggle, .cart-btn, .menu-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
  .card:hover img { transform: none; }
  .btn:hover { transform: none; box-shadow: none; }
}

@media (max-width: 768px) {
  .btn.sm { min-height: 44px; padding: 10px 16px; }
  .qtybtn { min-width: 44px; min-height: 44px; }
}
::selection { background: rgba(42, 143, 92, 0.20); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }

.title { font-weight: 600; }
.muted { color: var(--muted); }

input, textarea, select, button { font-size: 16px; }

/* ── Header ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 3vw, 28px);
  padding-top: env(safe-area-inset-top);
  background: rgba(244, 248, 245, 0.92);
  border-bottom: 1px solid var(--border);
}

@supports (backdrop-filter: blur(12px)) {
  .topbar {
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
  }
}

.topbar-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  grid-column: 1;
  justify-self: start;
  display: none;
}
.brand { grid-column: 1; justify-self: start; }
.nav { grid-column: 2; justify-self: center; }
.topbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}
.brand:hover { color: var(--accent); text-decoration: none; }
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background var(--t), color var(--t);
}
.nav a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.nav a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.fav-btn .icon {
  flex-shrink: 0;
}
.fav-btn .fav-label {
  font-weight: 500;
}
.btn-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-fav .icon-heart.filled,
.btn-fav.active .icon-heart {
  color: #c44536;
}
.drawer-header h3 .icon {
  color: #c44536;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .topbar {
    padding-left: 12px;
    padding-right: 12px;
    gap: 10px;
  }
  .topbar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .menu-toggle {
    order: 1;
    flex-shrink: 0;
  }
  .brand {
    order: 2;
    flex: 0 1 auto;
    gap: 6px;
    margin-left: 10px;
    grid-column: unset;
    justify-self: unset;
    font-size: 1.15rem;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
  }
  .topbar-actions {
    order: 3;
    flex-shrink: 0;
    gap: 6px;
    margin-left: auto;
    grid-column: unset;
    justify-self: unset;
  }
  .fav-btn .fav-label {
    display: none;
  }
  .fav-btn.cart-btn {
    order: 1;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .fav-btn .icon {
    margin-right: 0;
    width: 22px;
    height: 22px;
  }
  .fav-btn .cart-count {
    position: absolute;
    top: -3px;
    right: -5px;
    min-width: 12px;
    height: 12px;
    padding: 0 2px;
    font-size: 0.5rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 1.5px var(--surface);
  }
  #cartBtn.cart-btn {
    order: 2;
    flex-shrink: 0;
    width: auto;
    height: 44px;
    min-height: 44px;
    padding: 0 10px 0 12px;
    justify-content: center;
    gap: 5px;
  }
  #cartBtn.cart-btn > span:not(.cart-count) {
    display: inline;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
  }
  #cartBtn.cart-btn .icon {
    margin-right: 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  #cartBtn.cart-btn .cart-count {
    position: static;
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
  }
  .nav { display: none; }
  .menu-toggle { display: flex; }
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.cart-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.cart-btn .cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 999;
  background: rgba(244, 248, 245, 0.98);
  padding: 20px clamp(16px, 3vw, 28px);
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link,
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.mobile-nav-link:hover,
.mobile-nav-link.active,
.mobile-nav-toggle:hover,
.mobile-nav-toggle.open {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}
.mobile-nav-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--t);
  flex-shrink: 0;
  margin-left: 12px;
}
.mobile-nav-toggle.open .mobile-nav-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.mobile-nav-catalog { width: 100%; }
.mobile-nav-tree {
  padding: 4px 0 8px 12px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-tree[hidden] { display: none; }
.mobile-cat-group { margin-bottom: 4px; }
.mobile-cat-link {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.mobile-cat-link.sub {
  padding-left: 28px;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
}
.mobile-cat-link:hover,
.mobile-cat-link.active {
  background: var(--accent-light);
  color: var(--accent);
}
.mobile-cat-link.active { font-weight: 600; }
.mobile-subcat-list { padding-left: 8px; }

@media (max-width: 720px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #e4f0e8 0%, #f4f8f5 50%, #dceee4 100%);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  height: 140%;
  background: radial-gradient(ellipse, rgba(42, 143, 92, 0.10) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px) clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 768px) {
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; }
}
.hero-content { max-width: 580px; }
.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(1.55rem, 5.2vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-sub {
  font-size: clamp(0.95rem, 3.4vw, 1.12rem);
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 520px;
  text-wrap: pretty;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 767px) {
  .hero-inner {
    padding: 28px 18px 32px;
    gap: 24px;
    text-align: center;
  }
  .hero-content {
    max-width: none;
    margin: 0 auto;
  }
  .hero h1 {
    font-size: clamp(1.45rem, 6.8vw, 2rem);
    line-height: 1.2;
    margin-bottom: 12px;
    font-weight: 700;
  }
  .hero-sub {
    max-width: none;
    margin: 0 auto 20px;
    font-size: 0.98rem;
    line-height: 1.5;
    padding: 0 4px;
    font-weight: 500;
    color: #3f5248;
  }
  .hero-cta {
    justify-content: center;
    gap: 8px;
  }
  .hero-cta .btn {
    flex: 0 1 auto;
    padding: 8px 14px;
    min-height: 38px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}
.hero-visual {
  display: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
  max-width: 360px;
  margin: 0 auto;
  background: transparent;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) { .hero-visual { display: block; } }
.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-lg);
}

.h-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: var(--shadow);
}

/* ── Trust strip ── */
.trust-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.trust-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trust-item .h-icon { background: var(--sage-light); }

@media (max-width: 720px) {
  body[data-page="home"] {
    display: flex;
    flex-direction: column;
  }
  body[data-page="home"] > .hero { order: 1; }
  body[data-page="home"] > #catalog { order: 2; }
  body[data-page="home"] > .home-features { order: 3; }
  body[data-page="home"] > #delivery { order: 4; }
  body[data-page="home"] > .footer { order: 5; }

  .home-features .trust-strip {
    border-bottom: none;
  }
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--gap);
  align-items: start;
}
.container.narrow {
  display: block;
  max-width: 720px;
}

@media (max-width: 900px) {
  .container { grid-template-columns: 1fr; }
}

/* ── Panels ── */
.panel, .sidebar, .content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel.soft {
  background: var(--surface-muted);
  box-shadow: none;
}
.sidebar, .content, .panel { padding: clamp(16px, 2.5vw, 22px); }

.content-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.content-tip { font-size: 0.88rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}
.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #3aab72 100%);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  box-shadow: 0 8px 24px rgba(42, 143, 92, 0.28);
}

.btn.outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
.btn.outline:hover { background: var(--accent-light); color: var(--accent); }

.btn.danger {
  background: rgba(196, 69, 54, 0.08);
  border-color: rgba(196, 69, 54, 0.2);
  color: var(--danger);
}
.btn.danger:hover { background: rgba(196, 69, 54, 0.14); }

.ui-dialog-actions .btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.ui-dialog-actions .btn.danger:hover {
  background: #a8382c;
  border-color: #a8382c;
  color: #fff;
}

.btn.sm { padding: 8px 16px; min-height: 36px; font-size: 0.85rem; }
.btn.loading { opacity: 0.65; pointer-events: none; }
.btn.block { width: 100%; }

.btn-add {
  width: 100%;
  margin-top: 0;
}
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.btn-fav.active {
  border-color: rgba(196, 69, 54, 0.35);
  color: #c44536;
  background: rgba(196, 69, 54, 0.08);
}
.product-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.product-modal-actions .btn.block { margin-top: 0; }

.fav-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.fav-item:last-child { border-bottom: none; }
.fav-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.fav-item-body .title {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}
.fav-item-price {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.fav-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fav-item-actions .btn { width: 100%; }

/* ── Forms ── */
.form label {
  display: block;
  margin: 0 0 16px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  position: relative;
}
.form label > span:first-child {
  display: block;
  margin-bottom: 6px;
}
.form.inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.form.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form.grid2 { grid-template-columns: 1fr; }
}

input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t), box-shadow var(--t);
  font-family: var(--font-body);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 143, 92, 0.14);
}
input::placeholder, textarea::placeholder { color: #b0a59e; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  accent-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%232a8f5c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select:hover:not(:disabled) { border-color: var(--accent); }
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: var(--surface-muted);
}
select option {
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

/* ── Custom select (styled dropdown) ── */
.custom-select {
  position: relative;
  width: 100%;
}
label .custom-select,
.cat-select-wrap .custom-select,
.form > .custom-select {
  margin-top: 6px;
}
.custom-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  box-shadow: var(--shadow);
}
.custom-select-trigger::after {
  content: '';
  flex-shrink: 0;
  width: 12px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%232a8f5c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform var(--t) var(--ease);
}
.custom-select.open .custom-select-trigger::after {
  transform: rotate(180deg);
}
.custom-select-trigger:hover:not(:disabled) {
  border-color: var(--accent);
}
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 143, 92, 0.14);
}
.custom-select.disabled .custom-select-trigger {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-muted);
  box-shadow: none;
}
.custom-select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: min(280px, 50vh);
  overflow-y: auto;
  padding: 6px;
  -webkit-overflow-scrolling: touch;
}
.custom-select-list[hidden] { display: none; }
.custom-select-option {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.custom-select-option:hover,
.custom-select-option.active {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.custom-select-option.active { font-weight: 600; }

.radio-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.radio-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: border-color var(--t), background var(--t);
}
.radio-row label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}
.radio-row input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* ── Product grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(14px, 2vw, 20px);
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

@media (max-width: 720px) {
  #productsBox.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #productsBox .card-body {
    padding: 10px;
  }
  #productsBox .card-body h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    line-height: 1.25;
  }
  #productsBox .card-body .desc {
    display: none;
  }
  #productsBox .price {
    font-size: 0.95rem;
    margin-bottom: 2px;
  }
  #productsBox .stock-status {
    font-size: 0.86rem;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 2px;
    line-height: 1.3;
  }
  #productsBox .btn-add {
    margin-top: 8px;
    padding: 8px 6px;
    font-size: 0.78rem;
    min-height: 40px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t), box-shadow var(--t);
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface-muted);
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.card:hover img { transform: scale(1.04); }
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 6px;
}
.card-body .desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.price small { font-size: 0.8rem; font-weight: 500; color: var(--muted); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }

/* ── Category filters ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.hidden { display: none !important; }

.sidebar-search {
  margin-bottom: 18px;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.search-box-icon .icon { width: 18px; height: 18px; }
.search-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 40px 12px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 143, 92, 0.14);
}
.search-input::placeholder { color: var(--muted); }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-clear:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.cat-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}
.cat-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.cat-nav-link:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.cat-nav-link.active {
  background: var(--accent);
  color: #fff;
}
.cat-nav-link.root {
  font-weight: 600;
  margin-bottom: 6px;
}
.cat-nav-group {
  margin-bottom: 2px;
}
.cat-nav-subs {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 6px 10px;
  padding-left: 10px;
  border-left: 2px solid var(--accent-light);
}
.cat-nav-group.expanded .cat-nav-subs {
  display: flex;
}
.cat-nav-group.nested {
  margin-left: 4px;
}
.cat-nav-group.nested .cat-nav-subs {
  display: none;
  margin-left: 8px;
  padding-left: 8px;
}
.cat-nav-group.nested.expanded .cat-nav-subs {
  display: flex;
}
.cat-nav-link.sub.depth-2 { padding-left: 22px; font-size: 0.85rem; }
.cat-nav-link.sub.depth-3 { padding-left: 30px; font-size: 0.82rem; }
.cat-nav-link.sub.depth-4 { padding-left: 38px; font-size: 0.8rem; }
.cat-nav-link.sub {
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}
.cat-nav-link.sub:hover { color: var(--accent-dark); }
.cat-nav-link.sub.active {
  color: #fff;
  font-weight: 600;
}
.cat-nav-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform var(--t);
}
.cat-nav-group.expanded .cat-nav-link.cat .cat-nav-arrow {
  transform: rotate(45deg);
  margin-top: -3px;
}

.cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.cat-pill {
  scroll-snap-align: start;
  white-space: nowrap;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88rem;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cat-select-wrap { display: none; margin-top: 8px; }
.cat-select-wrap .custom-select { margin-top: 0; }
.cat-select-sub { display: none; margin-top: 0; }

@media (min-width: 521px) {
  .sidebar h3 {
    margin-bottom: 10px;
    font-size: 1.15rem;
  }
  .sidebar .reset {
    width: 100%;
    margin-top: 4px;
  }
}

@media (min-width: 901px) {
  .sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

@media (max-width: 520px) {
  .cat-nav { display: none; }
  .cat-select-wrap { display: block; }
  .cat-select-sub { display: none; }
  .cat-select-sub.visible { display: block; }
  .sidebar-search { margin-bottom: 14px; }
}

.sidebar-note {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 0.88rem;
}
.note-title { font-weight: 600; margin-bottom: 8px; }
.note-list { margin: 0; padding-left: 18px; color: var(--muted); }
.note-list li { margin-bottom: 4px; }

/* ── Cart drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 20, 0.45);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(420px, 100vw);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(21, 36, 25, 0.12);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: right 280ms var(--ease);
}
.drawer.open { right: 0; }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  padding-top: calc(18px + env(safe-area-inset-top));
}
.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.drawer-footer {
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1rem;
}
.drawer-total b { font-size: 1.25rem; color: var(--accent); }
.drawer-actions {
  display: flex;
  gap: 8px;
}
.drawer-actions .btn { flex: 1; }

.cart-min-notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff8e6;
  border: 1px solid #f0d78c;
  color: #7a5a12;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 500;
}
.cart-min-notice.is-ok {
  background: var(--accent-light);
  border-color: rgba(42, 143, 92, 0.25);
  color: var(--accent-dark);
}
.checkout-cart + .cart-min-notice {
  margin-top: 12px;
}
.btn.disabled,
.btn[aria-disabled="true"],
button.btn:disabled,
button.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  box-shadow: none;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  display: block;
}
.drawer-item-thumb {
  padding: 0;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.drawer-item-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
  transition: opacity var(--t);
}
.drawer-item-thumb:hover img { opacity: 0.88; }
.drawer-item-link {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 4px;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: inherit;
  cursor: pointer;
  line-height: 1.3;
}
.drawer-item-link:hover { color: var(--accent); }
.cart-item-price { font-weight: 600; white-space: nowrap; }
.qtybox { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qtybtn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.qtybtn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.qtybtn .icon { width: 14px; height: 14px; }

/* ── Product modal ── */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.product-modal.hidden { display: none; }
.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.product-modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
.product-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 90vh;
  overflow: auto;
}
.product-modal-gallery {
  position: relative;
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 48px 20px;
  min-height: 280px;
}
.product-modal-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.product-modal-img-wrap img {
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.product-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.product-modal-nav.prev { left: 8px; }
.product-modal-nav.next { right: 8px; }
.product-modal-nav.hidden { display: none; }
.product-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}
.product-thumbs img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.5;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.product-thumbs img.active { opacity: 1; border-color: var(--accent); }
.product-modal-info {
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.product-modal-info h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0;
  padding-right: 36px;
  line-height: 1.25;
}
.product-modal-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.product-modal-desc-block h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 8px 0 4px;
  font-weight: 600;
}
.product-modal-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.product-modal-desc.muted { font-style: italic; color: var(--muted); }
.product-modal-info .btn.block { margin-top: auto; }

@media (max-width: 768px) {
  .product-modal-body { grid-template-columns: 1fr; }
  .product-modal-gallery { padding: 24px 40px 16px; min-height: 220px; }
  .product-modal-img-wrap img { max-height: 40vh; }
  .product-modal-info { padding: 20px 16px 16px; }
  .product-modal-stock {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
  }
}

/* ── Checkout ── */
.checkout-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.step-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.step-badge.active { background: var(--accent-light); color: var(--accent); }

.checkout-cart .row,
.admin-table .row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.row.total {
  font-weight: 700;
  font-size: 1.05rem;
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding-top: 16px;
  margin-top: 4px;
}
@media (max-width: 520px) {
  .checkout-cart .row,
  .admin-table .row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Delivery info section ── */
.info-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 64px) clamp(16px, 3vw, 28px);
}
.info-section h2 { text-align: center; margin-bottom: 32px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.info-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.info-card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.info-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ── Footer ── */
.footer {
  margin-top: auto;
  background: var(--footer-bg);
  color: var(--footer-text);
}
.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px clamp(16px, 3vw, 28px) 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
.f-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.f-title { font-weight: 600; margin-bottom: 12px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--footer-muted); }
.f-muted { color: var(--footer-muted); font-size: 0.9rem; line-height: 1.6; }
.f-list { list-style: none; margin: 0; padding: 0; }
.f-list li { margin-bottom: 8px; }
.f-list a { color: var(--footer-text); opacity: 0.85; }
.f-list a:hover { opacity: 1; color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--footer-muted);
}

/* ── Icons (Lucide) ── */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 48px; height: 48px; }

.h-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
}
.h-icon .icon { width: 18px; height: 18px; }

.empty-state-icon {
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
}
.empty-state-icon .icon { width: 28px; height: 28px; }

/* ── Icon buttons ── */
.btn-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: none;
  box-shadow: none;
}
.btn-icon.danger { color: var(--danger); }
.btn-icon.danger:hover {
  border-color: rgba(196, 69, 54, 0.35);
  background: rgba(196, 69, 54, 0.08);
  color: var(--danger);
}

.btn .icon,
.cart-btn .icon { margin-right: 2px; }
.fav-btn .icon,
.cart-btn .icon { width: 20px; height: 20px; }

.product-modal-close .icon,
.product-modal-nav .icon,
#cartClose .icon { width: 20px; height: 20px; }

/* ── File upload ── */
.file-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
label.file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  font-weight: 600;
}
.file-upload-name {
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
  min-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Admin ── */
.list { list-style: none; margin: 12px 0; padding: 0; }
.list.admin li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 0.9rem;
  background: var(--surface-muted);
}
.list.admin li > input[type="text"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  min-height: 40px;
}
.list.admin .admin-info { flex: 1; min-width: 0; }
.list.admin .admin-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.form.inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.form.inline input[type="text"] {
  flex: 1;
  min-width: 160px;
  margin: 0;
}
.form.inline .btn { flex-shrink: 0; white-space: nowrap; }

.upload { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.images-wrap { display: flex; gap: 10px; flex-wrap: wrap; }
.img-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.img-chip img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.img-chip-controls { flex: 1; min-width: 0; }
.img-chip-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.img-chip-buttons .btn { padding: 6px 12px; min-height: 36px; font-size: 0.82rem; }
.img-chip-buttons .btn-icon { width: 36px; height: 36px; min-height: 36px; }

.admin-table .row > div:last-child {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.msg { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.msg.success { background: var(--sage-light); color: var(--sage); border: 1px solid rgba(90, 125, 101, 0.2); }
.msg.error { background: rgba(196, 69, 54, 0.08); color: var(--danger); border: 1px solid rgba(196, 69, 54, 0.2); }

.pad { padding: 16px; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.reset { margin-top: 10px; }

/* ── Suggest (Nova Poshta) ── */
.suggest {
  position: absolute;
  left: 0; right: 0; top: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  -webkit-overflow-scrolling: touch;
}
.suggest:empty, .suggest[style*="display: none"] { display: none !important; }
.suggest-item {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.suggest-item:hover, .suggest-item:active { background: var(--accent-light); }

/* ── Login page ── */
.login-card {
  max-width: 400px;
  margin: 48px auto;
  padding: clamp(24px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card h2 { text-align: center; margin-bottom: 24px; }
.login-logo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ── Focus & a11y ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .btn, .cat-pill, .nav a { min-height: 65px; }
  @media (max-width: 767px) {
    .hero-cta .btn { min-height: 55px; padding: 8px 14px; font-size: 0.8rem; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Custom dialogs (UI.alert / UI.confirm) ── */
.ui-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: rgba(15, 31, 20, 0.48);
  animation: ui-fade-in 180ms var(--ease);
}
.ui-overlay.hidden { display: none; }

@keyframes ui-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ui-dialog {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 22px;
  text-align: center;
  animation: ui-slide-in 220ms var(--ease);
}

@keyframes ui-slide-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ui-dialog-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-light);
  color: var(--accent);
}
.ui-dialog-icon.danger {
  background: rgba(196, 69, 54, 0.10);
  color: var(--danger);
}
.ui-dialog-icon.success {
  background: var(--sage-light);
  color: var(--sage);
}
.ui-dialog-icon.error {
  background: rgba(196, 69, 54, 0.10);
  color: var(--danger);
}
.ui-dialog-icon .icon { width: 24px; height: 24px; }

.ui-dialog-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--text);
}

.ui-dialog-message {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ui-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.ui-dialog-actions .btn {
  min-width: 120px;
  flex: 1 1 120px;
  max-width: 200px;
}

@media (max-width: 400px) {
  .ui-dialog { padding: 22px 18px 18px; }
  .ui-dialog-actions { flex-direction: column-reverse; }
  .ui-dialog-actions .btn { max-width: none; width: 100%; }
}

/* ── Admin tabs & CMS ── */
.admin-page { display: block; }
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-tab {
  padding: 10px 20px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.admin-tab:hover { border-color: var(--accent); color: var(--accent); }
.admin-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.admin-tab-panel.hidden { display: none; }

/* ── Orders admin ── */
.orders-panel { padding: clamp(16px, 2.5vw, 22px); }
.orders-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.orders-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.orders-subtab {
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.orders-subtab:hover { border-color: var(--accent); color: var(--accent); }
.orders-subtab.active {
  background: rgba(45, 106, 79, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.orders-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--border);
  font-size: 0.75rem;
  font-weight: 700;
}
.orders-subtab.active .orders-count {
  background: var(--accent);
  color: #fff;
}
.orders-list {
  display: grid;
  gap: 14px;
}
.orders-empty { margin: 8px 0; }
.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}
.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.order-card-date {
  display: block;
  font-size: 0.85rem;
  margin-top: 2px;
}
.order-card-total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}
.order-card-body p { margin: 0 0 6px; }
.order-field {
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.order-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.order-value {
  font-weight: 600;
  line-height: 1.4;
}
.order-phone-field { margin-bottom: 12px; }
.order-phone-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.order-phone-number {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}
.order-phone-number:hover { text-decoration: underline; }
.order-phone-copy {
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.order-phone-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.order-phone-copy.copied {
  border-color: var(--accent);
  background: rgba(45, 106, 79, 0.12);
  color: var(--accent);
}
.order-items {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.92rem;
}
.order-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn.sm {
  padding: 8px 16px;
  min-height: 40px;
  font-size: 0.88rem;
}
.btn.danger {
  border-color: #c0392b;
  color: #c0392b;
}
.btn.danger:hover {
  background: #c0392b;
  color: #fff;
}
.order-status-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.order-status-accepted {
  background: rgba(45, 106, 79, 0.15);
  color: var(--accent);
}
.order-status-rejected {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}
@media (max-width: 768px) {
  .orders-panel h3 { font-size: 1.35rem; font-weight: 800; }
  .orders-subtab {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 18px;
  }
  .order-card {
    padding: 18px;
    font-size: 1.05rem;
  }
  .order-card-head strong {
    font-size: 1.25rem;
    font-weight: 800;
  }
  .order-card-date { font-size: 0.92rem; font-weight: 600; }
  .order-card-total {
    font-size: 1.4rem;
    font-weight: 800;
  }
  .order-label {
    font-size: 0.95rem;
    font-weight: 700;
  }
  .order-value {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.45;
  }
  .order-phone-number {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.03em;
  }
  .order-phone-copy {
    font-size: 0.92rem;
    font-weight: 700;
    padding: 10px 18px;
    min-height: 44px;
  }
  .order-items {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.5;
  }
  .order-card-actions .btn.sm {
    flex: 1;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 700;
  }
  .order-status-badge {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 14px;
  }
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
}

/* ── Admin modals & product list ── */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin-toolbar h3 { margin: 0; }
.admin-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-toolbar-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.admin-modal.hidden { display: none; }
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.admin-modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  display: flex;
  flex-direction: column;
}
.admin-modal-wide { max-width: 820px; }
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.admin-modal-header h3 { margin: 0; font-size: 1.25rem; }
.admin-modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-modal-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .admin-modal-split { grid-template-columns: 1fr; }
}

.admin-prod-list .admin-prod-row {
  grid-template-columns: 64px 1fr auto auto;
  gap: 14px;
  align-items: center;
}
.admin-prod-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-prod-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.admin-prod-info b {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-prod-info .muted {
  font-size: 0.82rem;
}
.admin-prod-price {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.admin-prod-actions {
  display: flex;
  gap: 6px;
}
@media (max-width: 600px) {
  .admin-prod-list .admin-prod-row {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }
  .admin-prod-price { grid-column: 2; }
  .admin-prod-actions { grid-column: 2; }
}

.stock-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  width: fit-content;
}
.stock-badge.in {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.stock-badge.out {
  background: rgba(196, 69, 54, 0.12);
  color: var(--danger);
}

/* Subcategory tree (admin) */
.subcat-form .field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 10px 0 4px;
  color: var(--text);
}
.subcat-form .field-label:first-child { margin-top: 0; }
.subcat-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.subcat-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--accent-dark);
}
.list.admin.subcat-tree li.subcat-tree-row {
  align-items: center;
}
.list.admin.subcat-tree li.subcat-tree-empty {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
}
.subcat-tree-name {
  font-size: 0.92rem;
  line-height: 1.35;
}
.subcat-branch {
  color: var(--muted);
  font-weight: 400;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
.list.admin.subcat-tree li[data-depth="1"] .subcat-tree-name { padding-left: 4px; }
.list.admin.subcat-tree li[data-depth="2"] .subcat-tree-name { padding-left: 8px; }
.list.admin.subcat-tree li[data-depth="3"] .subcat-tree-name { padding-left: 12px; }

/* Toggle switch */
.form label.toggle-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 0 16px;
  min-height: auto;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.form label.toggle-field > .toggle-label {
  display: block;
  margin: 0;
  font-weight: 500;
  flex: 1;
}
.form label.toggle-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  pointer-events: none;
}
.form label.toggle-field .toggle-switch {
  display: block;
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  background: #c5d4ca;
  border-radius: 999px;
  transition: background var(--t);
}
.form label.toggle-field .toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform var(--t) var(--ease);
}
.form label.toggle-field input:checked + .toggle-switch {
  background: var(--accent);
}
.form label.toggle-field input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* Stock on catalog cards */
.stock-status {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
}
.stock-status.in { color: var(--accent); }
.stock-status.out { color: var(--danger); }
.card.out-of-stock { opacity: 0.85; }
.card.out-of-stock .btn-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.product-modal-stock {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.product-modal-stock.in { color: var(--accent); }
.product-modal-stock.out { color: var(--danger); }
