/*
Theme Name: Дом Рядом
Theme URI: https://domriadom.ru/
Author:  @domriadom|brbndx
Author URI: https://domriadom.ru
Description: Адаптивная тема для интернет-магазина продуктов с доставкой «Дом Рядом». Поддержка WooCommerce, адаптивный дизайн, категории с сайдбаром.
Version: 0.9.3
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: domryadom-theme
Tags: e-commerce, woocommerce, food-delivery, responsive, custom-menu
*/

/* ===== CSS Variables ===== */
:root {
  --color-primary: #1F9356;
  --color-primary-hover: #1F9356;
  --color-primary-light: #fff0f3;
  --color-text: #1a1a1a;
  --color-text-secondary: #6b7280;
  --color-bg: #EEEEF0;
  --color-content-bg: #ffffff;
  --color-bg-gray: #f5f5f5;
  --color-border: #e5e7eb;
  --color-card-bg: #f3f4f6;
  --color-green: #0da800;
  --color-green-hover: #0b9200;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --header-height: 64px;
  --sidebar-width: 220px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a, button, [role="button"], input, select, textarea, label {
  touch-action: manipulation;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ===== Скрыть скроллбары везде ===== */
::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 112px;
  background-color: var(--color-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: none;
  padding: 0 20px 24px 20px;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.site-header.header--hidden {
  transform: translateY(-100%);
}

.site-header.header--top {
}

.header-inner {
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  background-color: #fff;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.site-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 130px;
}

.site-logo svg {
  width: 32px;
  height: 32px;
}

/* Custom logo from WordPress Customizer */
.custom-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 130px;
}

.custom-logo {
  height: auto;
  max-height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* Fallback SVG logo image */
.site-logo-img {
  max-height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.site-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.header-search {
  flex: 1;
  max-width: 540px;
  display: flex;
  align-items: center;
}

/* Внутренняя обёртка — именно она position:relative для иконки */
.header-search-wrap {
  position: relative;
  width: 100%;
}

.header-search-wrap input,
.header-search input {
  width: 100%;
  min-width: 0; /* important for flex squish */
  height: 48px;
  padding: 0 16px 0 44px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-bg-gray, #f3f4f6);
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search-wrap input::placeholder,
.header-search input::placeholder {
  color: var(--color-text-secondary);
}

.header-search-wrap input:focus,
.header-search input:focus {
  background: var(--color-bg-gray, #e5e7eb);
}

/* Лупа — всегда внутри .header-search-wrap */
.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 1;
}

/* Нативная кнопка очистки браузера в search-полях */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%231F9356' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M1 1l12 12M13 1L1 13'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}
input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Базовые стили — общие для обеих кнопок шапки */
.btn-login,
.btn-support {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.btn-login svg,
.btn-support svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Кнопка входа/профиля — прозрачная с синей рамкой */
.btn-login {
  background: transparent;
  color: #333;
  border: 1px solid var(--color-border, #e5e5e5);
}

.btn-login:hover {
  background: var(--color-bg-gray, #f3f4f6);
  color: #333;
}

.btn-login svg {
  color: #555;
}

.btn-login--icon {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

/* Кнопка поддержки — иконочная, как btn-login--icon */
.btn-support {
  background: var(--color-bg-gray);
  color: var(--color-text);
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

.btn-support:hover {
  background: #e8e8e8;
  color: var(--color-text);
}

.btn-support-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Кнопка выбора учреждения в шапке — иконочная, как btn-login--icon */
.btn-fsin {
  background: var(--color-bg-gray);
  color: var(--color-text);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-fsin:hover { background: #e8e8e8; }

.btn-fsin svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: #1F9356;
}

/* Скрываем оригинальную плавающую кнопку плагина — используем кнопку в шапке */
#drd-tg-chat-toggle.drd-tg-tab {
  display: none !important;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* ===== Layout ===== */
.site-main-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  padding: 0 20px;
  min-height: calc(100vh - 112px);
}

/* ===== Sidebar ===== */
.site-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border: none;
  border-radius: 24px;
  background: var(--color-content-bg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  position: sticky;
  top: 112px;
  height: calc(100vh - 136px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.site-sidebar::-webkit-scrollbar {
  width: 4px;
}

.site-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.site-sidebar::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

.sidebar-nav {
  padding: 12px 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  transition: background var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: var(--color-bg-gray, #f5f5f5);
  color: var(--color-text);
}

.sidebar-nav-item.active {
  background: var(--color-bg-gray, #f5f5f5);
  color: var(--color-primary);
}

.sidebar-nav-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
}

.sidebar-nav-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Expandable categories */
.sidebar-nav-group {
  border-bottom: none;
}

.sidebar-nav-group:last-child {
  border-bottom: none;
}

.sidebar-nav-row {
  display: flex;
  align-items: center;
  transition: background-color 0.15s ease;
}

.sidebar-nav-row:hover,
.sidebar-nav-row:has(.sidebar-nav-item.active) {
  background: var(--color-bg-gray, #f5f5f5);
}

.sidebar-nav-row:hover .sidebar-nav-item,
.sidebar-nav-row:has(.sidebar-nav-item.active) .sidebar-nav-item {
  background: none;
}

.sidebar-nav-row .sidebar-nav-item {
  flex: 1;
  min-width: 0;
}

.sidebar-nav-toggle {
  display: none;
  align-self: stretch;
  background: none;
  border: none;
  padding: 0 16px;
  cursor: pointer;
  color: var(--color-text-secondary);
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

/* Показываем стрелочку при выделении (hover), активности или если группа открыта */
.sidebar-nav-row:hover .sidebar-nav-toggle,
.sidebar-nav-row:has(.sidebar-nav-item.active) .sidebar-nav-toggle,
.sidebar-nav-group.is-open .sidebar-nav-toggle {
  display: flex;
}

.sidebar-nav-toggle svg {
  transition: transform .25s ease;
}

.sidebar-nav-group.is-open .sidebar-nav-toggle svg {
  transform: rotate(180deg);
}

.sidebar-nav-toggle:hover {
  color: var(--color-primary);
}

.sidebar-subcats {
  padding: 0 16px 8px 52px;
}

.sidebar-nav-subitem {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color .15s ease;
}

.sidebar-nav-subitem:hover {
  color: var(--color-text);
}

.sidebar-nav-subitem.active {
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-separator {
  height: 1px;
  background: var(--color-border);
  margin: 8px 16px;
}

/* ===== Sidebar drawer header (mobile) ===== */
.sidebar-drawer-header {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

.sidebar-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-gray, #f5f5f5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background 0.15s;
  flex-shrink: 0;
}

.sidebar-drawer-close:hover {
  background: #e5e5e5;
}

/* Service button inside sidebar drawer header (mobile) — full width */
.sidebar-drawer-header .custom-service-trigger {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}

@media (max-width: 1024px) {
  .sidebar-drawer-header {
    display: flex;
  }
}

/* Desktop-only service button at top of sidebar */
.sidebar-service-btn-wrap {
  padding: 12px 12px 0;
  flex-shrink: 0;
}

.sidebar-service-btn-wrap .custom-service-trigger {
  width: 100%;
  margin: 0;
}

@media (max-width: 1024px) {
  .sidebar-service-btn-wrap {
    display: none;
  }
}

/* ===== Content Area (white sheet) ===== */
.site-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  background: var(--color-content-bg);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* ===== Cart Sidebar (right, desktop only) ===== */
:root {
  --cart-sidebar-width: 280px;
}

.cart-sidebar {
  display: none;
}

@media (min-width: 1200px) {
  .cart-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--cart-sidebar-width);
    flex-shrink: 0;
    border: none;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    position: sticky;
    top: 112px;
    height: calc(100vh - 136px);
    overflow: hidden;
    background: #fff;
  }
}

/* Hide FSIN button from header — now in cart sidebar/drawer */
.btn-fsin {
  display: none !important;
}

/* ===== Cart Sidebar/Drawer Header: FSIN selector + Clear ===== */
.cart-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* FSIN selector button */
.cart-fsin-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--color-bg-gray, #f5f5f5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.cart-fsin-btn:hover {
  background: #eee;
  border-color: #d0d0d0;
}

.cart-fsin-btn:active {
  background: #e5e5e5;
}

.cart-fsin-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--color-text);
}

.cart-fsin-btn-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.cart-fsin-btn-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cart-fsin-btn-sub {
  display: none !important;
}

.cart-fsin-btn-chevron {
  width: 7px;
  height: 12px;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

/* Clear cart button */
.cart-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.cart-clear-btn:hover {
  background: var(--color-bg-gray, #f5f5f5);
  color: #e74c3c;
}

.cart-clear-btn:active {
  background: #fde8e8;
}

.cart-clear-btn svg {
  width: 18px;
  height: 18px;
}

.cart-sidebar--loading {
  pointer-events: none;
}
/* Плавное затемнение всего содержимого без удаления из DOM */
.cart-sidebar-inner,
.cart-drawer .cart-sidebar-inner {
  transition: opacity 0.12s ease;
}
.cart-sidebar--loading .cart-sidebar-inner,
.cart-drawer.cart-sidebar--loading .cart-sidebar-inner {
  opacity: 0.55;
}

.cart-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Empty state */
.cart-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 32px 24px;
  color: var(--color-text-secondary);
  text-align: center;
}
.cart-sidebar-empty svg {
  width: 48px;
  height: 48px;
  color: #d1d5db;
}
.cart-sidebar-empty p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}
.cart-sidebar-empty span {
  font-size: 13px;
}

/* Items list */
.cart-sidebar-items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}
.cart-sidebar-items::-webkit-scrollbar { width: 4px; }
.cart-sidebar-items::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.cart-sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: none;
  position: relative;
}

/* Subtle remove button — top-right corner */
.cart-sidebar-item-remove {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  z-index: 1;
}
.cart-sidebar-item-remove svg {
  width: 10px;
  height: 10px;
}
.cart-sidebar-item:hover .cart-sidebar-item-remove {
  opacity: 1;
}
.cart-sidebar-item-remove:hover {
  color: #e74c3c;
}

.cart-sidebar-item-img-wrap {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #f3f4f6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.cart-sidebar-item-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.cart-sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.cart-sidebar-item-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.cart-sidebar-item-weight {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.cart-sidebar-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Quantity controls */
.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-primary);
  border-radius: 20px;
  overflow: hidden;
  height: 28px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cart-qty-btn:hover {
  background: rgba(0,0,0,0.1);
}
.cart-qty-btn svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
}

.cart-qty-value {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.cart-sidebar-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.cart-sidebar-item-price .woocommerce-Price-amount {
  font-size: inherit;
  font-weight: inherit;
}

/* Footer: total + checkout */
.cart-sidebar-footer {
  border-top: 1px solid var(--color-border);
  padding: 14px 16px;
  flex-shrink: 0;
}

.cart-sidebar-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

.cart-sidebar-total-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-sidebar-total-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.cart-sidebar-total-price {
  font-weight: 700;
  font-size: 15px;
}
.cart-sidebar-total-price .woocommerce-Price-amount {
  font-size: inherit;
  font-weight: inherit;
}

.cart-sidebar-checkout {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s;
}
.cart-sidebar-checkout:hover {
  background: var(--color-primary-dark, #177a45);
  color: #fff;
}


/* ===== Cart Drawer (mobile) ===== */
.cart-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.cart-drawer-overlay.show {
  display: block;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: #fff;
  border-radius: 20px 0 0 20px;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cart-drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

.cart-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-gray, #f5f5f5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background 0.15s;
  flex-shrink: 0;
}
.cart-drawer-close:hover {
  background: #e5e5e5;
}

/* Reuse cart-sidebar-inner inside the drawer */
.cart-drawer .cart-sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Hero / Stories Section ===== */
.hero-section {
  margin-bottom: 32px;
}

.hero-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-title span {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.stories-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.stories-row::-webkit-scrollbar {
  display: none;
}

.story-card {
  flex: 0 0 160px;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--transition);
}

.story-card:hover {
  transform: scale(1.02);
}

.story-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-label {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  line-height: 1.3;
}

.story-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 50%);
}

/* Scroll arrow */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--transition);
}

.scroll-arrow:hover {
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.scroll-arrow.right {
  right: -8px;
}

.scroll-arrow.left {
  left: -8px;
}

.scroll-arrow svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
}

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.section-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.section-link:hover {
  color: var(--color-text);
}

.section-link svg {
  width: 16px;
  height: 16px;
}

/* ===== Promo Banners (Акции) ===== */
.promos-section {
  margin-bottom: 32px;
}

.promos-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.promos-row::-webkit-scrollbar {
  display: none;
}

.promo-card {
  flex: 0 0 180px;
  height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}

.promo-card:hover {
  transform: scale(1.03);
}

.promo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
}

/* ===== Product Cards ===== */
.products-section {
  margin-bottom: 32px;
}

/* ===== Product Grid Skeleton ===== */
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-pulse {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease infinite;
  border-radius: 6px;
}

.product-card--skeleton {
  pointer-events: none;
  cursor: default;
}

.product-card--skeleton .product-card-image {
  aspect-ratio: 1;
  border-radius: 0;
}

.skeleton-line {
  border-radius: 4px;
}

.skeleton-pill {
  width: 80px;
  height: 36px;
  border-radius: var(--radius-full, 999px);
}

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

.product-card {
  background: var(--color-bg);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--color-text) 4%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-text) 5%, transparent);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card.has-variations-open > *:not(.product-card-variations-overlay) {
  filter: blur(5px);
  pointer-events: none;
  transition: filter 0.2s ease;
}

.product-card-variations-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.product-card.has-variations-open .product-card-variations-overlay {
  opacity: 1;
  pointer-events: auto;
}

.product-card-variations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 14px;
}

.product-card-variations-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  color: var(--color-text);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.product-card-variations-close:hover {
  background: rgba(0,0,0,0.1);
}

.product-card-variations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}
.product-card-variations-list::-webkit-scrollbar {
  display: none;
}

