/**
 * D&A Group — карточка товара WooCommerce в токенах темы.
 * Скоуп: body.dag-product.
 */

body.dag-product {
	background: var(--dag-ink-0);
	color: var(--dag-tx);
	font-family: var(--dag-font-body);
}

body.dag-product ::selection {
	background: var(--dag-acc);
	color: #fff;
}

/* Хлебные крошки Woo */

body.dag-product .woocommerce-breadcrumb {
	font-family: var(--dag-mono);
	font-size: 12px;
	color: var(--dag-tx-faint);
	margin: 20px 0 24px;
}

body.dag-product .woocommerce-breadcrumb a {
	color: var(--dag-tx-faint);
	text-decoration: none;
}

body.dag-product .woocommerce-breadcrumb a:hover {
	color: var(--dag-acc-2);
}

/* Карточка: сетка галерея + саммари */

body.dag-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
	max-width: 1140px;
	margin: 0 auto;
	padding: 8px var(--dag-pad, 32px) 40px;
}

@media (max-width: 900px) {
	body.dag-product div.product {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
}

/* Галерея */

body.dag-product .woocommerce-product-gallery {
	background: var(--dag-ink-2);
	border: 1px solid var(--dag-line, rgba(237, 238, 240, .09));
	border-radius: var(--dag-r-lg, 12px);
	overflow: hidden;
}

body.dag-product .woocommerce-product-gallery img {
	width: 100%;
	height: auto;
	border-radius: 0;
}

body.dag-product .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 8px;
	padding: 10px;
}

body.dag-product .flex-control-thumbs img {
	border-radius: 6px;
	border: 1px solid var(--dag-line, rgba(237, 238, 240, .09));
	opacity: .55;
}

body.dag-product .flex-control-thumbs img.flex-active {
	opacity: 1;
	border-color: var(--dag-acc);
}

/* Саммари */

body.dag-product .summary {
	padding-top: 6px;
}

body.dag-product .product_title {
	font-family: var(--dag-font);
	font-size: clamp(26px, 3.4vw, 38px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--dag-tx);
}

body.dag-product .woocommerce-product-rating {
	margin-top: 10px;
}

body.dag-product .price {
	margin-top: 18px;
	font-family: var(--dag-font);
	font-size: 28px;
	font-weight: 700;
	color: var(--dag-tx);
}

