/* KingFoods — фирменный стиль
   Палитра: #0D2B61 (navy), #FF7A00 (orange), #FFFFFF, #F5F7FA, #1F2933, #6B7280
   Шрифт: Manrope
*/

:root {
  --c-navy: #0D2B61;
  --c-orange: #FF7A00;
  --c-white: #FFFFFF;
  --c-bg: #F5F7FA;
  --c-text: #1F2933;
  --c-muted: #6B7280;
  --c-border: #E5EAF0;
  --c-border-strong: #DCE3EC;
  --c-line: #EEF1F5;
  --c-fish: #0D4F8B;
  --c-meat: #7A1E24;
  --c-jam: #9B1B30;
  --c-posuda: #2F6B3F;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-sm: 0 2px 6px rgba(13,43,97,0.06);
  --shadow-md: 0 6px 18px rgba(13,43,97,0.08);
  --shadow-lg: 0 16px 40px rgba(13,43,97,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-navy); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-orange); }

img { max-width: 100%; height: auto; display: block; }

h1 { font-size: 48px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 36px; font-weight: 700; line-height: 1.2; }
h3 { font-size: 22px; font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }

@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
}

.container { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--c-muted); }

/* ===== BUTTONS ===== */
button, input[type="button"], input[type="submit"], input[type="reset"] {
  white-space: nowrap;          /* buttons never wrap their text */
}
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 22px; height: 44px; border-radius: var(--r-md);
  font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: all .15s ease; text-align: center;
  white-space: nowrap;
}
.btn-primary { background: var(--c-orange); color: var(--c-white); }
.btn-primary:hover { background: #E66D00; color: var(--c-white); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary { background: var(--c-white); color: var(--c-navy); border-color: var(--c-navy); }
.btn-secondary:hover { background: var(--c-navy); color: var(--c-white); }
.btn-secondary.active { background: var(--c-navy); color: var(--c-white); }

.btn-lg { height: 52px; font-size: 16px; padding: 0 28px; }
.btn-sm { height: 32px; font-size: 13px; padding: 0 14px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ===== HEADER ===== */
.site-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 116px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-mark img {
  height: 96px; width: auto; display: block;
}
.logo-word {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
}
.logo-word strong {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 800;
  font-size: 42px;
  letter-spacing: -.01em;
  color: #0D2B61;
}
.logo-word strong span { color: #FF7A00; }
.logo-word em {
  margin-top: 8px;
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  color: #6B7280;
  text-transform: uppercase;
}
.main-nav { display: flex; gap: 28px; margin-left: 24px; flex: 1; }
.main-nav a {
  color: var(--c-text); font-weight: 600; font-size: 15px;
  padding: 6px 0; position: relative;
  white-space: nowrap;          /* nav items never wrap */
}
.main-nav a:hover { color: var(--c-orange); }
.main-nav a.active { color: var(--c-orange); }
.main-nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: var(--c-orange);
}
.header-right { display: flex; align-items: center; gap: 18px; }
.hdr-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  gap: 2px;
}
.hdr-phone {
  font-weight: 700;
  color: var(--c-navy);
  font-size: 15px;
  /* Phone numbers must always stay on one line — no wrap, no hyphen-break. */
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.hdr-phone:hover { color: var(--c-orange); }
.hdr-email {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-muted);
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s;
}
.hdr-email:hover { color: var(--c-orange); }
.hdr-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-navy); position: relative;
}
.hdr-icon:hover { background: var(--c-bg); color: var(--c-orange); }
.cart-badge {
  position: absolute; top: 0; right: 0;
  background: var(--c-orange); color: var(--c-white);
  font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .hdr-contacts { display: none; }
}
@media (max-width: 640px) {
  .logo-mark img { height: 64px; }
  .logo-word strong { font-size: 28px; }
  .logo-word em { font-size: 9px; letter-spacing: .08em; }
  .header-inner { height: 84px; }
}

/* ===== HERO ===== */
.hero { padding: 32px 0 24px; background: var(--c-white); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  min-height: 460px;
}
.hero-text {
  background: linear-gradient(135deg, var(--c-navy) 0%, #16408C 100%);
  border-radius: var(--r-xl);
  padding: 56px 48px;
  color: var(--c-white);
  display: flex; flex-direction: column; justify-content: center;
}
.hero-text h1 { color: var(--c-white); margin-bottom: 24px; }
.hero-sub { font-size: 18px; margin-bottom: 32px; opacity: 0.9; }
.hero-text .btn-primary { align-self: flex-start; }

.hero-panels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
}
.hero-panel {
  position: relative;
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 24px 16px; color: var(--c-white);
  font-weight: 700;
  transition: transform .25s;
  min-height: 460px;
}
.hero-panel::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,43,97,0.2) 0%, rgba(13,43,97,0.7) 100%);
}
.hero-panel:hover { transform: scale(1.02); }
.hero-panel-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.hero-panel-name { position: relative; z-index: 1; font-size: 22px; }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panels { grid-template-columns: repeat(2, 1fr); }
  .hero-panel { min-height: 200px; }
}

/* ===== ADVANTAGES ===== */
.advantages { padding: 32px 0; background: var(--c-white); }
.advantages-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 32px 24px;
  background: var(--c-bg);
  border-radius: var(--r-xl);
}
.adv-item { text-align: center; padding: 16px; }
.adv-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--c-white);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-navy); margin: 0 auto 16px;
}
.adv-item h3 { font-size: 18px; margin-bottom: 8px; }
.adv-item p { color: var(--c-muted); font-size: 14px; line-height: 1.5; }

@media (max-width: 1024px) { .advantages-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .advantages-grid { grid-template-columns: 1fr; } }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.section-link { color: var(--c-navy); font-weight: 700; font-size: 15px; }

/* ===== PRODUCT CARDS / GRID ===== */
.featured-section { padding: 48px 0; }
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: stretch;
}
@media (max-width: 1024px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .products-grid { grid-template-columns: 1fr; } }

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border-radius: 18px;
  border: 1px solid #e7edf5;
  box-shadow: 0 14px 38px rgba(9,35,75,.06);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  height: 100%;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(9,35,75,.12); }

/* Home page: rectangular cards (no rounded corners, no shadows) — jimmychoo style */
.page-home .products-grid { gap: 0; }           /* rectangles touch edge-to-edge */
.page-home .product-card {
  border-radius: 0;                              /* sharp corners */
  border: none;
  box-shadow: none;
  background: #fff;
}
.page-home .product-card:hover { transform: none; box-shadow: none; opacity: .95; }

