/* ============================================
   Product Card — картка товару, product-item,
   кількість, варіації, опції, анімації
   ============================================ */

/* Product List - Start */
.product-list {
	display: grid;
	grid-template-columns: repeat(var(--products-in-col), 1fr);
	gap: var(--products-indent-h) var(--products-indent-w);
}
.product-card {
	position: relative;
	display: flex;
	flex-direction: column;
}
.product-card .product-image-wrapper  {
	position: relative;
}
.product-card .product-image-wrapper img {
	height: auto;
	aspect-ratio: 1 / 1;
	width: 100%;
	object-fit: contain;
	border-radius: var(--radius-small);
	z-index: 1;
}
.product-card .product-image-wrapper .product-image-second {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
	z-index: 2;
	height: 100%;
	width: 100%;
	object-fit: cover;
	transition: all 0.7s ease;
}
.product-card:hover .product-image-wrapper .product-image-second {
	opacity: 1;
}
@media (max-width: 1279px) {
	.product-card .product-image-wrapper .product-image-second {
		display: none;
	}
}
.product-card img.cart-icon {
	border-radius: 0px;
}
.product-card > a {
	height: 100%;
	display: flex;
	flex-direction: column;
	font-size: 0;
	line-height: 0;
}
.product-card .product-info-wrapper {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}
/* Product List - End */

/* Product Badge - Start */
.product-tags-or-badges {
	position: absolute;
	top: 15px;
	left: 15px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 2;
}
.product-tags-or-badges .product-badge {
	display: block;
	background: var(--tag-bg, var(--primary));
	color: var(--tag-text, var(--primary-match));
	border-radius: var(--radius-small);
	padding: 6px 7px 4px 7px;
	font-size: 13px;
	line-height: 13px;
	text-align: center;
}
.product-tags-or-badges .product-badge.out-of-stock {
	background: var(--red);
	color: var(--white);
}
/* Product Badge - End */

/* Product Card Outofstock - Start */
.product-card.outofstock .product-image-wrapper > a {
	opacity: 0.5;
}
.product-card.outofstock .add-to-cart-wrapper .btn.disabled {
	cursor: default;
	pointer-events: none;
}
/* Product Card Outofstock - End */

/* Product Stock Status - Start */
.product-card .stock-status {
	display: none;
}
.stock-status {
	color: var(--black);
}
.stock-status.in-stock {
	color: var(--green);
}
.stock-status.out-of-stock {
	color: var(--red);
}
.stock-status.on-order,
.stock-status.on-backorder {
	color: var(--gold);
}
.stock-status.no-status {
	color: var(--blue);
}
/* Product Stock Status - End */

/* Wishlist + Compare - Start  */
.product-card .action-items {
	position: absolute;
	top: 15px;
	right: 15px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 3;
}
.product-card .compare-btn,
.product-card .wishlist-btn {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 30px;
	height: 30px;
	background: var(--primary);
	border: none;
	border-radius: var(--radius-small);
	padding: 6px 6px 6px 6px;
	cursor: pointer;
}
.product-card .wishlist-btn .icon-mask,
.product-card .compare-btn .icon-mask {
	--icon-base: 18px;
}
.product-card .wishlist-btn .icon-mask {
	--icon: url(/wp-content/themes/shop/img/icons/wishlist.svg);
}
.in-wishlist-already {
	position: relative;
}
.product-card .wishlist-btn.in-wishlist-already .icon-mask {
	--icon: url(/wp-content/themes/shop/img/icons/wishlist-full.svg);
}
.product-card .compare-btn .icon-mask {
	--icon: url(/wp-content/themes/shop/img/icons/compare.svg);
}
.in-compare-already {
	position: relative;
}
.product-card .compare-btn.in-compare-already .icon-mask {
	--icon: url(/wp-content/themes/shop/img/icons/compare-full.svg);
}
/* Wishlist + Compare - End  */

