/**
 * WC Product Table — оформление страницы товара.
 *
 * Все правила скоупятся классом body.wcpt-styled, который плагин добавляет
 * только на странице товара. Палитра та же, что у таблицы.
 */

body.wcpt-styled {
	--wcpt-bg: #ffffff;
	--wcpt-bg-alt: #f9fafb;
	--wcpt-border: #e5e7eb;
	--wcpt-text: #374151;
	--wcpt-heading: #111827;
	--wcpt-muted: #6b7280;
	--wcpt-brand: #2563eb;
	--wcpt-brand-hover: #1d4ed8;
	--wcpt-radius: 8px;
}

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

body.wcpt-styled .woocommerce-breadcrumb {
	/* Отбивка сверху: без неё крошки прилипают к шапке сайта */
	margin: 28px 0 26px;
	font-size: 13px;
	color: var(--wcpt-muted);
}

body.wcpt-styled .woocommerce-breadcrumb a {
	color: var(--wcpt-muted);
	text-decoration: none;
}

body.wcpt-styled .woocommerce-breadcrumb a:hover {
	color: var(--wcpt-brand);
	text-decoration: underline;
}

/* ------------------------------------------------------------------
   Заголовок, цена, мета
   ------------------------------------------------------------------ */

body.wcpt-styled .product_title {
	margin: 0 0 12px;
	font-size: 30px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--wcpt-heading);
	letter-spacing: -.01em;
}

body.wcpt-styled .summary .price,
body.wcpt-styled .summary p.price {
	display: block;
	margin: 0 0 20px;
	font-size: 26px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--wcpt-heading);
}

body.wcpt-styled .summary .price del {
	margin-right: 10px;
	font-size: 18px;
	font-weight: 400;
	color: var(--wcpt-muted);
	opacity: 1;
}

body.wcpt-styled .summary .price ins {
	background: none;
	text-decoration: none;
	color: var(--wcpt-heading);
}

body.wcpt-styled .summary .price .woocommerce-Price-amount {
	color: inherit;
}

body.wcpt-styled .woocommerce-product-details__short-description {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wcpt-text);
}

body.wcpt-styled .product_meta {
	margin: 22px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--wcpt-border);
	font-size: 13.5px;
	line-height: 1.9;
	color: var(--wcpt-muted);
}

body.wcpt-styled .product_meta > span {
	display: block;
}

body.wcpt-styled .product_meta .sku,
body.wcpt-styled .product_meta a {
	color: var(--wcpt-heading);
	text-decoration: none;
}

body.wcpt-styled .product_meta a {
	color: var(--wcpt-brand);
}

body.wcpt-styled .product_meta a:hover {
	text-decoration: underline;
}

/* Плашка «Распродажа» */
body.wcpt-styled .onsale {
	top: 12px;
	left: 12px;
	right: auto;
	min-height: 0;
	min-width: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
}

/* ------------------------------------------------------------------
   Галерея
   ------------------------------------------------------------------ */

body.wcpt-styled .woocommerce-product-gallery__wrapper,
body.wcpt-styled .woocommerce-product-gallery img {
	border-radius: var(--wcpt-radius);
}

body.wcpt-styled .woocommerce-product-gallery__image {
	background: var(--wcpt-bg-alt);
	border-radius: var(--wcpt-radius);
	overflow: hidden;
}

body.wcpt-styled .flex-control-thumbs li img {
	border: 1px solid transparent;
	border-radius: 6px;
	transition: border-color .12s ease, opacity .12s ease;
}

body.wcpt-styled .flex-control-thumbs li img.flex-active,
body.wcpt-styled .flex-control-thumbs li img:hover {
	border-color: var(--wcpt-brand);
	opacity: 1;
}

/* ------------------------------------------------------------------
   Вкладки с описанием
   ------------------------------------------------------------------ */

body.wcpt-styled .woocommerce-tabs {
	margin: 44px 0 0;
}

body.wcpt-styled .woocommerce-tabs ul.tabs {
	margin: 0 0 24px;
	padding: 0;
	border-bottom: 1px solid var(--wcpt-border);
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

body.wcpt-styled .woocommerce-tabs ul.tabs::before,
body.wcpt-styled .woocommerce-tabs ul.tabs::after,
body.wcpt-styled .woocommerce-tabs ul.tabs li::before,
body.wcpt-styled .woocommerce-tabs ul.tabs li::after {
	display: none;
}

body.wcpt-styled .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

body.wcpt-styled .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 10px 16px;
	border-bottom: 2px solid transparent;
	color: var(--wcpt-muted);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: color .12s ease, border-color .12s ease;
}

body.wcpt-styled .woocommerce-tabs ul.tabs li a:hover {
	color: var(--wcpt-heading);
}

body.wcpt-styled .woocommerce-tabs ul.tabs li.active a {
	color: var(--wcpt-brand);
	border-bottom-color: var(--wcpt-brand);
}

