/* ==========================================================================
   FP Product Grid — structure only.
   Every colour, size, border and spacing value comes from the Elementor
   controls via {{WRAPPER}} selectors, so nothing here fights your theme
   and nothing here needs !important.
   ========================================================================== */

/* Elementor flex-row / grid containers give their children min-width:auto,
   so the widget would grow to fit every slide in the track and push the
   whole page wider than the phone screen. Lock it to its column. */
.elementor-widget-fppg-product-grid,
.elementor-widget-fppg-product-grid > .elementor-widget-container {
	min-width: 0;
	max-width: 100%;
}

/* in a row-direction flex container, default to full width (zero specificity,
   so Elementor's own "Custom width" setting still overrides it) */
:where(.e-con, .e-con-inner) > :where(.elementor-widget-fppg-product-grid) { width: 100%; }

.fppg-wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* belt and braces: nothing inside the slider can ever paint past its edge */
.fppg-wrap--slider { overflow-x: hidden; overflow-x: clip; }

.fppg-heading { margin: 0 0 30px; }

.fppg-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fppg-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	background: #fff;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

/* ---- media: fully independent of the card box.
        font-size/line-height 0 kills the inline-element gap under the image. ---- */

.fppg-media {
	display: block;
	line-height: 0;
	font-size: 0;
	position: relative;
	overflow: hidden;
	flex: none;
}

.fppg-media > a,
.fppg-media > span {
	display: block;
	line-height: 0;
	height: 100%;
	width: 100%;
}

.fppg-media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	object-fit: contain;
	object-position: center;
}

/* "original size" mode — the image keeps its natural aspect ratio,
   no fixed height, so it can never be squashed or stretched */
.fppg-media--natural,
.fppg-media--natural > a,
.fppg-media--natural > span { height: auto; }

.fppg-media--natural img {
	height: auto;
	width: 100%;
	max-width: 100%;
	object-fit: fill;
}

/* ---- body ---- */

.fppg-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.fppg-title {
	margin: 0;
	word-break: break-word;
}

.fppg-title a {
	color: inherit;
	text-decoration: none;
	transition: color .2s ease;
	/* theme and Elementor kit link rules set font on anchors directly,
	   which overrides anything inherited from the heading — pull it back */
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	word-spacing: inherit;
}

.fppg-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
}

/* Woo wraps prices in its own spans — pull them back to our typography */
.fppg-price .woocommerce-Price-amount,
.fppg-price bdi,
.fppg-price ins,
.fppg-price del {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

.fppg-price ins { text-decoration: none; }
.fppg-price del { opacity: .5; font-weight: 400; }

.fppg-from {
	display: inline-block;
	line-height: 1;
}

.fppg-card,
.fppg-btn,
.fppg-shop-btn { box-sizing: border-box; }

.fppg-btn,
.fppg-shop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	line-height: 1;
	transition: background-color .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}

/* pins the card button to the bottom so uneven titles still line up */
.fppg-btn { margin-top: auto; }

.fppg-btn:hover,
.fppg-shop-btn:hover { text-decoration: none; }

.fppg-btn:focus-visible,
.fppg-shop-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.fppg-btn span,
.fppg-shop-btn span {
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	color: inherit;
}

.fppg-btn svg,
.fppg-shop-btn svg { flex: none; transition: transform .25s ease; }

.fppg-btn:hover svg,
.fppg-shop-btn:hover svg { transform: translateX(4px); }

/* ---- footer / shop button ---- */

.fppg-footer { display: flex; margin-top: 40px; }
.fppg-footer--left { justify-content: flex-start; }
.fppg-footer--center { justify-content: center; }
.fppg-footer--right { justify-content: flex-end; }

.fppg-empty {
	padding: 24px;
	border: 1px dashed #d5dae2;
	color: #6b7280;
	font-size: 14px;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.fppg-card,
	.fppg-btn,
	.fppg-btn svg { transition: none; }
}

/* ==========================================================================
   Design: Tabs + Slider
   Slide width = (track − gaps) ÷ products visible, so decimals give a peek:
   1.2 on phones = one full product + the edge of the next.
   Elementor controls override these defaults per device.
   ========================================================================== */

.fppg-wrap--slider {
	--fppg-spv: 4;
	--fppg-gap: 28px;
	position: relative;
}

@media (max-width: 1024px) {
	.fppg-wrap--slider { --fppg-spv: 2.3; }
}

@media (max-width: 767px) {
	.fppg-wrap--slider { --fppg-spv: 1.2; --fppg-gap: 16px; }
}

/* ---- bar: tabs + arrows on one line ---- */

.fppg-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 26px;
	min-width: 0;
}

.fppg-bar--no-tabs { justify-content: flex-end; }