.product-card-variation-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.product-card-variation-btn:hover {
  background: var(--color-primary-light);
}
.variation-btn-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}
.variation-btn-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}


/* --- Single Product Variations Pills --- */
.domryadom-variation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.domryadom-variation-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid color-mix(in srgb, var(--color-text) 15%, transparent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
  background: var(--color-bg);
}
.domryadom-variation-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.domryadom-variation-pill.selected {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.domryadom-variation-pill.disabled {
  opacity: 0.4;
  pointer-events: none;
  text-decoration: line-through;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-text) 8%, transparent);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.product-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
}

.product-card-badge.green {
  background: var(--color-green);
}

.product-card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.product-card-weight {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.product-card-footer {
  display: flex;
  align-items: flex-end;
  margin-top: auto;
}

/* ===== Cart Pill (price + plus) — static state ===== */
.product-card-cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #e8f5ee;
  border-radius: var(--radius-full, 999px);
  padding: 6px 6px 6px 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s cubic-bezier(.4,0,.2,1), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.product-card-cart-pill:hover {
  background: #d4eddd;
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(31,147,86,0.15);
}

.product-card-cart-pill:active {
  transform: scale(0.96);
  box-shadow: none;
}

.product-card-cart-pill .product-price-old {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
  margin-right: 4px;
  font-weight: 400;
}

.product-card-pill-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.product-card-pill-plus {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 400;
  color: var(--color-primary);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}

.product-card-cart-pill:hover .product-card-pill-plus {
  transform: rotate(90deg);
}

/* Old btn-add-to-cart — keep for backward compat but hidden in new pill design */
.btn-add-to-cart {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.btn-add-to-cart:hover {
  background: var(--color-green-hover);
}

.btn-add-to-cart svg {
  width: 18px;
  height: 18px;
}

/* ===== Product Card Qty Badge (green rounded square, top-right) ===== */
.product-card-qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  animation: domrdm-badge-pop 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes domrdm-badge-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* Smooth interaction for card controls */
.cart-qty-controls--card .cart-qty-btn {
  transition: background 0.15s, transform 0.15s;
}

.cart-qty-controls--card .cart-qty-btn:active {
  transform: scale(0.85);
}

/* ===== Cart controls inside product card footer ===== */
.cart-qty-controls--card {
  width: auto;
  height: 36px;
  border-radius: var(--radius-full, 999px);
}

.cart-qty-controls--card .cart-qty-value {
  font-size: 14px;
  font-weight: 700;
  padding: 0 4px;
  white-space: nowrap;
}

.cart-qty-controls--card .cart-qty-btn {
  width: 32px;
  height: 36px;
}

/* ===== Category Tiles (Рецепты, Для любимых...) ===== */
.category-tiles-section {
  margin-bottom: 32px;
}

.category-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.category-tile {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}

.category-tile:hover {
  transform: scale(1.03);
}

.category-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-tile-label {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

/* ===== Recipes Section ===== */
.recipes-section {
  margin-bottom: 32px;
}

.recipes-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.recipes-row::-webkit-scrollbar {
  display: none;
}

.recipe-card {
  flex: 0 0 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
}

.recipe-card:hover {
  transform: scale(1.03);
}

.recipe-card-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
}

.recipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 10px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  line-height: 1.3;
}

/* ===== Sub-Categories Grid ===== */
.subcategories-section {
  margin-bottom: 32px;
}

.subcategories-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 6px;
  margin-left: -6px;
  margin-right: -6px;
}