/* Category page: full-width edge-to-edge SQUARE cards (jimmychoo style) */
.page-category .catalog-section { padding: 0; }
.page-category .catalog-section > .container,
.page-category .catalog-content { max-width: 100%; padding: 0; margin: 0; }
.page-category .catalog-header { padding: 28px 32px; }
.page-category .products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;                                        /* squares touch edge-to-edge */
  align-items: stretch;
}
.page-category .product-card {
  border-radius: 0;                              /* sharp corners — square */
  border: none;
  box-shadow: none;
  background: #fff;
  transition: none;
}
.page-category .product-card:hover { transform: none; box-shadow: none; }
.page-category .product-card .product-image {
  aspect-ratio: 1 / 1;                           /* SQUARE — full-width */
  width: 100%;
}
.page-category .product-card .product-body {
  padding: 20px 24px 24px;
  background: #fff;
}
@media (max-width: 1024px) { .page-category .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .page-category .products-grid { grid-template-columns: 1fr; } }
.product-image {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  background: #f5f7fa;
  overflow: hidden;
}
.product-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.product-card:hover .product-image img { transform: scale(1.05); }
.product-cat-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--c-navy); color: var(--c-white);
  padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  z-index: 1;
}
.product-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.product-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.product-title a { color: #081b3d; text-decoration: none; }
.product-title a:hover { color: #ff7a00; }
.product-name { font-weight: 700; color: var(--c-text); font-size: 16px; }
.product-desc {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
  /* Allow up to 2 lines, then ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.product-price {
  font-weight: 800;
  color: #0D2B61;
  font-size: 18px;
  line-height: 1.2;
}
.product-price .muted {
  font-weight: 500;
  font-size: 13px;
  color: var(--c-muted);
}
.in-stock { color: #16A34A; font-size: 12px; font-weight: 600; white-space: nowrap; }
.product-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.product-actions .qty-control { flex: 1 1 130px; min-width: 130px; }
.product-actions .btn-primary { flex: 0 0 auto; }
.qty-control {
  display: inline-flex;
  align-items: center;
  background: var(--c-white);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  height: 40px;
  overflow: hidden;
}
.qty-control-lg { height: 48px; }
.qty-btn {
  width: 32px; height: 100%;
  border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--c-navy); font-weight: 700;
}
.qty-input {
  width: 50px; height: 100%; border: 0; text-align: center;
  font-family: inherit; font-weight: 700; font-size: 14px;
  background: transparent; -moz-appearance: textfield;
  min-width: 0;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-unit { color: var(--c-muted); font-size: 12px; margin-left: 6px; white-space: nowrap; }

/* ===== CATALOG LIST ===== */
.catalog-page-hero {
  background: linear-gradient(135deg, var(--c-navy) 0%, #16408C 100%);
  color: var(--c-white);
  padding: 72px 0 56px;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  margin-bottom: 32px;
}
.catalog-page-hero h1 { color: var(--c-white); margin-bottom: 12px; }
.catalog-page-hero p { font-size: 18px; opacity: 0.9; max-width: 720px; }

.cat-list-section { padding: 32px 0 64px; }
.cat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
@media (max-width: 768px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-card-image {
  aspect-ratio: 16/7;
  background-size: cover; background-position: center;
  position: relative;
}
.cat-card-badge {
  position: absolute; top: 16px; left: 16px;
  color: var(--c-white); padding: 6px 14px;
  border-radius: 12px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cat-card-body { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.cat-card-body h3 { margin-bottom: 4px; }
.cat-card-body p { color: var(--c-muted); font-size: 14px; }
.cat-card-link { margin-top: 12px; font-weight: 700; color: var(--c-orange); }

/* ===== CTA SECTION ===== */
.cta-section { padding: 48px 0 72px; }
.cta-inner {
  background: linear-gradient(135deg, var(--c-navy) 0%, #16408C 100%);
  border-radius: var(--r-xl);
  padding: 48px 56px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--c-white);
  gap: 24px;
}
.cta-inner h2 { color: var(--c-white); margin-bottom: 8px; }
.cta-inner p { opacity: 0.85; font-size: 16px; max-width: 600px; }
@media (max-width: 768px) {
  .cta-inner { flex-direction: column; align-items: stretch; text-align: center; padding: 32px; }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--c-navy);
  color: var(--c-white);
  padding: 56px 0 24px;
  margin-top: 48px;
}
.footer-inner {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col h4 { color: var(--c-white); margin-bottom: 16px; font-size: 16px; }
.footer-col a, .footer-col span { display: block; color: rgba(255,255,255,0.7); margin-bottom: 8px; font-size: 14px; }
.footer-col a:hover { color: var(--c-orange); }
.logo-light img { height: 48px; width: auto; margin-bottom: 16px; }
.footer-cta-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 11px 22px;
  background: var(--c-orange);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s, transform .15s;
}
.footer-cta-btn:hover { background: #E66E00; color: #fff !important; transform: translateY(-1px); }
.footer-bottom {
  display: flex; justify-content: space-between; padding-top: 24px;
  font-size: 13px; color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--c-orange); }
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ===== FLASH / ALERT ===== */
.flash, .alert {
  padding: 14px 20px; border-radius: var(--r-md); margin: 16px auto;
  font-size: 14px;
}
.flash-success, .alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.flash-error, .alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.flash-info, .alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert ul { padding-left: 18px; }

/* ===== CAT HERO (баннер раздела) — только фоновая картинка, без текста/иконки ===== */
.cat-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* 4.5:1 banner ratio — ультра-компактный hero (1920×427) */
  aspect-ratio: 4.5 / 1;
  margin-bottom: 0;
}

/* ===== CATALOG ===== */
.catalog-section { padding: 32px 0 64px; }
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; }
@media (max-width: 1024px) { .catalog-layout { grid-template-columns: 1fr; } }

/* Filters are completely removed from category pages — keep no CSS for them */
.catalog-header { display: flex; justify-content: space-between; margin-bottom: 16px; }

/* ===== PRODUCT PAGE ===== */
.product-page { padding: 32px 0 64px; }
.breadcrumbs { color: var(--c-muted); margin-bottom: 24px; font-size: 14px; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-orange); }
.product-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  margin-bottom: 48px;
  align-items: start;
}
@media (max-width: 1024px) { .product-detail { grid-template-columns: 1fr; gap: 24px; } }
/* Галерея: основное фото во всю ширину блока + миниатюры под ним */
.product-gallery { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 96px; }
.product-main-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--c-bg);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.product-main-image img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }

/* Стрелки листания галереи поверх главного фото */
.pg-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: var(--c-navy);
  font-size: 24px; line-height: 1; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(15,23,42,.18);
  transition: background .15s, transform .15s, opacity .15s;
  opacity: 0;
  z-index: 2;
  user-select: none;
}
.product-main-image:hover .pg-arrow,
.pg-arrow:focus { opacity: 1; }
.pg-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.pg-arrow:active { transform: translateY(-50%) scale(.96); }
.pg-prev { left: 12px; }
.pg-next { right: 12px; }
@media (max-width: 640px) {
  .pg-arrow { width: 38px; height: 38px; font-size: 20px; opacity: 1; background: rgba(255,255,255,.92); }
  .pg-prev { left: 8px; }
  .pg-next { right: 8px; }
}
/* Скрыть стрелки, если фото одно (на всякий случай) */
.product-main-image:not(.has-gallery) .pg-arrow { display: none; }

/* Счётчик фото в углу */
.pg-counter {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(15,23,42,.72); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 12px;
  z-index: 2; pointer-events: none;
  letter-spacing: .02em;
}
@media (max-width: 640px) { .pg-counter { right: 8px; bottom: 8px; } }

/* ===== LIGHTBOX (модалка полноразмерного фото) ===== */
.pg-lightbox {
  position: fixed; inset: 0;
  background: rgba(8,12,20,.92);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.pg-lightbox.is-open { display: flex; }
.pg-lightbox-img {
  max-width: 96vw; max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 12px 60px rgba(0,0,0,.5);
  user-select: none;
  -webkit-user-drag: none;
}
.pg-lb-close,
.pg-lb-arrow {
  position: absolute;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
  user-select: none;
  font-family: inherit;
}
.pg-lb-close:hover,
.pg-lb-arrow:hover { background: rgba(255,255,255,.22); }
.pg-lb-close:active,
.pg-lb-arrow:active { transform: scale(.94); }
.pg-lb-close {
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 22px;
}
.pg-lb-arrow {
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 26px; font-weight: 600;
}
.pg-lb-arrow:hover { transform: translateY(-50%) scale(1.06); }
.pg-lb-arrow:active { transform: translateY(-50%) scale(.94); }
.pg-lb-prev { left: 16px; }
.pg-lb-next { right: 16px; }
.pg-lb-counter {
  position: absolute;
  bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: 14px;
  background: rgba(0,0,0,.4);
  padding: 6px 14px;
  border-radius: 14px;
  font-weight: 500;
  letter-spacing: .03em;
}
@media (max-width: 640px) {
  .pg-lb-arrow { width: 44px; height: 44px; font-size: 22px; }
  .pg-lb-prev { left: 8px; }
  .pg-lb-next { right: 8px; }
  .pg-lb-close { width: 40px; height: 40px; font-size: 20px; top: 12px; right: 12px; }
}
body.pg-lb-open { overflow: hidden; }

.product-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.product-thumb {
  width: 100%;
  aspect-ratio: 1;
  padding: 0; border: 2px solid var(--c-border);
  background: var(--c-bg);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, opacity .15s;
  opacity: .7;
  border-radius: 0;
}
.product-thumb:hover { opacity: 1; }
.product-thumb.is-active { border-color: var(--c-orange); opacity: 1; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1024px) {
  .product-gallery { position: static; }
}
.product-detail-info h1 { font-size: 32px; margin: 12px 0 16px; }
.cat-badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  color: var(--c-white); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.product-detail-desc { color: var(--c-text); margin-bottom: 24px; font-size: 16px; }
.product-detail-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--c-line); }
.big-price { font-size: 36px; font-weight: 800; color: var(--c-navy); }
.product-actions-lg { margin-bottom: 32px; }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td {
  padding: 12px 0; text-align: left; border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}