body.dag-product .price del {
	color: var(--dag-tx-faint, #7C8188);
	font-weight: 400;
	font-size: .72em;
}

body.dag-product .price ins {
	color: var(--dag-acc-2);
	text-decoration: none;
}

body.dag-product div.product > .woocommerce-variation-price .price,
body.dag-product .woocommerce-variation-price .price {
	color: var(--dag-acc-2);
}

/* Описание short */

body.dag-product .woocommerce-product-details__short-description {
	margin-top: 16px;
	color: var(--dag-tx-dim);
	font-size: 15px;
	line-height: 1.65;
}

/* Кнопка корзины */

body.dag-product .cart .button,
body.dag-product a.button.product_type_simple,
body.dag-product a.button.product_type_variable,
body.dag-product button.single_add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 18px;
	padding: 14px 30px;
	border: 0;
	border-radius: var(--dag-r, 8px);
	background: var(--dag-acc-btn, #C94F0E);
	color: #fff;
	font-family: var(--dag-font);
	font-size: 15.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s var(--dag-ease, ease);
}

body.dag-product .cart .button:hover,
body.dag-product button.single_add_to_cart_button:hover {
	background: var(--dag-acc-btn-h, #B0450C);
}

body.dag-product .quantity input {
	padding: 12px;
	border: 1px solid var(--dag-line-2, rgba(237, 238, 240, .16));
	border-radius: var(--dag-r, 8px);
	background: var(--dag-ink-2, #15181C);
	color: var(--dag-tx, #EDEEF0);
}

/* Мета и атрибуты */

body.dag-product .product_meta {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--dag-line, rgba(237, 238, 240, .09));
	font-family: var(--dag-mono);
	font-size: 12.5px;
	color: var(--dag-tx-faint, #7C8188);
}

body.dag-product .product_meta a {
	color: var(--dag-tx-dim);
	text-decoration: none;
}

/* Вариации */

body.dag-product table.variations td {
	padding: 6px 0;
	border: 0;
}

body.dag-product table.variations label {
	font-family: var(--dag-font);
	font-weight: 600;
	color: var(--dag-tx);
}

body.dag-product table.variations select {
	padding: 8px 12px;
	border: 1px solid var(--dag-line-2, rgba(237, 238, 240, .16));
	border-radius: 6px;
	background: var(--dag-ink-2, #15181C);
	color: var(--dag-tx, #EDEEF0);
}

/* Табы */

body.dag-product .woocommerce-tabs {
	clear: both;
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 var(--dag-pad, 32px) 40px;
}

body.dag-product .woocommerce-tabs ul.tabs {
	display: flex;
	gap: 6px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--dag-line, rgba(237, 238, 240, .09));
}

body.dag-product .woocommerce-tabs ul.tabs li {
	margin: 0;
}

body.dag-product .woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding: 12px 18px;
	color: var(--dag-tx-dim, #A6AAB1);
	font-family: var(--dag-font);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

body.dag-product .woocommerce-tabs ul.tabs li.active a {
	color: var(--dag-acc-2);
	border-bottom-color: var(--dag-acc);
}

body.dag-product .woocommerce-tabs .panel {
	background: var(--dag-ink-2, #15181C);
	border: 1px solid var(--dag-line, rgba(237, 238, 240, .09));
	border-radius: var(--dag-r-lg, 12px);
	padding: 24px 26px;
	color: var(--dag-tx, #EDEEF0);
	font-size: 15.5px;
	line-height: 1.7;
}

body.dag-product .woocommerce-tabs .panel h2 {
	display: none;
}

/* Связанные товары */

body.dag-product .related.products,
body.dag-product .up-sells {
	clear: both;
	max-width: 1140px;
	margin: 0 auto 40px;
	padding: 0 var(--dag-pad, 32px);
}

body.dag-product .related.products > h2,
body.dag-product .up-sells > h2 {
	font-family: var(--dag-font);
	font-size: 24px;
	font-weight: 700;
	color: var(--dag-tx, #EDEEF0);
	margin: 0 0 20px;
}

body.dag-product ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.dag-product ul.products li.product {
	background: var(--dag-ink-2, #15181C);
	border: 1px solid var(--dag-line, rgba(237, 238, 240, .09));
	border-radius: var(--dag-r-lg, 12px);
	padding: 14px;
	overflow: hidden;
}

body.dag-product ul.products li.product img {
	width: 100%;
	height: auto;
	border-radius: 6px;
}

body.dag-product ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--dag-font);
	font-weight: 600;
	font-size: 15px;
	color: var(--dag-tx, #EDEEF0);
	padding: 0;
}

body.dag-product ul.products li.product .price {
	font-size: 15px;
	color: var(--dag-acc-2, #FF7D36);
	margin: 6px 0 10px;
}

@media (max-width: 900px) {
	body.dag-product ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Запрос цены вместо корзины (B2B) */

body.dag-product p.price:empty::after,
body.dag-product .summary .dc-price-request {
	font-family: var(--dag-font);
}

/* Мета-строки карточки (артикул/категория) — столбиком и с воздухом.
   Грузится и при Elementor-шаблоне (правило вне скоупа body.dag-product). */
.product_meta .detail-container {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 2px 0;
}

.product_meta .detail-label {
	font-weight: 600;
}

/* Мета-строки — подрядчик Elementor кладёт их в flex-строку; нам надо столбиком */
body .product_meta {
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

/* ============================================================
   AAA-апгрейд: живая галерея, собранная зона покупки,
   отклик связанных товаров, доступность.
   ============================================================ */

/* Галерея: ровный квадрат главного фото, тихий zoom, активный
   тумб с кольцом акцента вместо простого opacity. */

body.dag-product .woocommerce-product-gallery__wrapper,
body.dag-product .woocommerce-product-gallery__image {
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

body.dag-product .woocommerce-product-gallery__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--dag-ease, cubic-bezier(.2, .6, .3, 1));
}

body.dag-product .flex-control-thumbs img {
	transition: opacity .15s ease, border-color .15s ease;
}

body.dag-product .flex-control-thumbs img:hover {
	opacity: .85;
}

body.dag-product .flex-control-thumbs img.flex-active {
	opacity: 1;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--dag-acc) 65%, transparent);
	border-color: transparent;
}

/* Зона покупки: количество и кнопка — одна строка, кнопка тянется. */

body.dag-product form.cart {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-top: 20px;
	flex-wrap: wrap;
}

body.dag-product form.cart .quantity {
	flex: none;
}

body.dag-product .quantity input {
	width: 76px;
	height: 100%;
	min-height: 50px;
	text-align: center;
	font-family: var(--dag-font);
	font-weight: 600;
	transition: border-color .15s ease, box-shadow .15s ease;
}

body.dag-product .quantity input:focus {
	outline: none;
	border-color: var(--dag-acc);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--dag-acc) 16%, transparent);
}

body.dag-product form.cart .button,
body.dag-product button.single_add_to_cart_button {
	flex: 1 1 auto;
	margin-top: 0;
	min-height: 50px;
	letter-spacing: .01em;
	transition: background-color .15s var(--dag-ease, ease), box-shadow .15s ease;
}

body.dag-product form.cart .button:hover,
body.dag-product button.single_add_to_cart_button:hover {
	box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--dag-acc-btn, #C94F0E) 70%, transparent);
}

body.dag-product form.cart .button:active,
body.dag-product button.single_add_to_cart_button:active {
	transform: translateY(0);
}

body.dag-product form.cart .button:disabled {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Цена вариации не прыгает: место под неё зарезервировано мягко. */

body.dag-product .woocommerce-variation-price {
	min-height: 1em;
	margin-top: 10px;
}

body.dag-product .woocommerce-variation-availability {
	margin-top: 6px;
	font-size: 14px;
}

/* Табы: анимированное подчёркивание активного. */

body.dag-product .woocommerce-tabs ul.tabs li a {
	transition: color .15s ease, border-color .2s ease;
}

/* Связанные товары: тот же отклик, что у листинга. */

body.dag-product ul.products li.product {
	transition: box-shadow .22s var(--dag-ease, ease), border-color .22s ease;
}

body.dag-product ul.products li.product:hover {
	border-color: var(--dag-acc);
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
}

body.dag-product ul.products li.product img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform .45s var(--dag-ease, ease);
}

body.dag-product ul.products li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.6em;
	transition: color .15s ease;
}

body.dag-product ul.products li.product:hover .woocommerce-loop-product__title {
	color: var(--dag-acc-2, #FF7D36);
}

body.dag-product ul.products li.product .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 4px;
	padding: 10px 14px;
	border: 1px solid var(--dag-line-2, rgba(237, 238, 240, .16));
	border-radius: var(--dag-r, 8px);
	background: transparent;
	color: var(--dag-tx, #EDEEF0);
	font-family: var(--dag-font);
	font-weight: 600;
	text-align: center;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

body.dag-product ul.products li.product .button:hover {
	border-color: var(--dag-acc);
	color: var(--dag-acc-2, #FF7D36);
}

/* Доступность: клавиатура и reduced motion. */

body.dag-product a:focus-visible,
body.dag-product button:focus-visible,
body.dag-product select:focus-visible,
body.dag-product input:focus-visible {
	outline: 2px solid var(--dag-acc);
	outline-offset: 2px;
}