@media (min-width: 1025px) {
  .subcategories-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.subcategories-tabs::-webkit-scrollbar {
  display: none;
}

.subcategory-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text);
  background: #fff;
  border: none;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.08),
    0 2px 8px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.9);
  transition: all .2s ease;
}

.subcategory-tab:hover {
  box-shadow:
    0 2px 6px rgba(0,0,0,0.12),
    0 4px 12px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

.subcategory-tab.active {
  color: #fff;
  background: var(--color-primary);
  box-shadow:
    0 2px 8px color-mix(in srgb, var(--color-primary) 35%, transparent),
    0 4px 16px color-mix(in srgb, var(--color-primary) 20%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.subcategory-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}

.subcategory-card-image-wrap {
  position: relative;
  background: var(--color-bg-gray, #f2f2f2);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  width: 100%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.subcategory-card:hover .subcategory-card-image-wrap {
  background-color: #e9e9e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-text) 6%, transparent);
}

.subcategory-card-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  text-align: left;
  margin: 0;
  padding: 0 2px;
  transition: color 0.15s ease;
}

.subcategory-card:hover .subcategory-card-title {
  color: var(--color-primary);
}

.subcategory-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  transform: scale(1.02);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subcategory-card:hover .subcategory-card-image {
  transform: scale(1.08);
}

/* ===== City Modal ===== */
.city-popup {
  position: fixed;
  top: 80px;
  right: 24px;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  z-index: 200;
  display: none;
  max-width: 300px;
}

.city-popup.show {
  display: block;
}

.city-popup-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.city-popup-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.city-popup-buttons {
  display: flex;
  gap: 8px;
}

.btn-city-yes {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  transition: background var(--transition);
}

.btn-city-yes:hover {
  background: var(--color-primary-hover);
}

.btn-city-no {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--color-bg-gray);
  color: var(--color-text);
  font-weight: 500;
  font-size: 14px;
  transition: background var(--transition);
}

.btn-city-no:hover {
  background: #e8e8e8;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-content-bg);
  padding: 32px 0;
  max-width: 1560px;
  width: calc(100% - 40px);
  margin: 24px auto;
  border-radius: 24px;
}



.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* New Flex Layout */
.footer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.footer-col-legal {
  flex: 0 1 auto;
}

.footer-col-menu {
  flex: 0 1 auto;
  gap: 12px;
}

.footer-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-app-badge {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  transition: opacity var(--transition);
}

.footer-app-badge:hover {
  opacity: 0.8;
}

.footer-app-badge svg {
  width: 20px;
  height: 20px;
}

.footer-socials {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.footer-social-link:hover {
  background: #ddd;
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
  color: var(--color-text);
}

.footer-link {
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color var(--transition);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-text);
}

.footer-legal {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ===== Mobile City Header ===== */
.mobile-city-header {
  display: none;
  padding: 12px 16px;
  background: var(--color-bg);
}

.mobile-city-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.mobile-city-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.btn-select-address {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
}

/* ===== Mobile Search ===== */
.mobile-search {
  display: none;
  padding: 8px 20px;
  position: relative;
}

.mobile-search .header-search-icon {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.mobile-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  border: none;
  border-radius: var(--radius-full);
  background: #fff;
  font-size: 15px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ===== Search Overlay ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #fff;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.search-overlay[hidden] {
  display: none;
}
.search-overlay.is-visible {
  opacity: 1;
  transform: translateY(0);
}
body.search-overlay-open {
  overflow: hidden;
}

/* Panel wrapper — на мобиле прозрачный, просто flex-контейнер */
.search-overlay-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Header bar */
.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border);
}
.search-overlay-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-text);
}
.search-overlay-input-wrap {
  flex: 1;
  position: relative;
}
.search-overlay-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
  pointer-events: none;
}
.search-overlay-input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 38px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-bg-gray);
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  font-family: var(--font-family);
}
.search-overlay-input::placeholder {
  color: var(--color-text-secondary);
}
.search-overlay-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #b0b0b0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.search-overlay-clear[hidden] {
  display: none;
}

/* Body */
.search-overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Categories list */
.js-search-cats {
  padding: 6px 0 24px;
}
.search-cat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--transition);
}
.search-cat-item:active {
  background: var(--color-bg-gray);
}
.search-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Results panel */
.js-search-results {
  padding: 14px 16px 80px;
}
.js-search-results[hidden] {
  display: none;
}

/* Keyword chips */
.search-chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
}
.search-chips::-webkit-scrollbar { display: none; }
.search-chips:empty { display: none; }
.search-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-bg-gray);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.search-chip:active {
  background: #ddd;
}

/* Products grid */
.search-products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.search-product-card {
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--color-text) 4%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-text) 5%, transparent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity var(--transition);
}
.search-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-text) 8%, transparent);
}
.search-product-card:active {
  opacity: 0.75;
}
.search-product-img {
  aspect-ratio: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}
.search-product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.search-product-info {
  padding: 8px 10px 10px;
}
.search-product-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-product-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* No results */
.search-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
  font-size: 15px;
}

/* Skeleton loading */
.search-skeleton {
  display: flex;
  gap: 8px;
  padding-bottom: 14px;
}
.search-skeleton-chip {
  width: 90px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s infinite;
  flex-shrink: 0;
}
.search-products-grid--skeleton .search-product-card--skeleton {
  aspect-ratio: 0.85;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s infinite;
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Кнопка «В корзину» на карточке поиска ── */
.search-product-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.search-product-add {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s ease;
  padding: 0;
}
.search-product-add:active {
  transform: scale(0.9);
}
.search-product-add.is-loading {
  opacity: 0.6;
  font-size: 13px;
}
.search-product-add.is-done {
  background: #0da800;
  font-size: 14px;
}

/* Desktop: оверлей скрыт — поиск работает в области каталога */
@media (min-width: 768px) {
  .search-overlay { display: none !important; }
}

/* .header-search-clear удалена */

/* ── Desktop live-results ── */

/* Скрываем оригинальный контент страницы при активном поиске */
.site-content.search-active > *:not(#js-desktop-live-results) {
  display: none !important;
}

.desktop-live-results {
  padding: 4px 0 32px;
}

.desktop-search-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.desktop-search-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}
.desktop-search-more {
  font-size: 14px;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.desktop-search-more:hover {
  text-decoration: underline;
}

/* Чипы в десктоп-результатах */
.desktop-chips {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Сетка 5 колонок */
.desktop-products-grid {
  grid-template-columns: repeat(5, 1fr) !important;
}
.desktop-products-grid .search-product-card--skeleton {
  grid-template-columns: repeat(5, 1fr);
}

/* ===== Mobile Bottom Nav Pill ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}

/* Show dock bar whenever cart sidebar is hidden (< 1200px) */
@media (max-width: 1199px) {
  .mobile-bottom-nav {
    display: block;
  }
  /* Ensure content doesn't hide behind the dock bar */
  .site-content {
    padding-bottom: 80px;
  }
}

/* ===== Liquid Glass Pill ===== */
.mobile-pill {
  --glass-color: #bbbbbc;
  --glass-light: #fff;
  --glass-dark: #000;
  --glass-reflex-light: 1;
  --glass-reflex-dark: 1;

  display: flex;
  align-items: stretch;
  border-radius: 50px;
  padding: 5px;
  gap: 2px;
  pointer-events: all;
  background-color: color-mix(in srgb, var(--glass-color) 14%, transparent);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 1.8px 3px 0px -2px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -2px 0px -2px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 70%), transparent),
    inset -3px -8px 1px -6px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 50%), transparent),
    inset -0.3px -1px 4px 0px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 12%), transparent),
    inset -1.5px 2.5px 0px -2px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 18%), transparent),
    inset 0px 3px 4px -2px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 18%), transparent),
    inset 2px -6.5px 1px -4px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0px 1px 5px 0px color-mix(in srgb, var(--glass-dark) 8%, transparent),
    0px 6px 20px 0px color-mix(in srgb, var(--glass-dark) 10%, transparent);
  transition: background-color .3s ease, box-shadow .3s ease;
}