.fppg-tabs {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	flex: 1 1 auto;
	width: 0;      /* contributes 0 to the page's intrinsic width … */
	min-width: 0;  /* … and still grows to fill the bar via flex */
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding: 2px; /* room for the focus ring */
}

.fppg-tabs::-webkit-scrollbar { display: none; }

.fppg-bar--center .fppg-tabs { justify-content: center; }
.fppg-bar--right .fppg-tabs { justify-content: flex-end; }

/* a centred/right row that overflows must still start at the left edge */
.fppg-tabs.fppg-tabs--overflow { justify-content: flex-start; }

.fppg-wrap .fppg-tab {
	flex: none;
	margin: 0;
	padding: 11px 22px;
	border: 1px solid #e1e6ee;
	border-radius: 999px;
	background: #ffffff;
	color: #0a1f44;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .2px;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}

.fppg-wrap .fppg-tab:hover {
	color: #c1121f;
	border-color: rgba(193, 18, 31, .35);
	background: #ffffff;
}

.fppg-wrap .fppg-tab.is-active,
.fppg-wrap .fppg-tab.is-active:hover {
	background: #0a1f44;
	border-color: #0a1f44;
	color: #ffffff;
}

.fppg-wrap .fppg-tab:focus { outline: none; }
.fppg-wrap .fppg-tab:focus-visible { outline: 2px solid #c1121f; outline-offset: 2px; }

/* ---- arrows ---- */

.fppg-arrows {
	display: flex;
	gap: 10px;
	flex: none;
}

.fppg-wrap .fppg-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid #e1e6ee;
	border-radius: 50%;
	background: #ffffff;
	color: #0a1f44;
	line-height: 0;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .22s ease, color .22s ease, border-color .22s ease, opacity .22s ease;
}

.fppg-wrap .fppg-arrow:not(:disabled):hover {
	background: #c1121f;
	border-color: #c1121f;
	color: #ffffff;
}

.fppg-wrap .fppg-arrow:disabled {
	opacity: .35;
	cursor: default;
}

.fppg-wrap .fppg-arrow:focus { outline: none; }
.fppg-wrap .fppg-arrow:focus-visible { outline: 2px solid #c1121f; outline-offset: 2px; }

.fppg-wrap .fppg-arrow svg { display: block; }

/* nothing to scroll in the active tab → no arrows */
.fppg-wrap--slider.fppg-no-scroll .fppg-arrows,
.fppg-wrap--slider.fppg-no-scroll .fppg-dots { display: none; }

@media (max-width: 767px) {
	.fppg-arrows-hide-mob .fppg-arrows { display: none; }

	.fppg-bar { margin-bottom: 20px; }

	/* tabs scroll sideways instead of wrapping or squashing */
	.fppg-wrap .fppg-tab { padding: 10px 18px; font-size: 13.5px; }
}

/* ---- panels ---- */

.fppg-panel[hidden] { display: none !important; }

.fppg-panel.is-active { animation: fppg-fade .35s ease; }

@keyframes fppg-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* ---- track: native scroll + snap = smooth touch swipe on every phone ---- */

.fppg-track {
	display: flex;
	gap: var(--fppg-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	/* width:0 + min-width:100% = the track fills its column but adds nothing
	   to the parent's intrinsic width, so 10 slides can't stretch the page */
	width: 0;
	min-width: 100%;
	box-sizing: border-box;
	/* vertical room for hover lift + shadow only — no sideways bleed */
	padding: 8px 0 18px;
	margin: -8px 0 -18px;
}

.fppg-track::-webkit-scrollbar { display: none; }

.fppg-track:focus { outline: none; }
.fppg-track:focus-visible { outline: 2px solid #c1121f; outline-offset: 4px; }

.fppg-track.is-dragging {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
	user-select: none;
}

.fppg-track.is-dragging a { pointer-events: none; }

.fppg-slide {
	flex: 0 0 calc((100% - (var(--fppg-spv) - 1) * var(--fppg-gap)) / var(--fppg-spv));
	min-width: 0;
	scroll-snap-align: start;
	display: flex;
}

.fppg-slide > .fppg-card { width: 100%; }

.fppg-track img { -webkit-user-drag: none; user-select: none; }

/* ---- dots ---- */

.fppg-dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}

.fppg-dots:empty { display: none; }

.fppg-wrap .fppg-dot {
	width: 8px;
	height: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #d5dae2;
	cursor: pointer;
	box-shadow: none;
	transition: width .25s ease, background-color .25s ease;
}

.fppg-wrap .fppg-dot.is-active {
	width: 24px;
	background: #c1121f;
}

@media (prefers-reduced-motion: reduce) {
	.fppg-track { scroll-behavior: auto; }
	.fppg-panel.is-active { animation: none; }
	.fppg-wrap .fppg-tab,
	.fppg-wrap .fppg-arrow,
	.fppg-wrap .fppg-dot { transition: none; }
}
