/*
Theme Name: domone
Theme URI: https://domone.pl
Description: Sklep domone.pl — motyw potomny Twenty Twenty-Five: czarno-biały, Outfit + Inter, jeden kolor akcentu.
Author: ONECOM Sp. z o.o.
Template: twentytwentyfive
Version: 0.2.0
Requires at least: 6.7
Requires PHP: 8.3
License: GPL-2.0-or-later
Text Domain: domone
*/

/* Только то, чего нельзя задать в theme.json. Цвета, шрифты, отступы — в theme.json. */

:where(.wp-block-woocommerce-product-image, .wc-block-components-product-image) img {
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 4px;
	background: var(--wp--preset--color--base);
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

.domone-eyebrow {
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-4);
}

.domone-header .wp-block-search__input {
	border-radius: 999px;
	min-height: 48px;
}

.domone-logo,
.domone-logo img {
	flex-shrink: 0;
}

.domone-topbar p {
	margin: 0;
	text-align: center;
}

/* Телефон: логотип и иконки в одну строку, поиск — на всю ширину ниже */
@media (max-width: 781px) {
	.domone-header {
		flex-wrap: wrap !important;
		row-gap: 12px;
	}
	.domone-header > .wp-block-search {
		order: 3;
		flex: 1 1 100%;
		min-width: 0;
		max-width: 100%;
	}
	.domone-header .wp-block-search__inside-wrapper {
		box-sizing: border-box;
		width: 100% !important;
	}
}

/* Описание из Sellasist («Uniwersalny opis»): блоки «фото + текст» по 50 % — на телефоне друг под другом */
.woocommerce-Tabs-panel--description img,
.wp-block-woocommerce-product-description img {
	max-width: 100%;
	height: auto;
}
@media (max-width: 781px) {
	.woocommerce-Tabs-panel--description div[style*="inline-block"],
	.wp-block-woocommerce-product-description div[style*="inline-block"] {
		width: 100% !important;
		display: block !important;
	}
}

/* Меню категорий — строка, на телефоне прокручивается вбок. nav стоит во flex-группе шапки: без min-width: 0 он
   растягивается по содержимому (вся страница становится шире экрана) и прокрутка внутри не включается. */
nav:has(> .domone-catnav) {
	min-width: 0;
	max-width: 100%;
	flex: 1 1 auto;
}
.domone-catnav,
.domone-catnav ul {
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
	min-width: 0;
	max-width: 100%;
}
.domone-catnav li {
	padding: 14px 0;
	flex: none;
}
.domone-catnav a {
	text-decoration: none;
	font-weight: 500;
	font-size: 0.875rem;
	padding-bottom: 12px;
	border-bottom: 2px solid transparent;
}
.domone-catnav a[aria-current] {
	border-bottom-color: var(--wp--preset--color--contrast);
}

/* ---------- Главная ---------- */
.domone-hero h1 {
	font-size: clamp(2.125rem, 1rem + 4vw, 4.5rem);
}
.domone-lead {
	font-size: 1.125rem;
	color: #333;
	max-width: 440px;
}
.domone-hero__img img {
	display: block;
	width: 100%;
	height: clamp(320px, 42vw, 600px);
	object-fit: cover;
	border-radius: 4px;
	background: var(--wp--preset--color--accent-2);
}
.domone-section {
	margin-top: clamp(40px, 6vw, 96px) !important;
	margin-bottom: 20px !important;
}
.domone-section h2,
h2.domone-section {
	margin-top: 0;
	margin-bottom: 0;
}
h2.domone-section {
	margin-top: clamp(40px, 6vw, 96px) !important;
	margin-bottom: 20px !important;
}
.domone-section a {
	text-underline-offset: 4px;
}

/* Плитки категорий: телефон — 2 колонки, компьютер — мозаика из 4 колонок, первая плитка на два ряда */
.domone-cats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}
.domone-cats a {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wp--preset--color--accent-2);
	border-radius: 4px;
	overflow: hidden;
	text-decoration: none;
}
.domone-cats img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	mix-blend-mode: multiply;
	display: block;
}
/* Телефон, 2 колонки: нечётная последняя плитка — на всю ширину, без дыры справа */
.domone-cats li:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}
.domone-cats li:last-child:nth-child(odd) img {
	aspect-ratio: 2 / 1;
}
.domone-cats span {
	padding: 10px 12px 12px;
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1.25;
}
@media (min-width: 782px) {
	.domone-cats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-rows: 260px;
		gap: 12px;
	}
	.domone-cats li:first-child {
		grid-row: span 2;
	}
	.domone-cats li:last-child:nth-child(odd) {
		grid-column: auto;
	}
	.domone-cats img {
		position: absolute;
		inset: 0;
		height: 100%;
		aspect-ratio: auto;
	}
	/* Небольшие плитки: фото справа на 60 %, название слева внизу */
	.domone-cats li:not(:first-child) img {
		left: auto;
		width: 60%;
	}
	.domone-cats span {
		position: absolute;
		left: 20px;
		bottom: 20px;
		max-width: 40%;
		padding: 0;
		font-family: var(--wp--preset--font-family--outfit);
		font-weight: 700;
		font-size: 1.25rem;
		line-height: 1.15;
	}
	.domone-cats li:first-child span {
		max-width: 70%;
		padding: 10px 14px;
		background: var(--wp--preset--color--base);
		border-radius: 4px;
		font-size: 1.625rem;
	}
}