/* Star Rating - Start  */
.product-card .star-rating-wrapper {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 20px;
}
.product-card .star-rating-wrapper .star-rating {
	font-size: 18px;
	line-height: 18px;
	color: var(--gray);
}
.product-card .star-rating-wrapper .rating-value {
	font-family: var(--font-family-1);
	font-size: 13px;
	line-height: 13px;
	color: var(--gray);
	font-weight: 500;
	transform: translateY(1px);
}
/* Star Rating - End  */

/* Product SKU - Start  */
.product-card .product-card-sku {
	font-family: var(--font-family-2);
	font-size: 16px;
	line-height: 22px;
	color: var(--gray);
	margin-top: 17px;
}

@media (max-width: 1279px) {
	.product-card .product-card-sku {
		font-size: 14px;
		line-height: 22px;
		margin-top: 14px;
	}
}
/* Product SKU - End  */

/* Product Title */
.product-card .product-title {
	font-family: var(--font-family-1);
	font-size: 18px;
	line-height: 21px;
	width: 100%;
	margin: 14px 0;
	color: var(--black);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-line-clamp: 2;
}

/* Options - Start  */
.options-group {
	margin-bottom: 14px;
}
.option-block {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.option-head {
	width: 100%;
	font-size: 14px;
	line-height: 14px;
	font-weight: 500;
}
.option-block span.option-value {
	display: flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	height: 30px;
	padding: 0px 9px;
	background: var(--white);
	border: 1px solid var(--primary);
	font-size: 14px;
	line-height: 14px;
	transition: all 0.3s ease;
	cursor: pointer;
}
.option-block span.option-value.selected {
	background: var(--primary);
	color: var(--white);
}

/* Color - Start */
.options-group .option-block.is-color {
	display: none !important;
}
.color-option {
	position: relative;
	display: flex;
	width: 45px;
	height: 45px;
	background: red;
	border-radius: var(--radius-max);
	cursor: pointer;
	border: 2px solid var(--border);
	transition: all 0.3s ease;
}

.color-option.selected {
	border: 2px solid var(--black);
}
.color-option .color-name {
	display: flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	padding: 10px;
	border-radius: var(--radius-small);
	background: var(--light-gray);
	box-shadow: 0 0 8px rgb(0 0 0 / 15%);
	font-family: var(--font-family-1);
	font-size: 14px;
	line-height: 14px;
	text-align: center;
	color: var(--black);
	position: absolute;
	top: 48px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0 auto;
	z-index: 10;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: all 0.3s ease;
}
.color-option:hover .color-name {
	opacity: 1;
	visibility: visible;
	pointer-events: all;
}
/* Color - End */
/* Options - End  */

/* Add To Cart - Start  */
.product-card .add-to-cart-wrapper {
	display: flex;
	flex-direction: row-reverse;
	gap: 10px;
	margin-top: auto;
}
.product-card .product_type_simple.in-cart {
	pointer-events: none !important;
}
.btn.btn-accent.in-cart {
	background: var(--primary);
	color: var(--white);
}
.btn.btn-accent.in-cart span {
	color: var(--white);
}
.added_to_cart.wc-forward {
	display: none!important;
}
/* Add To Cart - End  */

/* Variation Popup - Start */
.variation-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgb(255 255 255 / 60%);
	backdrop-filter: blur(5px);
	z-index: 100;
	border-radius: inherit;
}

.variation-popup-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--white);
	padding: 15px;
	border-radius: var(--radius-medium);
	width: 90%;
	max-width: 300px;
	max-height: 80%;
	overflow-y: auto;
	box-shadow: 0 4px 20px rgb(0 0 0 / 12%);
}

.popup-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.popup-header h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.close-popup {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: var(--light-gray);
	border: none;
	border-radius: var(--radius-max);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: all 0.3s ease;
}
.close-popup:hover {
	background: var(--border);
}

.variation-attribute-row {
	margin-bottom: 10px;
}

.variation-attribute-row label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	line-height: 13px;
	font-weight: 500;
	color: var(--gray);
}

