/* Тёмная тема (класс es-dark у <html>, кнопка [es_theme] — includes/theme-mode.php).
   Графитовый фон, карточки чуть светлее, приглушённый синий для ссылок и мягкий оранжевый для кнопок покупки.
   Основное — переопределение палитры Blocksy и переменных магазина из style.css; ниже — точечные правки
   элементов WooCommerce и плагинов, у которых цвета прописаны прямо. */

html.es-dark {
	color-scheme: dark;

	/* Палитра Blocksy: 1–2 акцент, 3 текст, 4 заголовки, 5 рамки, 6–7 фоны, 8 карточки. */
	--theme-palette-color-1: #6ea6f2;
	--theme-palette-color-2: #5a92e0;
	--theme-palette-color-3: #c3ccd8;
	--theme-palette-color-4: #e4e9f0;
	--theme-palette-color-5: #343d4b;
	--theme-palette-color-6: #1d232c;
	--theme-palette-color-7: #171c23;
	--theme-palette-color-8: #222933;

	--theme-text-color: var(--theme-palette-color-3);
	--theme-headings-color: var(--theme-palette-color-4);
	--theme-link-initial-color: var(--theme-palette-color-1);
	--theme-border-color: var(--theme-palette-color-5);
	--theme-form-field-border-initial-color: #3d4757;
	--theme-form-field-background-initial-color: #1b2129;
	--theme-form-field-background-focus-color: #1b2129;
	--theme-form-text-initial-color: #e1e7ef;
	--theme-form-text-focus-color: #e1e7ef;

	/* Переменные магазина (style.css). */
	--es-surface: #222933;
	--es-text: #e1e7ef;
	--es-muted: #98a5b6;
	--es-muted-2: #aab5c4;
	--es-line: #343d4b;
	--es-line-2: #3d4757;
	--es-line-3: #343d4b;
	--es-navy: #141a22;
	--es-navy-2: #1a212c;
	--es-navy-3: #0f141a;
	--es-on-navy: #aeb9c8;
	--es-tint: #1e2938;
	--es-tint-2: #1b2431;
	--es-cta: #e58a33;
	--es-cta-hover: #ee9c4c;
}

html.es-dark body,
html.es-dark .site-main,
html.es-dark #main-container {
	background-color: var(--theme-palette-color-7);
	color: var(--theme-palette-color-3);
}

/* Фото товаров сняты на белом — в темноте белые квадраты слепят. Мягкая светло-серая подложка,
   а белый фон снимка растворяется в ней (multiply). */
html.es-dark ul.products li.product figure,
html.es-dark ul.products li.product .ct-media-container,
html.es-dark .ct-product-gallery-container .ct-media-container,
html.es-dark .wc-block-components-product-image,
html.es-dark .wc-block-cart-item__image,
html.es-dark .wc-block-components-order-summary-item__image {
	background-color: #dfe4ea;
	border-radius: 10px;
}

html.es-dark ul.products li.product img,
html.es-dark .ct-product-gallery-container img,
html.es-dark .wc-block-components-product-image img,
html.es-dark .wc-block-cart-item__image img,
html.es-dark .wc-block-components-order-summary-item__image img {
	mix-blend-mode: multiply;
	background: transparent !important;
}

/* Карточки товаров и боковые блоки. */
html.es-dark ul.products li.product,
html.es-dark .ct-sidebar .ct-widget,
html.es-dark .woocommerce-tabs,
html.es-dark .woocommerce-product-attributes,
html.es-dark .es-advantage,
html.es-dark .es-category {
	background-color: var(--es-surface);
	border-color: var(--es-line);
}

html.es-dark .woocommerce-product-attributes th,
html.es-dark .woocommerce-product-attributes td,
html.es-dark table td,
html.es-dark table th {
	border-color: var(--es-line);
}

html.es-dark .woocommerce-product-attributes tr:nth-child(odd) th,
html.es-dark .woocommerce-product-attributes tr:nth-child(odd) td {
	background-color: #262e39;
}

/* Поля ввода — и в WooCommerce-блоках корзины и оформления. */
html.es-dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.es-dark select,
html.es-dark textarea,
html.es-dark .wc-block-components-text-input input,
html.es-dark .wc-block-components-textarea,
html.es-dark .wc-blocks-components-select__select,
html.es-dark .wc-block-components-combobox .components-combobox-control__input {
	background-color: #1b2129 !important;
	color: #e1e7ef !important;
	border-color: #3d4757 !important;
}

html.es-dark .wc-block-components-text-input label,
html.es-dark .wc-blocks-components-select__label,
html.es-dark .wc-block-components-combobox label {
	color: var(--es-muted-2) !important;
}

html.es-dark ::placeholder {
	color: #7d8a9c;
}

/* Корзина и оформление (блоки WooCommerce). */
html.es-dark .wc-block-cart,
html.es-dark .wc-block-checkout,
html.es-dark .wc-block-components-sidebar,
html.es-dark .wc-block-components-totals-wrapper,
html.es-dark .wc-block-components-panel,
html.es-dark .wc-block-components-radio-control__option,
html.es-dark .wc-block-components-radio-control-accordion-option,
html.es-dark .wc-block-checkout__shipping-method-option {
	color: var(--theme-palette-color-3);
	border-color: var(--es-line) !important;
}

html.es-dark .wc-block-components-sidebar-layout .wc-block-components-sidebar,
html.es-dark .wc-block-checkout__sidebar {
	background-color: var(--es-surface);
	border-radius: 12px;
}

