/*
 * Ketology Products — Front-end styles
 * Design tokens: sage green, warm gold, cream, charcoal
 * BEM naming: .kp-[component]__[element]--[modifier]
 * Enqueued only on pages where a ketology shortcode renders.
 */

/* ── Design tokens ─────────────────────────────────────────────────────────── */

:root {
	--kp-cream:       #FAF8F5;
	--kp-sage:        #5B7B5B;
	--kp-sage-light:  #C9D3CA;
	--kp-gold:        #D4A04A;
	--kp-charcoal:    #2D2D2D;
	--kp-mid:         #6B6B6B;
	--kp-border:      #E5E0D8;
	--kp-green-text:  #3B6D11;
	--kp-red-text:    #993C1D;
	--kp-radius:      6px;
	--kp-radius-lg:   10px;
	--kp-font:        inherit;
}

/* ── Mentions list ──────────────────────────────────────────────────────────── */

.kp-mentions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ── Availability badge ─────────────────────────────────────────────────────── */

.kp-availability {
	display: inline-flex;
	align-items: center;
	gap: .35em;
	font-size: .875em;
	font-weight: 500;
}

.kp-availability::before {
	content: "";
	display: inline-block;
	width: .55em;
	height: .55em;
	border-radius: 50%;
	flex-shrink: 0;
	background: currentColor;
}

.kp-availability--in-stock {
	color: var(--kp-green-text);
}

.kp-availability--out-of-stock {
	color: var(--kp-red-text);
}

/* ── Description ───────────────────────────────────────────────────────────── */

.kp-description {
	color: var(--kp-charcoal);
	font-size: 1rem;
	line-height: 1.7;
}

.kp-description p {
	margin: 0 0 1em;
}

.kp-description p:last-child {
	margin-bottom: 0;
}

/* ── Pills ─────────────────────────────────────────────────────────────────── */

.kp-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.kp-pill {
	background-color: var(--kp-sage-light);
	color: var(--kp-sage);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 4px 12px;
	border-radius: 20px;
	white-space: nowrap;
/* 	text-transform: uppercase; */
}

.kp-pills--small .kp-pill {
	font-size: 0.7rem;
	padding: 3px 10px;
}

/* ── Details table ─────────────────────────────────────────────────────────── */

.kp-details {
	margin: 0;
}

.kp-details__table {
	width: 100%;
	border-collapse: collapse;
}

.kp-details__row {
	border-bottom: 1px solid var(--kp-border);
}

.kp-details__row:last-child {
	border-bottom: none;
}

.kp-details__label,
.kp-details__value {
	padding: 12px;
	font-size: 18px;
	line-height: 1.8;
	vertical-align: middle;
}

.kp-details__label {
	color: var(--kp-mid);
	font-weight: 300;
	width: 50%;
}

.kp-details__value {
	color: var(--kp-charcoal);
	font-weight: 500;
	text-align: right;
}

.kp-details__link {
	color: var( --e-global-color-f9f9839 ) !important;
	text-decoration: underline !important;
	font-weight: 500;
	font-size: 18px !important
}

.kp-details__link:hover {
	opacity: 0.8;
}

/* ── Buy block ─────────────────────────────────────────────────────────────── */

.kp-buy {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.kp-buy__meta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.kp-buy__price {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--kp-charcoal);
	letter-spacing: -0.02em;
}

.kp-buy__availability {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--kp-mid);
}

.kp-buy__availability--in-stock {
	color: var(--kp-green-text);
}

.kp-buy__availability--out-of-stock {
	color: var(--kp-red-text);
}

.kp-buy__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kp-buy__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--kp-gold);
	color: var(--e-global-color-4fd12c0);
	font-size: 0.95rem;
	font-weight: 600;
	padding: 12px 24px;
	border-radius: var(--kp-radius);
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.1s ease;
	white-space: nowrap;
}

.kp-buy__button:hover {
	background-color: #c49040;
	color: var(--e-global-color-4fd12c0);
	transform: translateY(-1px);
}

.kp-buy__button:active {
	transform: translateY(0);
}

.kp-buy__disclosure {
	font-size: 0.75rem;
	color: var(--kp-mid);
	margin: 0;
	line-height: 1.5;
}

/* ── Why we recommend ──────────────────────────────────────────────────────── */

.kp-why {
	background-color: var(--kp-cream);
	border-left: 3px solid var(--kp-sage);
	padding: 20px 24px;
	border-radius: 0 var(--kp-radius) var(--kp-radius) 0;
}

.kp-why__heading {
	color: var(--kp-sage);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin: 0 0 10px;
}

.kp-why__content {
	color: var(--kp-charcoal);
	font-size: 0.95rem;
	line-height: 1.7;
}

