/* Surgemint Product List widget — base styles. Elementor Style-tab controls
 * override colors/typography/spacing via higher-specificity {{WRAPPER}} rules. */

.surgemint-product-list-widget {
	width: 100%;
}

/* Header row: heading top-left, View All button top-right */
.surgemint-widget-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.surgemint-widget-heading {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
}

.surgemint-view-all-btn {
	display: inline-block;
	flex-shrink: 0;
	padding: 8px 18px;
	border-radius: 4px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	background: var(--pbd-brand, #222222);
	color: var(--pbd-on-brand, #ffffff);
	transition: background-color 0.3s ease, color 0.3s ease;
}

.surgemint-view-all-btn:hover {
	background: var(--pbd-brand-dark, #000000);
	color: var(--pbd-on-brand, #ffffff);
}

/* Grid layout. Column count per breakpoint comes from the widget's
 * responsive "Columns" control — Elementor writes --surgemint-columns here
 * per active device. The numbers after the comma below are just safety-net
 * fallbacks (used only if that custom property isn't set at all), so the
 * grid still looks right even before you've touched the control. */
.surgemint-product-grid {
	display: grid;
	grid-template-columns: repeat(var(--surgemint-columns, 5), 1fr);
	gap: 16px;
}

@media (max-width: 1024px) {
	.surgemint-product-grid {
		grid-template-columns: repeat(var(--surgemint-columns, 3), 1fr);
		gap: 14px;
	}
}

@media (max-width: 767px) {
	.surgemint-product-grid {
		grid-template-columns: repeat(var(--surgemint-columns, 2), 1fr);
		gap: 10px;
	}
}

/* Product card — clean, modern, bordered (not shadow-heavy) */
.surgemint-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid var(--pbd-line, #ececec);
	border-radius: 16px;
	padding: 12px;
	overflow: hidden;
	transition: box-shadow 0.25s ease, border-color 0.25s ease;
	height: 100%;
}

.surgemint-product-card:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

/* The aspect-ratio lives on the CONTAINER (swappable via the widget's
 * "Image Shape" style control) — the img just fills it. A tall book cover
 * forced into a square frame wastes space on the sides; picking Portrait
 * here fixes that without touching markup. */
.surgemint-product-thumb {
	position: relative;
	overflow: hidden;
	background: var(--pbd-tint, #fafafa);
	border-radius: 12px;
	margin-bottom: 8px;
	aspect-ratio: 3 / 4;
}

.surgemint-product-thumb-link {
	display: block;
	width: 100%;
	height: 100%;
}

.surgemint-product-thumb img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	padding: 4px;
	box-sizing: border-box;
	transition: transform 0.4s ease;
}

.surgemint-product-card:hover .surgemint-product-thumb img {
	transform: scale(1.04);
}

/* Round discount badge (e.g. "-25%") instead of a rectangular "Sale" tag */
.surgemint-sale-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--pbd-sale, #e63946);
	color: var(--pbd-on-brand, #ffffff);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	pointer-events: none;
}

/* Optional "Featured" pill (off by default; Shop Page widget can enable it).
 * Sits bottom-left of the image so it never collides with the sale badge. */
.surgemint-featured-badge {
	position: absolute;
	bottom: 10px;
	left: 10px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--pbd-brand, #111111);
	color: var(--pbd-on-brand, #ffffff);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.02em;
	pointer-events: none;
}

/* Wishlist heart overlays the top-right corner of the image, as its own
 * floating white circle — not grouped with Add to Cart in the footer. */
.surgemint-product-thumb .surgemint-wishlist-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #ffffff;
	border-color: #ffffff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.surgemint-product-thumb .surgemint-wishlist-btn:hover {
	background: #ffffff;
}

.surgemint-product-body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* Category + rating row */
.surgemint-product-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 4px;
}

.surgemint-product-category {
	font-size: 13px;
	color: var(--pbd-muted, #9a9a9a);
	text-transform: capitalize;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.surgemint-product-rating {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--pbd-ink-soft, #333333);
	flex-shrink: 0;
}

.surgemint-product-rating svg {
	width: 14px;
	height: 14px;
	fill: var(--pbd-accent, #ffb400);
}

/* Title — clamped to 2 lines, ellipsis after that */
.surgemint-product-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	text-overflow: ellipsis;
	max-height: calc(1.3em * 2);
}

.surgemint-product-title a {
	color: inherit;
	text-decoration: none;
}

.surgemint-product-title a:hover {
	text-decoration: none;
}

/* Optional short description (off by default) — clamped to 2 lines */
.surgemint-product-excerpt {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--pbd-muted, #6b6b6b);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* Variant swatches */
.surgemint-product-variants {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
}

.surgemint-variant-swatch {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.15);
	box-shadow: 0 0 0 1px #ffffff inset;
}

.surgemint-variant-more {
	font-size: 11px;
	color: var(--pbd-muted, #9a9a9a);
	margin-left: 2px;
}

/* Price + action buttons row */
.surgemint-product-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 6px;
}

.surgemint-product-price {
	font-size: 17px;
	font-weight: 700;
	color: var(--pbd-brand, #2f6fed);
}

.surgemint-product-price del {
	opacity: 0.6;
	font-weight: 400;
	font-size: 0.85em;
	margin-right: 6px;
	color: var(--pbd-muted, #a0a0a0);
}

.surgemint-product-price ins {
	text-decoration: none;
}

.surgemint-product-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* Icon-only action buttons.
 * <button> carries browser default appearance/padding/font that <a> doesn't —
 * without neutralizing it, the "Add to Cart" button can render as a native
 * pill shape with its icon squashed out, while the "Buy Now" link renders
 * fine. appearance:none + zeroed padding/border/font make both tags render
 * identically. */
a.surgemint-action-btn,
button.surgemint-action-btn,
.surgemint-product-actions .surgemint-action-btn {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 1px solid var(--pbd-line, #e5e5e5);
	border-radius: 50% !important;
	background: transparent;
	color: var(--pbd-ink, #111111);
	font-family: inherit;
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
	flex-shrink: 0;
}

.surgemint-action-btn svg {
	display: inline-block !important;
	width: 16px !important;
	height: 16px !important;
	flex-shrink: 0;
	pointer-events: none;
}

.surgemint-add-to-cart-btn:hover {
	background: var(--pbd-brand, #2f6fed);
	border-color: var(--pbd-brand, #2f6fed);
	color: var(--pbd-on-brand, #ffffff);
}

.surgemint-add-to-cart-btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

.surgemint-add-to-cart-btn.added {
	background: var(--pbd-brand, #2f6fed);
	border-color: var(--pbd-brand, #2f6fed);
	color: var(--pbd-on-brand, #ffffff);
}

/* Wishlist icon button — outline heart by default, filled + accent-colored
 * once saved (state kept client-side; see product-list-widget.js) */
.surgemint-wishlist-btn svg {
	fill: none;
	stroke: currentColor;
}

.surgemint-wishlist-btn:hover {
	color: var(--pbd-sale, #e63946);
	border-color: #e63946;
}

.surgemint-wishlist-btn.in-wishlist {
	color: var(--pbd-sale, #e63946);
	border-color: #e63946;
}

.surgemint-wishlist-btn.in-wishlist svg {
	fill: currentColor;
}

/* Full-width "Buy Now" button, below the price/actions row */
.surgemint-buy-now-full {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: 8px;
	padding: 9px 16px;
	border-radius: 8px;
	background: var(--pbd-brand, #111111);
	color: var(--pbd-on-brand, #ffffff);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.25s ease, opacity 0.25s ease;
}

.surgemint-buy-now-full:hover {
	opacity: 0.88;
	color: #ffffff;
}

.surgemint-buy-now-full svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

/* Slider layout */
.surgemint-product-slider-container {
	position: relative;
}

.surgemint-product-slider {
	overflow: hidden;
}

.surgemint-product-slider .swiper-slide {
	height: auto;
}

.surgemint-swiper-pagination {
	position: relative;
	margin-top: 16px;
	text-align: center;
}

.surgemint-swiper-prev,
.surgemint-swiper-next {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	z-index: 2;
	font-size: 18px;
	user-select: none;
}

.surgemint-swiper-prev {
	left: -18px;
}

.surgemint-swiper-next {
	right: -18px;
}

.surgemint-no-products {
	color: var(--pbd-muted, #777777);
	font-style: italic;
}