.spec-table th { color: var(--c-muted); font-weight: 500; font-size: 14px; width: 200px; }
.spec-table td { font-weight: 600; color: var(--c-navy); }

.related-section { margin-top: 48px; }

/* ===== PRODUCT TABS (Описание / Характеристики / Хранение / Документы) ===== */
.product-tabs { margin-top: 16px; border-top: 1px solid var(--c-border); }
.tabs-nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 16px;
}
.tab-btn {
  background: transparent;
  border: 0;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  letter-spacing: .01em;
}
.tab-btn:hover { color: var(--c-navy); }
.tab-btn.is-active {
  color: var(--c-orange);
  border-bottom-color: var(--c-orange);
}
.tabs-content { padding: 8px 0 24px; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-prose { color: var(--c-text); font-size: 15px; line-height: 1.65; }
.tab-prose p { margin: 0 0 12px; }
@media (max-width: 640px) {
  .tabs-nav { gap: 0; overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { padding: 12px 12px; font-size: 13px; white-space: nowrap; }
}

/* ===== CART ===== */
.cart-page { padding: 32px 0 64px; }
.cart-page h1 { margin-bottom: 32px; }
.cart-items {
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
  background: var(--c-white); overflow: hidden; margin-bottom: 24px;
}
.cart-item {
  display: grid;
  grid-template-columns: 80px 2fr 1fr 1.4fr 1fr 32px;
  align-items: center; gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--c-line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-thumb {
  display: block;
  width: 80px; height: 60px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
}
.cart-item-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cart-item-name a { font-weight: 700; }
.cart-item-name .muted { font-size: 12px; display: block; }
.cart-item-price, .cart-item-subtotal { font-weight: 700; }
.cart-item-subtotal { color: var(--c-navy); }
.cart-remove {
  width: 32px; height: 32px; border: 0; background: transparent;
  color: var(--c-muted); font-size: 22px; cursor: pointer; border-radius: 50%;
}
.cart-remove:hover { background: #FEE2E2; color: #DC2626; }

.cart-summary {
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.cart-total { font-size: 24px; }
.cart-total strong { color: var(--c-navy); font-size: 32px; }
.cart-actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .cart-item {
    grid-template-columns: 64px 1fr 32px;
    grid-template-rows: auto auto auto;
    gap: 8px 12px;
    padding: 14px 16px;
  }
  .cart-item-thumb {
    grid-column: 1; grid-row: 1 / 4;
    width: 64px; height: 64px;
  }
  .cart-item-name { grid-column: 2; grid-row: 1; }
  .cart-item-price { grid-column: 2; grid-row: 2; }
  .cart-item-subtotal { grid-column: 2; grid-row: 3; align-self: end; text-align: right; }
  .qty-control { grid-column: 2 / 4; grid-row: 4; margin-top: 4px; }
  .cart-remove { grid-column: 3; grid-row: 1; }
}

/* ===== CHECKOUT ===== */
.checkout-page { padding: 32px 0 64px; }
.checkout-page h1 { margin-bottom: 24px; }
.checkout-layout {
  display: grid; grid-template-columns: 2fr 1fr; gap: 32px;
  align-items: start;
}
@media (max-width: 1024px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-form { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 32px; }
.checkout-form h2 { font-size: 22px; margin: 24px 0 16px; }
.checkout-form h2:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field-full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 14px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 0 14px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md);
  font-family: inherit; font-size: 15px;
  height: 44px; background: var(--c-white);
}
.form-field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--c-navy);
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.register-after { margin: 24px 0; padding: 16px; background: var(--c-bg); border-radius: var(--r-md); }

.checkout-summary { background: var(--c-bg); border-radius: var(--r-lg); padding: 24px; position: sticky; top: 110px; }
.checkout-summary h3 { margin-bottom: 16px; }
.summary-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px;
  padding: 12px 0; border-bottom: 1px solid var(--c-line);
}
.summary-item-name { font-weight: 600; grid-column: 1 / -1; }
.summary-item-qty { font-size: 13px; color: var(--c-muted); }
.summary-item-total { font-weight: 700; text-align: right; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--c-navy); font-size: 20px; }
.summary-total strong { font-size: 28px; color: var(--c-navy); }

/* ===== AUTH ===== */
.auth-page { padding: 64px 0; }
.auth-container { max-width: 460px; margin: 0 auto; }
.auth-container h1 { text-align: center; margin-bottom: 32px; font-size: 32px; }
.auth-form { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 32px; }
.auth-bottom { text-align: center; margin-top: 24px; color: var(--c-muted); }
.auth-bottom a { color: var(--c-navy); font-weight: 700; }

/* ===== ACCOUNT ===== */
.account-page { padding: 32px 0 64px; }
.account-page h1 { margin-bottom: 32px; }
.account-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 768px) { .account-grid { grid-template-columns: 1fr; } }
.card { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 24px; margin-bottom: 24px; }
.card h2 { font-size: 22px; margin-bottom: 16px; }
.card h3 { font-size: 18px; margin-bottom: 12px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.card-header h2 { margin-bottom: 4px; }
.card-header-actions { display: flex; gap: 12px; align-items: center; }

.kv-table { width: 100%; }
.kv-table th, .kv-table td { padding: 10px 0; text-align: left; border-bottom: 1px solid var(--c-line); }
.kv-table th { color: var(--c-muted); font-weight: 500; width: 160px; font-size: 14px; }

.history-list { list-style: none; }
.history-list li { padding: 12px 0; border-bottom: 1px solid var(--c-line); font-size: 14px; }
.history-list li:last-child { border-bottom: 0; }

.empty-state { text-align: center; padding: 64px 24px; color: var(--c-muted); }
.empty-state .btn-primary { margin-top: 16px; }

/* ===== ORDER PAGE ===== */
.order-page { padding: 32px 0 64px; }
.order-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  color: var(--c-white); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.status-lg { padding: 8px 16px; font-size: 14px; border-radius: 16px; }

/* ===== STATIC PAGES ===== */
.static-page { padding: 64px 0; max-width: 920px; margin: 0 auto; }
.static-page h1 { margin-bottom: 16px; }
.static-page .lead { font-size: 18px; color: var(--c-muted); margin-bottom: 32px; }
.static-page h2 { margin: 32px 0 16px; font-size: 24px; }
.static-page p { margin-bottom: 16px; }
.check-list { list-style: none; padding: 0; }
.check-list li {
  padding: 8px 0 8px 28px; position: relative;
}
.check-list li::before {
  content: '✓'; position: absolute; left: 0; top: 8px;
  color: var(--c-orange); font-weight: 700;
}

.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: 32px;
}
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 24px;
}
.feature-num {
  display: inline-block; padding: 4px 10px;
  background: var(--c-bg); color: var(--c-orange);
  border-radius: 8px; font-weight: 800; font-size: 13px;
  margin-bottom: 12px;
}
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--c-muted); font-size: 14px; margin-bottom: 0; }

.contacts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 768px) { .contacts-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--c-bg); border-radius: var(--r-lg); padding: 24px;
}
.contact-card h3 { margin-bottom: 8px; font-size: 14px; color: var(--c-muted); font-weight: 600; }
.big-link { font-size: 20px; font-weight: 700; color: var(--c-navy); }
.contact-card-team {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-orange);
}
.contact-card-team h3 { color: var(--c-orange); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ============================
   ADMIN
============================ */
.admin-page { background: var(--c-bg); display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 248px;
  background: linear-gradient(180deg, #0D2B61 0%, #071b41 100%);
  color: #fff;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 18px rgba(13,43,97,.18);
}
.admin-sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.admin-sidebar .logo img {
  filter: brightness(0) invert(1);
  height: 40px;
  width: auto;
}
.admin-sidebar .logo .logo-word strong { color: #fff; font-size: 22px; line-height: 1; }
.admin-sidebar .logo .logo-word strong span { color: #FF7A00; }
.admin-sidebar .logo .logo-word em { color: rgba(255,255,255,.55); font-size: 9px; margin-top: 4px; }

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,.78);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-left: 3px solid transparent;
  white-space: nowrap;          /* nav items never wrap */
  transition: background .15s, color .15s, border-color .15s;
}
.admin-nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.admin-nav a.active {
  background: rgba(255,122,0,.18);
  color: #fff;
  border-left-color: #FF7A00;
}
.admin-nav .nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.admin-nav .nav-divider {
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 12px 6px;
}
.admin-nav .nav-section-title {
  padding: 4px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.40);
}

.admin-main {
  flex: 1;
  padding: 32px 40px;
  min-width: 0;
  background: var(--c-bg);
}
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}
.admin-topbar h1 { font-size: 28px; margin: 0; color: var(--c-navy); }
.admin-topbar .muted { font-size: 13px; }