.mobile-pill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 16px;
  border-radius: 40px;
  font-size: 11px;
  font-weight: 500;
  color: color-mix(in srgb, var(--glass-dark) 55%, transparent);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  min-width: 68px;
  transition: color .18s ease, transform .2s cubic-bezier(.5,0,0,1);
}

.mobile-pill-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform .2s cubic-bezier(.5,0,0,1);
}

.mobile-pill-item:active svg {
  transform: scale(0.9);
}

.mobile-pill-item:hover,
.mobile-pill-item.is-active {
  color: color-mix(in srgb, var(--glass-dark) 85%, transparent);
}

.mobile-pill-item.is-active {
  background-color: color-mix(in srgb, var(--glass-color) 32%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 8%), transparent),
    inset 2px 1px 0px -1px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 70%), transparent),
    inset -1.5px -1px 0px -1px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 40%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 16%), transparent),
    inset 0px -4px 1px -2px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent),
    0px 3px 6px 0px color-mix(in srgb, var(--glass-dark) 6%, transparent);
}

/* Cart button: green accent preserved on glass */
.mobile-pill-cart {
  background: color-mix(in srgb, var(--color-primary) 80%, transparent);
  color: #fff;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff 12%, transparent),
    inset 1px 2px 0px -1px color-mix(in srgb, #fff 40%, transparent),
    inset -1px -2px 0px -1px color-mix(in srgb, #000 10%, transparent),
    0px 2px 8px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.mobile-pill-cart:hover {
  background: color-mix(in srgb, var(--color-primary) 90%, transparent);
  color: #fff;
}

.mobile-pill-cart svg {
  stroke: #fff;
}

/* ===== Sidebar overlay for mobile ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9998;
}

.sidebar-overlay.show {
  display: block;
}

/* ===== Delivery Badge ===== */
.delivery-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-bg-gray);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.delivery-badge svg {
  width: 16px;
  height: 16px;
  color: var(--color-green);
}

/* ===== WooCommerce Overrides ===== */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.woocommerce ul.products li.product {
  margin: 0;
  padding: 0;
  width: auto !important;
}

.woocommerce .price {
  color: var(--color-text) !important;
  font-size: 15px !important;
}

.woocommerce .price del {
  color: var(--color-text-secondary) !important;
  font-size: 12px !important;
}

.woocommerce .price ins {
  color: var(--color-primary) !important;
  font-weight: 700 !important;
}

.woocommerce a.button,
.woocommerce button.button {
  background: var(--color-green) !important;
  color: #fff !important;
  border-radius: var(--radius-full) !important;
  font-weight: 500 !important;
  padding: 8px 20px !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--color-green-hover) !important;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ===== Header alignment: 3-zone grid matching content columns ===== */
@media (min-width: 1200px) {
  /* Match the site-main-wrapper for perfect alignment */
  .header-inner {
    padding: 0 20px;
    gap: 24px;
  }

  /* Зона 1: Логотип — ширина = левый сайдбар */
  .site-logo {
    width: var(--sidebar-width);   /* 220px */
    flex-shrink: 0;
    height: 100%;
    padding: 0;
    justify-content: center;
    border: none;
    box-sizing: border-box;
  }

  /* Зона 2: Поиск — занимает всё пространство над центральной зоной */
  .header-search {
    flex: 1;
    max-width: none;
    padding: 0;
  }
  /* Обёртка с иконкой занимает всю ширину зоны минус padding */
  .header-search-wrap {
    width: 100%;
  }

  /* Зона 3: Кнопки — ширина = правый сайдбар, прижаты вправо */
  .header-actions {
    width: var(--cart-sidebar-width);  /* 280px */
    flex-shrink: 0;
    height: 100%;
    padding: 0;
    justify-content: flex-end;
    border: none;
    box-sizing: border-box;
  }
}

/* Global utility for hiding mobile inputs */
.mobile-only-search {
  display: none;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
  .site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    background: #fff;
    border-radius: 0 20px 20px 0;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    width: min(300px, 85vw);
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .site-header {
    padding-left: 0;
    padding-right: 0;
  }

  .site-footer {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .site-sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
  }

  .site-sidebar.open {
    transform: translateX(0);
  }

  .site-content {
    padding: 16px;
    padding-bottom: 80px;
  }

  .site-main-wrapper {
    padding: 0;
  }

  .header-search {
    max-width: none;
  }

  .story-card {
    flex: 0 0 160px;
    height: 160px;
  }

  .subcategories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .footer-top {
    flex-direction: column;
    gap: 24px;
  }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 640px) {
  :root {
    --header-height: 60px;
  }

  .site-header {
    border-bottom: none;
  }

  /* Логотип — левый край, кнопки — правый */
  .header-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .site-logo {
    margin-right: 0;
    flex-shrink: 0;
    min-width: 100px; /* Safeguard robust space for logo */
  }

  .site-logo svg {
    width: 27px;
    height: 27px;
  }

  .site-logo .custom-logo {
    max-height: 36px;
  }

  .site-logo-img {
    width: 85px;
  }

  .site-logo-text {
    font-size: 18px;
  }

  .header-actions {
    margin-left: 0;
    gap: 6px;
    flex-shrink: 0;
  }

  .header-search {
    display: block;
    flex: 1;
  }

  .header-search-wrap {
    height: 42px; /* Равно кнопкам */
    background: var(--color-bg);
    border-radius: 21px;
  }

  .header-search-wrap input.desktop-only-search {
    display: none !important;
  }

  .header-search-wrap input.mobile-only-search {
    display: block;
    font-size: 14px;
    height: 100%;
  }

  @media (max-width: 380px) {
    .header-search {
      flex: 0 0 42px;
    }
    .header-search-wrap input.mobile-only-search {
      opacity: 0;
      padding: 0;
      cursor: pointer;
    }
    .header-search-wrap .header-search-icon {
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }

  .btn-push {
    display: none !important;
  }

  .mobile-pill-search {
    display: none !important;
  }

  .btn-login {
    width: 42px; /* Выровняли с другими кнопками */
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .btn-login span {
    display: none;
  }

  .mobile-city-header {
    display: block;
  }

  .mobile-search {
    display: none !important;
  }

  /* mobile-bottom-nav already shown via @media max-width:1199px */

  .site-content {
    padding: 12px 16px;
    padding-bottom: 80px;
  }

  .hero-title {
    font-size: 18px;
  }

  .section-title {
    font-size: 18px;
  }

  .story-card {
    flex: 0 0 130px;
    height: 130px;
  }

  .promo-card {
    flex: 0 0 140px;
    height: 90px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .product-card-body {
    padding: 8px;
  }

  .product-card-title {
    font-size: 12px;
  }

  .product-card-weight {
    font-size: 11px;
  }

  .product-card-pill-price {
    font-size: 13px;
  }

  .product-card-cart-pill {
    padding: 5px 5px 5px 10px;
  }

  .cart-qty-controls--card {
    height: 32px;
  }

  .cart-qty-controls--card .cart-qty-value {
    font-size: 12px;
  }

  .cart-qty-controls--card .cart-qty-btn {
    width: 28px;
    height: 32px;
  }

  .category-tiles-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .subcategories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .subcategory-card-image-wrap {
    border-radius: 8px;
  }

  .subcategory-card-title {
    font-size: 12px;
    padding: 2px 1px 0 1px;
  }

  .footer-row {
    flex-direction: column;
    gap: 32px;
  }

  .site-footer {
    padding: 32px 24px 90px 24px;
    margin-bottom: 0;
    width: 100%;
    border-radius: 24px 24px 0 0;
  }

  .footer-col-legal,
  .footer-col-menu {
    flex: none;
    width: 100%;
  }

  .footer-col-menu {
    gap: 16px;
    align-items: flex-start;
  }

  .footer-link {
    font-size: 15px;
    padding: 4px 0;
    display: inline-block;
    color: var(--color-text-secondary);
  }
  
  .footer-col-legal {
    align-items: center;
    text-align: center;
  }
  
  .footer-media {
    justify-content: center !important;
  }

  /* --- Scrolled state: search no longer hides logo --- */
  .site-logo,
  .header-search {
    transition: opacity .25s ease, max-width .25s ease, padding .25s ease;
  }

  body.is-scrolled .header-search {
    display: flex !important;
    flex: 1;
    opacity: 1;
  }

  body.is-scrolled .mobile-search {
    display: none !important;
  }
}

/* ===== Utility classes ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== WordPress specific ===== */
.wp-block-image img {
  border-radius: var(--radius-md);
}

.entry-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 24px 0 12px;
}

.entry-content p {
  margin-bottom: 16px;
}

/* ===== Страница (page.php) ===== */
.single-post {
  max-width: 960px;
  width: 100%;
  /* min-width:0 предотвращает растягивание flex-контейнера */
  min-width: 0;
}

.single-post h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .single-post h1 {
    font-size: 22px;
    margin-bottom: 16px;
  }
}

/* ===== Tables: адаптивность ===== */

/* Таблица — блочный контейнер с горизонтальным скроллом */
.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
  margin-bottom: 20px;
}

/* Внутренняя структура таблицы остаётся стандартной */
.entry-content table tbody { display: table-row-group; }
.entry-content table thead { display: table-header-group; }
.entry-content table tfoot { display: table-footer-group; }
.entry-content table tr    { display: table-row; }

.entry-content table td,
.entry-content table th {
  display: table-cell;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #e0e0e0);
  vertical-align: top;
  min-width: 90px;
}

.entry-content table th {
  background: var(--color-bg-gray, #f5f5f5);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.entry-content table td strong { font-weight: 600; }

.entry-content table ul {
  padding-left: 18px;
  margin: 4px 0;
}

.entry-content table ul li { margin-bottom: 4px; }

@media (max-width: 640px) {
  .entry-content table td,
  .entry-content table th {
    font-size: 12px;
    padding: 7px 9px;
    min-width: 80px;
  }
}

/* ===== Page Templates ===== */
.page-template-default .site-content {
  max-width: 900px;
}

@media (max-width: 960px) {
  .page-template-default .site-content {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ===== Cart widget in header ===== */
.header-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--color-green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition);
}

.header-cart:hover {
  background: var(--color-green-hover);
}

.header-cart svg {
  width: 20px;
  height: 20px;
}

.header-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== Search results page ===== */
.search-results-count {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

/* ===== Pagination (hidden — replaced by infinite scroll) ===== */
.pagination { display: none; }

/* ===== Infinite scroll loader ===== */
.infinite-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0 48px;
}
.infinite-loader[hidden] { display: none; }

.infinite-loader-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary, #1F9356);
  opacity: 0.3;
  animation: infiniteDotPulse 1.2s ease-in-out infinite;
}
.infinite-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.infinite-loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes infiniteDotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%           { opacity: 1;   transform: scale(1.15); }
}

/* ============================================================
   МИНИМАЛЬНЫЙ ЗАКАЗ — плашка в корзине
   ============================================================ */

.cart-min-order {
    padding: 12px 16px 4px;
}

.cart-min-order-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cart-min-order-bar-fill {
    height: 100%;
    background: #1F9356;
    border-radius: 2px;
    transition: width .4s ease;
    min-width: 4px;
}

.cart-min-order-text {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.cart-min-order-text strong {
    color: #1a1a1a;
}

/* Заблокированная кнопка чекаута */
.cart-sidebar-checkout--disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    background: #aaa;
    color: #fff;
    border: none;
    width: 100%;
    text-align: center;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 20px;
    font-family: inherit;
}

/* ============================================================
   СТРОКА ДОСТАВКИ В КОРЗИНЕ
   ============================================================ */
.cart-sidebar-delivery {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 2px;
}

/* Спиннер пересчёта доставки */
.cart-sidebar-delivery .cart-sidebar-total-price.is-recalculating {
    position: relative;
    color: transparent !important;
}
.cart-sidebar-delivery .cart-sidebar-total-price.is-recalculating * {
    color: transparent !important;
}
.cart-sidebar-delivery .cart-sidebar-total-price.is-recalculating::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(31,147,86,0.2);
    border-top-color: #1F9356;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Тихий пересчёт доставки (без крутящегося круга, просто серый шрифт) */
.cart-sidebar-delivery .cart-sidebar-total-price.is-recalculating-quiet,
.cart-sidebar-delivery .cart-sidebar-total-price.is-recalculating-quiet * {
    color: #9c9c9c !important;
    transition: color 0.22s ease;
}

.cart-sidebar-choose-delivery {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #1F9356;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s;
}

.cart-sidebar-choose-delivery:hover { opacity: .75; }

/* ============================================================
   ПОПАП ВЫБОРА УЧРЕЖДЕНИЯ ФСИН — Liquid Glass
   ============================================================ */
.fsin-popup-overlay {
    --glass-color: #bbbbbc;
    --glass-light: #fff;
    --glass-dark: #000;
    --glass-reflex-light: 1;
    --glass-reflex-dark: 1;

    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: color-mix(in srgb, var(--glass-color) 18%, transparent);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    animation: fsinFadeIn .25s ease;
}

.fsin-popup-overlay[hidden] { display: none; }

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

.fsin-popup {
    position: relative;
    border-radius: 24px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 400px;
    animation: fsinSlideUp .28s cubic-bezier(.34, 1.56, .64, 1);
    /* Liquid glass card */
    background-color: color-mix(in srgb, var(--glass-light) 72%, transparent);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 14%), transparent),
        inset 1.8px 3px 0px -2px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
        inset -2px -2px 0px -2px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 70%), transparent),
        inset -3px -8px 1px -6px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 50%), transparent),
        inset -0.3px -1px 4px 0px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
        inset -1.5px 2.5px 0px -2px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 14%), transparent),
        inset 0px 3px 4px -2px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 14%), transparent),
        0px 2px 8px 0px color-mix(in srgb, var(--glass-dark) 8%, transparent),
        0px 12px 40px 0px color-mix(in srgb, var(--glass-dark) 12%, transparent);
}