html.es-dark .wc-block-components-checkout-step__title,
html.es-dark .wc-block-components-title,
html.es-dark .wc-block-components-totals-item__label,
html.es-dark .wc-block-components-totals-footer-item,
html.es-dark .wc-block-components-product-name {
	color: var(--theme-palette-color-4) !important;
}

/* Поиск в шапке (FiboSearch) и его выпадающий список. */
html.es-dark header#header .dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input,
html.es-dark .dgwt-wcas-suggestions-wrapp,
html.es-dark .dgwt-wcas-details-wrapp {
	background-color: #1b2129 !important;
	color: #e1e7ef !important;
	border-color: #3d4757 !important;
}

html.es-dark .dgwt-wcas-suggestion {
	color: #e1e7ef !important;
}

html.es-dark .dgwt-wcas-suggestion-selected {
	background-color: #283140 !important;
}

/* Выпадающие меню, всплывающая корзина, окно реквизитов, мобильное меню. */
html.es-dark .sub-menu,
html.es-dark .ct-cart-content,
html.es-dark #offcanvas .ct-panel-inner,
html.es-dark .es-customer__dialog {
	background-color: var(--es-surface) !important;
	color: var(--theme-palette-color-3);
}

/* Хлебные крошки, подписи, мелкий текст. */
html.es-dark .ct-breadcrumbs,
html.es-dark .woocommerce-result-count,
html.es-dark .entry-meta {
	color: var(--es-muted);
}

/* Цены и кнопки покупки остаются заметными, но без «кислотности». */
html.es-dark .price,
html.es-dark .wc-block-components-product-price {
	color: var(--theme-palette-color-4);
}

/* Подвал и так тёмный — делаем его в тон странице. */
html.es-dark .es-footer,
html.es-dark footer#footer [data-row] {
	background-color: #11161c;
}

/* Кнопка переключения темы. */
.es-theme {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--es-on-navy);
	font: inherit;
	font-size: 13px;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s;
}

.es-theme:hover,
.es-theme:focus-visible {
	color: #fff;
}

.es-theme__sun {
	display: none;
}

html.es-dark .es-theme__sun {
	display: inline;
}

html.es-dark .es-theme__moon {
	display: none;
}

/* В мобильном меню кнопка на светлом фоне панели. */
#offcanvas .es-theme {
	color: var(--theme-palette-color-3);
	font-size: 15px;
	padding-block: 8px;
}

/* Тёмно-синий шапки в светлой теме служит и цветом текста — в тёмной такой текст светлый. */
html.es-dark .es-filter__preset,
html.es-dark .es-customer__logo-text,
html.es-dark .es-customer__title,
html.es-dark .es-customer__subtitle,
html.es-dark .es-customer-summary {
	color: var(--theme-palette-color-4);
}

html.es-dark .es-filter__preset {
	border-color: var(--es-line-2);
}

/* Синие кнопки: насыщенный синий с белым текстом вместо светло-голубого (палитра 1 светлее для ссылок). */
html.es-dark {
	--theme-button-background-initial-color: #2c5fa8;
	--theme-button-background-hover-color: #3770c0;
	--theme-button-text-initial-color: #fff;
	--theme-button-text-hover-color: #fff;
}

html.es-dark header#header [data-id="menu"] > ul > li:first-child > .ct-menu-link,
html.es-dark .ct-header-cta .ct-button,
html.es-dark .es-filter button[type="submit"] {
	background-color: #2c5fa8;
	color: #fff;
}

/* Сообщения WooCommerce («Сохранено», «Товар добавлен в корзину», ошибки): светлая плашка Blocksy — в тон теме. */
html.es-dark .woocommerce-message,
html.es-dark .woocommerce-info,
html.es-dark .woocommerce-error,
html.es-dark .wc-block-components-notice-banner {
	background-color: #1e2938 !important;
	color: #e1e7ef !important;
	border-color: #2f3d52 !important;
}

html.es-dark .woocommerce-error,
html.es-dark .wc-block-components-notice-banner.is-error {
	background-color: #3b1d1d !important;
	border-color: #5a2a2a !important;
}

/* Поле только для чтения (ИНН в кабинете, телефон в окне реквизитов) — заметно бледнее. */
html.es-dark input[readonly] {
	background-color: #262e39 !important;
	color: var(--es-muted) !important;
}

/* Окно реквизитов и строка «Покупатель»: ошибки и разделитель адресов. */
html.es-dark .es-customer__message { background: #3b1d1d; color: #f3a5a0; }
html.es-dark .es-customer-summary__row--addresses { border-top-color: var(--es-line); }

/* Переключатель «Доставка / Самовывоз»: выбранный вариант — синим, а не белой плашкой. */
html.es-dark .wc-block-checkout__shipping-method-option {
	background-color: var(--es-surface) !important;
	color: var(--theme-palette-color-3) !important;
}

html.es-dark .wc-block-checkout__shipping-method-option--selected {
	background-color: #1e2938 !important;
	border-color: var(--theme-palette-color-1) !important;
	color: var(--theme-palette-color-4) !important;
	box-shadow: inset 0 0 0 1px var(--theme-palette-color-1) !important;
}

/* «До бесплатной доставки не хватает …» на оформлении заказа */
html.es-dark .es-delivery-note--short {
	background: #3a2a17;
	color: #ffc58a;
}
