/* ==========================================================================
   Grisha на WordPress: то, чего не было на статичном сайте —
   картинки WordPress, ссылки-фильтры, форма покупки, уведомления, корзина,
   оформление заказа и личный кабинет WooCommerce.
   ========================================================================== */

/* Картинка на весь блок (замена <Image fill> из Next.js) */
img.fill {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	padding: 0 !important;
	margin: -1px !important;
}

/* Цена WooCommerce */
.woocommerce-Price-currencySymbol {
	margin-left: 0.1em;
}

.card__price del,
.pdp__price del {
	color: var(--muted);
	margin-right: 8px;
}

.card__price ins,
.pdp__price ins {
	text-decoration: none;
}

/* ---------- Каталог: фильтры-ссылки и страницы ---------- */

.filters a {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
	padding: 6px 0;
	position: relative;
	transition: color 0.3s var(--ease);
}

.filters a:hover,
.filters a[aria-current="page"] {
	color: var(--ink);
}

.filters a[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--ink);
}

.pager {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 0 var(--pad) clamp(60px, 10vh, 120px);
}

.pager .page-numbers {
	min-width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	font-size: 12px;
}

.pager .page-numbers.current,
.pager a.page-numbers:hover {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

/* ---------- Страница товара: форма покупки WooCommerce ---------- */

.pdp__buy form.cart {
	display: grid;
	gap: 18px;
	margin: 0;
}

.pdp__buy table.variations,
.pdp__buy table.variations tbody,
.pdp__buy table.variations tr,
.pdp__buy table.variations th,
.pdp__buy table.variations td {
	display: block;
	border: 0;
	padding: 0;
	margin: 0;
	text-align: left;
}

.pdp__buy table.variations {
	width: 100%;
	border-collapse: collapse;
}

.pdp__buy table.variations tr + tr {
	margin-top: 18px;
}

.pdp__buy table.variations th.label,
.pdp__buy table.variations td.label {
	margin-bottom: 12px;
}

.pdp__buy table.variations label {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}

.pdp__buy .reset_variations {
	display: none !important;
}

.pdp .sizes__list button:disabled {
	opacity: 0.35;
	text-decoration: line-through;
	cursor: not-allowed;
}

.pdp__buy .woocommerce-variation {
	font-size: 13px;
	color: var(--ink-2);
}

.pdp__buy .woocommerce-variation:empty,
.pdp__buy .woocommerce-variation-description:empty {
	display: none;
}

/* Цена варианта повторяет цену в заголовке — прячем, оставляем наличие */
.pdp__buy .woocommerce-variation-price {
	display: none;
}

.pdp__buy .stock {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
}

.pdp__buy .stock.out-of-stock {
	color: #9a3b2e;
}

.pdp__buy .woocommerce-variation-add-to-cart,
.pdp__buy form.cart:not(.variations_form) {
	display: grid;
	gap: 10px;
}

/* Количество всегда 1: одежду берут по одной вещи в размере */
.pdp__buy .quantity {
	display: none !important;
}

.pdp__buy .single_add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 0 28px;
	border: 1px solid var(--ink);
	background: var(--ink);
	color: var(--paper);
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	cursor: pointer;
	transition:
		background 0.4s var(--ease),
		color 0.4s var(--ease);
}

.pdp__buy .single_add_to_cart_button:hover {
	background: transparent;
	color: var(--ink);
}

.pdp__buy .single_add_to_cart_button.disabled,
.pdp__buy .single_add_to_cart_button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.pdp__buy .single_add_to_cart_button.disabled:hover {
	background: var(--ink);
	color: var(--paper);
}

.pdp__price {
	white-space: nowrap;
}