body.wcpt-styled .woocommerce-Tabs-panel {
	font-size: 15px;
	line-height: 1.65;
	color: var(--wcpt-text);
}

body.wcpt-styled .woocommerce-Tabs-panel > h2:first-child {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 600;
	color: var(--wcpt-heading);
}

/* ------------------------------------------------------------------
   Таблица характеристик
   ------------------------------------------------------------------ */

body.wcpt-styled table.shop_attributes {
	width: 100%;
	margin: 0;
	border: 1px solid var(--wcpt-border);
	border-radius: var(--wcpt-radius);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	font-size: 14px;
}

body.wcpt-styled table.shop_attributes tr:nth-child(even) {
	background: var(--wcpt-bg-alt);
}

body.wcpt-styled table.shop_attributes th,
body.wcpt-styled table.shop_attributes td {
	padding: 12px 18px;
	border: 0;
	border-bottom: 1px solid var(--wcpt-border);
	font-style: normal;
	text-align: left;
	vertical-align: top;
}

body.wcpt-styled table.shop_attributes tr:last-child th,
body.wcpt-styled table.shop_attributes tr:last-child td {
	border-bottom: 0;
}

body.wcpt-styled table.shop_attributes th {
	width: 36%;
	font-weight: 500;
	color: var(--wcpt-muted);
}

body.wcpt-styled table.shop_attributes td {
	color: var(--wcpt-heading);
}

body.wcpt-styled table.shop_attributes td p {
	margin: 0;
	padding: 0;
}

/* ------------------------------------------------------------------
   Отзывы
   ------------------------------------------------------------------ */

body.wcpt-styled #reviews .commentlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.wcpt-styled #reviews .commentlist li .comment_container {
	padding: 18px;
	border: 1px solid var(--wcpt-border);
	border-radius: var(--wcpt-radius);
	background: var(--wcpt-bg);
}

body.wcpt-styled #reviews .comment-text {
	margin: 0;
	padding: 0;
	border: 0;
}

body.wcpt-styled #review_form_wrapper .comment-form input[type="text"],
body.wcpt-styled #review_form_wrapper .comment-form input[type="email"],
body.wcpt-styled #review_form_wrapper .comment-form textarea {
	width: 100%;
	padding: 10px 13px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-family: inherit;
	font-size: 15px;
}

body.wcpt-styled #review_form_wrapper .comment-form input:focus,
body.wcpt-styled #review_form_wrapper .comment-form textarea:focus {
	outline: 0;
	border-color: var(--wcpt-brand);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* ------------------------------------------------------------------
   Кнопки WooCommerce, если где-то остались
   ------------------------------------------------------------------ */

body.wcpt-styled .button,
body.wcpt-styled button.button,
body.wcpt-styled input.button,
body.wcpt-styled a.button {
	padding: 11px 22px;
	border: 0;
	border-radius: 6px;
	background: var(--wcpt-brand);
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: background .15s ease;
}

body.wcpt-styled .button:hover,
body.wcpt-styled button.button:hover,
body.wcpt-styled input.button:hover,
body.wcpt-styled a.button:hover {
	background: var(--wcpt-brand-hover);
	color: #fff;
}

/* ------------------------------------------------------------------
   Секция похожих: на всю ширину, с отбивкой от карточки товара
   ------------------------------------------------------------------ */

body.wcpt-styled .wcpt-section {
	clear: both;
	width: 100%;
	max-width: none;
	margin: 48px 0 0;
	padding-top: 40px;
	border-top: 1px solid var(--wcpt-border);
	float: none;
}

body.wcpt-styled .wcpt-section__title {
	margin: 0 0 18px;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--wcpt-heading);
}

/* Родные блоки похожих/апсейлов на случай, если таблица выключена */
body.wcpt-styled .related > h2,
body.wcpt-styled .upsells > h2 {
	margin: 0 0 18px;
	font-size: 24px;
	font-weight: 600;
	color: var(--wcpt-heading);
}

@media (max-width: 767px) {

	body.wcpt-styled .woocommerce-breadcrumb {
		margin: 18px 0 18px;
	}

	body.wcpt-styled .product_title {
		font-size: 24px;
	}

	body.wcpt-styled .summary .price,
	body.wcpt-styled .summary p.price {
		font-size: 22px;
	}

	body.wcpt-styled .wcpt-section {
		margin-top: 36px;
		padding-top: 28px;
	}

	body.wcpt-styled .wcpt-section__title {
		font-size: 20px;
	}

	body.wcpt-styled .woocommerce-tabs ul.tabs {
		gap: 0;
		overflow-x: auto;
		flex-wrap: nowrap;
	}

	body.wcpt-styled .woocommerce-tabs ul.tabs li a {
		white-space: nowrap;
	}
}