/* Product photo uploader */
.product-photo-uploader {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.ppu-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--c-border-strong);
  border-radius: 12px;
  background: #F5F7FA center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ppu-preview.ppu-preview-square {
  aspect-ratio: 1 / 1;                       /* квадратная превью для card-изображений */
}
  color: var(--c-muted);
  font-size: 13px;
  position: relative;
  overflow: hidden;
}
.ppu-preview span.muted { position: static; }
.ppu-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ppu-controls input[type="file"] {
  height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
}
.ppu-controls input[type="text"] {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
}
.ppu-controls small { display: block; line-height: 1.45; }
.ppu-controls .btn-secondary { align-self: flex-start; }
@media (max-width: 720px) {
  .product-photo-uploader { grid-template-columns: 1fr; }
}

/* Form checkboxes (admin forms) — proper stacked layout */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  font-weight: 500;
  font-size: 14px;
  color: var(--c-text);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #FF7A00;
  cursor: pointer;
}
.checkbox span { line-height: 1.2; }

.stats-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 20px;
}
.stat-label { color: var(--c-muted); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--c-navy); }

.data-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.data-table thead th {
  background: var(--c-bg); color: var(--c-muted);
  text-align: left; padding: 12px 16px;
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--c-border);
}
.data-table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--c-line);
}
.data-table tbody tr:hover { background: var(--c-bg); }
.data-table .total-row td { background: var(--c-bg); border-top: 2px solid var(--c-navy); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 1024px) { .detail-grid { grid-template-columns: 1fr; } }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--c-line); }

.attr-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; margin-bottom: 8px; }
.attr-row input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--c-border-strong); border-radius: var(--r-md); font-family: inherit; }

.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); }