@keyframes fsinSlideUp {
    from { transform: translateY(20px) scale(.96); opacity: 0; }
    to   { transform: translateY(0) scale(1);     opacity: 1; }
}

/* Mandatory mode: first-time visitors cannot close */
.fsin-popup-overlay.fsin-popup--mandatory .fsin-popup-close {
    display: none;
}

.fsin-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: color-mix(in srgb, var(--glass-color) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--glass-light) 30%, transparent);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.fsin-popup-close:hover {
    background: color-mix(in srgb, var(--glass-color) 35%, transparent);
    transform: scale(1.08);
}
.fsin-popup-close:active {
    transform: scale(0.94);
}

.fsin-popup-close svg {
    width: 16px;
    height: 16px;
    stroke: #444;
}

.fsin-popup-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.fsin-popup-logo img,
.fsin-popup-logo a img,
.fsin-popup-logo .custom-logo {
    width: 160px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.fsin-popup-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a1a1a;
    padding-right: 36px;
}

.fsin-popup-subtitle {
    font-size: 13px;
    color: #777;
    margin: 0 0 20px;
    line-height: 1.4;
}

.fsin-popup-field {
    margin-bottom: 14px;
}

.fsin-popup-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fsin-popup-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid color-mix(in srgb, var(--glass-dark) 10%, transparent);
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a1a;
    background: color-mix(in srgb, var(--glass-light) 85%, transparent);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fsin-popup-field select:focus {
    outline: none;
    border-color: #1F9356;
    box-shadow: 0 0 0 3px color-mix(in srgb, #1F9356 15%, transparent);
}

.fsin-popup-field select:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.fsin-popup-save {
    margin-top: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #1F9356;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 14px color-mix(in srgb, #1F9356 30%, transparent);
}

.fsin-popup-save:hover { opacity: .88; transform: translateY(-1px); }
.fsin-popup-save:active { transform: scale(0.98); }

.fsin-popup-save:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   SMS-ONLY AUTH: скрываем поля паролей WooCommerce
   ============================================================ */
.woocommerce-form-login .woocommerce-form__label-for-checkbox,
.woocommerce-form-login .lost_password,
.woocommerce-form-register .woocommerce-form__label-for-checkbox,
.woocommerce-account .woocommerce-MyAccount-navigation-link--lost-password,
.woocommerce-ResetPassword,
.woocommerce-form-row--password,
#customer_login .woocommerce-form-row.form-row-last, /* поле пароля */
.woocommerce-form-login [name="password"] { display: none !important; }

/* ============================================================
   CATEGORY SALE CAROUSEL
   ============================================================ */
.category-sale-section {
    margin-bottom: 24px;
}

.sale-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px; /* For hover shadow */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sale-carousel::-webkit-scrollbar {
    display: none;
}

.sale-carousel > .product-card {
    flex: 0 0 calc(50% - 6px);
    max-width: 200px;
    scroll-snap-align: start;
}

@media (min-width: 576px) {
    .sale-carousel > .product-card { flex: 0 0 calc(33.333% - 8px); }
}
@media (min-width: 768px) {
    .sale-carousel > .product-card { flex: 0 0 calc(25% - 9px); }
}
@media (min-width: 1024px) {
    .sale-carousel > .product-card { flex: 0 0 calc(20% - 9.6px); max-width: none; }
}

/* Expanded Grid Mode */
.sale-carousel.is-expanded {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    overflow-x: hidden;
}

.sale-carousel.is-expanded > .product-card {
    flex: none;
    max-width: none;
    width: auto;
}

button.section-link {
    background: transparent;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--color-primary);
}
button.section-link:hover { opacity: 0.8; }