.kp-why__content p {
	margin: 0 0 0.8em;
}

.kp-why__content p:last-child {
	margin-bottom: 0;
}

/* ── Product card ──────────────────────────────────────────────────────────── */

.kp-card {
	background: var(--e-global-color-4fd12c0);
	border: 1px solid var(--kp-border);
	border-radius: var(--kp-radius-lg);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kp-card:hover {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.kp-card__image-link {
	display: block;
	overflow: hidden;
	background-color: var(--kp-cream);
	aspect-ratio: 1 / 1;
}

.kp-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.kp-card:hover .kp-card__image {
	transform: scale(1.03);
}

.kp-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.kp-card__title {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
}

.kp-card__title a {
	color: var(--kp-charcoal);
	text-decoration: none;
}

.kp-card__title a:hover {
	color: var(--kp-sage);
}

.kp-card__description {
	font-size: 0.85rem;
	color: var(--kp-mid);
	line-height: 1.5;
	margin: 0;
	flex: 1;
}

.kp-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--kp-border);
}

.kp-card__price {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--kp-charcoal);
}

.kp-card__buy-btn {
	display: inline-flex;
	align-items: center;
	background-color: var(--kp-gold);
	color: var(--e-global-color-4fd12c0);
	font-size: 0.8rem;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: var(--kp-radius);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}

.kp-card__buy-btn:hover {
	background-color: #c49040;
	color: var(--e-global-color-4fd12c0);
}

/* ── Shop grid ─────────────────────────────────────────────────────────────── */

.kp-shop {
	display: grid;
	gap: 24px;
}

.kp-shop--cols-1 { grid-template-columns: 1fr; }
.kp-shop--cols-2 { grid-template-columns: repeat(2, 1fr); }
.kp-shop--cols-3 { grid-template-columns: repeat(3, 1fr); }
.kp-shop--cols-4 { grid-template-columns: repeat(4, 1fr); }

.kp-shop__empty {
	color: var(--kp-mid);
	font-style: italic;
	text-align: center;
	padding: 32px;
}

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

@media ( max-width: 1024px ) {
	.kp-shop--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 768px ) {
	.kp-shop--cols-3,
	.kp-shop--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 480px ) {
	.kp-shop--cols-2,
	.kp-shop--cols-3,
	.kp-shop--cols-4 { grid-template-columns: 1fr; }

	.kp-buy__button {
		width: 100%;
		justify-content: center;
	}

	.kp-card__footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.kp-card__buy-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ── Article product embed ─────────────────────────────────────────────────── */
/*
 * Colours reference Elementor global CSS variables with hex fallbacks.
 * Fallbacks ensure correct rendering inside the TinyMCE editor preview.
 */

.kp-article-product {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 32px 0;
}

.kp-article-product:first-of-type {
	margin-top: 56px !important;
}

.kp-article-product p {
	margin-bottom: 0 !important;
}

/* Label row */

.kp-article-product__label-row {
	display: flex;
	align-items: center;
	gap: 16px;
}

.kp-article-product__divider {
	flex: 1;
	height: 1px;
	background-color: var(--e-global-color-accent);
}

.kp-article-product__label {
	display: inline-block;
	background-color: var(--e-global-color-accent);
	color: var(--e-global-color-25f2e66);
	font-size: 0.85rem;
	font-weight: 500;
	text-transform: uppercase;
	line-height: 100%;
	padding: 12px 22px;
	border-radius: 9999px;
	white-space: nowrap;
	flex-shrink: 0;
	letter-spacing: 30%;
}

/* Hero image */

.kp-article-product__image-wrap {
	width: 100%;
	border-radius: 20px;
	overflow: hidden;
	line-height: 0;
	position: relative;
	padding: 48px;
}

.kp-article-product__image-wrap::after {
	position: absolute;
    content: '';
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--e-global-color-accent);
    opacity: .03;
    pointer-events: none;
}

.kp-article-product__image {
	width: 100%;
	height: 470px;
	object-fit: cover;
	display: block;
	border-radius: 20px;
	margin: 0 !important;
}

/* White background: contain image within padded area, keep tint overlay */
.kp-article-product--white-bg .kp-article-product__image {
	object-fit: contain;
}

/* Solid background: fill the wrap edge-to-edge, remove padding and tint */
.kp-article-product--solid-bg .kp-article-product__image-wrap {
	padding: 0;
}

.kp-article-product--solid-bg .kp-article-product__image-wrap::after {
	display: none;
}

@media (max-width: 767px) {
	.kp-article-product__image-wrap {
		padding: 24px;
	}
	
	.kp-article-product__image {
		height: 300px !important;
	}
}

/* Title + subtitle */

