/* ── WC Product Slider — Front-End Styles ──────────────────────────────────
   Card styles mirror Advanced Product Grid visually, but use wcps-* class
   names to stay completely isolated from APG's JS/CSS selectors.
   ──────────────────────────────────────────────────────────────────────── */

:root {
	--wcps-primary: #c52b25;
}

/* ── Slider wrapper ──────────────────────────────────────────────────────── */
.wcps-slider-wrapper {
	position: relative;
	width: 100%;
	/* Do NOT set overflow:hidden here — it clips the nav arrows.
	   Swiper handles its own overflow internally. */
}

/* ── Swiper overrides ────────────────────────────────────────────────────── */
.wcps-slider-wrapper .swiper {
	overflow: hidden;   /* Swiper needs this to clip slides */
	padding-bottom: 4px;
}

/* Navigation arrows */
.wcps-slider-wrapper .swiper-button-prev,
.wcps-slider-wrapper .swiper-button-next {
	color: var(--wcps-primary);
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	box-shadow: 0 2px 8px rgba(0,0,0,.10);
	transition: all 0.2s ease;
}
.wcps-slider-wrapper .swiper-button-prev:hover,
.wcps-slider-wrapper .swiper-button-next:hover {
	background: var(--wcps-primary);
	color: #fff;
	border-color: var(--wcps-primary);
}
.wcps-slider-wrapper .swiper-button-prev::after,
.wcps-slider-wrapper .swiper-button-next::after {
	font-size: 14px;
	font-weight: 700;
}

/* Scrollbar */
.wcps-slider-wrapper .swiper-scrollbar {
	background: #e5e7eb;
	height: 4px;
	border-radius: 4px;
	margin-top: 16px;
}
.wcps-slider-wrapper .swiper-scrollbar-drag {
	background: var(--wcps-primary);
	border-radius: 4px;
}

/* Pagination dots */
.wcps-pagination {
	margin-top: 20px;
	text-align: center;
}
.wcps-slider-wrapper .swiper-pagination-bullet {
	background: #d1d5db;
	opacity: 1;
	width: 8px;
	height: 8px;
	transition: all 0.2s;
}
.wcps-slider-wrapper .swiper-pagination-bullet-active {
	background: var(--wcps-primary);
	width: 24px;
	border-radius: 4px;
}
.wcps-slider-wrapper .swiper-pagination-progressbar { background: #e5e7eb; height: 3px; border-radius: 3px; }
.wcps-slider-wrapper .swiper-pagination-progressbar-fill { background: var(--wcps-primary); border-radius: 3px; }

/* ── Product card ────────────────────────────────────────────────────────── */
.wcps-product-card {
	background: none;
	height: 100%;
	display: flex;
	flex-direction: column;
	position: relative;
	/* NO overflow:hidden here — that would clip the add-to-cart button
	   when it floats upward out of the image boundary on hover. */
}

/* ── Image container ─────────────────────────────────────────────────────── */
.wcps-product-card .product-image-container {
	position: relative;
	overflow: hidden;           /* clips images and the button container */
	aspect-ratio: 1281 / 1920;
}

/* Image link — covers full image area so the card image is clickable */
.wcps-product-card .wcps-image-link {
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;                 /* below the add-to-cart container (z-index 10) */
	text-decoration: none;
}

.wcps-product-card .product-image-container img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: opacity 0.3s ease;
	display: block;
}

.wcps-product-card .hover-image {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
}

.wcps-product-card:hover .hover-image { opacity: 1; }
.wcps-product-card:hover .main-image  { opacity: 0; }

/* ── Add to cart container ───────────────────────────────────────────────────
   Centering approach:
   - position: absolute with left:0; right:0 stretches the container to
     the exact pixel width of product-image-container regardless of how
     many slides are shown. This is why centering is always correct at
     3, 4, 5 or any slides-per-view.
   - display:flex + justify-content:center centers the button inside it.
   - The upward float on hover is done via translateY on the container,
     NOT via padding changes (padding changes cause layout shifts).
   - overflow:hidden on product-image-container is what clips the container
     when it would otherwise overflow — no need to clip on the card.
   ──────────────────────────────────────────────────────────────────────── */
.wcps-product-card .add-to-cart-container {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;               /* resting position: near bottom of image */
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transform: translateY(0);
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 10;                /* above wcps-image-link (z-index 1) */
	pointer-events: none;
}

.wcps-product-card:hover .add-to-cart-container {
	opacity: 1;
	transform: translateY(-12px);   /* floats upward on hover */
	pointer-events: auto;
}

/* ── Button styles (wcps-btn-cart) ───────────────────────────────────────── */
.wcps-product-card .wcps-btn-cart {
	background-color: var(--wcps-primary);
	color: #fff;
	border: none;
	padding: 12px 25px;
	border-radius: 4px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.3s ease;
	white-space: nowrap;
	text-decoration: none;
	line-height: 1;
}

.wcps-product-card .wcps-btn-cart:hover        { background-color: #000; color: #fff; }
.wcps-product-card .wcps-btn-cart.wcps-loading { filter: grayscale(1); opacity: 0.7; pointer-events: none; }
.wcps-product-card .wcps-btn-cart.wcps-added   { background-color: #28a745; }

.wcps-product-card .wcps-btn-cart svg {
	width: 22px;
	height: auto;
	flex-shrink: 0;
}
.wcps-product-card .wcps-btn-cart svg path { stroke: #fff; }

/* Sale badge */
.wcps-product-card .onsale {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 6;
	background: #bd3229;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 3px;
}

/* ── Product info (below image) ──────────────────────────────────────────── */
.wcps-product-card .product-info {
	padding: 12px 0;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.wcps-product-card .product-price {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.wcps-product-card .product-title {
	font-size: 16px;
	font-weight: 400;
	margin: 0;
}

.wcps-product-card .product-title a {
	font-size: 1rem;
	font-weight: 600;
	color: #333;
	text-decoration: none;
	transition: color 0.3s ease;
}
.wcps-product-card .product-title a:hover { color: #bd3229; }

/* ── No products message ─────────────────────────────────────────────────── */
.wcps-no-products {
	padding: 20px;
	color: #6b7280;
	font-size: 15px;
}

/* ── Toast notification ──────────────────────────────────────────────────── */
.wcps-toast {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 14px 20px;
	border-radius: 6px;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	z-index: 99999;
	transform: translateX(400px);
	transition: transform 0.3s ease;
	max-width: 300px;
	pointer-events: none;
}
.wcps-toast.wcps-toast-success { background: #28a745; }
.wcps-toast.wcps-toast-error   { background: #dc3545; }
.wcps-toast.wcps-toast-show    { transform: translateX(0); }

/* ── Mobile (≤ 480px): static button, no hover needed ───────────────────── */
@media (max-width: 480px) {

	.wcps-product-card .add-to-cart-container {
		position: static;
		opacity: 1;
		transform: none !important;
		display: flex;
		justify-content: center;
		pointer-events: auto;
		margin-top: 10px;
		bottom: auto;
	}

	.wcps-product-card .wcps-btn-cart {
		width: 100%;
		justify-content: center;
	}

	.wcps-product-card .product-title a { font-size: 0.813rem !important; }
}