/* Admin login */
.admin-login-page { background: var(--c-navy); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.admin-login-wrap { width: 100%; max-width: 420px; }
.admin-login {
  background: var(--c-white); border-radius: var(--r-xl);
  padding: 40px; box-shadow: var(--shadow-lg);
}
.admin-login .logo { display: flex; justify-content: center; margin-bottom: 24px; }
.admin-login h1 { text-align: center; font-size: 24px; margin-bottom: 24px; color: var(--c-navy); }

/* Mobile sidebar (slide from RIGHT) */
@media (max-width: 1024px) {
  .admin-sidebar {
    position: fixed;
    top: 0; right: -280px; bottom: 0;
    width: 280px;
    transition: right .25s ease;
    z-index: 1100;
    box-shadow: -8px 0 32px rgba(15,23,42,.18);
    overflow-y: auto;
  }
  .admin-sidebar.open { right: 0; }
  .admin-main { padding: 70px 14px 24px; }
  .admin-topbar h1 { font-size: 20px; line-height: 1.2; }
  .admin-topbar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
}

/* Hamburger toggle (visible only on mobile) */
.admin-menu-toggle {
  display: none;
  background: var(--c-orange, #FF7A00);
  border: none;
  color: #fff;
  width: 42px; height: 42px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(255,122,0,.3);
}
.admin-menu-toggle:hover { background: #E66B00; }
.admin-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 1099;
  opacity: 0;
  transition: opacity .25s;
}
.admin-sidebar-overlay.show { opacity: 1; pointer-events: auto; }
.admin-sidebar-overlay { pointer-events: none; }
@media (max-width: 1024px) {
  .admin-menu-toggle { display: inline-flex; order: -1; }
  .admin-sidebar-overlay { display: block; }
  body.admin-page { overflow-x: hidden; }
}

/* Product-edit mobile tweaks */
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-field label { font-size: 13px; }
  .form-field input[type="text"],
  .form-field input[type="number"],
  .form-field input[type="date"],
  .form-field textarea,
  .form-field select {
    font-size: 16px; /* iOS zoom prevention */
    width: 100%;
    max-width: 100%;
  }
  textarea[name="description"],
  textarea[name="documents"] { min-height: 100px; }
  .card { padding: 14px; margin: 12px 0; border-radius: 12px; }
  h2[style*="margin-top:32px"] { margin-top: 22px !important; font-size: 18px; }
  .checkbox-group { padding: 10px 12px; }
  .attr-row { grid-template-columns: 1fr; gap: 6px; }
  .form-actions { flex-wrap: wrap; gap: 10px; }
  .form-actions > * { flex: 1; min-width: 140px; }
  /* Gallery tiles: 2 columns on phone */
  .pp-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .pp-action-btn { width: 28px; height: 28px; font-size: 14px; }
  .pp-badge { font-size: 10px; padding: 2px 6px; }
  /* AI boxes: tighter padding */
  #aiBox, #aiImgBox { padding: 12px !important; }
  /* Crop modal: take more of the screen */
  .pp-modal-inner { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .pp-canvas-wrap { min-height: 50vh; }
  .pp-modal-controls { padding: 10px 12px; flex-wrap: wrap; }
  .pp-modal-controls input[type="range"] { flex: 1; min-width: 120px; }
}

/* Prevent horizontal overflow on small screens */
@media (max-width: 480px) {
  .admin-main { padding: 70px 10px 20px; }
  .form-field input, .form-field select, .form-field textarea { font-size: 14px; }
  .pp-gallery { grid-template-columns: 1fr !important; }
}

/* ============================================== */
/* ===== NEW HOMEPAGE LAYOUT (from fixed.zip) === */
/* ============================================== */

/* Hero carousel */
.hero { padding: 16px 0; background: #fff; }
.hero-carousel {
  position: relative;
  height: 390px;
  border-radius: 14px;
  overflow: hidden;
  background: #061b3f;
  box-shadow: 0 12px 36px rgba(10,35,80,.10);
}
/* Home page: full-width rectangular hero (jimmychoo style — no rounded corners) */
.page-home .hero { padding: 0; }
.page-home .hero > .container { max-width: 100%; padding: 0; }
.page-home .hero-carousel { border-radius: 0; box-shadow: none; height: 460px; }
.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .8s ease;
  display: flex;
  align-items: stretch;
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
/* No blue gradient ::before — overlay panel handles the dimming */
/* Image fills slide via <picture> instead of background-image so mobile
   media query can swap the source. */
.hero-slide .hero-picture,
.hero-slide .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-slide .hero-img {
  object-fit: cover;
  object-position: center right;
  z-index: 0;
  display: block;
}
.hero-slide .hero-overlay {
  position: relative;
  z-index: 2;
  width: 52%;
  max-width: 620px;
  height: 100%;
  padding: 40px;                 /* universal carousel-edge margin: top/right/bottom/left */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
  pointer-events: none;
}
.hero-slide .hero-overlay > * { pointer-events: auto; }

/* Text panel — sits in top-left corner of overlay's content area (40px from each edge). */
.hero-slide .hero-overlay-text {
  background: var(--hero-overlay-bg, rgba(31,41,55,0.70));
  color: var(--hero-overlay-fg, #fff);
  margin: 0;
  padding: 22px 28px;              /* tight panel padding — fits in 390px carousel with action visible */
  border-radius: 8px;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 0;
}
/* Home: rectangular text panel (no rounded corners) */
.page-home .hero-slide .hero-overlay-text { border-radius: 0; }
.hero-slide .hero-overlay-text h1 {
  color: #FF7A00;                  /* orange title per palette */
  font-size: 32px;
  line-height: 1.12;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.hero-slide .hero-overlay-text p {
  color: var(--hero-overlay-fg, #fff);
  opacity: .9;
  font-size: 21px;                /* 14 × 1.5 — bigger description on web */
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-slide .hero-overlay-action {
  margin-top: auto;              /* fills any remaining space between panel and bottom */
  padding-top: 40px;             /* minimum 40px gap between panel and button */
  background: transparent;
}
.hero-slide .hero-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ff7a00; color: #fff;
  padding: 16px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  width: max-content;
  white-space: nowrap;          /* button text never wraps */
  box-shadow: 0 8px 18px rgba(255,122,0,.28);
  transition: background .15s, transform .15s;
}
.hero-slide .hero-btn:hover { background: #e96e00; transform: translateY(-1px); }
/* Home: rectangular hero button (no rounded corners) */
.page-home .hero-slide .hero-btn { border-radius: 0; }

.hero-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 5;
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .15s;
}
.hero-arrow:hover { background: rgba(255,255,255,.32); }
.hero-arrow-prev { left: 12px; }
.hero-arrow-next { right: 12px; }

.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 6px;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  transition: background .15s, width .2s;
  padding: 0;
}
.hero-dot.is-active { background: #ff7a00; width: 22px; border-radius: 4px; }
.hero-dot:hover { background: rgba(255,255,255,.85); }

@media (max-width: 1100px) {
  .hero-carousel { height: 340px; }
  .hero-slide .hero-overlay       { width: 60%; padding: 32px; }
  .hero-slide .hero-overlay-action{ padding-top: 32px; }
  .hero-slide .hero-overlay-text    { padding: 18px 24px; }
  .hero-slide .hero-overlay-text h1 { font-size: 26px; }
  .hero-slide .hero-overlay-text p  { font-size: 19px; }   /* 13 × 1.5 */
}
@media (max-width: 640px) {
  .hero-carousel { height: 240px; }
  .hero-track { min-height: 240px; }
  /* Mobile source asset is 1080×350 (wide strip). Rendered area is wider and short. */
  .hero-slide .hero-img { object-position: center 30%; }

  .hero-slide .hero-overlay {
    width: 100%;
    padding: 16px;                  /* universal carousel-edge margin on mobile */
    text-align: left;
  }
  /* Text panel — capped to half of banner; button always fits below. */
  .hero-slide .hero-overlay-text {
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 100%;
    max-height: calc(50% - 16px);   /* text ≤ half of banner */
    overflow: hidden;
    box-sizing: border-box;
  }
  .hero-slide .hero-overlay-text h1 {
    font-size: 17px;
    line-height: 1.2;
    margin: 0 0 4px;
    letter-spacing: -.01em;
  }
  .hero-slide .hero-overlay-text p {
    font-size: 11px;
    line-height: 1.35;
    margin: 0;
    color: #fff;
    opacity: .9;
    /* clamp to 3 lines if it tries to overflow */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-slide .hero-overlay-action {
    margin-top: auto;
    padding-top: 16px;              /* minimum gap from panel to button */
  }
  .hero-slide .hero-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
  /* Hide position indicator (dots) on mobile */
  .hero-dots { display: none; }
  /* Arrows: vertical-center on sides (no overlap with button) */
  .hero-arrow {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 34px; height: 34px;
  }
  .hero-arrow-prev { left: 12px; }
  .hero-arrow-next { right: 12px; }
}
@media (max-width: 420px) {
  .hero-carousel { height: 220px; }
  .hero-track { min-height: 220px; }
  .hero-slide .hero-overlay { padding: 14px; }
  .hero-slide .hero-overlay-text {
    padding: 8px 12px;
    max-height: calc(50% - 14px);
  }
  .hero-slide .hero-overlay-text h1 { font-size: 15px; margin: 0 0 3px; line-height: 1.2; }
  .hero-slide .hero-overlay-text p  { font-size: 10px; line-height: 1.3; }
  .hero-slide .hero-overlay-action { padding-top: 14px; }
  .hero-slide .hero-btn { padding: 9px 18px; font-size: 12px; }
}

/* Advantages block (admin-editable, 4-in-a-row) — jimmychoo-style full-width rectangular */
.page-home .features { padding: 14px 0 20px; background: #fff; }
.advantages-heading {
  font-size: 30px;                     /* same as .section-head h2 */
  font-weight: 700;                    /* same as .section-head h2 (h2 base) */
  color: var(--c-orange);              /* orange palette */
  text-align: left;
  text-transform: none;
  letter-spacing: -0.03em;             /* same as .section-head h2 */
  margin: 0;                           /* no spacing above/below */
}
/* Home page: full-width rectangular advantages strip */
.page-home .features { padding: 0; background: #fff; }
.page-home .features > .container { max-width: 100%; padding: 0; }
.page-home .advantages-heading { padding: 14px 24px 8px; margin: 0; }
.page-home .advantages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;                              /* rectangles touch — no rounded card */
  background: #fff;
  border: none;                        /* jimmychoo: no outer border */
  border-radius: 0;                    /* sharp corners */
  box-shadow: none;                    /* flat, no shadow */
  padding: 0;
}
.advantage {
  display: flex;
  flex-direction: row;
  align-items: flex-start;             /* text starts at top, not vertically centered */
  text-align: left;
  padding: 24px 26px;                  /* bigger breathing room */
  gap: 18px;
  border-right: 1px solid var(--c-orange);
  background: #fff;
}
.advantage:last-child { border-right: none; }
.advantage-photo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}
.advantage-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;                  /* круглое изображение */
  object-fit: cover;
  display: block;
  background: #F1F5F9;
}
.advantage-photo-empty {
  border-radius: 50%;
  background: #F1F5F9;
  color: var(--c-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.advantage-icon {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--c-orange);
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 5px;
  box-sizing: border-box;
}
.advantage-icon svg { width: 100%; height: 100%; display: block; }
.advantage-text {
  display: flex; flex-direction: column;
  min-width: 0;
  flex: 1;
}
.advantage b {
  font-size: 17px;                     /* unified with body text */
  margin: 0 0 6px;                     /* text starts at TOP */
  color: var(--c-navy);
  font-weight: 800;
  line-height: 1.25;
}
.advantage span {
  font-size: 15px;                     /* unified with body text */
  color: var(--c-muted);
  line-height: 1.5;
  display: block;                      /* show on mobile too */
}

@media (max-width: 920px) {
  .advantages-grid { grid-template-columns: repeat(2, 1fr); }
  /* 2-col: hide right border on every 2nd item */
  .advantage:nth-child(2n) { border-right: none; }
}
@media (max-width: 720px) {
  .advantages-heading { font-size: 22px; margin-bottom: 4px; letter-spacing: -0.01em; }
  .advantages-grid {
    grid-template-columns: 1fr;        /* 1 column on mobile, full text visible */
    gap: 0;
    padding: 0;
  }
  .advantage {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 20px 24px;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid var(--c-orange);
  }
  .advantage:last-child { border-bottom: none; }
  .advantage-photo-wrap { width: 64px; height: 64px; }
  .advantage-photo { width: 64px; height: 64px; }
  .advantage-icon { width: 26px; height: 26px; padding: 4px; }
  .advantage b { font-size: 16px; margin-bottom: 4px; }
  .advantage span { font-size: 14px; line-height: 1.45; }
}

/* Sections: categories + products — full-width rectangular on home */
.page-home .categories-section,
.page-home .products-section { padding: 0; background: #fff; }
.page-home .features { background: #fff; }
.page-home .categories-section > .container,
.page-home .products-section > .container,
.page-home .features > .container { max-width: 100%; padding: 0; }
.page-home .section-head { padding: 32px 32px 20px; margin: 0; position: relative; }
.page-home .section-head::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 36px;
  background: var(--c-orange);
}
.page-home .section-head h2,
.page-home .advantages-heading {
  padding-left: 16px;                  /* space for orange bar */
  position: relative;
}
/* Orange accent bar for advantages-heading (not inside .section-head) */
.page-home .advantages-heading::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 28px;
  background: var(--c-orange);
}
.page-home .category-grid,
.page-home .products-grid { padding: 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 13px 0 11px;
  gap: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 800;                    /* extra-bold for visual weight */
  color: var(--c-navy);                /* navy — same as base h2 */
  letter-spacing: -.025em;
  line-height: 1.15;
}
.section-link {
  color: #0d2b61;
  font-weight: 800;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  padding: 8px 0;
  border-bottom: 2px solid var(--c-orange);
  transition: color .2s;
}
.section-link:hover { color: #ff7a00; }

/* Category grid — home page uses rectangular cards with no rounded corners */
.page-home .category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;                              /* rectangles touch edge-to-edge */
}
.page-home .category {
  background: #fff;
  border: none;                        /* jimmychoo: no card border */
  border-radius: 0;                    /* rectangular — no rounded corners */
  overflow: hidden;
  box-shadow: none;                    /* flat, no shadow */
  transition: opacity .2s;
  aspect-ratio: 1 / 1;                  /* square card */
  position: relative;
}
.page-home .category:hover { opacity: .85; }
.category a {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  height: 100%;
}
.category img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* Category overlay (icon + title + gradient) removed — clean photo-only cards on home */
.category > a > div.category-label,
.category-icon,
.category h3 { display: none !important; }

/* CTA */
.cta {
  margin-top: 5px;
  margin-bottom: 29px;
  padding: 19px 23px;
  border-radius: 18px;
  background: linear-gradient(135deg,#0d2b61,#071b41);
  color: #fff;
  box-shadow: 0 16px 50px rgba(10,35,80,.10);
}
.cta-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 30px;
}
.cta h2 { margin: 0 0 10px; font-size: 32px; color: #fff; }
.cta p { margin: 0; color: #d8e3f4; font-size: 16px; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ff7a00; color: #fff;
  padding: 17px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(255,122,0,.24);
}
.cta-btn:hover { background: #e96e00; }

/* New homepage responsive */
@media (max-width: 1100px) {
  .feature-grid, .category-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card { flex-direction: column; }
  .product-card .product-img { width: 100%; flex: 0 0 auto; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .feature-grid, .category-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }   /* products: 2 per row on mobile */
  .feature { border-right: 0; border-bottom: 1px solid #e7edf5; }
  .page-home .category-grid { grid-template-columns: 1fr; }
  /* category-label / icon / h3 are hidden on all breakpoints — see .category > a > div.category-label rule above */
  .page-home .section-head { padding: 22px 18px 14px; }
  .page-home .section-head h2,
  .page-home .advantages-heading { font-size: 24px; }
}

/* ===== Toast notifications (cart add etc) ===== */
.kf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  min-width: 280px;
  max-width: 380px;
  background: #fff;
  color: #1F2933;
  border: 1px solid #e7edf5;
  border-left: 4px solid #16A34A;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 50px rgba(10,35,80,.18);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(20px);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  font-size: 14px;
}
.kf-toast.kf-toast-show { opacity: 1; transform: translateY(0); }
.kf-toast-error { border-left-color: #DC2626; }
.kf-toast-msg { flex: 1; font-weight: 600; }
.kf-toast-link { color: #0D2B61; font-weight: 700; text-decoration: none; white-space: nowrap; }
.kf-toast-link:hover { color: #FF7A00; }
.kf-toast-close {
  background: transparent; border: 0;
  width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer;
  font-size: 18px; line-height: 1; color: #6B7280;
}
.kf-toast-close:hover { background: #F5F7FA; color: #1F2933; }
@media (max-width: 480px) {
  .kf-toast { left: 12px; right: 12px; min-width: 0; max-width: none; }
}

/* ===== v2.0.0: BULK PRICE + TIER TABLE + BOX CALCULATOR ===== */
.bulk-price-block {
  background: linear-gradient(135deg, #FFF6EC 0%, #FFF 100%);
  border: 1px solid var(--c-orange);
  border-radius: var(--r-lg);
  padding: 16px 22px;
  margin-bottom: 18px;
}
.bulk-price-label {
  font-size: 12px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 4px;
}
.bulk-price {
  font-size: 18px;
  color: var(--c-navy);
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.bulk-price-val {
  font-size: 44px;
  font-weight: 800;
  color: var(--c-orange);
  letter-spacing: -0.02em;
  line-height: 1;
}
.bulk-price-unit { font-size: 18px; color: var(--c-muted); font-weight: 600; }

.tier-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tier-table th {
  background: var(--c-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  padding: 10px 14px;
  text-align: left;
}
.tier-table td {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--c-navy);
  border-top: 1px solid var(--c-line);
  vertical-align: middle;
}
.tier-table td strong { font-weight: 700; font-size: 16px; }
.tier-table .tier-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.tier-dot-small  { background: #93C5FD; }
.tier-dot-medium { background: #2563EB; }
.tier-dot-bulk   { background: var(--c-orange); }
.tier-row-active { background: #FFF6EC !important; }
.tier-row-active td strong { color: var(--c-orange); }

.box-calculator { margin-bottom: 32px; }
.box-qty-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.product-actions-boxes .qty-control {
  margin-bottom: 16px;
  width: 100%;
  max-width: 320px;
}

.calc-result {
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
  border: 1px solid var(--c-border);
}
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.calc-row .calc-label { color: var(--c-muted); }
.calc-row .calc-value { color: var(--c-navy); font-weight: 600; }
.calc-row-main .calc-value { font-weight: 700; font-size: 15px; }
.calc-row-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid var(--c-navy);
}
.calc-row-total .calc-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.calc-row-total .calc-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--c-orange);
  letter-spacing: -0.02em;
}

.btn-add-to-order { width: 100%; max-width: 320px; }

/* ===== INFO BLOCKS (documents, storage, specs) ===== */
.info-block {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 16px;
}
.info-block-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.info-block-content { color: var(--c-text); font-size: 14px; line-height: 1.6; }
.info-block .spec-table { background: transparent; }
.info-block.alert-warn {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 640px) {
  .bulk-price-val { font-size: 34px; }
  .bulk-price { font-size: 16px; }
  .tier-table th, .tier-table td { padding: 8px 10px; font-size: 13px; }
  .tier-table td strong { font-size: 14px; }
  .calc-row-total .calc-value { font-size: 24px; }
  .btn-add-to-order { max-width: 100%; }
}

/* ===== CATALOG/CATEGORY: bulk price + box hint on cards ===== */
.product-card .product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 6px;
}
.product-card .product-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-orange);
  letter-spacing: -0.02em;
}
.product-card .product-price .muted {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-muted);
}
.product-card .product-price-hint {
  display: block;
  font-size: 11px;
  color: var(--c-muted);
  margin-top: 2px;
  font-weight: 500;
}
/* ==========================================================================
   Универсальные справочники (admin/references.php)
   ========================================================================== */
.refs-layout {
  display: grid;
  grid-template-columns: 220px 280px 1fr;
  gap: 20px;
  margin-top: 18px;
}
.refs-layout > section,
.refs-layout > aside {
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.refs-groups h3,
.refs-attrs h3,
.refs-options h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-navy);
}
.refs-groups-list,
.refs-attrs-list,
.refs-options-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.refs-groups-list li a,
.refs-attrs-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--c-text);
  transition: background .15s;
}
.refs-groups-list li a:hover,
.refs-attrs-list li a:hover { background: var(--c-bg); }
.refs-groups-list li.active a,
.refs-attrs-list li.active a {
  background: var(--c-navy);
  color: #fff;
}
.refs-groups-list .g-icon { font-size: 18px; }
.refs-groups-list .g-name { font-size: 14px; font-weight: 600; }

.refs-attrs-list li a { font-size: 13px; }
.refs-attrs-list .a-type {
  font-size: 11px;
  background: var(--c-bg);
  color: var(--c-muted);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
}
.refs-attrs-list li.active .a-type {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.refs-attrs-list .a-filter {
  color: var(--c-orange);
  font-size: 14px;
}
.refs-attrs-list li.active .a-filter { color: #fff; }
.refs-attrs-list .a-unit {
  font-size: 11px;
  color: var(--c-muted);
}
.refs-attrs-list li.active .a-unit { color: rgba(255,255,255,0.7); }

.refs-options-head,
.refs-attrs-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.refs-options-head h3,
.refs-attrs-head h3 { margin-right: auto; margin-bottom: 0; }

.refs-options-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  background: #fff;
  cursor: grab;
}
.refs-options-list li.dragging { opacity: 0.4; }
.refs-options-list .opt-handle {
  color: var(--c-muted);
  cursor: grab;
  user-select: none;
}
.refs-options-list .opt-text {
  flex: 1;
  font-size: 14px;
}
.refs-options-list .opt-edit,
.refs-options-list .opt-delete {
  background: none;
  border: none;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
}
.refs-options-list .opt-edit:hover { color: var(--c-navy); background: var(--c-bg); }
.refs-options-list .opt-delete:hover { color: #fff; background: #dc3545; }

/* ===== UX-улучшения редактора справочников ===== */
.refs-pane { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.refs-pane h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; margin: 0;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-navy);
}
.refs-pane h3 .badge {
  background: var(--c-orange); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  letter-spacing: 0; text-transform: none;
}
.refs-search {
  position: relative;
}
.refs-search input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--c-bg);
  transition: border-color .15s, background .15s;
}
.refs-search input:focus { outline: none; border-color: var(--c-orange); background: #fff; }
.refs-search::before {
  content: "🔍";
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; opacity: .55;
}
.refs-list-scroll { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.refs-list-scroll::-webkit-scrollbar { width: 6px; }
.refs-list-scroll::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }

.refs-groups-list li { margin-bottom: 4px; }
.refs-groups-list li a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--c-text);
  transition: all .15s;
}
.refs-groups-list li a:hover {
  background: var(--c-bg);
  border-color: var(--c-border);
}
.refs-groups-list li.active a {
  background: var(--c-navy);
  color: #fff;
  border-color: var(--c-navy);
  box-shadow: 0 2px 8px rgba(15,23,42,.15);
}
.refs-groups-list .g-icon {
  font-size: 18px;
  text-align: center;
}
.refs-groups-list .g-name { font-size: 14px; font-weight: 600; }
.refs-groups-list .g-count {
  font-size: 11px;
  background: var(--c-bg);
  color: var(--c-muted);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.refs-groups-list li.active .g-count {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.refs-attrs-list li { margin-bottom: 6px; }
.refs-attrs-list li a {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  background: #fff;
  transition: all .15s;
}
.refs-attrs-list li a:hover {
  background: var(--c-bg);
  border-color: var(--c-orange);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.refs-attrs-list li.active a {
  background: var(--c-navy);
  color: #fff;
  border-color: var(--c-navy);
}
.refs-attrs-list .a-name { font-size: 14px; font-weight: 600; }
.refs-attrs-list .a-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 4px;
  background: #EFF6FF;
  color: #1E40AF;
  white-space: nowrap;
}
.refs-attrs-list .a-type.t-select     { background: #DBEAFE; color: #1E40AF; }
.refs-attrs-list .a-type.t-multiselect{ background: #E0E7FF; color: #4338CA; }
.refs-attrs-list .a-type.t-number     { background: #DCFCE7; color: #166534; }
.refs-attrs-list .a-type.t-range      { background: #D1FAE5; color: #065F46; }
.refs-attrs-list .a-type.t-text       { background: #F1F5F9; color: #475569; }
.refs-attrs-list .a-type.t-textarea   { background: #F1F5F9; color: #475569; }
.refs-attrs-list .a-type.t-date       { background: #FEF3C7; color: #92400E; }
.refs-attrs-list .a-type.t-checkbox   { background: #FCE7F3; color: #9D174D; }
.refs-attrs-list li.active .a-type { background: rgba(255,255,255,.18); color: #fff; }
.refs-attrs-list .a-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--c-muted);
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--c-border);
}
.refs-attrs-list li.active .a-meta { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.18); }
.refs-attrs-list .a-filter-badge {
  background: #FFF7ED; color: #C2410C;
  padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 600;
}
.refs-attrs-list li.active .a-filter-badge {
  background: rgba(255,255,255,.18); color: #fff;
}

.refs-options-list li {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
  cursor: grab;
  transition: all .15s;
}
.refs-options-list li:hover {
  border-color: var(--c-orange);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.refs-options-list li.dragging { opacity: 0.4; cursor: grabbing; }
.refs-options-list .opt-handle {
  color: var(--c-muted);
  cursor: grab;
  user-select: none;
  font-size: 16px;
  text-align: center;
  line-height: 1;
}
.refs-options-list .opt-text {
  font-size: 14px;
  outline: none;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: text;
}
.refs-options-list .opt-text:hover { background: var(--c-bg); }
.refs-options-list .opt-text:focus {
  background: #fff;
  border-color: var(--c-orange);
  cursor: text;
}
.refs-options-list .opt-text[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: var(--c-muted);
  opacity: .5;
}
.refs-options-list .opt-actions { display: flex; gap: 2px; }
.refs-options-list .opt-edit,
.refs-options-list .opt-delete {
  background: none;
  border: 1px solid transparent;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .12s;
}
.refs-options-list .opt-edit:hover {
  color: var(--c-navy);
  background: var(--c-bg);
  border-color: var(--c-border);
}
.refs-options-list .opt-delete:hover {
  color: #fff;
  background: #DC2626;
  border-color: #DC2626;
}

.refs-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--c-muted);
}
.refs-empty-icon { font-size: 48px; opacity: .35; margin-bottom: 12px; }
.refs-empty-title { font-size: 14px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.refs-empty-hint { font-size: 12px; }

.refs-pane-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.refs-help {
  font-size: 11px;
  color: var(--c-muted);
  background: #F8FAFC;
  border: 1px dashed var(--c-border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Toast уведомления */
.refs-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: refsToastIn .3s ease;
}
.refs-toast.success { background: #16A34A; }
.refs-toast.error   { background: #DC2626; }
.refs-toast.info    { background: #2563EB; }
@keyframes refsToastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Улучшенные модалки */
.modal-card {
  width: min(540px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.modal-card .modal-subtitle {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 16px;
}
.modal-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}
.modal-card label small {
  display: block;
  font-weight: 400;
  color: var(--c-muted);
  margin-top: 4px;
  font-size: 11px;
}
.modal-card input[type="text"],
.modal-card input[type="email"],
.modal-card input:not([type]),
.modal-card select {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  margin-top: 4px;
  font-weight: 400;
  color: var(--c-text);
  background: #fff;
}
.modal-card input:focus,
.modal-card select:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(255,122,0,.15);
}
.modal-card label.check {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400;
  padding: 8px 12px;
  background: var(--c-bg);
  border-radius: 6px;
  cursor: pointer;
}
.modal-card label.check input { margin: 0; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--c-border);
}

/* Кнопки в шапке панелей */
.refs-pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.refs-pane-head h3 { flex: 1; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  transition: all .15s;
  font-family: inherit;
}
.btn-icon:hover { background: var(--c-bg); border-color: var(--c-orange); }
.btn-icon.btn-primary {
  background: var(--c-orange);
  color: #fff;
  border-color: var(--c-orange);
}
.btn-icon.btn-primary:hover { background: #EA6F00; border-color: #EA6F00; }
.btn-icon.btn-danger {
  background: #fff;
  color: #DC2626;
  border-color: #FCA5A5;
}
.btn-icon.btn-danger:hover { background: #DC2626; color: #fff; border-color: #DC2626; }
.btn-icon.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-muted);
  padding: 4px 8px;
  font-size: 14px;
}
.btn-icon.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }

@media (max-width: 1024px) {
  .refs-layout { grid-template-columns: 1fr; }
  .refs-list-scroll { max-height: none; }
}

/* ==========================================================================
   Универсальные характеристики (новый блок в product-edit.php)
   ========================================================================== */
.attr-section {
  margin: 18px 0;
  padding: 16px;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.attr-section .attr-group-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-navy);
}
.attr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 768px) {
  .attr-grid { grid-template-columns: 1fr; }
}
.attr-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--c-text);
}
.attr-field input[type="text"],
.attr-field input[type="number"],
.attr-field input[type="date"],
.attr-field select,
.attr-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font: inherit;
  background: #fff;
}
.attr-field input[type="text"]:focus,
.attr-field input[type="number"]:focus,
.attr-field input[type="date"]:focus,
.attr-field select:focus,
.attr-field textarea:focus {
  outline: none;
  border-color: var(--c-orange);
}
.attr-field .unit { color: var(--c-muted); font-size: 12px; margin-left: 6px; }
.attr-field.required label::after { content: ' *'; color: #dc3545; }

/* Множественный выбор — теги */
.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fff;
  min-height: 42px;
}
.multi-select .tag {
  background: var(--c-navy);
  color: #fff;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.multi-select .tag .remove {
  cursor: pointer;
  opacity: 0.7;
}
.multi-select .tag .remove:hover { opacity: 1; }
.multi-select select {
  border: none;
  outline: none;
  flex: 1;
  min-width: 100px;
  font: inherit;
  background: transparent;
  padding: 2px 4px;
}

/* Чекбокс-свойства в 3 колонки */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 768px) {
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--c-bg);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
}
.checkbox-grid label:hover { background: #E5EAF0; }
.checkbox-grid input[type="checkbox"] { margin: 0; }

/* ==========================================================================
   Цены: 3 уровня (на карточке товара)
   ========================================================================== */
.price-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}
@media (max-width: 768px) {
  .price-tiers { grid-template-columns: 1fr; }
}
.price-tier {
  padding: 16px;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: var(--r-md);
  text-align: center;
  position: relative;
  transition: all .2s;
}
.price-tier.is-best {
  background: linear-gradient(135deg, var(--c-orange), #FF9D3D);
  color: #fff;
  border-color: var(--c-orange);
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}
.price-tier.is-best::before {
  content: '★ ЛУЧШАЯ ЦЕНА';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-orange);
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.price-tier .tier-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-bottom: 6px;
  font-weight: 600;
}
.price-tier .tier-price {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}
.price-tier .tier-price-box {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}
.price-tier .tier-min {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

/* ==========================================================================
   Калькулятор стоимости
   ========================================================================== */
.cost-calculator {
  margin: 18px 0;
  padding: 18px;
  background: linear-gradient(135deg, var(--c-navy), #1a4080);
  color: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.cost-calculator h3 {
  font-size: 16px;
  margin-bottom: 12px;
}
.calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  .calc-inputs { grid-template-columns: 1fr; }
}
.calc-inputs label {
  font-size: 12px;
  opacity: 0.8;
  display: block;
  margin-bottom: 4px;
}
.calc-inputs input {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 600;
  background: rgba(255,255,255,0.95);
  color: var(--c-text);
}
.calc-result {
  background: rgba(255,255,255,0.1);
  padding: 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.7;
}
.calc-result strong { color: var(--c-orange); font-size: 18px; }
.calc-result .row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

/* ==========================================================================
   Документы товара (админ/публичная часть)
   ========================================================================== */
.product-docs {
  margin: 14px 0;
}
.product-docs h4 { font-size: 14px; margin-bottom: 10px; color: var(--c-navy); }
.docs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docs-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--c-bg);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.docs-list .doc-icon {
  width: 28px;
  height: 28px;
  background: var(--c-navy);
  color: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.docs-list .doc-icon.pdf { background: #dc3545; }
.docs-list .doc-icon.jpg,
.docs-list .doc-icon.png,
.docs-list .doc-icon.webp { background: #0D4F8B; }
.docs-list .doc-icon.docx,
.docs-list .doc-icon.doc { background: #1a4080; }
.docs-list .doc-title { flex: 1; }
.docs-list .doc-size { color: var(--c-muted); font-size: 12px; }

/* Загрузка документов в админке */
.doc-uploader {
  border: 2px dashed var(--c-border);
  padding: 20px;
  border-radius: var(--r-md);
  text-align: center;
  background: var(--c-bg);
}
.doc-uploader.drag-over { border-color: var(--c-orange); background: #fff7ed; }
.doc-uploader input[type="file"] { display: none; }
.doc-uploader label { cursor: pointer; color: var(--c-orange); font-weight: 600; }
.doc-uploader .hint { color: var(--c-muted); font-size: 12px; margin-top: 6px; }

/* Сертификаты (теги) */
.cert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cert-tag {
  background: var(--c-orange);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.cert-tag.is-organic { background: #2F6B3F; }

/* Старые правила .product-gallery (сетка 2fr/1fr/1fr для .pg-main/.pg-thumb) и .gallery-thumbs
   удалены: использовалась разметка .product-main-image + .product-thumbs (см. выше). */

/* Миниатюры галереи под основным фото */

/* Светофор цветов (модалки) */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff;
  padding: 24px;
  border-radius: var(--r-md);
  width: min(90vw, 480px);
  box-shadow: var(--shadow-lg);
}
.modal-card h3 {
  margin-bottom: 16px;
  color: var(--c-navy);
}
.modal-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.modal-card label input,
.modal-card label select,
.modal-card label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font: inherit;
}
.modal-card label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ===== AI-генерация для категорий ===== */
.cat-ai-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px dashed var(--c-orange);
  border-radius: 12px;
  background: #FFF7F0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cat-ai-panel-title { color: var(--c-orange); font-size: 15px; }
.cat-ai-panel-hint  { font-size: 13px; flex: 1; }

.cat-ai-block {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cat-ai-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cat-ai-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-muted);
  min-width: 140px;
}
.cat-ai-select {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  background: var(--c-white);
  font: inherit;
  font-size: 14px;
  color: var(--c-text);
}
.cat-ai-select:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}
.cat-ai-textarea {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  background: var(--c-white);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
.cat-ai-textarea:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}
.cat-ai-status {
  font-size: 12px;
  color: var(--c-muted);
}
.cat-ai-hint {
  display: block;
  font-size: 12px;
}

@media (max-width: 600px) {
  .cat-ai-row { flex-direction: column; align-items: stretch; }
  .cat-ai-label { min-width: 0; }
}


/* ============================================ */
/* ===== Admin global image preview (lightbox) - applies to ALL <img> in admin pages === */
/* ============================================ */

/* 1) Make every admin <img> visibly clickable */
.admin-main img,
.admin-sidebar img,
.admin-page .logo img,
.admin-page .ppu-preview,
.admin-page .pp-tile img,
.admin-page .data-table img,
.admin-page .ref-cell img,
.admin-page .cat-thumb img {
  cursor: zoom-in;
  transition: transform .15s ease, box-shadow .15s ease;
}
.admin-page img:not(.no-zoom):hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(13,43,97,.18);
}

/* 2) Lightbox overlay */
.admin-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 38, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: kfLightboxFade .18s ease;
}
.admin-lightbox.is-open { display: flex; }
.admin-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  background: #fff;
  padding: 4px;
}
.admin-lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 20px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  text-align: center;
  font-family: 'Manrope', sans-serif;
  letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(8,18,38,0) 0%, rgba(8,18,38,.6) 100%);
  pointer-events: none;
}
.admin-lightbox-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.admin-lightbox-close:hover { background: rgba(255,255,255,.24); }

@keyframes kfLightboxFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Mobile: edge-to-edge, smaller close button position */
@media (max-width: 640px) {
  .admin-lightbox { padding: 12px; }
  .admin-lightbox-close { top: 8px; right: 8px; width: 40px; height: 40px; }
  .admin-lightbox-caption { font-size: 12px; padding: 10px 14px; }
}

/* ===========================================================
   v2.2.0 — Page Blocks (блочный CMS): базовые стили
   Применяются к блокам, отрендеренным через pb_render()
   =========================================================== */
.pb-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: filter .15s, background .15s, color .15s;
  line-height: 1.2;
}
.pb-btn:hover { filter: brightness(1.05); }
.pb-btn--primary {
  background: var(--c-primary, #FF7A00);
  color: var(--c-primary-contrast, #fff);
  border: 1px solid var(--c-primary, #FF7A00);
}
.pb-btn--secondary {
  background: #fff;
  color: var(--c-navy, #0D2B61);
  border: 1px solid var(--c-navy, #0D2B61);
}
.pb-2col,
.pb-3col,
.pb-features { margin: 16px 0; }
.pb-feature {
  padding: 16px;
  border: 1px solid var(--c-border, #E2E8F0);
  border-radius: var(--card-radius, 12px);
  background: var(--card-bg, #fff);
  box-shadow: var(--card-shadow, 0 2px 12px rgba(13,43,97,0.06));
}
.pb-feature__icon {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--c-primary, #FF7A00);
}
.pb-feature__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy, #0D2B61);
}
.pb-feature__desc {
  font-size: 14px;
  color: var(--c-muted, #64748B);
  line-height: 1.5;
}
@media (max-width: 640px) {
  .pb-2col,
  .pb-3col,
  .pb-features {
    grid-template-columns: 1fr !important;
  }
}