.variation-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.variation-popup-content .variation-option {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	padding: 0 10px;
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: var(--radius-small);
	font-size: 13px;
	line-height: 13px;
	cursor: pointer;
	transition: all 0.3s ease;
}
.variation-option:hover {
	border-color: var(--primary);
}
.variation-option.active {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--white);
}

.variation-info {
	margin-bottom: 12px;
}
.variation-info .variation-price {
	font-size: 16px;
	font-weight: 600;
}
.variation-info .variation-stock {
	font-size: 13px;
	margin-top: 4px;
}

.variation-row {
	margin-bottom: 15px;
}

.variation-row label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
}

.variation-select {
	width: 100%;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-small);
}

/* Адаптация блока количества в карточке */
.product-card .custom-quantity-input {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 0 20px;
}

/* Variation Popup - Mob */
@media (max-width: 1279px) {
	.popup-header {
		margin-bottom: 5px;
	}
	.popup-header h4 {
		font-size: 12px;
		line-height: 14px;
		font-weight: 500;
	}
	.variation-popup-content {
		padding: 10px;
	}
	.variation-popup-content .variation-attribute-row label {
		margin-bottom: 5px;
		font-size: 10px;
		line-height: 10px;
	}
	.variation-popup-content .variation-options {
		gap: 4px;
	}
	.variation-popup-content .variation-option {
		height: 21px;
		padding: 0 6px;
		font-size: 11px;
		line-height: 11px;
	}
	.variation-popup-content .btn {
		height: 30px;
	}
	.variation-popup-content .variation-info .variation-price {
		font-size: 12px;
		line-height: 14px;
		font-weight: 500;
	}
}
/* Variation Popup - End */

/* Hidden product info */
.product-card .product-info-wrapper .product-sku,
.product-card .product-info-wrapper .product-meta,
.product-card .product-info-wrapper .product-short-description,
.product-card .product-info-wrapper .product-categories {
	display: none;
}

/* Product Card Responsive - Start */
@media (max-width: 1279px) {
	.product-card .product-title {
		font-size: 14px;
		line-height: 18px;
		margin: 10px 0;
	}
	.product-card {
		--btn-height: 40px;
	}
	.product-card .btn {
		font-size: 12px;
	}
	.product-card .add-to-cart-wrapper {
		gap: 5px;
	}
	.product-card .custom-quantity-input {
		padding: 0 10px;
	}
	.product-card .custom-quantity-input .quantity-display {
		width: 15px;
		font-size: 12px;
	}
	.product-tags-or-badges {
		top: 10px;
		left: 10px;
		gap: 5px;
	}
	.product-card .product-badge {
		padding: 8px 7px 7px 7px;
		font-size: 11px;
		line-height: 11px;
	}
	.product-card .action-items {
		top: 10px;
		right: 10px;
		gap: 5px;
	}
	.product-card .compare-btn, .product-card .wishlist-btn {
		width: 24px;
		height: 24px;
		padding: 5px;
	}
	.product-card .product-item__price {
		font-size: 13px;
		line-height: 16px;
	}
}
/* Product Card Responsive - End */

/* ================================ */
/* Universal Product Item Component */
/* ================================ */

.product-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 0;
	background: var(--white);
	border-radius: var(--radius-small);
	position: relative;
	transition: all 0.3s ease;
}
.product-item__image {
	width: 90px;
	height: 90px;
}
.product-item__img {
	border-radius: var(--radius-small);
}
.product-item__info {
	flex-grow: 1;
}
.product-item__name {
	font-family: var(--font-family-1);
	font-size: 16px;
	line-height: 18px;
	font-weight: 500;
	margin-bottom: 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}
.product-item__variations {
	font-size: 14px;
	line-height: 18px;
	color: var(--gray);
	margin-bottom: 8px;
}
.product-item__variations:empty {
	display: none;
}
.variation-item {
	margin-bottom: 4px;
}
.product-item__price {
	font-family: var(--font-family-1);
	font-size: 16px;
	line-height: 18px;
	font-weight: 600;
	width: fit-content;
	margin-bottom: 15px;
}
.product-item__price:has(del) {
	display: flex;
	flex-direction: row-reverse;
	gap: 10px;
	margin-right: auto;
}
.product-item__price del {
	font-size: 14px;
}
.product-item__discount-percent {
	color: var(--status-danger);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}
