/* ── Chargefy Selector ─────────────────────────────────────────────────────── */

.cfy-selector {
	--cfy-accent:    #64c8c2;
	--cfy-accent-dim:#3ea09a;
	--cfy-bg:        #121212;
	--cfy-card:      #1c1c1c;
	--cfy-border:    #282828;
	--cfy-text:      #f0f0f0;
	--cfy-muted:     #888;
	--cfy-star:      #e8a020;
	--cfy-radius:    10px;
	--cfy-gap:       12px;
	--cfy-img-h:     140px; /* reserved — prevents layout shift */

	background: var(--cfy-bg);
	padding: 32px 20px 28px;
	box-sizing: border-box;
	font-family: inherit;
}

.cfy-selector *,
.cfy-selector *::before,
.cfy-selector *::after {
	box-sizing: inherit;
}

/* ── Tab bar — underline style ─────────────────────────────────────────────── */

.cfy-selector__tabs {
	display: flex;
	justify-content: center;
	gap: 0;
	margin: 0 auto 24px;
	width: fit-content;
	max-width: 100%;
	border-bottom: 1px solid var(--cfy-border);
}

@media (max-width: 640px) {
	.cfy-selector__tabs {
		width: 100%;
		flex-wrap: wrap;
		overflow-x: visible;
		justify-content: flex-start;
	}
	.cfy-tab {
		flex: 0 0 100%;
		max-width: 100%;
		box-sizing: border-box;
	}
}

.cfy-tab {
	padding: 9px 20px;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	background: transparent;
	color: var(--cfy-muted);
	transition: color 0.18s, border-color 0.18s;
	white-space: nowrap;
	outline: none;
}

.cfy-tab:focus,
.cfy-tab:focus-visible {
	outline: 2px solid #64c8c2;
	outline-offset: 2px;
}

.cfy-tab:hover {
	color: var(--cfy-text);
	background: transparent;
	border-color: var(--cfy-accent) !important;
}

.cfy-tab--active {
	color: var(--cfy-accent);
	border-bottom-color: #64c8c2 !important;
}

/* ── Panel ─────────────────────────────────────────────────────────────────── */

.cfy-selector__panel { display: none; }
.cfy-panel--active   { display: block; }

/* ── Products row ──────────────────────────────────────────────────────────── */