/* ---------- Карточки товаров в списках ---------- */
.domone-cards .wc-block-product,
.domone-cards .wp-block-post {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.domone-cards .wc-block-components-product-image {
	margin: 0 !important;
}
.domone-card__title {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--inter) !important;
	font-weight: 400 !important;
	font-size: 0.9375rem !important;
	line-height: 1.35 !important;
	letter-spacing: 0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.domone-card__title a {
	text-decoration: none;
}
.domone-card__stock {
	margin: 0 !important;
	font-size: 0.8125rem;
}
.domone-card__buy {
	margin-top: auto !important;
	gap: 8px;
	flex-wrap: wrap !important;
}
.domone-cards .wc-block-product,
.domone-cards .wp-block-post {
	min-width: 0;
}
.domone-cards .wc-block-components-product-price {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 700;
	font-size: 1.25rem;
}
.domone-card__add {
	margin: 0 !important;
}
.domone-card__add .wp-block-button__link,
.domone-card__add .wc-block-components-product-button__button {
	min-height: 44px;
	padding: 0 16px !important;
	border: 1px solid var(--wp--preset--color--contrast) !important;
	background: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
	font-size: 0.875rem !important;
	white-space: nowrap !important;
}
.domone-card__add .wp-block-button__link:hover,
.domone-card__add .wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--base) !important;
}

/* Наличие: точка + текст */
.stock,
.wc-block-components-product-stock-indicator {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--wp--preset--color--accent-3);
}
.stock::before,
.wc-block-components-product-stock-indicator::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}
.stock.out-of-stock,
.wc-block-components-product-stock-indicator--out-of-stock {
	color: var(--wp--preset--color--accent-4);
}