.product-item .btn {
	height: var(--btn-height-small);
}
.product-item__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	height: var(--btn-height-small);
}
.product-item__remove {
	display: flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radius-small);
	transition: all 0.3s ease;
}
.product-item__remove img {
	width: 20px;
	height: 20px;
	display: none;
}
.product-item__total:has(del) {
	gap: 6px;
	flex-wrap: wrap;
}
.product-item__total del {
	font-size: 12px;
	font-weight: 300;
}
.product-item__total {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 100px;
	height: var(--btn-height-small);
	font-family: var(--font-family-1);
	font-size: 18px;
	line-height: 22px;
	font-weight: 600;
}

/* Product Item Outofstock */
.product-item.outofstock .product-item__image-link {
	opacity: 0.5;
}
.product-item.outofstock .product-item__actions .btn.disabled {
	cursor: default;
	pointer-events: none;
}
.product-item__stock-label {
	color: var(--red);
	font-size: 13px;
	line-height: 13px;
	font-weight: 500;
	margin-bottom: 10px;
	margin-top: -4px;
}

/* Context modifiers */
.cart-lightbox .product-item__add-to-cart,
.cart-lightbox .product-item__total {
	display: none;
}
.wishlist-lightbox .product-item__total {
	display: none;
}
.wishlist-lightbox .product-item.is-variable .product-item__quantity {
	display: block !important;
}
.checkout-wrapper .product-item__add-to-cart {
	display: none;
}

/* ================================ */
/* Quantity Input                    */
/* ================================ */

.custom-quantity-input {
	display: flex;
	align-items: center;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-small);
	overflow: hidden;
	height: var(--btn-height);
}
.product-item .custom-quantity-input {
	height: var(--btn-height-small);
}

.custom-quantity-input .quantity-btn {
	width: 28px;
	height: 28px;
	margin: 0px;
	border: none;
	background: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	line-height: 20px;
	padding-bottom: 2px;
	color: var(--black);
	transition: all 0.3s ease;
}
.product-item .custom-quantity-input .quantity-btn {
	width: 28px;
	height: 28px;
}

.custom-quantity-input .quantity-display {
	width: 20px;
	height: 100%;
	border: none;
	background: transparent;
	text-align: center;
	font-family: var(--font-family-1);
	font-size: 16px;
	font-weight: 500;
	color: var(--black);
	padding: 0;
}
.product-item .custom-quantity-input .quantity-display {
	width: 20px;
}
.custom-quantity-input.loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Product Item Responsive */
@media (max-width: 768px) {
	.product-item {
		flex-wrap: wrap;
	}
	.product-item__image {
		width: 60px;
		height: 60px;
	}
	.product-item__info {
		max-width: calc(100% - 60px - 10px - 30px);
	}
	.product-item__quantity {
		margin-left: calc(60px + 10px);
	}
	.product-item:not(:has(.product-item__quantity)) .product-item__actions {
		margin-left: calc(60px + 10px);
	}
	.product-item .btn {
		font-size: 14px;
		line-height: 14px;
		padding: 0 20px;
	}
	.product-item__remove {
		position: absolute;
		top: 0;
		right: 0;
	}
	.product-item__remove img {
		width: 20px;
		height: 20px;
		display: block;
	}
	.product-item__remove span {
		display: none;
	}
	.product-item__total {
		justify-content: flex-end;
		flex-grow: 1;
	}
}

/* ================================ */
/* Animations                       */
/* ================================ */

.product-item.updating {
	opacity: 0.6;
}

.product-item.removing {
	opacity: 0;
	transform: translateX(-20px);
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.product-item {
	animation: slideIn 0.3s ease-out;
}
