/* ============================================================
   Единая карточка товара (.pcard)
   Используется во всех сетках каталога: главная, категории,
   поиск, акции, производитель, страницы ароматов, модули.
   Разметка — catalog/view/theme/default/template/product/product_card.twig
   ============================================================ */

.pcard {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.pcard:hover {
	border-color: #e2e2e2;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

/* ===== Изображение ===== */
.pcard__image {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	/* страховка на случай аномально широкого контейнера (слайдер до инициализации) */
	max-height: 360px;
	background: #f8f8f8;
	overflow: hidden;
}

.pcard__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	/* перебивает глобальное `.active img { border: 2px solid #333 !important }` */
	border: 0 !important;
}

.pcard:hover .pcard__image img {
	transform: scale(1.05);
}

.pcard__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	max-width: calc(100% - 20px);
	padding: 4px 9px;
	background: rgba(63, 20, 30, 0.92);
	color: #fff;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.3;
	border-radius: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ===== Текстовая часть ===== */
.pcard__body {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
	-webkit-box-flex: 1;
	-ms-flex: 1;
	flex: 1;
	padding: 14px 16px 16px;
}

.pcard__meta {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.pcard__tag {
	background: #f0f0f0;
	color: #555;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
	padding: 3px 8px;
	border-radius: 4px;
}

.pcard__title {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	margin: 0 0 10px;
	min-height: 2.8em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pcard__title a {
	color: #222;
	text-decoration: none;
	transition: color 0.2s ease;
}

.pcard__title a:hover,
.pcard__title a:focus {
	color: rgba(63, 20, 30, 1);
	text-decoration: none;
}

/* В плитке карточка компактная — описание показывается только в режиме списка */
.pcard__desc {
	display: none;
	font-size: 12px;
	color: #888;
	line-height: 1.5;
	margin: 0 0 10px;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pcard__rating {
	margin-bottom: 6px;
}

.pcard__price {
	margin-top: auto;
	padding-top: 4px;
	margin-bottom: 12px;
}

.pcard__price-current {
	font-size: 17px;
	font-weight: 700;
	color: #111;
	letter-spacing: 0.3px;
}

.pcard__price-old {
	font-size: 13px;
	font-weight: 400;
	color: #999;
	text-decoration: line-through;
	margin-left: 8px;
}

.pcard__price-tax {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	color: #999;
}

/* ===== Кнопки ===== */
.pcard__actions {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: stretch;
	-ms-flex-align: stretch;
	align-items: stretch;
	gap: 8px;
}

.pcard__actions .btn-cart {
	display: -webkit-box;
	display: -ms-flexbox;
	display: inline-flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	gap: 6px;
	-webkit-box-flex: 1;
	-ms-flex: 1 1 auto;
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 12px;
	background: linear-gradient(135deg, #4A1A1F, #6B1F2C);
	color: #fff;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

.pcard__actions .btn-cart:hover,
.pcard__actions .btn-cart:not(.in-cart):focus,
.pcard__actions .btn-cart:not(.in-cart):active {
	background: linear-gradient(135deg, #5B2028, #7C2837);
	color: #fff;
	outline: none;
}

.pcard__actions .btn-cart i {
	font-size: 13px;
}

.pcard__actions .btn-cart span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.pcard__actions .btn-cart.in-cart,
.pcard__actions .btn-cart.in-cart:focus,
.pcard__actions .btn-cart.in-cart:active {
	background: #fff;
	color: #1a1a1a;
	border-color: #ddd;
	outline: none;
}

.pcard__actions .btn-cart.in-cart:hover {
	background: #f5f5f5;
	border-color: #ccc;
}

.pcard__actions .btn-wishlist {
	display: -webkit-box;
	display: -ms-flexbox;
	display: inline-flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	-ms-flex: 0 0 auto;
	flex: 0 0 auto;
	width: 38px;
	padding: 0;
	background: #fff;
	color: #b0b0b0;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

.pcard__actions .btn-wishlist:hover,
.pcard__actions .btn-wishlist:focus {
	color: #e74c3c;
	border-color: #e0b4b0;
	background: #fff;
	outline: none;
}

.pcard__actions .btn-wishlist i {
	font-size: 15px;
	line-height: 1;
	color: inherit;
}

.pcard__actions .btn-wishlist.in-wishlist,
.pcard__actions .btn-wishlist.in-wishlist:hover,
.pcard__actions .btn-wishlist.in-wishlist:focus {
	color: #e74c3c;
	border-color: #e0b4b0;
	background: rgba(231, 76, 60, 0.06);
}

/* Текст кнопки избранного нужен скриптам (common.js меняет его),
   но визуально кнопка — только иконка. */
.pcard__actions .btn-wishlist span {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ===== Поведение в сетках ===== */
/* Ряд с карточками — flex, чтобы соседние карточки были одной высоты */
.row:has(> .product-layout > .pcard) {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
}

.row:has(> .product-layout > .pcard) > .product-layout {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
}

.product-layout > .pcard,
.swiper-slide > .pcard {
	height: 100%;
}

.swiper-slide {
	height: auto;
}

.aroma-grid > .pcard {
	height: 100%;
}

/* ===== Режим списка (переключатель «список / плитка») ===== */
@media (min-width: 768px) {
	.product-list .pcard {
		-webkit-box-orient: horizontal;
		-webkit-box-direction: normal;
		-ms-flex-direction: row;
		flex-direction: row;
	}

	.product-list .pcard .pcard__image {
		-ms-flex: 0 0 230px;
		flex: 0 0 230px;
		width: 230px;
	}

	.product-list .pcard .pcard__body {
		padding: 18px 20px;
	}

	.product-list .pcard .pcard__title {
		font-size: 16px;
		min-height: 0;
	}

	.product-list .pcard .pcard__desc {
		display: -webkit-box;
		-webkit-line-clamp: 3;
	}

	.product-list .pcard .pcard__price-current {
		font-size: 20px;
	}

	.product-list .pcard .pcard__actions {
		max-width: 320px;
	}
}

/* ===== Адаптив ===== */
@media (max-width: 991px) {
	.pcard__body {
		padding: 12px 12px 14px;
	}
}

@media (max-width: 767px) {
	.pcard {
		border-radius: 10px;
	}

	.pcard__body {
		padding: 10px 10px 12px;
	}

	.pcard__meta {
		gap: 4px;
		margin-bottom: 6px;
	}

	.pcard__tag {
		font-size: 10px;
		padding: 2px 6px;
	}

	.pcard__title {
		font-size: 12px;
		margin-bottom: 8px;
	}

	.pcard__price {
		margin-bottom: 10px;
	}

	.pcard__price-current {
		font-size: 15px;
	}

	.pcard__price-old {
		font-size: 12px;
		margin-left: 6px;
	}

	.pcard__actions {
		gap: 6px;
	}

	.pcard__actions .btn-cart {
		padding: 8px 8px;
		font-size: 11px;
		gap: 4px;
	}

	.pcard__actions .btn-wishlist {
		width: 34px;
	}
}

@media (max-width: 479px) {
	.pcard__actions .btn-cart i {
		display: none;
	}
}
