/* ОБЩИЕ */
body {
  font-family: 'Montserrat', Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #333;
  background-color: #e6dfd6;
}

/* ШАПКА */
header {
  background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #1565c0 100%);
  color: white;
  padding: 2rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  z-index: 2;
}

.site-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
}

.header-center-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.flip-btn {
  width: 140px;
  height: 46px;
  border: none;
  border-radius: 12px;
  background-color: #007bff;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.flip-btn:hover {
  background-color: #28a745;
  transform: translateY(-2px);
}

.cart-left {
  position: absolute;
  left: 10%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cart-mini-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cart-mini-info span {
  color: #bbdefb;
  font-weight: 600;
  font-size: 1.15rem;
}

.header-cart-actions {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
}
#header-cart-btn {
  padding:10px 18px;
  border:none;
  border-radius:20px;
  background:linear-gradient(135deg,#1565c0,#1e88e5);
  color:#fff;
  font-weight:700;
  font-size:1rem;
  cursor:pointer;
  font-family:inherit;
  white-space:nowrap;
  transition:transform .2s, box-shadow .2s, background .2s;
}
#header-cart-btn:hover {
  background:linear-gradient(135deg,#0d47a1,#1565c0);
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(21,101,192,.45);
}
.cart-icon { font-size:1.15em; vertical-align:-1px; margin-right:4px; }

#checkout-header-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff6f00, #ff8f00);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

#checkout-header-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255,143,0,0.5);
}

.contacts-right {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.contacts-right a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.contacts-right a:hover {
  color: #ff8f00;
}

.contacts-right .phone {
  font-family: 'Pacifico', cursive;
  font-size: 1.6rem;
  color: #e3f2fd;
  line-height: 1.2;
}

.contacts-right .email {
  font-family: 'Pacifico', cursive;
  font-size: 1.3rem;
  color: #90caf9;
  line-height: 1.2;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px 20px;
}

section {
  margin-bottom: 50px;
}

section h2 {
  font-size: 1.5rem;
  color: #1a237e;
  border-bottom: 3px solid #1565c0;
  padding-bottom: 8px;
  display: inline-block;
}

/* ФИЛЬТРЫ */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
}

