/*
 * Elementor Shop Products Page — mirrors the xsmokehub Products page
 * (Products.tsx): a filters row (search + sort), pill category tabs, a
 * responsive grid of product cards (image, badge, "View Product" overlay,
 * brand, name, short description, stars, price, Add to Cart) and client-side
 * pagination. The Elementor controls override these defaults via generated
 * CSS.
 */

/* ---- Wrapper ---- */
/* Centred content column, so the grid is inset from the viewport edges like the
   storefront it mirrors instead of running bleed-to-bleed. The header's inner
   row uses the same 1270px / 24px so the two line up. */
.espp-wrap {
	width: 100%;
	max-width: 1270px;
	margin: 0 auto;
	padding: 40px 24px 72px;
}

/* ---- Filters row ---- */
.espp-filters {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-bottom: 32px;
}

.espp-search {
	position: relative;
	flex: 1;
	max-width: 384px;
	min-width: 220px;
}

.espp-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	color: #888888;
	pointer-events: none;
	z-index: 1;
}

.espp-search-input {
	box-sizing: border-box;
	width: 100%;
	padding: 10px 16px 10px 42px;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	background-color: #ffffff;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: #222222;
	transition: border-color 0.2s ease;
}

/* Keep the left padding clear of the search icon even when a theme styles
   all inputs with its own padding. */
.espp-search .espp-search-input {
	padding-left: 42px !important;
}

.espp-search-input::placeholder {
	color: #bbbbbb;
}

.espp-search-input:focus {
	outline: none;
	border-color: #222222;
}

.espp-sort {
	display: flex !important;
	align-items: center;
	flex-wrap: nowrap;
	gap: 8px;
	margin-left: auto;
}

.espp-sort-label {
	flex-shrink: 0;
	white-space: nowrap;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 400;
	color: #888888;
}

.espp-sort select {
	width: auto;
	max-width: 100%;
	min-width: 0;
	flex-shrink: 1;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	padding: 10px 12px;
	background-color: #ffffff;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 400;
	color: #222222;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.espp-sort select:focus {
	outline: none;
	border-color: #222222;
}

/* ---- Category section: heading + subtitle + centred pills ----
 *
 * Mirrors the hggorras storefront category block: a centred uppercase
 * heading, a muted subtitle, and a centred wrapping row of white pill
 * buttons whose active state is a gold gradient. That design uses the system
 * UI stack rather than the plugin's DM Serif / Jost pairing, so the typeface
 * is scoped to this block via --espp-font while the rest of the widget keeps
 * its own fonts.
 */

.espp-cats-section {
	--espp-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	margin-bottom: 24px;
}

.espp-cat-head {
	margin-bottom: 16px;
}

