/* =========================================================
   ESun Product Carousel — Electric Sun design
   ========================================================= */

.esun-carousel {
	position: relative;
	width: 100%;
}

.esun-carousel__swiper {
	overflow: hidden;
}

/* ---------- Card ---------- */

.esun-card {
	position: relative;
	width: 100%;
	aspect-ratio: 2 / 3;           /* uniform card size regardless of image */
	background-color: #111;
	overflow: hidden;
	isolation: isolate;
}

/* Full-bleed image: fills the box, crops instead of distorting.
   Any image size/orientation renders identically. */
.esun-card__media-link {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	overflow: hidden;
	z-index: 1;
}

/* Fallback for browsers without aspect-ratio support:
   force the 2:3 shape with a padding spacer. */
@supports not (aspect-ratio: 2 / 3) {
	.esun-card::before {
		content: "";
		display: block;
		padding-bottom: 150%;
	}
}

/* Hardened against Elementor's global `img { height: auto }` and theme
   image rules: absolutely positioned + !important so the image ALWAYS
   covers the full card, zoom-cropping any aspect ratio to fit. */
.esun-carousel .esun-card .esun-card__media,
.elementor-widget-container .esun-carousel .esun-card__media,
.elementor .esun-carousel .esun-card__media {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	min-width: 100% !important;
	min-height: 100% !important;
	object-fit: cover !important;
	object-position: center center !important;
	display: block;
	margin: 0 !important;
	transition: transform 0.6s ease;
}

.esun-card:hover .esun-card__media {
	transform: scale(1.04);
}

/* Bottom gradient so text is readable on any photo */
.esun-overlay-yes .esun-card::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 46%;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.72) 0%,
		rgba(0, 0, 0, 0.38) 45%,
		rgba(0, 0, 0, 0) 100%
	);
	z-index: 2;
	pointer-events: none;
}

/* ---------- Level badge (top-right) ---------- */

.esun-card__badge {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	background-color: #e8121c;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.02em;
	padding: 7px 12px;
	border-radius: 4px;
	white-space: nowrap;
}

/* ---------- Bottom content ---------- */

.esun-card__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 0 18px 18px;
}

.esun-card__title {
	margin: 0 0 10px;
	font-family: "Prata", "Playfair Display", Georgia, "Times New Roman", serif;
	font-size: 23px;
	font-weight: 400;
	line-height: 1.25;
	color: #fff;
	letter-spacing: 0.01em;

	/* keep long names to two lines so all cards align */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.esun-card__title a {
	color: inherit;
	text-decoration: none;
}

.esun-card__title a:hover {
	text-decoration: none;
	opacity: 0.9;
}

.esun-card__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* ---------- Price ---------- */

.esun-card__price {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 23px;
	font-weight: 700;
	color: #fff;
	line-height: 1;
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}

.esun-card__price del {
	color: #8f8f8f;
	font-size: 0.82em;
	font-weight: 400;
	text-decoration: line-through;
	order: -1; /* regular price first, like the design */
}

.esun-card__price del .amount,
.esun-card__price del bdi {
	color: inherit;
	font-weight: inherit;
}

.esun-card__price ins {
	text-decoration: none;
	color: inherit;
	font-weight: inherit;
}

.esun-card__price .amount,
.esun-card__price bdi {
	color: inherit;
}

/* ---------- Cart button (red circle) ---------- */

.esun-card__cart {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background-color: #e8121c;
	color: #fff;
	text-decoration: none;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.esun-card__cart:hover,
.esun-card__cart:focus {
	color: #fff;
	background-color: #c40f18;
	transform: scale(1.06);
}

.esun-card__cart svg {
	display: block;
}

/* Hide WooCommerce's default "View cart" link that gets appended after AJAX add */
.esun-card__row .added_to_cart {
	display: none;
}

/* Loading state for AJAX add to cart */
.esun-card__cart.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------- Navigation arrows (below, centered) ---------- */

.esun-carousel__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 34px;
}

.esun-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background-color: #fff;
	color: #e8121c;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.esun-arrow:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.esun-arrow:focus-visible {
	outline: 2px solid #e8121c;
	outline-offset: 2px;
}

.esun-arrow.swiper-button-disabled {
	opacity: 0.45;
	cursor: default;
	transform: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.esun-arrow svg {
	display: block;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.esun-card__media,
	.esun-card__cart,
	.esun-arrow {
		transition: none;
	}
	.esun-card:hover .esun-card__media {
		transform: none;
	}
}

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
	.esun-card__title {
		font-size: 20px;
	}
	.esun-card__price {
		font-size: 20px;
	}
	.esun-carousel__nav {
		margin-top: 24px;
	}
}