.details__body a {
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Уведомления WooCommerce ---------- */

.woocommerce-notices-wrapper:empty {
	display: none;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	margin: 0 0 16px;
	padding: 16px 18px;
	border: 1px solid var(--line);
	background: var(--paper);
	font-size: 13px;
	line-height: 1.5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
}

.woocommerce-error {
	border-color: rgba(154, 59, 46, 0.4);
	display: grid;
}

.woocommerce-message .button,
.woocommerce-info .button {
	order: 2;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}

.archive .woocommerce-notices-wrapper,
.post-type-archive .woocommerce-notices-wrapper {
	padding: 16px var(--pad) 0;
}

/* ---------- Обычные страницы, корзина, оформление заказа, кабинет ---------- */

.page-body,
.wc-page {
	padding: 0 var(--pad) clamp(80px, 12vh, 140px);
}

.page-body {
	max-width: 760px;
	font-size: 15px;
	line-height: 1.7;
	color: var(--ink-2);
}

.page-body > * + * {
	margin-top: 14px;
}

.page-body a {
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wc-page {
	font-size: 14px;
}

.wc-page a:not(.wc-block-components-button):not(.button) {
	text-underline-offset: 3px;
}

/* Блоки корзины и оформления заказа: шрифты и кнопки сайта */
.wc-page .wp-block-woocommerce-cart,
.wc-page .wp-block-woocommerce-checkout {
	font-family: var(--sans);
	color: var(--ink);
}

.wc-page h2,
.wc-page .wc-block-components-title,
.wc-page .wc-block-components-checkout-step__title {
	font-family: var(--serif) !important;
	font-weight: 400 !important;
	font-size: 26px !important;
	line-height: 1.15 !important;
	letter-spacing: -0.005em;
	text-transform: none !important;
}

.wc-page .wc-block-cart__totals-title {
	font-family: var(--sans) !important;
	font-size: 11px !important;
	font-weight: 500 !important;
	letter-spacing: 0.16em;
	text-transform: uppercase !important;
	color: var(--muted);
}

.wc-page .wc-block-components-button:not(.is-link),
.wc-page .wc-block-cart__submit-button,
.wc-page .wc-block-components-checkout-place-order-button,
.wc-page .button,
.wc-page button[type="submit"] {
	min-height: 52px;
	border-radius: 0 !important;
	border: 1px solid var(--ink) !important;
	background: var(--ink) !important;
	color: var(--paper) !important;
	font-family: var(--sans) !important;
	font-size: 11px !important;
	font-weight: 500 !important;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	box-shadow: none !important;
	padding: 0 28px;
	cursor: pointer;
}

.wc-page .wc-block-components-button:not(.is-link):hover,
.wc-page .button:hover,
.wc-page button[type="submit"]:hover {
	background: transparent !important;
	color: var(--ink) !important;
}

.wc-page input[type="text"],
.wc-page input[type="email"],
.wc-page input[type="tel"],
.wc-page input[type="password"],
.wc-page input[type="number"],
.wc-page select,
.wc-page textarea,
.wc-page .wc-block-components-text-input input,
.wc-page .wc-blocks-components-select__select {
	border-radius: 0 !important;
	border-color: var(--line) !important;
	background: var(--paper) !important;
	font-family: var(--sans) !important;
	color: var(--ink) !important;
	box-shadow: none !important;
}

.wc-page input:focus,
.wc-page select:focus,
.wc-page textarea:focus {
	border-color: var(--ink) !important;
	outline: none;
}

.wc-page .wc-block-components-radio-control__option,
.wc-page .wc-block-components-radio-control-accordion-option,
.wc-page .wc-block-components-panel,
.wc-page .wc-block-components-totals-wrapper {
	border-color: var(--line) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.wc-page .wc-block-components-radio-control__option-checked,
.wc-page .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	box-shadow: inset 0 0 0 1px var(--ink) !important;
}

.wc-page .wc-block-components-product-name {
	font-family: var(--serif);
	font-size: 20px;
	line-height: 1.2;
	color: var(--ink);
	text-decoration: none;
}

.wc-page .wc-block-cart-item__image img,
.wc-page .wc-block-components-order-summary-item__image img {
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: 0;
}

.wc-page .wc-block-components-formatted-money-amount {
	white-space: nowrap;
}

/* Классический вид (личный кабинет, страница заказа) */
.wc-page .woocommerce {
	display: grid;
	grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
	gap: var(--pad);
	align-items: start;
}

.wc-page .woocommerce > .woocommerce-notices-wrapper,
.wc-page .woocommerce > :only-child,
.wc-page .woocommerce > form,
.wc-page .woocommerce > .u-columns,
.wc-page .woocommerce > h2 {
	grid-column: 1 / -1;
}

.wc-page .woocommerce-MyAccount-navigation ul {
	display: grid;
	gap: 0;
	border-top: 1px solid var(--line);
}

.wc-page .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

.wc-page .woocommerce-MyAccount-navigation li.is-active a,
.wc-page .woocommerce-MyAccount-navigation li a:hover {
	color: var(--ink);
}

.wc-page .woocommerce-MyAccount-content {
	display: grid;
	gap: 16px;
	color: var(--ink-2);
}

.wc-page .woocommerce-MyAccount-content a {
	color: var(--ink);
	text-decoration: underline;
}

.wc-page .u-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--pad);
}

.wc-page form .form-row {
	display: grid;
	gap: 6px;
	margin: 0 0 16px;
}

.wc-page form .form-row label {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

.wc-page form .form-row input.input-text,
.wc-page form .form-row select,
.wc-page form .form-row textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--line);
	font-size: 14px;
}

.wc-page table.shop_table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.wc-page table.shop_table th,
.wc-page table.shop_table td {
	text-align: left;
	padding: 12px 8px 12px 0;
	border-bottom: 1px solid var(--line);
}

.wc-page table.shop_table th {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ---------- Адаптив ---------- */

@media (max-width: 768px) {
	.wc-page .woocommerce,
	.wc-page .u-columns {
		grid-template-columns: 1fr;
	}

	.wc-page h2,
	.wc-page .wc-block-components-title,
	.wc-page .wc-block-components-checkout-step__title {
		font-size: 22px !important;
	}

	.pdp__buy,
	.pdp__alt {
		width: 100%;
	}
}
