/* Google Fonts завантажуються через <link media="print" onload> в HTML — не блокують рендер.
   Локальні @import залишаємо — вони швидкі (той самий сервер) і грузяться паралельно. */
@import 'reset.css';
@import 'variables.css';
@import 'polish.css';

html { scrollbar-gutter: stable; } /* резервує місце під скролбар — без стрибків лейауту */
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); padding-top: var(--header-height); display: flex; flex-direction: column; min-height: 100dvh; }
main { flex: 1 0 auto; }
.footer { flex-shrink: 0; }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }

/* ---------- Scroll animations — базові класи (деталі у polish.css) ---------- */
/* Reduced-motion override */
@media (prefers-reduced-motion: reduce) {
  .anim-hidden, .anim-from-left, .anim-from-right, .anim-scale {
    opacity: 1; transform: none; transition: none;
  }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; border-radius: var(--border-radius); font-weight: 500; transition: var(--transition); cursor: pointer; border: none; font-family: var(--font-body); font-size: 0.95rem; }
.btn-primary { background: var(--color-accent); color: var(--color-white); }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { border: 2px solid var(--color-accent); color: var(--color-accent); background: transparent; }
.btn-outline:hover, .btn-outline.active { background: var(--color-accent); color: var(--color-white); }
.btn-ghost { color: var(--color-text-muted); background: transparent; border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-white); }