.espp-cat-title {
	margin: 0 0 6px;
	font-family: var(--espp-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #1a1a1a;
	text-align: center;
}

.espp-cat-subtitle {
	margin: 0;
	font-family: var(--espp-font);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	color: #888888;
	text-align: center;
}

.espp-cats {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 10px;
}

.espp-cat-btn {
	min-height: 40px;
	padding: 9px 22px;
	border: 1px solid #e5e5e5;
	border-radius: 999px;
	background-color: #ffffff;
	color: #1a1a1a;
	font-family: var(--espp-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.25;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Hover: light grey fill, forced over any theme (Minimog) button hover. */
.espp-cat-btn:hover,
.espp-cat-btn:focus-visible {
	background-color: #f5f5f5 !important;
	border-color: #dedede !important;
	color: #171717 !important;
	transform: scale(1.02);
}

/* Active: gold gradient. --espp-gold-a / --espp-gold-b carry the defaults and
are overridden by the Elementor "Active Tab Gradient" colour controls. The
flat background-color underneath is the fallback for browsers without
linear-gradient support. */
.espp-cat-btn.is-active {
	border-color: transparent;
	background-color: #b47b18;
	background-image: linear-gradient(135deg, var(--espp-gold-a, #b47b18), var(--espp-gold-b, #f0d486));
	color: #070708;
	box-shadow: 0 3px 10px rgba(170, 119, 28, 0.22);
}

.espp-cat-btn.is-active:hover,
.espp-cat-btn.is-active:focus-visible {
	background-color: #b47b18 !important;
	background-image: linear-gradient(135deg, var(--espp-gold-a, #b47b18), var(--espp-gold-b, #f0d486)) !important;
	border-color: transparent !important;
	color: #070708 !important;
	transform: scale(1.02);
}

/* ---- Hero slider: big product card above the grid ---- */
.espp-hero {
	margin: 0 0 32px;
}

.espp-hero-viewport {
	position: relative;
	padding: 0 54px;
}

.espp-hero-track {
	position: relative;
	border-radius: 20px;
	background-color: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	overflow: hidden;
}

.espp-hero-slide {
	display: none;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 40px;
	padding: 42px;
}

.espp-hero-slide.is-active {
	display: grid;
	animation: espp-hero-fade 0.45s ease;
}

@keyframes espp-hero-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.espp-hero-media {
	display: block;
	border-radius: 14px;
	overflow: hidden;
	background-color: #f2f2f2;
	aspect-ratio: 1 / 1;
}

.espp-hero-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.espp-hero-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	min-width: 0;
}

.espp-hero-eyebrow {
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid rgba(180, 123, 24, 0.45);
	border-radius: 999px;
	background-color: rgba(240, 212, 134, 0.16);
	color: #8a5d10;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.espp-hero-title {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.15;
	color: #111111;
}

.espp-hero-title a {
	color: inherit;
	text-decoration: none;
}

.espp-hero-pricing {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 2px;
}

/* "PRECIO" caption above the number, on the hero and on every card. */
.espp-price-label {
	color: #9a9a9a;
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.espp-hero-price {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.1;
	color: #111111;
}

/* The currency code sits small beside the amount ("$208.00  MXN"). */
.espp-price-currency {
	margin-left: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #7a7a7a;
	letter-spacing: 0.04em;
}

.espp-hero-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding: 11px 22px;
	border-radius: 8px;
	background-color: #b47b18;
	background-image: linear-gradient(135deg, var(--espp-gold-a, #b47b18), var(--espp-gold-b, #f0d486));
	color: #070708;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(170, 119, 28, 0.28);
	transition: filter 0.2s ease;
}

.espp-hero-cta:hover {
	filter: brightness(1.05);
	color: #070708;
}

.espp-hero-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid #e2e2e2;
	border-radius: 50%;
	background-color: #ffffff;
	color: #444444;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	transform: translateY(-50%);
	transition: border-color 0.2s ease, color 0.2s ease;
}

.espp-hero-nav:hover {
	border-color: #c9c9c9;
	color: #111111;
}

.espp-hero-prev {
	left: 0;
}

.espp-hero-next {
	right: 0;
}

.espp-hero-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

.espp-hero-dot {
	width: 7px;
	height: 7px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: #d2d2d2;
	cursor: pointer;
	transition: width 0.2s ease, background-color 0.2s ease;
}

.espp-hero-dot.is-active {
	width: 20px;
	border-radius: 999px;
	background-image: linear-gradient(135deg, var(--espp-gold-a, #b47b18), var(--espp-gold-b, #f0d486));
}

/* ---- Count ---- */
.espp-count {
	margin: 0 0 24px;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 400;
	color: #888888;
}

/* ---- Grid ---- */
.espp-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)); /* fallback; Elementor overrides */
	column-gap: 24px;
	row-gap: 24px;
}

/* ---- Product card: image with a code chip, then code, title, price row and
the add-to-cart / buy-now button pair ---- */
.espp-product-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #ececec;
	border-radius: 16px;
	background-color: #ffffff;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.espp-product-card:hover {
	border-color: #e0e0e0;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.espp-product-card.espp-hidden {
	display: none;
}

.espp-card-image {
	position: relative;
	display: block;
	/* Portrait, matching the storefront's product shots. */
	aspect-ratio: 5 / 6;
	overflow: hidden;
	background-color: #f2f2f2;
}

.espp-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.espp-product-card:hover .espp-card-image img {
	transform: scale(1.04);
}

.espp-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 9px;
	border-radius: 4px;
	background-color: #111111;
	color: #ffffff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Product code, overlaid on the bottom-left of the photo. Light pill: the
   storefront's product shots are dark, and the shadow keeps it legible if a
   light photo is uploaded later. */
.espp-card-chip {
	position: absolute;
	bottom: 10px;
	left: 10px;
	padding: 4px 9px;
	border-radius: 5px;
	background-color: rgba(255, 255, 255, 0.94);
	color: #1a1a1a;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.espp-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
}

.espp-card-code {
	color: #b98a2c;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.espp-card-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	color: #141414;
}

.espp-card-title a {
	color: inherit;
	text-decoration: none;
}

.espp-card-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #9a9a9a;
	font-size: 11px;
}

/* Five inline SVGs, so they need their own flex row and a hairline gap. */
.espp-stars {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	line-height: 0;
}

.espp-card-info {
	margin: 0;
	color: #8b8b8b;
	font-size: 12px;
	line-height: 1.5;
}

/* Price on the left, quantity stepper on the right. `margin-top:auto` keeps
the row pinned to the bottom so cards of unequal height stay aligned. */
.espp-card-buy-row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 10px;
}

.espp-card-pricing {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.espp-card-price {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
	color: #111111;
}

/* ---- Quantity stepper ---- */
.espp-qty {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	border: 1px solid #e4e4e4;
	border-radius: 8px;
	overflow: hidden;
	background-color: #ffffff;
}

.espp-qty-btn {
	width: 26px;
	height: 30px;
	padding: 0;
	border: 0;
	background: none;
	color: #8b8b8b;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.espp-qty-btn:hover {
	background-color: #f6f6f6;
	color: #111111;
}

.espp-qty-input {
	width: 34px;
	height: 30px;
	padding: 0;
	border: 0;
	border-right: 1px solid #efefef;
	border-left: 1px solid #efefef;
	background-color: #ffffff;
	color: #111111;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.espp-qty-input::-webkit-inner-spin-button,
.espp-qty-input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* ---- Card action buttons ---- */
.espp-card-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.espp-btn {
	display: inline-flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 6px 10px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.06em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease, filter 0.2s ease;
}

.espp-btn-icon {
	flex-shrink: 0;
}

.espp-btn-ghost {
	border-color: #e4e4e4;
	background-color: #ffffff;
	color: #1c1c1c;
}

.espp-btn-ghost:hover {
	border-color: #c9c9c9;
	color: #000000;
}

.espp-btn-gold {
	background-color: #b47b18;
	background-image: linear-gradient(135deg, var(--espp-gold-a, #b47b18), var(--espp-gold-b, #f0d486));
	color: #070708;
	box-shadow: 0 2px 7px rgba(170, 119, 28, 0.24);
}

.espp-btn-gold:hover {
	filter: brightness(1.05);
	color: #070708;
}

/* Single-button cards (variable / sold out) span the full width. */
.espp-btn-wide {
	flex-basis: 100%;
}

.espp-add.is-added {
	border-color: #2f8f4e;
	background-color: #2f8f4e;
	color: #ffffff;
}

.espp-add.is-loading,
.espp-buy-now.is-loading {
	opacity: 0.65;
	cursor: progress;
}

.espp-btn.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ---- Empty state ---- */
.espp-empty {
	text-align: center;
	padding: 64px 0;
}

.espp-empty-emoji {
	margin: 0 0 12px;
	font-size: 36px;
	line-height: 1;
}

.espp-empty-text {
	margin: 0;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	color: #888888;
}

/* ---- Pagination ---- */
.espp-pagination {
	display: none;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 40px;
}

.espp-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	background-color: #ffffff;
	color: #666666;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.espp-page-btn:hover {
	border-color: #222222;
	color: #222222;
}

.espp-page-btn.is-active {
	background-color: #222222;
	border-color: #222222;
	color: #ffffff;
}

.espp-page-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.espp-page-btn:disabled:hover {
	border-color: #e5e5e5;
	color: #666666;
}

.espp-page-prev,
.espp-page-next {
	font-size: 18px;
	padding: 0 10px;
}

/* ---- Responsive: tablet 2 columns, mobile 1 column ---- */
@media (max-width: 1024px) {
	.espp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 767px) {
	/*
	 * Two columns on phones (consistent with the home shop-grid). Slightly
	 * tighter gaps keep the narrower cards usable; card type/padding is left
	 * as-is.
	 */
	.espp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		column-gap: 12px;
		row-gap: 16px;
	}

	/* Hero: single column, tighter padding, arrows pulled in. */
	.espp-hero {
		margin-bottom: 22px;
	}

	.espp-hero-viewport {
		padding: 0 44px;
	}

	.espp-hero-slide {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
		padding: 20px;
	}

	.espp-hero-title {
		font-size: 20px;
	}

	.espp-hero-price {
		font-size: 20px;
	}

	.espp-hero-cta {
		padding: 10px 18px;
	}

	.espp-hero-nav {
		width: 32px;
		height: 32px;
	}

	/* Card: the button pair stacks so each label gets a full line. */
	.espp-card-body {
		padding: 12px 12px 14px;
	}

	.espp-card-title {
		font-size: 14px;
	}

	.espp-card-price {
		font-size: 17px;
	}

	.espp-card-actions {
		flex-direction: column;
	}

	.espp-btn {
		min-height: 36px;
	}

	/* Category pills and heading shrink on phones, matching the reference. */
	.espp-cat-title {
		font-size: 17px;
		letter-spacing: 0.14em;
	}

	.espp-cat-subtitle {
		font-size: 12px;
	}

	.espp-cat-btn {
		min-height: 36px;
		padding: 7px 16px;
		border-radius: 12px;
		font-size: 11px;
		letter-spacing: 0.04em;
	}
}