/* Полоса: доставка, оплата, возврат, фактура */
.domone-trust {
	list-style: none;
	margin: clamp(40px, 6vw, 96px) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	border-top: 1px solid var(--wp--preset--color--contrast);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.domone-trust li {
	padding: 20px 16px 20px 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.domone-trust span {
	font-size: 0.875rem;
	color: var(--wp--preset--color--accent-4);
}
@media (min-width: 782px) {
	.domone-trust {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.domone-trust li {
		padding: 28px 24px;
	}
	.domone-trust li:first-child {
		padding-left: 0;
	}
	.domone-trust li + li {
		border-left: 1px solid var(--wp--preset--color--accent-6);
	}
}

/* ---------- Категория ---------- */
.domone-catalog__head h1 {
	margin: 0;
	font-size: clamp(2rem, 1rem + 3vw, 3.5rem);
	letter-spacing: -0.03em;
}
.domone-catalog__head .woocommerce-result-count,
.domone-catalog__head .wc-block-product-results-count {
	color: var(--wp--preset--color--accent-4);
	margin: 0;
}
.domone-filters h3 {
	margin: 24px 0 8px;
	font-family: var(--wp--preset--font-family--inter);
	font-weight: 500;
}
/* Ползунок цены: сетка WooCommerce «170px 0 170px» шире колонки фильтров (295 px) — ползунок вылезал на товары */
.domone-filters .wc-block-product-filter-price-slider__content {
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
}
.domone-filters .wc-block-product-filter-price-slider__content input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
}
.domone-catalog__bar {
	padding-bottom: 16px;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
	margin-bottom: 24px;
}
.domone-catalog__bar select {
	min-height: 40px;
	border: 1px solid #CFCCC6;
	border-radius: 4px;
	padding: 0 10px;
	font: inherit;
	background: var(--wp--preset--color--base);
}

/* ---------- Карточка товара ---------- */
.domone-product__top {
	margin-top: 24px !important;
}
.domone-product__summary {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.domone-product__summary > * {
	margin: 0 !important;
}
.domone-product__summary .domone-eyebrow a {
	color: inherit;
	text-decoration: none;
}
/* Блок галереи WooCommerce ограничен max-width: 512px — в колонке 58 % (713 px) фото было маленьким */
.domone-product .wp-block-woocommerce-product-image-gallery {
	width: 100%;
	max-width: none;
}
/* Фото из Sellasist — до 12 штук: миниатюры по 6 в ряд */
.domone-product .flex-control-thumbs {
	display: grid !important;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
	margin-top: 8px !important;
}
.domone-product .flex-control-thumbs li {
	width: auto !important;
	margin: 0 !important;
}
.domone-product .flex-control-thumbs img {
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 4px;
}
.domone-product .woocommerce-product-gallery__image img {
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 4px;
}
.domone-product__title {
	font-size: clamp(1.75rem, 1rem + 2vw, 2.75rem) !important;
	line-height: 1.05 !important;
}
.domone-product__price .wc-block-components-product-price,
.domone-product__price .price {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 800;
	font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem);
	line-height: 1;
}
.domone-product__price p {
	margin: 0;
}
.domone-product form.cart {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.domone-product form.cart .quantity input {
	height: 56px;
	width: 88px;
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 999px;
	text-align: center;
	font: inherit;
	font-weight: 600;
}
.domone-product form.cart .single_add_to_cart_button {
	flex: 1;
	min-height: 56px;
	border-radius: 999px;
}
.domone-info {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 4px;
}
.domone-info li {
	padding: 14px 18px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	font-size: 0.875rem;
	line-height: 1.45;
}
.domone-info li + li {
	border-top: 1px solid #F0EEEA;
}
.domone-info svg {
	flex-shrink: 0;
}
.domone-ask a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-size: 0.875rem;
	text-underline-offset: 3px;
}
.domone-product__description,
.domone-related {
	margin-top: clamp(48px, 6vw, 96px) !important;
}
.domone-related .wp-block-post-template {
	gap: 20px;
}
@media (max-width: 781px) {
	.domone-related .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* ---------- Оформление заказа и «Спасибо» ---------- */
.domone-checkout-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 10px var(--wp--preset--spacing--30);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.domone-checkout-header a {
	text-decoration: none;
}
.domone-checkout-header__back,
.domone-checkout-header__safe {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-size: 0.875rem;
}
.domone-checkout-header__safe {
	justify-self: end;
	color: var(--wp--preset--color--accent-4);
}
.domone-checkout-header .domone-logo {
	display: flex;
	align-items: center;
	gap: 8px;
}
@media (max-width: 600px) {
	.domone-checkout-header__back span,
	.domone-checkout-header__safe span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}
.wc-block-checkout .wc-block-components-radio-control__option,
.wc-block-checkout .wc-block-components-text-input input,
.wc-block-checkout .wc-blocks-components-select__select {
	border-radius: 4px;
}
.wc-block-checkout .wc-block-components-checkout-place-order-button {
	min-height: 56px;
	border-radius: 999px;
	font-weight: 600;
}
/* Карта пунктов Apaczka: кнопка и выбранный пункт — в стиле магазина вместо зелёных */
#apaczka_mp_geowidget_show_map.button.alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-height: 48px;
	margin: 12px 0 0;
	padding: 0 24px;
	border: 1px solid var(--wp--preset--color--contrast) !important;
	border-radius: 999px;
	font-size: 0.9375rem !important;
	line-height: 1.2;
	white-space: nowrap;
	background: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
	box-shadow: none !important;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}
#apaczka_mp_geowidget_show_map:hover {
	background: var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--base) !important;
}
.apaczka_selected_point_data {
	margin-top: 12px;
	padding: 14px 16px !important;
	border: 1px solid var(--wp--preset--color--accent-6) !important;
	border-radius: 4px;
	background: var(--wp--preset--color--accent-2) !important;
	font-size: 0.875rem;
	line-height: 1.45;
}
#selected-parcel-machine-id {
	font-weight: 600;
}
.domone-thanks__status {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 700;
	font-size: clamp(1.75rem, 1rem + 2vw, 2.25rem);
	line-height: 1.1;
}
.domone-next {
	margin-top: 32px;
	padding: 20px;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 4px;
}
.domone-next ol {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
}
.domone-next li {
	position: relative;
	padding: 0 0 18px 28px;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}
.domone-next li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid var(--wp--preset--color--contrast);
	box-sizing: border-box;
	background: var(--wp--preset--color--base);
}
.domone-next li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 18px;
	bottom: 0;
	width: 2px;
	background: var(--wp--preset--color--accent-6);
}
.domone-next li.is-done::before {
	background: var(--wp--preset--color--contrast);
}
.domone-next li span {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--accent-4);
}
.domone-next__links {
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}
.domone-next__links a:not(.wp-element-button) {
	font-size: 0.9375rem;
	text-underline-offset: 3px;
}
.domone-next__links .wp-element-button {
	text-decoration: none;
}

/* Отклик на нажатие: кнопка чуть сжимается — видно, что нажатие принято */
.wp-element-button,
.wc-block-components-button,
.single_add_to_cart_button,
#apaczka_mp_geowidget_show_map {
	transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms ease, color 160ms ease;
}
.wp-element-button:active,
.wc-block-components-button:active,
.single_add_to_cart_button:active,
#apaczka_mp_geowidget_show_map:active {
	transform: scale(0.97);
}
/* Плитка категории: фото слегка приближается — только мышью (на телефоне hover «залипает» после тапа) */
.domone-cats img {
	transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
	.domone-cats a:hover img {
		transform: scale(1.03);
	}
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
