/**
 * Caprina Shop — Стили карточки товара
 *
 * Кастомные стили для single product page, не затрагивающие
 * базовые стили Blocksy. Работает поверх темы.
 *
 * Содержание:
 *   1.  Общие стили карточки
 *   2.  Цена, бейдж скидки, inline-иконки оплаты
 *   3.  Виджет «Долями»
 *   4.  Кнопки количества (+/-)
 *   5.  Кнопка «В избранное»
 *   6.  Бейджи доверия (trust badges)
 *   7.  Блок доставки
 *   8.  Блок оплаты (mobile)
 *   9.  Блок УТП
 *  10.  Связанные товары / допродажи
 *  11.  Попапы (Quick View + trust badge)
 *  12.  Таблица размеров
 *  13.  Адаптивная вёрстка — планшет (≤999px)
 *  14.  Адаптивная вёрстка — мобильный (≤689px)
 */


/* ==========================================================================
   1. ОБЩИЕ СТИЛИ КАРТОЧКИ
   ========================================================================== */

.product-entry-wrapper {
	--caprina-gap: 16px;
}

.entry-summary-items {
	display: flex;
	flex-direction: column;
}


/* ==========================================================================
   2. ЦЕНА, БЕЙДЖ СКИДКИ, INLINE-ИКОНКИ ОПЛАТЫ
   ========================================================================== */