.filter-btn {
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.filter-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.filter-btn.active {
  outline: 3px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}

/* Главная кнопка Каталог */
.dropdown-toggle {
  height: 52px;
  padding: 0 24px;
  padding-bottom: 22px;
  background-color: #007bff;
  position: relative;
  z-index: 2;
}

.dropdown-toggle:hover {
  background-color: #0056b3;
}

/* Обычные кнопки — поменьше */
.small-btn {
  height: 38px;
  padding: 0 18px;
}

/* Цвета кнопок */
.filter-btn[data-category="all"]        { background: #007bff; }
.filter-btn[data-category="all"]:hover    { background: #0056b3; }
.filter-btn[data-category="cups"]       { background: #17a2b8; }
.filter-btn[data-category="cups"]:hover   { background: #0d6f81; }
.filter-btn[data-category="plates"]      { background: #fd7e14; }
.filter-btn[data-category="plates"]:hover { background: #d96a02; }
.filter-btn[data-category="cutlery"]     { background: #6f42c1; }
.filter-btn[data-category="cutlery"]:hover{ background: #5a32a3; }
.filter-btn[data-category="containers"]  { background: #20c997; }
.filter-btn[data-category="containers"]:hover { background: #17a589; }
.filter-btn[data-category="packaging"]   { background: #e83e8c; }
.filter-btn[data-category="packaging"]:hover  { background: #c93678; }
.filter-btn[data-category="napkins"]     { background: #ffc107; color: #333; }
.filter-btn[data-category="napkins"]:hover  { background: #e0ad0e; color: #333; }
.filter-btn[data-category="household"]   { background: #28a745; }
.filter-btn[data-category="household"]:hover { background: #218838; }
.filter-btn[data-category="stationery"]  { background: #6610f2; }
.filter-btn[data-category="stationery"]:hover { background: #520dc2; }
.filter-btn[data-category="other"]       { background: #6c757d; }
.filter-btn[data-category="other"]:hover   { background: #565e64; }

/* Выпадающее меню */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 220px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 1;
  border: 1px solid rgba(21,101,192,0.2);
  padding-top: 8px;
  margin-top: -8px;
}

.dropdown-wrapper:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:hover {
  background-color: #e3f2fd;
  color: #1a237e;
}

/* СЕТКА ТОВАРОВ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 8px 25px rgba(21,101,192,0.2);
  transform: translateY(-4px);
}

.product-image {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.product-name {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.product-code {
  font-size: 12px;
  color: #888;
  margin: 0;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: #1a237e;
  margin: 4px 0;
}

.product-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.qty-box {
  display: flex;
  align-items: center;
  border: 1.5px solid #1565c0;
  border-radius: 8px;
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #1565c0;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.qty-btn:hover { background: #0d47a1; }

.qty-input {
  width: 36px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
}

.add-to-cart-btn {
  flex-grow: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00c853, #00e676);
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.add-to-cart-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0,200,83,0.4);
}

/* 3D-анимация кнопки «Прайс» */
.price-nav-btn {
  perspective: 900px;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.price-nav-btn:hover {
  background: transparent;
  transform: none;
}
.price-flip-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.2,.75,.25,1);
}
.price-nav-btn:hover .price-flip-inner {
  transform: rotateY(180deg);
}
.price-flip-front, .price-flip-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg,#007bff,#1565c0);
  color: #fff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 7px 16px rgba(0,0,0,.22);
}
.price-flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg,#1565c0,#007bff);
}
.price-nav-btn:active .price-flip-inner {
  transform: rotateY(180deg) scale(.98);
}
@media (prefers-reduced-motion: reduce) {
  .price-flip-inner { transition: none; }
}

/* ПРАЙС — кнопки скачивания */
.price-download-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a237e;
  margin: 20px 0 15px 0;
  text-align: center;
}

.price-download-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.price-download-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.price-download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Кнопка "Весь прайс" — выделяется */
.price-download-btn.all-btn {
  background: linear-gradient(135deg, #007bff, #1565c0);
  font-size: 16px;
  padding: 12px 28px;
}

.price-download-btn.all-btn:hover {
  background: linear-gradient(135deg, #0056b3, #0d47a1);
}

/* Цвета кнопок прайса по категориям */
.price-download-btn[data-cat="cups"]       { background: #17a2b8; }
.price-download-btn[data-cat="cups"]:hover   { background: #0d6f81; }
.price-download-btn[data-cat="plates"]      { background: #fd7e14; }
.price-download-btn[data-cat="plates"]:hover { background: #d96a02; }
.price-download-btn[data-cat="cutlery"]     { background: #6f42c1; }
.price-download-btn[data-cat="cutlery"]:hover{ background: #5a32a3; }
.price-download-btn[data-cat="containers"]  { background: #20c997; }
.price-download-btn[data-cat="containers"]:hover { background: #17a589; }
.price-download-btn[data-cat="packaging"]   { background: #e83e8c; }
.price-download-btn[data-cat="packaging"]:hover  { background: #c93678; }
.price-download-btn[data-cat="napkins"]     { background: #ffc107; color: #333; }
.price-download-btn[data-cat="napkins"]:hover  { background: #e0ad0e; color: #333; }
.price-download-btn[data-cat="household"]   { background: #28a745; }
.price-download-btn[data-cat="household"]:hover { background: #218838; }
.price-download-btn[data-cat="stationery"]  { background: #6610f2; }
.price-download-btn[data-cat="stationery"]:hover { background: #520dc2; }
.price-download-btn[data-cat="other"]       { background: #6c757d; }
.price-download-btn[data-cat="other"]:hover   { background: #565e64; }

/* МАХ */
.max-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.max-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.max-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(21,101,192,0.15);
}

.max-card h3 { font-size: 1.2rem; margin: 0 0 10px 0; color: #1a237e; }
.max-card p { color: #555; margin: 0; }

/* КОРЗИНА */
#cart-items {
  border: 2px dashed #1565c0;
  border-radius: 10px;
  padding: 20px;
  min-height: 120px;
  margin-bottom: 15px;
  background: #f5f9ff;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#cart-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a237e;
  margin: 15px 0;
}

#checkout-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(135deg, #ff6f00, #ff8f00);
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

#checkout-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(255,143,0,0.5);
}

/* ПОДВАЛ */
footer {
  text-align: center;
  padding: 25px;
  background: linear-gradient(135deg, #1a237e, #0d47a1);
  color: #bbdefb;
}

footer p { margin: 4px 0; }

/* АДАПТИВНОСТЬ */
@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); }
  .max-cards { grid-template-columns: repeat(2, 1fr); }
  .cart-left { left: 6%; }
  .contacts-right { right: 6%; }
}

@media (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  header { flex-direction: column; min-height: auto; padding-bottom: 1.5rem; }
  .cart-left, .contacts-right {
    position: static;
    transform: none;
    margin-top: 1rem;
  }
}

@media (max-width: 500px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .max-cards { grid-template-columns: 1fr; }
  .contacts-right .phone { font-size: 1.2rem; }
  .contacts-right .email { font-size: 1rem; }
}

/* Дополнительные категории */
.filter-btn[data-category="scotch"] { background: #f39c12; }
.filter-btn[data-category="scotch"]:hover { background: #d68910; }
.filter-btn[data-category="bag"] { background: #8e44ad; }
.filter-btn[data-category="bag"]:hover { background: #71368a; }
.filter-btn[data-category="boxes"] { background: #795548; }
.filter-btn[data-category="boxes"]:hover { background: #5d4037; }

.price-download-btn[data-cat="scotch"] { background: #f39c12; }
.price-download-btn[data-cat="scotch"]:hover { background: #d68910; }
.price-download-btn[data-cat="bag"] { background: #8e44ad; }
.price-download-btn[data-cat="bag"]:hover { background: #71368a; }
.price-download-btn[data-cat="boxes"] { background: #795548; }
.price-download-btn[data-cat="boxes"]:hover { background: #5d4037; }

/* Новые категории */
.filter-btn[data-category="gloves"] { background: #c0392b; }
.filter-btn[data-category="gloves"]:hover { background: #962d22; }
.filter-btn[data-category="receipt"] { background: #16a085; }
.filter-btn[data-category="receipt"]:hover { background: #117a65; }
.filter-btn[data-category="trashbags"] { background: #34495e; }
.filter-btn[data-category="trashbags"]:hover { background: #263747; }
.filter-btn[data-category="foodbucket"] { background: #d35400; }
.filter-btn[data-category="foodbucket"]:hover { background: #a84300; }
.price-download-btn[data-cat="gloves"] { background: #c0392b; }
.price-download-btn[data-cat="receipt"] { background: #16a085; }
.price-download-btn[data-cat="trashbags"] { background: #34495e; }
.price-download-btn[data-cat="foodbucket"] { background: #d35400; }
.admin-link { display:flex; align-items:center; justify-content:center; text-decoration:none; }

/* v5: dual red back-to-top controls */
.back-to-top-left,.back-to-top-right{
 position:fixed;top:50%;transform:translateY(-50%);z-index:9999;
 width:64px;height:64px;border:0;border-radius:50%;
 background:#d32f2f;color:#fff;font-size:34px;font-weight:800;
 box-shadow:0 5px 16px rgba(0,0,0,.28);cursor:pointer;
}
.back-to-top-left{left:18px}.back-to-top-right{right:18px}
.back-to-top-left:hover,.back-to-top-right:hover{background:#b71c1c}


/* v11: компактная шапка при прокрутке */
header { transition: min-height .28s ease, padding .28s ease, box-shadow .28s ease; }
header.compact { min-height: 74px; padding: .55rem 1.2rem; }
header.compact .site-title { display:none; }
header.compact .header-center { gap:.3rem; }
header.compact .header-center-nav { gap:8px; }
header.compact .flip-btn { height:38px; }
header.compact .cart-left, header.compact .contacts-right { gap:6px; }
header.compact .cart-mini-info span { font-size:.9rem; }
header.compact .contacts-right .phone { font-size:1rem; }
header.compact .contacts-right .email { display:none; }

/* v11: мобильная шапка */
@media (max-width: 768px) {
  header { min-height:0; height:auto; padding:10px 10px; display:grid; grid-template-columns:1fr; gap:8px; }
  .site-title { font-size:1.15rem; line-height:1.15; }
  .header-center { gap:7px; width:100%; }
  .header-center-nav { width:100%; gap:7px; flex-wrap:nowrap; }
  .header-center-nav .flip-btn { flex:1 1 0; min-width:0; width:auto; height:40px; font-size:13px; }
  .cart-left, .contacts-right { position:static; transform:none; margin:0; width:100%; }
  .cart-left { flex-direction:row; justify-content:center; gap:8px; }
  .cart-mini-info { flex-direction:row; gap:8px; }
  .cart-mini-info span { font-size:.78rem; }
  #checkout-header-btn { padding:7px 12px; font-size:.8rem; }
  .contacts-right { display:flex; flex-direction:row; justify-content:center; flex-wrap:wrap; gap:5px 10px; }
  .contacts-right .phone { font-size:.9rem; }
  .contacts-right .email { font-size:.8rem; }
  .max-phone { font-size:.85rem !important; }
  main { padding:15px 10px; }
  .dropdown-toggle { padding:0 22px; height:46px; }
  .dropdown-menu { position:absolute; min-width:250px; max-height:70vh; overflow:auto; }
  .dropdown-item { font-size:16px; padding:12px 16px; }
  .filters { margin-bottom:15px; }
}

@media (max-width: 500px) {
  .products-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .product-info { padding:8px; }
  .product-name { font-size:12px; }
  .product-price { font-size:16px; }
  .qty-box { transform:scale(.9); transform-origin:left center; }
  .add-to-cart-btn { font-size:11px; padding:7px 6px; }
}

/* v11: окно оформления заказа */
.checkout-modal { display:none; position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,.62); align-items:center; justify-content:center; padding:18px; }
.checkout-modal.open { display:flex; }
.checkout-dialog { position:relative; width:min(760px,100%); max-height:92vh; overflow:auto; background:#fff; border-radius:18px; padding:28px; box-shadow:0 18px 60px rgba(0,0,0,.35); }
.checkout-dialog h2 { margin:0 0 18px; color:#1a237e; }
.checkout-close { position:absolute; right:14px; top:10px; border:0; background:transparent; font-size:34px; color:#555; cursor:pointer; }
.checkout-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.checkout-grid label { display:flex; flex-direction:column; gap:5px; font-weight:600; font-size:14px; color:#333; }
.checkout-grid input { box-sizing:border-box; width:100%; padding:10px 12px; border:1px solid #bbb; border-radius:8px; font:inherit; }
.checkout-wide { grid-column:1/-1; }
.payment-fieldset { border:1px solid #bbb; border-radius:8px; padding:12px; display:flex; gap:14px; flex-wrap:wrap; }
.payment-fieldset legend { font-weight:700; padding:0 5px; }
.payment-fieldset .radio-label { display:flex; flex-direction:row; align-items:center; gap:6px; font-weight:500; }
.payment-fieldset input { width:auto; }
.checkout-summary { margin:18px 0; padding:12px; background:#f5f9ff; border-radius:10px; font-size:14px; }
.checkout-submit { border:0; border-radius:24px; padding:12px 26px; background:linear-gradient(135deg,#ff6f00,#ff8f00); color:#fff; font-weight:700; font-size:16px; cursor:pointer; }
@media(max-width:600px){ .checkout-dialog{padding:22px 15px;} .checkout-grid{grid-template-columns:1fr;} .checkout-wide{grid-column:auto;} }

/* v11: кнопки категорий скрыты, каталог остаётся выпадающим */
.filters > .filter-btn.small-btn { display:none; }
.dropdown-toggle { font-size:17px; font-weight:700; }

.dropdown-wrapper.open .dropdown-menu { display:block; }


/* v12: категории снова доступны в каталоге и в разделе прайса */
.dropdown-menu { min-width: 290px; }
.dropdown-item { font-size: 16px; font-weight: 600; padding: 12px 16px; border-radius: 8px; margin: 2px 5px; }
.dropdown-item:hover { background:#e3f2fd; color:#1a237e; }
.price-download-buttons { display:flex; flex-wrap:wrap; gap:10px; }
.price-download-btn { border:0; border-radius:10px; padding:11px 16px; color:#fff; font-weight:700; cursor:pointer; background:#1565c0; transition:transform .18s, box-shadow .18s; }
.price-download-btn:hover { transform:translateY(-2px); box-shadow:0 6px 14px rgba(0,0,0,.18); }
.price-download-btn.all-btn { background:#1565c0; }

.cart-item { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.cart-item-main { display:flex; flex-direction:column; gap:4px; flex:1; min-width:220px; }
.cart-item-main small, .checkout-order-name small { color:#777; font-weight:400; }
.cart-item-controls, .checkout-order-controls { display:flex; align-items:center; gap:6px; }
.cart-qty-btn { width:34px; height:34px; border:1px solid #bbb; border-radius:7px; background:#fff; cursor:pointer; font-size:20px; line-height:1; }
.cart-qty-input, .checkout-order-controls input { width:58px; height:34px; box-sizing:border-box; border:1px solid #bbb; border-radius:7px; text-align:center; font-weight:700; }
.cart-item-sum { min-width:90px; text-align:right; }

.checkout-order-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid #e5eaf0; }
.checkout-order-name { display:flex; flex-direction:column; gap:3px; flex:1; min-width:0; }
@media(max-width:600px){
  .price-download-btn { width:100%; }
  .checkout-order-row { align-items:flex-start; flex-direction:column; }
  .checkout-order-controls { width:100%; justify-content:flex-end; }
}

/* v13: каталог перенесён в шапку рядом с Прайсом */
.header-center-nav { position:relative; }
.header-catalog-wrapper { position:relative; display:inline-block; }
.header-catalog-btn { position:relative; z-index:10002; }
.catalog-arrow { font-size:.8em; margin-left:4px; }
.header-catalog-menu {
  display:none; position:absolute; top:calc(100% + 8px); left:0;
  min-width:290px; max-height:70vh; overflow:auto;
  background:#fff; border:1px solid rgba(21,101,192,.2);
  border-radius:12px; box-shadow:0 12px 28px rgba(0,0,0,.22);
  padding:8px; z-index:10001;
}
.header-catalog-wrapper:hover .header-catalog-menu,
.header-catalog-wrapper.open .header-catalog-menu { display:block; }
.header-catalog-menu .dropdown-item { display:block; margin:2px 0; padding:11px 14px; border-radius:8px; font-size:16px; font-weight:600; color:#333; text-decoration:none; white-space:nowrap; }
.header-catalog-menu .dropdown-item:hover { background:#e3f2fd; color:#1a237e; }

/* Контакты: две компактные строки по два элемента */
.contacts-right { gap:14px; }
.contacts-right .contact-row { display:flex; align-items:center; justify-content:center; gap:32px; white-space:nowrap; }
.contacts-right .phone, .contacts-right .email { font-family:'Montserrat', Arial, sans-serif; font-size:1.12rem; line-height:1.15; font-weight:600; }
.contacts-right .phone { color:#e3f2fd; }
.contacts-right .email { color:#e3f2fd; }
.contacts-right .max-phone { color:#fff; }

/* Кнопки корзины */
.cart-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
#clear-cart-btn {
  padding:12px 22px; border:none; border-radius:25px; background:#d32f2f;
  color:#fff; font-weight:600; font-size:16px; cursor:pointer; font-family:inherit;
  transition:transform .2s, box-shadow .2s, background .2s;
}
#clear-cart-btn:hover { background:#b71c1c; transform:translateY(-1px); box-shadow:0 5px 12px rgba(211,47,47,.3); }
.remove-order-btn {
  border:0; border-radius:7px; padding:7px 10px; background:#ef5350; color:#fff;
  font-weight:600; cursor:pointer; font-family:inherit;
}
.remove-order-btn:hover { background:#c62828; }

/* Не даём браузеру делать лишнюю прокрутку при смене высоты sticky-шапки */
html { scroll-behavior:smooth; overflow-anchor:none; }
#catalog, #price, #cart { scroll-margin-top:110px; }

@media (max-width: 768px) {
  .header-center-nav { width:auto; }
  .header-catalog-wrapper { flex:1 1 0; min-width:0; }
  .header-catalog-menu { left:50%; transform:translateX(-50%); min-width:min(300px,92vw); }
  .contacts-right .contact-row { gap:10px; flex-wrap:wrap; }
  .contacts-right .phone, .contacts-right .email { font-size:.88rem; }
  .contacts-right { gap:4px; }
}

/* v14: кнопка корзины в шапке и увеличенные интервалы контактов */
.cart-left { gap:10px; }
@media (min-width: 769px) {
  .header-cart-actions { margin-left:10px; }
}
@media (max-width: 768px) {
  .header-cart-actions { gap:10px; width:100%; }
  #header-cart-btn, #checkout-header-btn { padding:8px 12px; font-size:.82rem; }
  .contacts-right .contact-row { gap:18px; }
  .contacts-right { gap:9px; }
}

/* v15: удобное количество без стрелок браузера */
.qty-input, .cart-qty-input, .checkout-order-controls input { -moz-appearance:textfield; appearance:textfield; width:58px; min-width:58px; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button,
.cart-qty-input::-webkit-outer-spin-button, .cart-qty-input::-webkit-inner-spin-button,
.checkout-order-controls input::-webkit-outer-spin-button, .checkout-order-controls input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.remove-cart-btn { border:0; border-radius:7px; padding:7px 10px; background:#ef5350; color:#fff; font-weight:600; cursor:pointer; font-family:inherit; white-space:nowrap; }
.remove-cart-btn:hover { background:#c62828; }
.cart-item-controls { flex-wrap:wrap; }
@media (max-width:768px) {
  .site-title { display:none; }
  header { padding:8px 8px; gap:7px; }
  .header-center { gap:5px; }
  .header-center-nav { width:100%; gap:6px; }
  .header-center-nav .flip-btn { height:36px; font-size:12px; }
  .cart-left { gap:6px; width:100%; justify-content:center; overflow:hidden; }
  .cart-mini-info { gap:5px; min-width:0; }
  .cart-mini-info span { font-size:.72rem; white-space:nowrap; }
  .header-cart-actions { gap:6px; margin:0; min-width:0; }
  #header-cart-btn, #checkout-header-btn { padding:7px 9px; font-size:.72rem; }
  .contacts-right .contact-row { gap:16px; }
  .contacts-right .phone, .contacts-right .email { font-size:.82rem; }
  .contacts-right { gap:6px; }
  .qty-box { transform:none; }
  .qty-input { width:58px; min-width:58px; }
  .product-bottom { gap:5px; }
  .add-to-cart-btn { min-width:0; }
}
@media (max-width:420px) {
  .cart-mini-info { display:none; }
  .cart-left { gap:5px; }
  .header-cart-actions { width:100%; justify-content:center; }
  #header-cart-btn, #checkout-header-btn { font-size:.7rem; padding:7px 8px; }
  .contacts-right .contact-row { gap:11px; }
  .contacts-right .phone, .contacts-right .email { font-size:.76rem; }
  .product-bottom { flex-wrap:wrap; }
  .qty-box { flex:0 0 auto; }
  .add-to-cart-btn { flex:1 1 110px; }
}


/* v17: исправления мобильного каталога и окна оформления */
.checkout-dialog { box-sizing:border-box; max-height:calc(100dvh - 20px); }
.checkout-dialog form { display:flex; flex-direction:column; min-height:0; }
.checkout-summary { max-height:32vh; overflow:auto; }
.checkout-actions { display:flex; justify-content:flex-end; gap:10px; position:sticky; bottom:0; background:#fff; padding-top:10px; margin-top:4px; z-index:2; }
.checkout-submit, .checkout-cancel { min-height:46px; }
.checkout-cancel { border:1px solid #bbb; border-radius:24px; padding:12px 22px; background:#fff; color:#333; font-weight:700; font-size:16px; cursor:pointer; }
.checkout-cancel:hover { background:#f3f3f3; }
@media (max-width:768px) {
  .header-catalog-menu { left:0 !important; right:auto !important; transform:none !important; width:min(300px,calc(100vw - 16px)); min-width:0 !important; max-width:calc(100vw - 16px); box-sizing:border-box; }
  .header-catalog-menu .dropdown-item { white-space:normal; overflow-wrap:anywhere; }
  .checkout-modal { padding:10px; align-items:flex-start; }
  .checkout-dialog { width:100%; max-width:100%; max-height:calc(100dvh - 20px); overflow:auto; padding:48px 14px 14px; border-radius:14px; }
  .checkout-dialog h2 { font-size:22px; line-height:1.2; margin-bottom:12px; padding-right:34px; }
  .checkout-close { right:8px; top:6px; font-size:34px; width:44px; height:44px; line-height:40px; z-index:5; }
  .checkout-grid { gap:10px; }
  .checkout-summary { max-height:28vh; margin:12px 0; }
  .checkout-actions { justify-content:stretch; }
  .checkout-actions button { flex:1 1 0; }
  .back-to-top-left, .back-to-top-right { display:none !important; }
}
@media (max-width:420px) {
  .checkout-dialog h2 { font-size:20px; }
  .checkout-summary { max-height:25vh; }
  .checkout-actions { flex-direction:column-reverse; }
  .checkout-actions button { width:100%; }
}


/* v19: компактная шапка и информация о корзине */
.cart-mini-info span { white-space:nowrap; }
#header-cart-btn { padding-left:14px; padding-right:14px; }
.price-nav-btn { width:105px; }

/* v19: резервное меню каталога всегда имеет собственные элементы; JS только добавляет обработчики */
@media (max-width:768px) {
  header { position:relative; min-height:118px; padding:8px 8px 48px; display:block; }
  .site-title { display:none !important; }
  .header-center { position:absolute; top:8px; right:8px; width:auto !important; margin:0; }
  .header-center-nav { width:auto !important; display:flex; gap:4px; flex-wrap:nowrap; }
  .header-center-nav .flip-btn { flex:0 0 auto; height:34px; font-size:12px; padding:0 8px; }
  .header-catalog-wrapper { flex:0 0 auto; }
  .price-nav-btn { width:72px !important; min-width:72px !important; }
  .cart-left { position:absolute !important; top:48px; left:8px; right:8px; width:auto !important; height:36px; margin:0 !important; display:flex !important; flex-direction:row !important; justify-content:flex-end !important; align-items:center; gap:7px; }
  .cart-mini-info { margin-right:auto; display:flex !important; flex-direction:row !important; align-items:center; gap:7px; }
  .cart-mini-info span { font-size:.8rem !important; color:#fff; font-weight:700; }
  .header-cart-actions { width:auto !important; display:flex; gap:5px; }
  #header-cart-btn, #checkout-header-btn { padding:7px 8px !important; font-size:.72rem !important; white-space:nowrap; }
  #header-cart-btn .cart-icon { display:none; }
  .header-catalog-menu { left:auto !important; right:0 !important; transform:none !important; width:min(300px,calc(100vw - 16px)); max-width:calc(100vw - 16px); }
  .contacts-right { margin-top:82px; }
}
@media (max-width:420px) {
  header { min-height:124px; }
  .header-center { right:6px; }
  .header-center-nav .flip-btn { font-size:11px; padding:0 6px; }
  .price-nav-btn { width:64px !important; min-width:64px !important; }
  .cart-left { top:47px; left:6px; right:6px; }
  .cart-mini-info span { font-size:.72rem !important; }
  #header-cart-btn, #checkout-header-btn { font-size:.68rem !important; padding:7px 7px !important; }
  .contacts-right { margin-top:84px; }
}

/* v19: на мобильном окно заказа помещается целиком, кнопки всегда видны */
@media (max-width:768px) {
  .checkout-modal { padding:6px; align-items:center; overflow:hidden; }
  .checkout-dialog { width:100%; max-width:100%; height:calc(100dvh - 12px); max-height:calc(100dvh - 12px); padding:42px 12px 10px; overflow:auto; border-radius:12px; }
  .checkout-dialog h2 { margin-top:0; font-size:20px; line-height:1.15; white-space:normal; }
  .checkout-summary { max-height:24vh; }
  .checkout-actions { position:sticky; bottom:0; margin:8px -12px -10px; padding:8px 12px 10px; box-shadow:0 -4px 12px rgba(0,0,0,.08); }
  .checkout-actions button { min-height:44px; }
}


/* v20: исправление мобильной шапки — она закреплена, компактна и не меняет высоту */
header {
  position: sticky !important;
  top: 0 !important;
}

@media (max-width: 768px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
    display: block !important;
    box-sizing: border-box;
    height: 112px !important;
    min-height: 112px !important;
    padding: 6px 8px 5px !important;
    overflow: visible !important;
  }

  .header-center {
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    left: auto !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
  }

  .header-center-nav {
    width: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 5px !important;
  }

  .header-center-nav .flip-btn {
    flex: 0 0 auto !important;
    height: 34px !important;
    margin: 0 !important;
  }

  .header-catalog-wrapper {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
  }

  .header-catalog-btn {
    width: auto !important;
    min-width: 0 !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .price-nav-btn {
    width: 66px !important;
    min-width: 66px !important;
  }

  .cart-left {
    position: absolute !important;
    top: 45px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: 38px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 7px !important;
  }

  .cart-mini-info {
    margin-right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0 !important;
    min-width: 46px !important;
    line-height: 1.05 !important;
  }

  .cart-mini-info span {
    display: block !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    color: #fff !important;
    font-weight: 700 !important;
  }

  .header-cart-actions {
    width: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
  }

  #header-cart-btn,
  #checkout-header-btn {
    padding: 7px 8px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #header-cart-btn .cart-icon { display: none !important; }

  .contacts-right {
    position: absolute !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 4px !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
  }

  .contacts-right .contact-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 14px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .contacts-right .phone,
  .contacts-right .email {
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
  }

  .header-catalog-menu {
    top: calc(100% + 7px) !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    width: min(300px, calc(100vw - 16px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 125px) !important;
  }
}

/* На телефонах hover не должен снова открывать меню после выбора категории. */
@media (hover: none), (pointer: coarse) {
  .header-catalog-wrapper:hover .header-catalog-menu { display: none !important; }
  .header-catalog-wrapper.open .header-catalog-menu { display: block !important; }
}

@media (max-width: 420px) {
  header {
    height: 108px !important;
    min-height: 108px !important;
  }
  .header-center { top: 5px !important; right: 6px !important; }
  .header-center-nav { gap: 4px !important; }
  .header-center-nav .flip-btn { height: 32px !important; font-size: 11px !important; padding: 0 6px !important; }
  .price-nav-btn { width: 62px !important; min-width: 62px !important; }
  .cart-left { top: 42px !important; left: 6px !important; right: 6px !important; }
  .cart-mini-info { min-width: 42px !important; }
  .cart-mini-info span { font-size: 10px !important; }
  #header-cart-btn, #checkout-header-btn { font-size: 10px !important; padding: 7px 6px !important; }
  .contacts-right { left: 6px !important; right: 6px !important; bottom: 3px !important; }
  .contacts-right .contact-row { gap: 10px !important; }
  .contacts-right .phone, .contacts-right .email { font-size: 9px !important; }
}

/* v21: мобильная шапка — фиксированная, компактная и без перекрытия кнопок */
@media (max-width: 768px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
    height: 114px !important;
    min-height: 114px !important;
    max-height: 114px !important;
    box-sizing: border-box !important;
    display: block !important;
    padding: 6px 8px 4px !important;
    overflow: visible !important;
  }

  .header-center {
    position: absolute !important;
    top: 6px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 3 !important;
  }

  .header-center-nav {
    width: auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .header-catalog-wrapper {
    flex: 0 0 auto !important;
    width: auto !important;
    position: relative !important;
    z-index: 10001 !important;
  }

  .header-center-nav .flip-btn {
    flex: 0 0 auto !important;
    height: 34px !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    line-height: 34px !important;
    box-sizing: border-box !important;
  }

  .price-nav-btn {
    width: 68px !important;
    min-width: 68px !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
  }

  .cart-left {
    position: absolute !important;
    top: 43px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: 37px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    overflow: visible !important;
    z-index: 4 !important;
  }

  .cart-mini-info {
    flex: 0 0 auto !important;
    margin: 0 0 0 10px !important;
    min-width: 78px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 7px !important;
    line-height: 1 !important;
  }

  .cart-mini-info span {
    display: block !important;
    white-space: nowrap !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    color: #fff !important;
  }

  .header-cart-actions {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  #header-cart-btn,
  #checkout-header-btn {
    position: relative !important;
    z-index: 10002 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    height: 34px !important;
    padding: 6px 9px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
  }

  #header-cart-btn .cart-icon { display: none !important; }

  .contacts-right {
    position: absolute !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: 4px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 3px !important;
    z-index: 2 !important;
    pointer-events: auto !important;
  }

  .contacts-right .contact-row {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    flex-wrap: nowrap !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .contacts-right .phone,
  .contacts-right .email {
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
  }

  /* На телефоне меню Каталог строго по центру экрана. */
  .header-catalog-menu {
    top: calc(100% + 7px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(300px, calc(100vw - 16px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box !important;
    z-index: 10003 !important;
  }
}

/* Не позволяем сенсорному hover снова показывать уже закрытое меню. */
@media (hover: none), (pointer: coarse) {
  .header-catalog-wrapper:hover .header-catalog-menu { display: none !important; }
  .header-catalog-wrapper.open .header-catalog-menu { display: block !important; }
}

@media (max-width: 420px) {
  header {
    height: 114px !important;
    min-height: 114px !important;
    max-height: 114px !important;
  }

  .header-center {
    top: 6px !important;
  }

  .header-center-nav {
    gap: 7px !important;
  }

  .header-center-nav .flip-btn {
    height: 33px !important;
    line-height: 33px !important;
    font-size: 11px !important;
    padding: 0 10px !important;
  }

  .price-nav-btn {
    width: 64px !important;
    min-width: 64px !important;
  }

  .cart-left {
    top: 42px !important;
    left: 6px !important;
    right: 6px !important;
    height: 38px !important;
  }

  .cart-mini-info {
    margin-left: 10px !important;
    min-width: 76px !important;
    gap: 7px !important;
  }

  .cart-mini-info span {
    font-size: 17px !important;
  }

  #header-cart-btn,
  #checkout-header-btn {
    height: 33px !important;
    padding: 6px 8px !important;
    font-size: 10px !important;
  }

  .contacts-right {
    left: 6px !important;
    right: 6px !important;
    bottom: 4px !important;
    gap: 3px !important;
  }

  .contacts-right .contact-row {
    gap: 12px !important;
  }

  .contacts-right .phone,
  .contacts-right .email {
    font-size: 9px !important;
  }
}


/* v22: мобильная шапка — Каталог/Прайс справа, меню по центру экрана,
   кнопки шапки кликабельны, телефоны внизу, количество/сумма по центру по высоте. */
@media (max-width: 768px) {
  .header-center {
    position: absolute !important;
    top: 6px !important;
    left: auto !important;
    right: 8px !important;
    width: auto !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    transform: none !important;
    z-index: 3 !important;
  }

  .header-center-nav {
    width: auto !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }

  .header-center-nav .flip-btn {
    width: auto !important;
    min-width: 0 !important;
    height: 34px !important;
    padding: 0 12px !important;
    line-height: 34px !important;
    font-size: 12px !important;
  }

  /* Размеры кнопок сохраняем; меняем только расположение. */
  .price-nav-btn {
    width: 68px !important;
    min-width: 68px !important;
  }

  .cart-left {
    top: 43px !important;
    left: 8px !important;
    right: 8px !important;
    height: 38px !important;
    z-index: 10010 !important;
  }

  /* Сам блок количества/суммы немного ниже, по центру свободного промежутка;
     по горизонтали не сдвигаем. */
  .cart-mini-info {
    margin-left: 10px !important;
    transform: translateY(5px) !important;
    gap: 7px !important;
  }

  .cart-mini-info span {
    font-size: 18px !important;
    line-height: 1 !important;
  }

  .header-cart-actions {
    position: relative !important;
    z-index: 10011 !important;
    pointer-events: auto !important;
  }

  #header-cart-btn,
  #checkout-header-btn {
    position: relative !important;
    z-index: 10012 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }

  /* Телефоны и контакты всегда внизу и не пересекаются с кнопками корзины. */
  .contacts-right {
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: 4px !important;
    margin: 0 !important;
    z-index: 2 !important;
  }

  /* На телефоне кнопка Прайс остаётся именно «Прайс», без 3D-переворота в «Скачать». */
  .price-nav-btn:hover .price-flip-inner,
  .price-nav-btn:active .price-flip-inner {
    transform: none !important;
  }

  .price-nav-btn .price-flip-front {
    transform: rotateY(0deg) !important;
  }
  .price-nav-btn .price-flip-back {
    transform: rotateY(180deg) !important;
  }

  /* Меню Каталог — строго по центру всего экрана, независимо от положения кнопки. */
  .header-catalog-menu {
    position: fixed !important;
    top: 42px !important;
    left: 50vw !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(300px, calc(100vw - 16px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 54px) !important;
    padding: 10px !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    z-index: 10020 !important;
  }

  .header-catalog-menu .dropdown-item {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    margin: 2px 0 !important;
    padding: 10px 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: normal !important;
  }
}

@media (max-width: 420px) {
  .header-center {
    right: 6px !important;
  }

  .header-center-nav {
    gap: 7px !important;
  }

  .header-center-nav .flip-btn {
    height: 33px !important;
    line-height: 33px !important;
    font-size: 11px !important;
    padding: 0 10px !important;
  }

  .price-nav-btn {
    width: 64px !important;
    min-width: 64px !important;
  }

  .cart-left {
    top: 42px !important;
    left: 6px !important;
    right: 6px !important;
    height: 38px !important;
  }

  .cart-mini-info {
    margin-left: 10px !important;
    gap: 7px !important;
    transform: translateY(5px) !important;
  }

  .cart-mini-info span {
    font-size: 17px !important;
  }

  .contacts-right {
    left: 6px !important;
    right: 6px !important;
    bottom: 3px !important;
  }

  .header-catalog-menu {
    top: 41px !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .price-nav-btn:hover .price-flip-inner,
  .price-nav-btn:active .price-flip-inner {
    transform: none !important;
  }
  .header-catalog-wrapper:hover .header-catalog-menu { display: none !important; }
  .header-catalog-wrapper.open .header-catalog-menu { display: block !important; }
}

/* v23: только положение мобильного меню и кнопок Каталог/Прайс. Остальное не меняем. */
@media (max-width: 768px) {
  .header-center {
    left: auto !important;
    right: 28px !important;
    width: auto !important;
    transform: none !important;
  }

  /* Меню опускаем ниже всей закреплённой шапки, чтобы не перекрывало количество/сумму. */
  .header-catalog-menu {
    position: fixed !important;
    top: 120px !important;
    left: 50vw !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-height: calc(100dvh - 130px) !important;
  }
}

@media (max-width: 420px) {
  .header-center {
    right: 24px !important;
  }

  .header-catalog-menu {
    top: 120px !important;
    left: 50vw !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-height: calc(100dvh - 130px) !important;
  }
}

/* v24: только финальная подстройка положения мобильных кнопок и блока количества/суммы. */
@media (max-width: 768px) {
  .header-center {
    right: 48px !important;
  }

  .cart-mini-info {
    transform: translateY(-5px) !important;
  }
}

@media (max-width: 420px) {
  .header-center {
    right: 44px !important;
  }

  .cart-mini-info {
    transform: translateY(-5px) !important;
  }
}

/* v25: только каталог — сдвигаем влево, кнопку Прайс не меняем. */
@media (max-width: 768px) {
  .header-catalog-wrapper {
    position: relative !important;
    left: -36px !important;
  }
}
@media (max-width: 420px) {
  .header-catalog-wrapper {
    left: -32px !important;
  }
}

/* v26: только точечные правки мобильной шапки */
@media (max-width:768px) {
  /* Прайс остаётся на своём месте, но выглядит именно как полноценная кнопка. */
  .price-nav-btn {
    background: #007bff !important;
    border: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 7px 16px rgba(0,0,0,.22) !important;
  }
  .price-nav-btn .price-flip-inner {
    transform: none !important;
    background: transparent !important;
  }
  .price-nav-btn .price-flip-front {
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .price-nav-btn .price-flip-back {
    display: none !important;
  }

  /* Количество и сумма: только выше по вертикали, без изменения по горизонтали. */
  .cart-mini-info {
    transform: translateY(-4px) !important;
  }
}

/* v27: только размер кнопки «Прайс» и вертикальное положение количества/суммы. */
@media (max-width: 768px) {
  .price-nav-btn {
    width: 86px !important;
    min-width: 86px !important;
  }

  .cart-mini-info {
    transform: translateY(-12px) !important;
  }
}

@media (max-width: 420px) {
  .price-nav-btn {
    width: 78px !important;
    min-width: 78px !important;
  }

  .cart-mini-info {
    transform: translateY(-12px) !important;
  }
}

/* v28: только исправление ширины кнопки «Прайс». Положение не меняем. */
@media (max-width: 768px) {
  .price-nav-btn {
    width: 106px !important;
    min-width: 106px !important;
    max-width: 106px !important;
  }
  .price-nav-btn .price-flip-inner,
  .price-nav-btn .price-flip-front {
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }
}

@media (max-width: 420px) {
  .price-nav-btn {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
  }
}

/* v29: только кнопка «Прайс» на мобильных — увеличиваем ширину и выводим её поверх соседней кнопки.
   Положение кнопки не меняем. */
@media (max-width: 768px) {
  .price-nav-btn {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
    position: relative !important;
    z-index: 20 !important;
  }
}
@media (max-width: 420px) {
  .price-nav-btn {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
  }
}

/* v30: окончательная точечная правка только кнопки «Прайс» на мобильных.
   Устраняем перекрытие кнопкой «Каталог» и гарантируем полную надпись. */
@media (max-width: 768px) {
  .header-center-nav .price-nav-btn {
    position: relative !important;
    z-index: 10005 !important;
    flex: 0 0 86px !important;
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    white-space: nowrap !important;
  }

  .header-center-nav .price-nav-btn .price-flip-inner,
  .header-center-nav .price-nav-btn .price-flip-front {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-indent: 0 !important;
  }

  .header-center-nav .price-nav-btn .price-flip-front {
    justify-content: center !important;
    padding: 0 !important;
  }
}

@media (max-width: 420px) {
  .header-center-nav .price-nav-btn {
    flex-basis: 86px !important;
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
  }
}

/* v31: только горизонтальное положение мобильных кнопок «Каталог» и «Прайс».
   Размеры и все остальные элементы не меняем. */
@media (max-width: 768px) {
  .header-center {
    right: 8px !important;
  }
}
@media (max-width: 420px) {
  .header-center {
    right: 6px !important;
  }
}

/* v32: только положение «Каталог» и расстояние до «Прайс» на мобильных.
   Размеры кнопок, «Прайс» и всё остальное не меняем. */
@media (max-width: 768px) {
  .header-center-nav {
    gap: 0 !important;
  }
  .header-catalog-btn {
    transform: translateX(2.5px) !important;
  }
}

/* v39: только возвращаем десктопный блок корзины и контактов к краям шапки.
   Мобильную шапку не меняем. */
@media (min-width: 769px) {
  header .cart-left {
    left: 2% !important;
  }
  header .contacts-right {
    right: 2% !important;
  }
}

/* v46: подкатегории каталога. На компьютере раскрываются при наведении,
   на телефоне — по отдельной кнопке-стрелке внутри пункта. */
.header-catalog-menu .catalog-menu-group { position:relative; width:100%; }
.header-catalog-menu .catalog-menu-row { display:flex; align-items:center; width:100%; }
.header-catalog-menu .catalog-menu-row > .dropdown-item { flex:1 1 auto; min-width:0; }
.header-catalog-menu .submenu-toggle {
  flex:0 0 32px; width:32px; height:38px; margin-left:2px; border:0; border-radius:8px;
  background:transparent; color:#555; font-size:24px; line-height:1; cursor:pointer;
}
.header-catalog-menu .submenu-toggle:hover { background:#e3f2fd; color:#1a237e; }
.header-catalog-menu .dropdown-submenu {
  display:none; margin:0 0 4px 14px; padding:4px 0 2px 8px;
  border-left:2px solid #e3f2fd; box-sizing:border-box;
}
.header-catalog-menu .catalog-menu-group.submenu-open > .dropdown-submenu { display:block; }
.header-catalog-menu .dropdown-subitem {
  display:block; padding:8px 10px; border-radius:7px; color:#444; text-decoration:none;
  font-size:14px; font-weight:600; line-height:1.25; white-space:normal;
}
.header-catalog-menu .dropdown-subitem:hover { background:#eef6ff; color:#1a237e; }

@media (max-width: 768px) {
  .header-catalog-menu .catalog-menu-group:hover > .dropdown-submenu { display:none; }
  .header-catalog-menu .catalog-menu-group.submenu-open > .dropdown-submenu { display:block; }
  .header-catalog-menu .submenu-toggle { flex-basis:34px; width:34px; }
  .header-catalog-menu .dropdown-submenu { margin-left:10px; padding-left:7px; }
  .header-catalog-menu .dropdown-subitem { padding:9px 10px; font-size:15px; }
}

/* v50: только размер кнопки "+" и более заметная стрелка подкатегорий */
.qty-box .qty-btn[data-action="plus"] {
  width: 42px !important;
  min-width: 42px !important;
}
.product-bottom .add-to-cart-btn {
  padding-left: 6px !important;
  padding-right: 6px !important;
}
.header-catalog-menu .submenu-toggle {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  border: 2px solid #1565c0;
  border-radius: 7px;
  background: #1565c0;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(21,101,192,.25);
  transition: background-color .18s, transform .18s, box-shadow .18s;
}
.header-catalog-menu .submenu-toggle:hover,
.header-catalog-menu .submenu-toggle:focus-visible {
  background: #0d47a1;
  box-shadow: 0 3px 8px rgba(21,101,192,.35);
  transform: scale(1.05);
  outline: none;
}
@media (max-width: 768px) {
  .header-catalog-menu .submenu-toggle {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    font-size: 27px;
    line-height: 30px;
  }
}


/* v51: только визуальное центрирование знака "+" в кнопке количества на ПК.
   Мобильную версию не меняем. */
@media (min-width: 769px) {
  .qty-box .qty-btn[data-action="plus"] {
    text-indent: -10px !important;
  }
}

/* v53: только ещё один сдвиг знака "+" на ПК и тёплый зелёный цвет кнопок подкатегорий. */
@media (min-width: 769px) {
  .qty-box .qty-btn[data-action="plus"] {
    text-indent: -20px !important;
  }
}
.header-catalog-menu .submenu-toggle {
  background: #72ad78;
  border-color: #639f69;
  color: #fff;
}
.header-catalog-menu .submenu-toggle:hover,
.header-catalog-menu .submenu-toggle:focus-visible {
  background: #619f68;
  border-color: #568e5d;
  box-shadow: 0 3px 8px rgba(97,159,104,.30);
}