.cfy-products {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: var(--cfy-gap);
	max-width: 1380px;
	margin: 0 auto;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */

.cfy-product {
	background: var(--cfy-card);
	border: 1px solid var(--cfy-border);
	border-radius: var(--cfy-radius);
	flex: 0 0 auto;
	width: 200px;
	display: flex;
	flex-direction: column;
	overflow: visible;
	position: relative;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Clip the image corners without clipping the label badge */
.cfy-product__image {
	border-radius: calc(var(--cfy-radius) - 1px) calc(var(--cfy-radius) - 1px) 0 0;
	overflow: hidden;
}

.cfy-product:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
	text-decoration: none;
	color: inherit;
}

/* Labelled: colored thick top border only — sides/bottom stay default */
.cfy-product--labelled {
	border-top: 3px solid var(--lbl-color, var(--cfy-accent));
}

/* Highlighted: the chosen colour as a gradient washing down over the normal
   card grey — same idea as the wash behind the banner images. Strongest behind
   the product photo, gone by the time it reaches the price, so the card is
   marked out without being painted over. */
.cfy-product--highlighted {
	background-color: var(--cfy-card);
	background-image: linear-gradient(
		180deg,
		var(--cfy-hl-soft, rgba(100, 200, 194, 0.20)) 0%,
		rgba(0, 0, 0, 0) 72%);
	border-color: var(--cfy-hl, var(--cfy-accent));
}

/* A label still owns the thick top edge */
.cfy-product--highlighted.cfy-product--labelled {
	border-top-color: var(--lbl-color, var(--cfy-hl, var(--cfy-accent)));
}

.cfy-product--highlighted:hover {
	box-shadow: 0 10px 28px var(--cfy-hl-glow, rgba(100, 200, 194, 0.22));
}

.cfy-product--highlighted .cfy-product__image {
	background: rgba(0, 0, 0, 0.12);
}

/* Price and arrow pick up the highlight colour; body text stays light.
   --cfy-hl-ink is the same colour, lifted when it is too dark to read here. */
.cfy-product--highlighted .cfy-price-value,
.cfy-product--highlighted .cfy-product__arrow {
	color: var(--cfy-hl-ink, var(--cfy-hl, var(--cfy-accent)));
}

.cfy-product--highlighted .cfy-product__arrow {
	opacity: 0.9;
}

/* ── Label badge ───────────────────────────────────────────────────────────── */

.cfy-product__label {
	position: absolute;
	top: -1px;
	right: 14px;
	background: var(--lbl-color, var(--cfy-accent));
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	padding: 4px 10px 5px;
	border-radius: 0 0 7px 7px;
	white-space: nowrap;
	z-index: 2;
	line-height: 1;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	/* Subtle top-border matches card top border */
	border-top: 3px solid var(--lbl-color, var(--cfy-accent));
}

/* ── Image — fixed height reserves space, kills CLS ───────────────────────── */

.cfy-product__image {
	width: 100%;
	height: var(--cfy-img-h);
	background: #111;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	/* overflow + border-radius set above in the Card section */
}

.cfy-product__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* ── Inner content ─────────────────────────────────────────────────────────── */

.cfy-product__inner {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 14px 14px 14px;
	gap: 10px;
}

/* Head: name + rating */
.cfy-product__head {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cfy-product__name {
	font-size: 13px;
	font-weight: 600;
	color: var(--cfy-text);
	margin: 0;
	line-height: 1.4;
}

/* Rating — plain text, no badge */
.cfy-product__rating {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	color: var(--cfy-muted);
}

.cfy-product__rating svg {
	width: 11px;
	height: 11px;
	fill: var(--cfy-star);
	flex-shrink: 0;
}

/* ── Footer: price + arrow ─────────────────────────────────────────────────── */

.cfy-product__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
}

.cfy-product__price {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.cfy-price-label {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--cfy-muted);
}

.cfy-price-value {
	font-size: 18px;
	font-weight: 700;
	color: var(--cfy-text);
	line-height: 1;
}

/* Normalise WooCommerce price HTML */
.cfy-price-value .woocommerce-Price-amount,
.cfy-price-value bdi {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

/* Arrow indicator — slides right on card hover */
.cfy-product__arrow {
	color: var(--lbl-color, var(--cfy-accent));
	display: flex;
	align-items: center;
	flex-shrink: 0;
	opacity: 0.7;
	transition: transform 0.18s ease, opacity 0.18s ease;
}

.cfy-product__arrow svg {
	width: 18px;
	height: 18px;
}

.cfy-product:hover .cfy-product__arrow {
	transform: translateX(4px);
	opacity: 1;
}

/* ── "Visa alla" link ──────────────────────────────────────────────────────── */

.cfy-selector__all {
	text-align: right;
	margin-top: 12px;
	max-width: 1380px;
	margin-left: auto;
	margin-right: auto;
}

.cfy-selector__all a {
	color: var(--cfy-muted);
	font-size: 13px;
	text-decoration: none;
	transition: color 0.15s;
}

.cfy-selector__all a:hover {
	color: var(--cfy-accent);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
	.cfy-products {
		flex-wrap: wrap;
	}
	.cfy-product {
		width: calc(33.333% - var(--cfy-gap));
		min-width: 155px;
	}
}

@media (max-width: 640px) {
	.cfy-product {
		width: calc(50% - var(--cfy-gap) / 2);
		box-sizing: border-box;
		padding: 8px 4px;
		margin: 0 auto 12px auto;
	}
}

@media (max-width: 380px) {
	.cfy-product {
		width: 100%;
		box-sizing: border-box;
		padding: 8px 2px;
		margin: 0 auto 10px auto;
	}
}