/* ============================================================
   СЛАЙДЕР «НОВИНКИ» — вставляется в середину каталога
   ============================================================ */
.new-arrivals-section {
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.new-arrivals-section .section-header {
    margin-bottom: 14px;
}

.new-arrivals-section .section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.new-arrivals-section .section-title::before {
    content: '✨';
    font-size: 16px;
}

.new-arrivals-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.new-arrivals-carousel::-webkit-scrollbar {
    display: none;
}

.new-arrivals-carousel > .product-card {
    flex: 0 0 calc(50% - 6px);
    max-width: 200px;
    scroll-snap-align: start;
}

@media (min-width: 576px) {
    .new-arrivals-carousel > .product-card { flex: 0 0 calc(33.333% - 8px); }
}
@media (min-width: 768px) {
    .new-arrivals-carousel > .product-card { flex: 0 0 calc(25% - 9px); }
}
@media (min-width: 1024px) {
    .new-arrivals-carousel > .product-card { flex: 0 0 calc(20% - 9.6px); max-width: none; }
}

/* ============================================================
   CHECKOUT MODAL (IFRAME)
   ============================================================ */
.checkout-modal-overlay {
    --glass-color: #bbbbbc;
    --glass-light: #fff;
    --glass-dark: #000;
    --glass-reflex-light: 1;
    --glass-reflex-dark: 1;

    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: color-mix(in srgb, var(--glass-color) 18%, transparent);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fsinFadeIn 0.2s ease;
}

.checkout-modal-overlay[hidden] {
    display: none;
}

.checkout-modal-dialog {
    position: relative;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fsinSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Liquid glass card */
    background-color: color-mix(in srgb, #fff 72%, transparent);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, #fff 14%, transparent),
        inset 1.8px 3px 0px -2px color-mix(in srgb, #fff 80%, transparent),
        inset -2px -2px 0px -2px color-mix(in srgb, #fff 70%, transparent),
        inset -3px -8px 1px -6px color-mix(in srgb, #fff 50%, transparent),
        inset -0.3px -1px 4px 0px color-mix(in srgb, #000 10%, transparent),
        inset -1.5px 2.5px 0px -2px color-mix(in srgb, #000 14%, transparent),
        inset 0px 3px 4px -2px color-mix(in srgb, #000 14%, transparent),
        0px 2px 8px 0px color-mix(in srgb, #000 8%, transparent),
        0px 12px 40px 0px color-mix(in srgb, #000 12%, transparent);
}

.checkout-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid color-mix(in srgb, #000 10%, transparent);
}
.checkout-modal-heading {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.checkout-modal-back {
    display: none !important;
}

.checkout-modal-close {
    position: static;
    background: color-mix(in srgb, var(--glass-color) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--glass-light) 30%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    transition: background 0.15s;
    padding: 0;
}

.checkout-modal-close:hover {
    background: color-mix(in srgb, var(--glass-color) 35%, transparent);
}

.checkout-modal-close svg {
    width: 16px;
    height: 16px;
    stroke: #444;
}

@media (max-width: 767px) {
    .checkout-modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    .checkout-modal-dialog {
        margin-top: auto;
        max-width: none;
        border-radius: 24px 24px 0 0;
        height: 90vh;
        max-height: none;
        animation: slideUpBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}
@keyframes slideUpBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.checkout-modal-body {
    flex: 1;
    position: relative;
}

#checkoutModalSpinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(31,147,86,0.2);
    border-top-color: #1F9356;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

#checkoutModalIframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 24px;
    transition: opacity 0.2s;
}

/* ============================================================
   CHECKOUT PAGE CONTENT (MODAL STYLES)
   ============================================================ */
body.domrdm-modal-checkout {
    background: transparent;
    padding: 12px 24px 24px;
}
.woocommerce-checkout-wrapper.is-modal-iframe {
    height: 100%;
}

.domrdm-checkout-layout {
    font-family: var(--font-family);
    color: var(--color-text);
}

.domrdm-checkout-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    text-align: left;
    color: #1a1a1a;
}

.domrdm-checkout-section-title {
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--color-text);
    width: 100%;
    grid-column: 1 / -1 !important;
}
.domrdm-checkout-header .domrdm-checkout-section-title {
    margin-top: 0 !important;
}

.domrdm-billing-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row-wide {
    grid-column: 1 / -1 !important;
}

/* Readonly fields (city, index, address) */
body.domrdm-modal-checkout .fsin-readonly-field input {
    background-color: color-mix(in srgb, #000 5%, transparent) !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    border-color: color-mix(in srgb, #000 5%, transparent) !important;
}

/* Custom Field Layout Overrides per User Request */
body.domrdm-modal-checkout #billing_state_field {
    display: none !important;
}
body.domrdm-modal-checkout #billing_city_field,
body.domrdm-modal-checkout #billing_postcode_field,
body.domrdm-modal-checkout #billing_middle_name_field,
body.domrdm-modal-checkout #billing_birth_date_field {
    grid-column: span 1 !important;
    width: 100% !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row-first,
body.domrdm-modal-checkout .woocommerce form .form-row-last {
    grid-column: span 1 !important;
    width: 100% !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row label {
    display: none !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row .required {
    display: none !important;
}

/* Hide Additional Information / Details heading */
body.domrdm-modal-checkout .woocommerce-additional-fields > h3 {
    display: none !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row input.input-text,
body.domrdm-modal-checkout .woocommerce form .form-row input[type="email"],
body.domrdm-modal-checkout .woocommerce form .form-row input[type="tel"],
body.domrdm-modal-checkout .woocommerce form .form-row select,
body.domrdm-modal-checkout .woocommerce form .form-row textarea.input-text,
body.domrdm-modal-checkout .woocommerce form .form-row #order_comments {
    width: 100% !important;
    border: 1.5px solid color-mix(in srgb, #000 10%, transparent) !important;
    background: color-mix(in srgb, #fff 85%, transparent) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    border-radius: 20px !important;
    padding: 16px 20px !important;
    font-size: 15px !important;
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-align: left !important;
    color: var(--color-text) !important;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s !important;
    outline: none !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
    display: block !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 16px !important;
    padding-right: 48px !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row input.input-text:focus,
body.domrdm-modal-checkout .woocommerce form .form-row select:focus,
body.domrdm-modal-checkout .woocommerce form .form-row textarea.input-text:focus,
body.domrdm-modal-checkout .woocommerce form .form-row #order_comments:focus {
    background: #fff !important;
    border-color: var(--color-primary) !important;
}

body.domrdm-modal-checkout .woocommerce form .form-row.woocommerce-invalid input.input-text,
body.domrdm-modal-checkout .woocommerce form .form-row.woocommerce-invalid select {
    border-color: #EF3F61 !important;
    background: #fdf2f2 !important;
}

/* CSS Reordering to put Coupon below notes without nesting HTML forms */
body.domrdm-modal-checkout .woocommerce {
    display: flex;
    flex-direction: column;
}
body.domrdm-modal-checkout .domrdm-checkout-layout,
body.domrdm-modal-checkout form.domrdm-checkout-form {
    display: contents;
}
body.domrdm-modal-checkout .woocommerce-notices-wrapper { order: 0; width: 100%; margin-top: 0 !important; }
body.domrdm-modal-checkout .domrdm-checkout-header { order: 1; width: 100%; margin-bottom: 12px; margin-top: 0 !important; padding-top: 0 !important; }
body.domrdm-modal-checkout #customer_details { order: 2; width: 100%; margin-bottom: 16px; margin-top: 0 !important;}

body.domrdm-modal-checkout #order_review_heading { 
    order: 5; 
    width: 100%;
}
body.domrdm-modal-checkout #order_review { 
    display: contents; 
}
body.domrdm-modal-checkout .woocommerce-checkout-review-order-table {
    order: 6;
    width: 100%;
    margin-bottom: 24px;
}

/* Coupon inside payment step */
body.domrdm-modal-checkout #domrdm-coupon-slot {
    margin-bottom: 16px;
}
body.domrdm-modal-checkout #domrdm-coupon-slot:empty {
    display: none;
}
body.domrdm-modal-checkout .woocommerce-form-coupon-toggle {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 0 8px 0 !important;
    margin-bottom: 0 !important;
    width: 100%;
}
body.domrdm-modal-checkout form.checkout_coupon { 
    width: 100%;
    margin-bottom: 0 !important;
    position: relative !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

body.domrdm-modal-checkout #payment { 
    order: 7; 
    width: 100%;
}

/* Hide payment methods selection */
body.domrdm-modal-checkout #payment ul.payment_methods,
body.domrdm-modal-checkout #payment div.payment_box {
    display: none !important;
}
body.domrdm-modal-checkout .woocommerce-info {
    border: none !important;
    background: transparent !important;
    color: var(--color-text) !important;
    font-weight: 500 !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.domrdm-modal-checkout .woocommerce-info::before {
    display: none !important;
}
body.domrdm-modal-checkout .woocommerce-info a {
    color: var(--color-primary) !important;
    text-decoration: none !important;
}

/* Hide native login toggle (since we use custom SMS auth) */
body.domrdm-modal-checkout .woocommerce-form-login-toggle {
    display: none !important;
}

/* Hide all native WooCommerce top notification and error blocks,
   but allow coupon-related messages to show */
body.domrdm-modal-checkout .woocommerce-notices-wrapper,
body.domrdm-modal-checkout .woocommerce-NoticeGroup {
    margin: 0 !important;
    padding: 0 !important;
}
body.domrdm-modal-checkout .woocommerce-notices-wrapper:empty,
body.domrdm-modal-checkout .woocommerce-NoticeGroup:empty {
    display: none !important;
}
/* Style coupon notices inline */
body.domrdm-modal-checkout .woocommerce-notices-wrapper .woocommerce-message,
body.domrdm-modal-checkout .woocommerce-notices-wrapper .woocommerce-error {
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    color: var(--color-text) !important;
    margin: 8px 0 !important;
    list-style: none !important;
}
body.domrdm-modal-checkout .woocommerce-notices-wrapper .woocommerce-message::before,
body.domrdm-modal-checkout .woocommerce-notices-wrapper .woocommerce-error::before {
    display: none !important;
}
body.domrdm-modal-checkout .woocommerce-notices-wrapper .woocommerce-error {
    background: #fef2f2 !important;
    color: #991b1b !important;
}
body.domrdm-modal-checkout .woocommerce-notices-wrapper .woocommerce-message {
    background: #f0fdf4 !important;
    color: #166534 !important;
}

body.domrdm-modal-checkout form.checkout_coupon {
    display: none; /* Woocommerce toggles this via JS */
}

/* Hide the help text, but DO NOT hide .form-row */
body.domrdm-modal-checkout form.checkout_coupon > p:not(.form-row) {
    display: none !important;
}

body.domrdm-modal-checkout form.checkout_coupon p.form-row-first { 
    width: 100% !important; 
    margin: 0 !important; 
    padding: 0 !important;
    float: none !important; 
}

body.domrdm-modal-checkout form.checkout_coupon input.input-text {
    width: 100% !important;
    height: 52px !important;
    border-radius: 16px !important;
    background: #f3f4f6 !important;
    border: 1px solid transparent !important;
    padding: 0 60px 0 16px !important; /* Space for the button */
    font-size: 15px !important;
    box-shadow: none !important;
    transition: border-color 0.2s, background 0.2s !important;
}
body.domrdm-modal-checkout form.checkout_coupon input.input-text:focus {
    border-color: var(--color-primary) !important;
    background: #fff !important;
    outline: none !important;
}

body.domrdm-modal-checkout form.checkout_coupon p.form-row-last { 
    position: absolute !important;
    right: 6px !important;
    top: 6px !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important; 
}

body.domrdm-modal-checkout form.checkout_coupon button.button {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: var(--color-primary) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") !important;
    background-size: 20px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 12px !important; /* Matches outer radius proportionally */
    border: none !important;
    color: transparent !important; /* Hides original text */
    text-indent: 100px !important; /* Hack to move text out of view */
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 0 !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
}
body.domrdm-modal-checkout form.checkout_coupon button.button:hover {
    background-color: var(--color-primary-hover) !important;
}

/* Order Review Table Styling */
body.domrdm-modal-checkout .domrdm-review-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 24px 0 16px !important;
    font-size: 14px !important;
    background: transparent !important;
    border: none !important;
}
body.domrdm-modal-checkout .domrdm-review-table th,
body.domrdm-modal-checkout .domrdm-review-table td {
    padding: 10px 0 !important;
    border: none !important;
    background: transparent !important;
    vertical-align: middle !important;
}
/* Generic tfoot row defaults */
body.domrdm-modal-checkout .domrdm-review-table tfoot th {
    text-align: left !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    color: var(--color-text-secondary, #6b7280) !important;
}
body.domrdm-modal-checkout .domrdm-review-table tfoot td {
    text-align: right !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: var(--color-text, #1a1a1a) !important;
}
/* Delivery time row — value styled subtly */
body.domrdm-modal-checkout .domrdm-review-table tfoot .domrdm-delivery-time td {
    font-weight: 500 !important;
    color: var(--color-text-secondary, #6b7280) !important;
}
/* Order total row (Итого) — hero styling */
body.domrdm-modal-checkout .domrdm-review-table .order-total th,
body.domrdm-modal-checkout .domrdm-review-table .order-total td {
    padding-top: 16px !important;
    padding-bottom: 4px !important;
    border-top: 1px solid var(--color-border, #e5e7eb) !important;
    margin-top: 8px !important;
}
body.domrdm-modal-checkout .domrdm-review-table .order-total th {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--color-text, #1a1a1a) !important;
}
body.domrdm-modal-checkout .domrdm-review-table .order-total td {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--color-primary, #1F9356) !important;
}
body.domrdm-modal-checkout .woocommerce-checkout-review-order-table thead,
body.domrdm-modal-checkout .woocommerce-checkout-review-order-table tbody {
    display: none !important; /* Hide individual items since they saw them in cart */
}

/* Payment Methods */
body.domrdm-modal-checkout #payment {
    background: none !important;
    border-radius: 0 !important;
}
body.domrdm-modal-checkout #payment ul.payment_methods {
    padding: 0 !important;
    border-bottom: none !important;
    display: none !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 !important;
    border: none !important;
}
body.domrdm-modal-checkout #payment li.payment_method {
    margin: 0 !important;
    background: #f9fafb !important;
    border-radius: 16px !important;
    padding: 16px !important;
    border: 1px solid transparent !important;
}
body.domrdm-modal-checkout #payment li.payment_method > input.input-radio {
    display: none !important;
}
body.domrdm-modal-checkout #payment li.payment_method > label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: var(--color-text) !important;
}
body.domrdm-modal-checkout #payment li.payment_method > label::before {
    content: '' !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    border: 2px solid #ccc !important;
    margin-right: 12px !important;
    transition: border-color 0.2s !important;
}
body.domrdm-modal-checkout #payment li.payment_method input.input-radio:checked + label::before {
    border-color: var(--color-primary) !important;
    background-image: radial-gradient(circle, var(--color-primary) 40%, transparent 45%) !important;
}

body.domrdm-modal-checkout #payment div.payment_box {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    font-size: 14px !important;
    color: var(--color-text-secondary) !important;
}
body.domrdm-modal-checkout #payment div.payment_box::before { display: none !important; }
body.domrdm-modal-checkout #payment div.payment_box > p:empty { display: none !important; }

/* Place Order Button */
body.domrdm-modal-checkout #place_order {
    width: 100% !important;
    background: var(--color-primary) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 18px 24px !important;
    border: none !important;
    border-radius: 50px !important;
    margin-top: 32px !important;
    cursor: pointer !important;
    transition: opacity 0.2s, transform 0.1s !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
body.domrdm-modal-checkout #place_order:hover {
    opacity: 0.9 !important;
}
body.domrdm-modal-checkout #place_order:active {
    transform: scale(0.98) !important;
}

/* Hide Order Notes / Comments */
body.domrdm-modal-checkout .woocommerce-additional-fields {
    margin-top: 24px !important;
}

/* ============================================================
   SINGLE PAGE CHECKOUT (Reordering)
   ============================================================ */
body.domrdm-modal-checkout #order_review_heading {
    order: 3 !important;
}
body.domrdm-modal-checkout .woocommerce-checkout-review-order-table {
    order: 4 !important;
}
body.domrdm-modal-checkout .domrdm-payment-step {
    order: 7 !important;
    width: 100%;
    margin-bottom: 24px;
}
body.domrdm-modal-checkout #payment {
    display: block !important;
    order: 8 !important;
}
body.domrdm-modal-checkout #payment ul.payment_methods,
body.domrdm-modal-checkout #payment div.payment_box {
    display: none !important;
}
body.domrdm-modal-checkout #place_order {
    display: none !important;
}
body.domrdm-modal-checkout .woocommerce-additional-fields {
    /* display: none !important; */
}