/* Product cards */
.product-card { background: var(--color-white); border-radius: var(--border-radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card__image { aspect-ratio: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 4rem; position: relative; }
.product-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-card__title { font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; min-height: 2.8em; }
.product-card__title a {
  color: var(--color-text); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__title a:hover { color: var(--color-accent); }
.product-card__meta { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; margin-bottom: 10px; height: 1.8em; align-items: center; }
.product-card__tag { font-size: 0.75rem; color: var(--color-text-muted); background: var(--color-bg); padding: 2px 8px; border-radius: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.product-card__price { font-size: 1.2rem; font-weight: 700; color: var(--color-accent); }
.product-card__price-old { font-size: 0.9rem; color: var(--color-text-muted); text-decoration: line-through; margin-left: 8px; }
.product-card__footer { margin-top: auto; padding-top: 12px; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }

/* ── Stagger animation: картки при рендері ── */
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.products-grid .product-card { animation: card-in 0.36s ease both; }
@media (prefers-reduced-motion: reduce) { .products-grid .product-card { animation: none; } }

.section { padding: 80px 0; }

/* Category cards — головна сторінка */
.categories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat-card { border-radius: var(--border-radius-lg); overflow: hidden; cursor: pointer; min-height: 180px; display: flex; align-items: flex-end; text-decoration: none; transition: var(--transition); position: relative; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-card__bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 5rem; }
.cat-card__label { position: relative; z-index: 1; padding: 16px 20px; background: linear-gradient(to top, rgba(44,36,21,0.88), transparent); width: 100%; color: white; font-weight: 600; }
.cat-card--wide { grid-column: span 2; }
.section-title { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 40px; color: var(--color-text); }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; position: absolute; top: 10px; left: 10px; z-index: 1; }
.badge-sale { background: var(--color-accent); color: white; }
.badge-new { background: var(--color-success); color: white; }

/* Notification */
.notification { position: fixed; top: 80px; right: 24px; background: var(--color-primary); color: white; padding: 14px 20px; border-radius: var(--border-radius); transform: translateY(-20px); opacity: 0; transition: all 0.3s; z-index: 1000; max-width: 300px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.notification--show { transform: translateY(0); opacity: 1; }

/* Wishlist button (global) */
.wishlist-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: none; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: var(--transition);
  color: var(--color-text-muted); line-height: 1;
}
.wishlist-btn:hover { transform: scale(1.12); }
.wishlist-btn--active { color: #e53935; }

/* ── Custom Select ── */
.cs-wrap { position: relative; }

/* у form-group розгортаємо на всю ширину */
.form-group .cs-wrap { display: block; }

.cs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 16px; min-height: 48px;
  border: 1px solid var(--color-border); border-radius: var(--border-radius);
  background: white; cursor: pointer; font-size: 1rem;
  color: var(--color-text); font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none; box-sizing: border-box; width: 100%;
}
.cs-trigger::after {
  content: ''; flex-shrink: 0; margin-left: auto;
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%23aaa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
  background-size: contain; transition: transform 0.22s;
}
.cs-wrap.cs-open .cs-trigger { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(200,113,47,0.12); }
.cs-wrap.cs-open .cs-trigger::after { transform: rotate(180deg); }
.cs-trigger.cs-has-value { color: var(--color-text); }
.cs-disabled .cs-trigger { opacity: 0.5; cursor: not-allowed; }

/* Текстовий вміст тригера */
.cs-trigger-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.cs-panel {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 5px);
  background: white; border: 1px solid var(--color-border);
  border-radius: var(--border-radius); box-shadow: 0 8px 32px rgba(44,36,21,0.13);
  z-index: 500; overflow: hidden; min-width: 100%;
}
.cs-wrap.cs-open .cs-panel { display: block; }
.cs-list { max-height: 240px; overflow-y: auto; padding: 4px 0; }
.cs-option {
  padding: 10px 16px; cursor: pointer; font-size: 0.95rem;
  transition: background 0.14s, color 0.14s;
  color: var(--color-text); line-height: 1.4;
}
.cs-option:hover { background: var(--color-bg); color: var(--color-accent); }
.cs-option.cs-selected { color: var(--color-accent); font-weight: 600; background: rgba(200,113,47,0.06); }

/* Nova Poshta custom warehouse picker */
.np-picker { position: relative; }
.np-picker__value {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: var(--border-radius); background: white;
  color: var(--color-text-muted); cursor: pointer; font-size: 0.95rem;
  transition: border-color 0.2s;
  min-height: 44px;
}
.np-picker__value::after { content: '▾'; font-size: 0.75rem; opacity: 0.5; margin-left: 8px; flex-shrink: 0; transition: transform 0.2s; }
.np-picker.open .np-picker__value::after { transform: rotate(180deg); }
.np-picker.open .np-picker__value { border-color: var(--color-accent); }
.np-picker__value.selected { color: var(--color-text); }
.np-picker__panel {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: white; border: 1px solid var(--color-border);
  border-radius: var(--border-radius); box-shadow: var(--shadow-md);
  z-index: 400; overflow: hidden;
}
.np-picker.open .np-picker__panel { display: block; }
.np-picker__search-wrap { padding: 10px; border-bottom: 1px solid var(--color-border); }
.np-picker__search {
  width: 100%; padding: 8px 12px; border: 1px solid var(--color-border);
  border-radius: 8px; font-size: 0.9rem; outline: none;
  transition: border-color 0.2s;
}
.np-picker__search:focus { border-color: var(--color-accent); }
.np-picker__list { max-height: 260px; overflow-y: auto; }
.np-picker__item {
  padding: 10px 14px; cursor: pointer; font-size: 0.88rem;
  border-bottom: 1px solid var(--color-bg); line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.np-picker__item:hover { background: var(--color-bg); color: var(--color-accent); }
.np-picker__status { padding: 16px 14px; color: var(--color-text-muted); font-size: 0.9rem; text-align: center; }

/* Nova Poshta autocomplete */
.np-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 300;
  max-height: 240px;
  overflow-y: auto;
}
.np-dropdown.open { display: block; }
.np-dropdown__item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.np-dropdown__item:hover { background: var(--color-bg); }
.np-dropdown__item span { color: var(--color-text-muted); font-size: 0.8rem; }
.np-dropdown__loading,
.np-dropdown__empty { color: var(--color-text-muted); cursor: default; justify-content: center; }
.np-dropdown__loading:hover,
.np-dropdown__empty:hover { background: none; }

/* Tags for characteristics */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* Cart */
.cart-item { display: flex; gap: 16px; align-items: center; padding: 16px; background: white; border-radius: var(--border-radius); margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.cart-item__thumb { width: min(80px, 22vw); height: min(80px, 22vw); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: clamp(1.4rem, 5vw, 2rem); flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cart-item__title { font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.cart-item__remove { color: var(--color-text-muted); font-size: 1rem; padding: 2px 6px; background: none; border: none; cursor: pointer; flex-shrink: 0; transition: color 0.15s; }
.cart-item__remove:hover { color: #c0392b; }
.cart-item__bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item__qty { display: flex; align-items: center; gap: 8px; }
.cart-item__qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-border); font-size: 1.1rem; cursor: pointer; background: white; transition: background 0.15s; }
.cart-item__qty button:hover { background: var(--color-bg); }
.cart-item__qty span { font-weight: 600; min-width: 24px; text-align: center; }
.cart-item__price { font-weight: 700; font-size: 1rem; color: var(--color-accent); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: var(--border-radius); font-size: 1rem; font-family: var(--font-body); background: var(--color-white); color: var(--color-text); transition: border-color var(--transition); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(200,113,47,0.12); }
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input.input-error { border-color: #e53935; box-shadow: 0 0 0 3px rgba(229,57,53,0.1); }
.form-group input.input-ok   { border-color: #43a047; box-shadow: 0 0 0 3px rgba(67,160,71,0.1); }
.field-error { color: #e53935; font-size: 0.82rem; margin-top: 4px; min-height: 0; }

/* Catalog count */
.catalog__count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 3px 10px 3px 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}
.catalog__count::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* Catalog layout */
.catalog-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
.catalog-sidebar { background: var(--color-white); border-radius: var(--border-radius-lg); padding: 24px; box-shadow: var(--shadow-sm); position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow-y: auto; scrollbar-gutter: stable; }
.filter-group { margin-bottom: 20px; }
.filter-group h4,
.filter-group__title { font-weight: 600; margin-bottom: 10px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
.filter-group__title:hover { color: var(--color-accent); }
.filter-group__arrow { font-size: 0.8rem; transition: transform 0.18s ease; display: inline-block; flex-shrink: 0; }
.filter-group--collapsed .filter-group__arrow { transform: rotate(-90deg); }
.filter-group__body { overflow: hidden; }
.filter-group--collapsed .filter-group__body { display: none; }
.cat-filter--hidden { display: none !important; }
.filter-btn {
  display: block; width: 100%; text-align: left;
  padding: 8px 14px;
  border-radius: var(--border-radius); border: none; background: transparent;
  cursor: pointer; font-family: var(--font-body); font-size: 0.88rem;
  color: var(--color-text);
  transition: background 0.18s, color 0.18s, transform 0.1s;
  margin-bottom: 2px;
}
.filter-btn:hover { background: var(--color-bg); }
.filter-btn:active { transform: scale(0.97); }
.filter-btn.active { background: var(--color-accent); color: white; }

/* ── Sidebar filter chips — каталог (мобіль і десктоп) ── */
.catalog-sidebar .filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 20px;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  margin-bottom: 0;
  white-space: nowrap;
  text-align: center;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
}
.catalog-sidebar .filter-btn:hover  { background: var(--color-bg); }
.catalog-sidebar .filter-btn:active { transform: scale(0.96); }
.catalog-sidebar .filter-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* ── Per-type sub-sections (режим "Всі") — глобально (десктоп + мобіль) ── */
.type-filter-sub { margin-bottom: 12px; }
.type-filter-sub:last-child { margin-bottom: 0; }
.type-filter-sub + .type-filter-sub { border-top: 1px solid var(--color-border); padding-top: 10px; }
.type-filter-sub__label {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--color-text-muted); margin-bottom: 6px;
  padding: 2px 0;
}
.type-filter-sub__arrow {
  font-size: 0.6rem; flex-shrink: 0;
  transition: transform 0.18s ease;
  opacity: 0.6;
}
.type-filter-sub--collapsed .type-filter-sub__arrow { transform: rotate(-90deg); }
.type-filter-sub__btns {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.26s ease;
}
.type-filter-sub--collapsed .type-filter-sub__btns { max-height: 0; }

/* Auth/Account */
.auth-tabs { display: flex; border-bottom: 2px solid var(--color-border); margin-bottom: 32px; }
.auth-tab { padding: 12px 24px; border: none; background: none; font-family: var(--font-body); font-size: 1rem; font-weight: 500; cursor: pointer; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.auth-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.dashboard-tabs { display: flex; border-bottom: 2px solid var(--color-border); margin-bottom: 32px; }
.dash-tab { padding: 12px 24px; border: none; background: none; font-family: var(--font-body); font-size: 1rem; font-weight: 500; cursor: pointer; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.dash-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--color-border); }
.order-card { background: var(--color-white); border-radius: var(--border-radius); padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.order-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.order-status { font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; background: #fff3e0; color: #e65100; }

/* Mobile burger — styles live in header.css */

/* ── Emoji: no I-beam cursor, no text selection ─────────────────────────────
   .e applied via JS (fixEmojiCursors in main.js) to every emoji char in DOM.
   CSS fallback covers pseudo-elements (::after/::before) and known containers */
.e {
  cursor: default !important;
  user-select: none;
  -webkit-user-select: none;
  display: inline-block;
}

/* Known decorative emoji containers — no cursor, no text selection */
.hero::after,
.about-visual,
.about-visual__emoji,
.cat-card__bg,
.feature-item > div:first-child,
.insta-emoji {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* Logo badge — shared component used in header + admin sidebar */
.logo-badge {
  width: 38px; height: 38px;
  background: var(--color-accent);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  font-family: var(--font-heading);
  line-height: 1;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.hero__badge,
.process-num {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