.kp-article-product__meta {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.kp-article-product__title {
	font-size: 1.5rem !important;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.03em;
	color: var(--e-global-color-primary) !important;
	margin: 0;
}

.kp-article-product__subtitle {
	font-size: 1.1rem;
	font-weight: 400;
	color: var(--e-global-color-f9f9839);
	margin: 0;
	line-height: 1.3;
}

/* Buy section */

.kp-article-product__buy {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.kp-article-product__buy-heading {
	font-size: 1.2rem;
	font-weight: 500;
	color: var(--e-global-color-primary);
	letter-spacing: -0.1em;
	margin: 0;
}

.kp-article-product__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.kp-article-product__supermarkets {
	font-size: 1rem;
	color: var(--e-global-color-text);
	padding-left: 8px;
}

.kp-article-product .elementor-button {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
}

.kp-article-product .elementor-button:hover {
	filter: brightness(0.9);
}

.kp-article-product__ext-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.kp-article-product__disclosure {
	font-size: 0.75rem;
	color: var(--kp-mid);
	margin: 0;
	line-height: 1.5;
}

/* Responsive */

@media ( max-width: 600px ) {
	.kp-article-product__image {
		height: 260px;
	}

	.kp-article-product__title {
		font-size: 1.25rem;
	}

	.kp-article-product .elementor-button {
		width: 100%;
		justify-content: center !important;
	}
}

/* ── Top Pick shortcode ─────────────────────────────────────────────────────── */

.kp-top-pick {
	display: flex;
	flex-direction: column;
	gap: 56px;
	margin: 32px 0;
}

.kp-top-pick:first-of-type {
	margin-top: 56px !important;
}

.kp-top-pick p {
	margin-bottom: 0 !important;
}

.kp-top-pick img {
	margin: 0;
}

/* Card */

.kp-top-pick__card {
	background: var(--secondary);
	border-radius: 20px;
	padding: 28px 24px 36px;
	display: flex;
	flex-direction: column;
	gap: 28px;
	background-color: var(--e-global-color-secondary);
	border-radius: 20px;
}

/* Header */

.kp-top-pick__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.kp-top-pick__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--e-global-color-f9f9839);
	text-transform: uppercase;
	font-size: 16px;
	letter-spacing: 30%;
	font-weight: 500;
}

.kp-top-pick__badge-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.kp-top-pick__logo {
	width: 40px;
	flex-shrink: 0;
}

/* Image */

.kp-top-pick__image-wrap,
.kp-top-pick__info {
	text-decoration: none;
	color: inherit;
}

.kp-top-pick__image-wrap {
	width: 100%;
	line-height: 0;
}

.kp-top-pick__image {
	width: 100%;
	height: 470px;
	object-fit: cover;
	display: block;
	border-radius: 20px;
	border: 5px solid var(--e-global-color-cf64f6c) !important;
	box-shadow: 0 4px 24px rgba(207, 154, 65, 0.5) !important;
	margin: 0 !important;
	max-height: 470px;
}

/* Info */

.kp-top-pick__info {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 8px;
}

.kp-top-pick__title {
	margin: 0;
}

.kp-top-pick__description {
	margin: 0;
	color: var(--e-global-color-text);
	font-weight: 400;
}

/* Tags */

.kp-top-pick__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 8px;
}

.kp-top-pick__tag {
	background-color: rgba(72, 111, 72, 0.1);
	color: var(--e-global-color-accent);
	padding: 8px 12px;
	border-radius: 9999px;
	white-space: nowrap;
	line-height: 100%;
	font-size: 14px;
}

/* Buy section */

.kp-top-pick__buy {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 8px;
}

.kp-top-pick__price-line {
	margin: 0;
	font-size: 15px !important;
}

.kp-top-pick__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.kp-top-pick .elementor-button {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
}

.kp-top-pick__ext-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

/* Footer */

.kp-top-pick__footer {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 8px;
}

.kp-top-pick__rule {
	border: none;
	border-top: 1px solid var(--e-global-color-cf64f6c);
	margin: 4px 0 !important;
}

.kp-top-pick__disclaimer {
	margin: 0;
	font-size: 13px;
	line-height: 160%;
	color: var(--e-global-color-text);
	opacity: 0.8;
}

/* Why We Recommend This */