/* ============================================================
   PAYMENT STEP
   ============================================================ */
.domrdm-payment-option {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 16px 18px !important;
    background: #f5f7f5 !important;
    border: 1.5px solid transparent !important;
    border-radius: 18px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 15px !important;
    color: var(--color-text, #1a1a1a) !important;
    transition: background 0.15s, border-color 0.15s, transform 0.1s !important;
    margin-bottom: 10px !important;
    -webkit-tap-highlight-color: transparent;
    text-align: left !important;
}
.domrdm-payment-option:hover {
    background: #eef3ee !important;
    border-color: var(--color-primary, #1F9356) !important;
}
.domrdm-payment-option:active { transform: scale(0.98) !important; }

.domrdm-payment-icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: #fff; border-radius: 12px;
    margin-right: 14px; flex-shrink: 0;
    color: var(--color-primary, #1F9356);
}
.domrdm-sbp-icon { background: #f0f4ff; }
.domrdm-payment-label { flex: 1; font-weight: 600; font-size: 15px; }
.domrdm-payment-arrow { color: #999; flex-shrink: 0; margin-left: 8px; }

/* Saved cards */
.domrdm-payment-cards { margin-bottom: 4px; }
.domrdm-cards-loading {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; color: #888; font-size: 14px;
}
.domrdm-saved-card {
    display: flex; align-items: center; width: 100%;
    padding: 16px 18px; background: #f5f7f5;
    border: 1.5px solid transparent; border-radius: 18px;
    cursor: pointer; font-family: inherit; font-size: 15px;
    color: var(--color-text, #1a1a1a);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    margin-bottom: 10px; -webkit-tap-highlight-color: transparent;
}
.domrdm-saved-card:hover {
    background: #eef3ee; border-color: var(--color-primary, #1F9356);
}
.domrdm-saved-card:active { transform: scale(0.98); }

.domrdm-card-icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: #fff;
    border-radius: 12px; margin-right: 14px; flex-shrink: 0;
    font-size: 11px; font-weight: 700; color: #333; text-transform: uppercase;
}
.domrdm-card-icon.visa { color: #1a1f71; }
.domrdm-card-icon.mastercard { color: #eb001b; }
.domrdm-card-icon.mir { color: #0f754e; }
.domrdm-card-info { flex: 1; }
.domrdm-card-pan { font-weight: 600; font-size: 15px; letter-spacing: 0.02em; }
.domrdm-card-exp { font-size: 12px; color: #888; margin-top: 2px; }

/* SBP Section */
.domrdm-sbp-section { text-align: center; padding: 20px 0; animation: fadeIn 0.3s ease; }
.domrdm-sbp-qr-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.domrdm-sbp-qr-wrap canvas { border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,0.08); }
.domrdm-sbp-hint { font-size: 14px; color: #888; margin: 0 0 12px; }
.domrdm-sbp-deeplink {
    display: inline-block; padding: 14px 32px;
    background: var(--color-primary, #1F9356); color: #fff !important;
    border-radius: 50px; font-weight: 600; font-size: 15px;
    text-decoration: none !important; transition: opacity 0.15s; margin-bottom: 16px;
}
.domrdm-sbp-deeplink:hover { opacity: 0.88; }

.domrdm-sbp-status, .domrdm-charge-status {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 16px; color: #888; font-size: 14px;
}

/* Small spinner */
.domrdm-spinner-sm {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(31,147,86,0.2);
    border-top-color: #1F9356; border-radius: 50%;
    animation: spin 1s linear infinite; flex-shrink: 0;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-text);
  margin-right: 4px;
  flex-shrink: 0;
  min-width: 40px;
}

/* Back button in modal header */
.checkout-modal-back {
    display: none !important;
    background: none; border: none; padding: 0;
    cursor: pointer; color: #444;
    -webkit-tap-highlight-color: transparent; margin-right: 8px;
}
.checkout-modal-back svg { width: 20px; height: 20px; stroke: #444; }
body.domrdm-checkout-step-payment .checkout-modal-back,
body.domrdm-checkout-step-2 .checkout-modal-back {
    display: flex !important; align-items: center;
}

/* ===== Footer Mobile Toggle ===== */
.footer-mobile-toggle {
    display: none;
    width: 100%;
    height: 32px;
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: pointer;
    margin-bottom: 12px;
    padding: 0;
}
.footer-mobile-toggle svg {
    transition: transform 0.3s ease;
}
@media (max-width: 767px) {
    .footer-mobile-toggle {
        display: flex;
    }
    .site-footer .footer-col-menu {
        display: none;
    }
    .site-footer.is-expanded .footer-col-menu {
        display: flex;
    }
    .site-footer.is-expanded .footer-mobile-toggle svg {
        transform: rotate(180deg);
    }
}

/* ==========================================================================
   Cookie Popup
   ========================================================================== */
.domrdm-cookie-popup {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 100px;
    padding: 12px 12px 12px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    z-index: 9999;
    max-width: 90%;
    width: max-content;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.domrdm-cookie-popup.is-hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

.domrdm-cookie-text {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
}

.domrdm-cookie-text .text-primary {
    color: var(--color-primary, #1F9356);
}

.domrdm-cookie-btn {
    background: #F2F2F2;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.domrdm-cookie-btn:hover {
    background: #E5E5E5;
}

@media (max-width: 768px) {
    .domrdm-cookie-popup {
        bottom: calc(96px + env(safe-area-inset-bottom)); /* ~10px above mobile dockbar */
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        max-width: none;
        flex-direction: column;
        align-items: stretch;
        border-radius: 24px;
        padding: 20px;
        gap: 16px;
    }

    .domrdm-cookie-popup.is-hidden {
        transform: translateY(20px);
    }
}