.caprina-price .woocommerce-Price-amount {
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.caprina-price del .woocommerce-Price-amount {
	font-weight: 400;
	opacity: 0.5;
}

.caprina-price ins {
	text-decoration: none;
}

.caprina-price ins .woocommerce-Price-amount {
	color: var(--theme-headings-color);
}

.caprina-price-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.caprina-price-row > .price {
	margin-bottom: 0;
}

.caprina-discount-badge {
	display: flex;
	align-items: center;
	background: #c62828;
	color: #fff;
	padding: 2px 10px;
	border-radius: 6px;
	font-family: 'Manrope', sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	flex-shrink: 0;
	width: auto;
}

.caprina-price-payment-icons {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	vertical-align: middle;
	margin-left: 4px;
}

.caprina-price-payment-icons .caprina-payment-icon {
	opacity: 0.6;
}

.caprina-price-payment-icons .caprina-payment-icon svg {
	height: 18px;
	width: auto;
}

.caprina-price-payment-icons .caprina-payment-icon--mir svg {
	height: 14px;
}


/* ==========================================================================
   3. ВИДЖЕТ «ДОЛЯМИ»
   ========================================================================== */

.caprina-dolyame-widget {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #f8f7f5;
	border: 1px solid var(--theme-border-color, #f0ebe4);
	border-radius: 12px;
	margin-top: 8px;
}

.caprina-dolyame-badge {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.caprina-dolyame-badge svg {
	height: 20px;
	width: auto;
}

.caprina-dolyame-text {
	font-size: 14px;
	line-height: 1.3;
	color: var(--theme-text-color, #4f4541);
}

.caprina-dolyame-text strong {
	font-weight: 700;
	color: var(--theme-headings-color, #241815);
}


/* ==========================================================================
   3d. БЕЙДЖ «−5% ПРИ ОНЛАЙН ОПЛАТЕ»
   ========================================================================== */

.caprina-online-discount-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	background: #e8f5e9;
	border: 1px solid #a5d6a7 !important;
	border-radius: 20px;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.2s ease;
	margin-top: 4px;
}

.caprina-online-discount-badge:hover {
	background: #c8e6c9;
	opacity: 1;
}

.caprina-online-discount-badge__icon {
	display: flex;
	align-items: center;
	color: #2e7d32;
	flex-shrink: 0;
}

.caprina-online-discount-badge__icon svg {
	width: 16px;
	height: 16px;
}

.caprina-online-discount-badge__label {
	font-size: 13px;
	font-weight: 600;
	color: #1b5e20;
}

.caprina-online-discount-badge__arrow {
	font-size: 16px;
	color: #2e7d32;
	font-weight: 700;
	line-height: 1;
}

/* Таблица в попапе онлайн-скидки */
.caprina-discount-table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0;
	font-size: 14px;
}

.caprina-discount-table th,
.caprina-discount-table td {
	padding: 8px 10px;
	text-align: left;
	border-bottom: 1px solid #f0ebe4;
}

.caprina-discount-table th {
	font-weight: 600;
	color: #241815;
	background: #f9f6f3;
}

.caprina-discount-yes {
	color: #2e7d32;
	font-weight: 700;
}

.caprina-discount-note {
	font-size: 12px;
	color: #6b6561;
	margin-top: 8px;
}


/* ==========================================================================
   4. КНОПКИ КОЛИЧЕСТВА (+/-)
   ========================================================================== */

.caprina-qty-wrapper {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1px solid var(--theme-border-color, #f0ebe4);
	border-radius: 10px;
	overflow: hidden;
	height: 45px;
}

.caprina-qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 100%;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease;
}

.caprina-qty-btn:hover {
	background: rgba(0, 0, 0, 0.04);
}

.caprina-qty-btn svg {
	width: 14px;
	height: 14px;
}

.caprina-qty-wrapper input.qty {
	width: 50px;
	text-align: center;
	border: none;
	background: transparent;
	font-family: 'Manrope', sans-serif;
	font-weight: 600;
	font-size: 16px;
	-moz-appearance: textfield;
	appearance: textfield;
	padding: 0;
	height: 100%;
}

.caprina-qty-wrapper input.qty::-webkit-outer-spin-button,
.caprina-qty-wrapper input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}


/* ==========================================================================
   5. КНОПКА «В ИЗБРАННОЕ»
   ========================================================================== */

.caprina-wishlist-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 45px;
	height: 45px;
	min-width: 45px;
	border: 1px solid var(--theme-border-color, #f0ebe4);
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
	padding: 0;
	margin-left: 10px;
	flex-shrink: 0;
}

.caprina-wishlist-btn svg {
	width: 22px;
	height: 22px;
	transition: transform 0.2s ease;
}

.caprina-wishlist-btn:hover {
	border-color: rgba(0, 0, 0, 0.15);
	background: rgba(0, 0, 0, 0.02);
}

.caprina-wishlist-btn:hover svg {
	transform: scale(1.1);
}

.caprina-wishlist-btn.is-active {
	background: #fef2f2;
	border-color: #fca5a5;
}

.caprina-wishlist-btn.is-active svg path {
	fill: #dc2626;
}

/*
 * Сброс ограничения ширины кнопки «В корзину».
 * Blocksy Customizer ставит --theme-button-max-width: 30%, из-за чего
 * в сочетании с border-radius: 100px кнопка схлопывается в круг.
 */
.entry-summary-items > .ct-product-add-to-cart > .cart {
	--theme-button-max-width: 100%;
}

.entry-summary-items > .ct-product-add-to-cart > .cart .single_add_to_cart_button {
	min-width: 140px;
	white-space: nowrap;
}


/* ==========================================================================
   6. БЕЙДЖИ ДОВЕРИЯ (trust badges)
   ========================================================================== */

.caprina-trust-badges {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 12px 0;
	border-top: 1px solid var(--theme-border-color, #f0ebe4);
	margin-top: 8px;
}

.caprina-trust-badge {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	transition: opacity 0.2s ease;
}

.caprina-trust-badge:hover {
	opacity: 0.7;
}

.caprina-trust-badge__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	color: var(--theme-headings-color, #241815);
}

.caprina-trust-badge__icon svg {
	width: 24px;
	height: 24px;
}

.caprina-trust-badge__icon--nxp {
	color: #c62828;
}

.caprina-trust-badge__label {
	font-size: 14px;
	font-weight: 500;
	color: var(--theme-text-color, #4f4541);
}


/* ==========================================================================
   7. БЛОК ДОСТАВКИ
   ========================================================================== */

.caprina-delivery-block {
	padding: 20px 0;
	border-top: 1px solid var(--theme-border-color, #f0ebe4);
	margin-top: 10px;
}

.caprina-delivery-title {
	font-family: 'Manrope', sans-serif;
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--theme-headings-color, #241815);
	margin-bottom: 14px;
}

.caprina-delivery-methods {
	display: flex;
	gap: 20px;
}

.caprina-delivery-method {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #f8f7f5;
	border-radius: 12px;
	flex: 1;
	min-width: 0;
}

.caprina-delivery-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.caprina-delivery-logo svg {
	height: 24px;
	width: auto;
}

.caprina-delivery-logo--dpd svg {
	height: 20px;
}

.caprina-delivery-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.caprina-delivery-name {
	font-weight: 600;
	font-size: 13px;
	color: var(--theme-headings-color, #241815);
}

.caprina-delivery-desc {
	font-size: 12px;
	color: var(--theme-text-color, #4f4541);
	opacity: 0.7;
}


/* ==========================================================================
   8. БЛОК ОПЛАТЫ (полный блок — только мобильный)
   ========================================================================== */

.caprina-payment-block--mobile {
	display: none;
}

.caprina-payment-block {
	padding: 16px 0;
	border-top: 1px solid var(--theme-border-color, #f0ebe4);
}

.caprina-payment-title {
	font-family: 'Manrope', sans-serif;
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--theme-headings-color, #241815);
	margin-bottom: 12px;
}

.caprina-payment-methods {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.caprina-payment-icon {
	display: flex;
	align-items: center;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.caprina-payment-icon:hover {
	opacity: 1;
}

.caprina-payment-icon svg {
	height: 20px;
	width: auto;
}

.caprina-payment-icon--mir svg {
	height: 16px;
}


/* ==========================================================================
   9. БЛОК УТП (utp)
   ========================================================================== */

[data-block="hook:424"] {
	display: none !important;
}

.caprina-utp-section {
	padding: 50px 0;
	margin-inline: auto;
	width: var(--theme-container-width);
	max-width: var(--theme-normal-container-max-width);
}

.caprina-utp-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 30px;
	background: #f8f7f5;
	border-radius: 16px;
	padding: 40px 30px;
}

.caprina-utp-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
}

.caprina-utp-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	color: var(--theme-headings-color, #241815);
	margin-bottom: 4px;
}

.caprina-utp-icon svg {
	width: 40px;
	height: 40px;
}

.caprina-utp-title {
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	font-size: 15px;
	color: var(--theme-headings-color, #241815);
	margin: 0;
	line-height: 1.3;
}

.caprina-utp-desc {
	font-size: 13px;
	color: var(--theme-text-color, #4f4541);
	opacity: 0.7;
	margin: 0;
	line-height: 1.4;
}


/* Таймер обратного отсчёта — скрываем секунды и убираем двоеточие после минут */
.ct-product-sale-countdown div > span:last-child {
	display: none;
}

.ct-product-sale-countdown div > span:nth-last-child(2) b:after {
	display: none;
}


/* ==========================================================================
   10. СВЯЗАННЫЕ ТОВАРЫ / ДОПРОДАЖИ
   ========================================================================== */

.caprina-related-section,
section.related.products,
section.up-sells.upsells.products {
	padding-top: 40px;
	margin-inline: auto;
	width: var(--theme-container-width);
	max-width: var(--theme-normal-container-max-width);
}

section.related.products .ct-module-title,
section.up-sells.upsells.products .ct-module-title {
	font-family: 'Manrope', sans-serif;
	font-weight: 600;
	font-size: 22px;
	text-transform: none;
	letter-spacing: -0.01em;
	color: var(--theme-headings-color, #241815);
	margin-bottom: 24px;
}

/* Адаптация цен в карточках связанных товаров для длинных сумм */
section.related.products .price,
section.up-sells.upsells.products .price {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

section.related.products .price del,
section.up-sells.upsells.products .price del {
	font-size: 13px;
	opacity: 0.5;
}


/* ==========================================================================
   11. ПОПАПЫ (QUICK VIEW)
   ========================================================================== */

/* Кастомная кнопка quick view на карточках товаров */
.caprina-quick-view-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.95);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	z-index: 2;
	opacity: 0;
	transform: translateY(4px);
}

.product:hover .caprina-quick-view-btn {
	opacity: 1;
	transform: translateY(0);
}

.caprina-quick-view-btn:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Модалка попапа */
.caprina-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(18, 21, 25, 0.7);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.caprina-popup-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.caprina-popup-card {
	background: var(--theme-palette-color-8, #fff);
	border-radius: 20px;
	max-width: 900px;
	width: 90%;
	max-height: 85vh;
	overflow-y: auto;
	position: relative;
	padding: 40px;
	box-shadow: 0 50px 100px rgba(18, 21, 25, 0.4);
	transform: translateY(20px);
	transition: transform 0.3s ease;
}

.caprina-popup-overlay.is-open .caprina-popup-card {
	transform: translateY(0);
}

.caprina-popup-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	border-radius: 50%;
	transition: background-color 0.2s ease;
	z-index: 1;
}

.caprina-popup-close:hover {
	background: rgba(0, 0, 0, 0.05);
}

.caprina-popup-close svg {
	width: 16px;
	height: 16px;
}

.caprina-popup-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}

.caprina-popup-gallery img {
	width: 100%;
	height: auto;
	border-radius: 12px;
	object-fit: cover;
}

.caprina-popup-info {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.caprina-popup-title {
	font-family: 'Manrope', sans-serif;
	font-weight: 600;
	font-size: 22px;
	color: var(--theme-headings-color, #241815);
}

.caprina-popup-price {
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	font-size: 20px;
}

/* Trust badge popup */
.caprina-trust-popup-card {
	max-width: 520px;
	padding: 32px;
}

.caprina-trust-popup-close {
	font-size: 24px;
	line-height: 1;
	color: var(--theme-text-color, #4f4541);
}

.caprina-trust-popup__content h3 {
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	font-size: 20px;
	color: var(--theme-headings-color, #241815);
	margin: 0 0 12px;
}

.caprina-trust-popup__content p {
	font-size: 15px;
	line-height: 1.6;
	color: var(--theme-text-color, #4f4541);
	margin: 0;
}


/* ==========================================================================
   12. ТАБЛИЦА РАЗМЕРОВ (Size Guide)
   ========================================================================== */

/* Стилизация модалки размерной сетки Blocksy Pro */
#ct-size-guide-modal .ct-container {
	border-radius: 20px;
	padding: 40px;
}

#ct-size-guide-modal table {
	width: 100%;
	border-collapse: collapse;
}

#ct-size-guide-modal th,
#ct-size-guide-modal td {
	padding: 10px 16px;
	text-align: center;
	font-size: 14px;
	border-bottom: 1px solid var(--theme-border-color, #f0ebe4);
}

#ct-size-guide-modal th {
	font-weight: 600;
	background: #f8f7f5;
}

#ct-size-guide-modal .ct-toggle-close {
	width: 36px;
	height: 36px;
}


/* ==========================================================================
   13. АДАПТИВНАЯ ВЁРСТКА — ПЛАНШЕТ (≤999px)
   ========================================================================== */

@media (max-width: 999.98px) {

	.caprina-delivery-methods {
		flex-direction: column;
		gap: 10px;
	}

	.caprina-popup-content {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.caprina-popup-card {
		padding: 24px;
		max-width: 95%;
	}

	.entry-summary-items > .caprina-payment-block {
		order: 10;
	}

	.entry-summary-items > .caprina-delivery-block {
		order: 9;
	}

	.caprina-utp-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
		padding: 30px 20px;
	}
}


/* ==========================================================================
   14. АДАПТИВНАЯ ВЁРСТКА — МОБИЛЬНЫЙ (≤689px)
   ========================================================================== */

@media (max-width: 689.98px) {

	.caprina-dolyame-widget {
		padding: 10px 12px;
		gap: 8px;
	}

	.caprina-dolyame-text {
		font-size: 13px;
	}

	.caprina-delivery-method {
		padding: 10px 12px;
	}

	.caprina-payment-methods {
		gap: 12px;
	}

	.caprina-popup-card {
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		padding: 20px;
	}

	.caprina-popup-content {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.caprina-wishlist-btn {
		width: 40px;
		height: 40px;
		min-width: 40px;
	}

	.caprina-wishlist-btn svg {
		width: 18px;
		height: 18px;
	}

	/* На мобильном: скрыть inline payment icons, показать полный блок */
	.caprina-price-payment-icons {
		display: none;
	}

	.caprina-payment-block--mobile {
		display: block;
	}

	section.related.products .ct-module-title,
	section.up-sells.upsells.products .ct-module-title {
		font-size: 16px;
	}

	section.related.products .price,
	section.up-sells.upsells.products .price {
		font-size: 14px;
	}

	.caprina-utp-section {
		width: 100%;
		max-width: 100%;
		padding-left: 0;
		padding-right: 0;
	}

	.caprina-utp-grid {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 24px 16px;
		border-radius: 0;
	}

	.caprina-utp-title {
		font-size: 13px;
	}

	.caprina-utp-desc {
		font-size: 12px;
	}

	.caprina-trust-popup-card {
		max-width: 100%;
		border-radius: 16px 16px 0 0;
		align-self: flex-end;
		height: auto;
		max-height: 80vh;
	}

	/* Хлебные крошки на мобильном не нужны */
	.woocommerce-breadcrumb {
		display: none;
	}
}