.kp-top-pick__why {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.kp-top-pick__why-label {
	color: var(--e-global-color-f9f9839);
	text-transform: uppercase;
	margin: 0;
	letter-spacing: 30% !important;
	font-size: 16px;
	font-weight: 500;
}

.kp-top-pick__why-body p {
	margin: 0 0 1em;
	
}

.kp-top-pick__why-body p:last-child {
	margin-bottom: 0;
}

/* Responsive */

@media ( max-width: 600px ) {
	.kp-top-pick {
		gap: 32px;
	}

	.kp-top-pick__image {
		height: 260px;
	}

	.kp-top-pick .elementor-button {
		width: 100%;
		justify-content: center !important;
	}
	
	.kp-top-pick__info, .kp-top-pick__tags, .kp-top-pick__buy, .kp-top-pick__footer {
		padding: 0;
	}
}

/* ── Recipe Products shortcode ─────────────────────────────────────────────── */

.recipe-products {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.recipe-products p {
	margin-bottom: 0 !important;
}

.recipe-products__card {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 28px;
}

.recipe-products__card:not(:last-child){
	padding-bottom: 28px;
}

.recipe-products__image-wrap {
	flex-shrink: 0;
	width: 150px;
	height: 200px;
	border-radius: 20px;
	overflow: hidden;
	line-height: 0;
	display: block;
	text-decoration: none;
	border: 1px solid var( --e-global-color-58606c7 );
}

.recipe-products__image {
	width: 150px;
	height: 100% !important;
	object-fit: cover;
	display: block;
	border-radius: 20px;
	margin: 0 !important;
}

.recipe-products__content {
	display: flex;
	flex-direction: column;
	gap: 24px;
	flex: 1;
	min-width: 0;
}

.recipe-products__text {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.recipe-products__title a {
	font-size: 20px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	letter-spacing: -0.03em !important;
	color: var(--e-global-color-primary) !important;
	margin: 0 !important;
}

.recipe-products__title-link {
	text-decoration: none;
	color: inherit;
}

.recipe-products__description {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: -0.03em;
	color: var(--e-global-color-text);
	margin: 0;
}

.recipe-products__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.recipe-products .elementor-button {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
}

.recipe-products .elementor-button:hover {
	filter: brightness(0.9);
}

.recipe-products__ext-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

@media ( max-width: 600px ) {
	.recipe-products__card {
		flex-direction: column;
		align-items: flex-start;
	}

	.recipe-products__image-wrap,
	.recipe-products__image {
		width: 100%;
		height: 220px !important;
	}

	.recipe-products .elementor-button {
		width: 100%;
		justify-content: center !important;
	}
}

/* ── Product gallery ─────────────────────────────────────────────────────────── */

.kp-gallery {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Main slide image */
.keto-gallery__main .splide__track {
	border-radius: 20px;
	overflow: hidden;
}

.kp-gallery__img {
	width: 100%;
	display: block;
	padding: 0;
	position: relative;
	z-index: 1;
}

/* Square/landscape — fill the box */
.kp-gallery__img--cover {
	aspect-ratio: 1 / 1;
	max-height: 500px;
	object-fit: cover;
}

/* Slightly portrait — grow naturally to fit */
.kp-gallery__img--auto {
	height: auto;
	object-fit: contain;
	padding: 24px;
}

/* Very portrait — contain within a capped square */
.kp-gallery__img--contain {
	aspect-ratio: 1 / 1;
	max-height: 500px;
	object-fit: contain;
	padding: 24px;
}

/* Overlay background for fit slides via ::after so product white bg doesn't bleed */
.keto-gallery__slide--fit {
	position: relative;
}

.keto-gallery__slide--fit::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--e-global-color-accent);
	opacity: 0.05;
	z-index: 1;
	pointer-events: none;
}

.kp-gallery--solid-bg .kp-gallery__img {
	padding: 0;
}

.kp-gallery--single .kp-gallery__img {
	border-radius: var(--kp-radius-lg);
	background: var(--kp-cream);
}

/* Thumbnail strip */
.keto-gallery__thumbs .splide__slide {
	cursor: pointer;
	border-radius: 12px;
	overflow: hidden;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
	background: var(--kp-cream);
}

.keto-gallery__thumbs .splide__slide.is-active {
	border-color: var(--kp-sage);
}

.kp-gallery__thumb-img {
	width: 100%;
	height: 80px;
	object-fit: contain;
	display: block;
	padding: 6px;
}

.kp-gallery--solid-bg .kp-gallery__thumb-img {
	object-fit: cover;
	padding: 0;
}

@media (max-width: 767px) {
	.kp-gallery__img {
		padding: 20px;
	}

	.kp-gallery__img--cover,
	.kp-gallery__img--contain {
		max-height: 360px;
	}

	.kp-gallery__thumb-img {
		height: 64px;
	}
}

@media (max-width: 1024px) {
	/* Fade-out mask on the right to signal the strip is scrollable */
	.keto-gallery__thumbs {
		-webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
		        mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
	}
}


/* ── Brand link ── */
.kp-brand,
.kp-details__link {
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.kp-brand {
    letter-spacing: 3px;
    text-transform: uppercase;
}

.kp-brand:hover,
.kp-details__link:hover {
    opacity: 0.7;
    text-decoration: none;
}
