/* ==========================================================================
   Ketology Grid System — grid.css
   Structural layout only. Visual styling (colours, fonts, shadows) is
   intentionally left minimal so you can apply your design tokens freely.
   BEM: keto-grid, keto-slider-*, keto-card-*, keto-pill-*, keto-meta-*
   ========================================================================== */


/* ------------------------------------------------------------------
   Grid wrapper
   ------------------------------------------------------------------ */
.keto-grid {
    display: grid;
    width: 100%;
}


/* ------------------------------------------------------------------
   Slider wrapper
   ------------------------------------------------------------------ */
.keto-slider-wrap {
    position: relative;
    width: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.keto-slider-wrap.is-ready {
    opacity: 1;
}

.keto-slider .splide__track {
    overflow: visible;
}

.keto-slider-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.keto-nav-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--e-global-color-primary) !important;
    background: transparent !important;
    color: var(--e-global-color-primary) !important;
    cursor: pointer !important;
    transition: opacity 0.22s ease !important;
    padding: 0 !important;
}

.keto-nav-btn:hover {
    opacity: 0.5;
}

.keto-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}


/* ------------------------------------------------------------------
   Base card — shared across all variants
   ------------------------------------------------------------------ */
.keto-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--e-global-color-4fd12c0);
}

.keto-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}


/* ------------------------------------------------------------------
   Card: Standard
   Image top, content below
   ------------------------------------------------------------------ */
.keto-card--standard {
	border-radius: 0 !important;
}

.keto-card--standard .keto-card__image-wrap {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: none;
	border-radius: 20px;
	border: 1px solid var(--e-global-color-58606c7);
}

.keto-card--product .keto-card__image-wrap {
    border: none;
}

.keto-card--standard .keto-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.22s ease;
}

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


.keto-card--standard .keto-card__title a {
	font-weight: 500 !important;
}

.keto-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--e-global-color-58606c7);
}

.keto-card__body {
	padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.keto-card__category {
    font-size: 14px;
    font-weight: 500;
	line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--e-global-color-accent);
    margin: 0;
}

.keto-card__text-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.keto-card__title {
    margin: 0;
}

.keto-card__title a {
    text-decoration: none;
    color: inherit;
	font-size: 20px !important;
    font-weight: 400;
    line-height: 140%;
    letter-spacing: -0.03em;
    margin: 0;
    color: var(--e-global-color-primary) !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.keto-card__title a:hover {
    color: var(--e-global-color-accent);
}

.keto-card__excerpt {
    font-size: 16px;
    line-height: 160%;
    letter-spacing: -0.02em;
    color: var(--e-global-color-text);
    opacity: 0.8;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.keto-card--standard.keto-card--product .keto-card__excerpt {
    -webkit-line-clamp: 2;
}

.keto-card--white-bg .keto-card__image-wrap {
    padding: 24px;
}

.keto-card--white-bg .keto-card__image {
    object-fit: contain;
}

.keto-card--white-bg .keto-card__image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--e-global-color-accent);
    opacity: 0.05;
    pointer-events: none;
    border-radius: inherit;
}

.keto-card--solid-bg .keto-card__image {
    object-fit: cover;
}

/* ------------------------------------------------------------------
   Card: Top Pick product variant
   ------------------------------------------------------------------ */
.keto-card--top-pick {
    overflow: visible;
}

.keto-card--top-pick .keto-card__image-wrap {
    height: 302px;
    border: 5px solid var(--e-global-color-cf64f6c);
    box-shadow: 0px 4px 24px 0px rgba(207, 154, 65, 0.5);
}

.keto-card__top-pick-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(106, 106, 106, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    color: var(--e-global-color-4fd12c0);
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.04em;
    white-space: nowrap;
    pointer-events: none;
}

.keto-card--top-pick .keto-card__body {
    gap: 24px;
}

.keto-card__top-pick-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.keto-card__divider {
    border: none;
    border-top: 1px solid var(--e-global-color-58606c7);
    margin: 0;
    width: 100%;
}

.keto-card__top-pick-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding-left: 8px;
}

.keto-card--top-pick .keto-card__price {
    font-size: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.keto-card__top-pick-footer .elementor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    text-decoration: none;
    white-space: nowrap;
}

/* Green credential pills — used on top pick cards */
.keto-pill--green {
    padding: 8px 12px;
    background: rgba(72, 111, 72, 0.10);
    color: var(--e-global-color-accent);
    font-size: 14px;
}

.keto-card__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin: 0;
    flex-wrap: wrap;
}

.keto-card__author {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    letter-spacing: -0.04em !important;
    color: var(--e-global-color-text) !important;
    text-decoration: none !important;
    font-weight: inherit !important;
    transition: opacity 0.3s ease;
}

.keto-card__author:hover {
    opacity: 0.7;
    text-decoration: none !important;
}

.keto-card__author .span-reading-time {
    display: none;
}

.span-reading-time {
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: -0.04em;
    color: var(--e-global-color-text);
}

.keto-card__avatar {
    width: 20px;
    height: 20px;
    border-radius: 100% !important;
    object-fit: cover;
}

.keto-card__price {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--e-global-color-text);
    margin: 0;
}

.keto-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: var(--e-global-color-cf64f6c);
    color: var(--e-global-color-4fd12c0);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.22s ease;
}

.keto-card__cta:hover {
    opacity: 0.88;
}

/* Featured product — gold border */
.keto-card--featured {
    border: 2px solid var(--e-global-color-cf64f6c);
}

/* Credential pills row */
.keto-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 10px;
}


/* ------------------------------------------------------------------
   Card: Overlay
   Full-bleed image, text on top
   ------------------------------------------------------------------ */
.keto-card--overlay {
    background: var(--e-global-color-primary);
    height: 480px;
    width: 100%;
}

.keto-card__overlay-inner {
    display: block;
    position: relative;
    height: 100%;
    width: 100%;
    color: var(--e-global-color-4fd12c0);
    overflow: hidden;
    border-radius: 16px;
    isolation: isolate;
}

/* Full-card link — absolutely covers the card, sits above bg/gradient */
.keto-card__overlay-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 16px;
}

.keto-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .45s cubic-bezier(.15,.75,.5,1) 0s;
}

.keto-card--overlay:hover .keto-card__bg {
    transform: scale(1.1);
}

.keto-card__bg--empty {
    background: var(--e-global-color-58606c7);
}

.keto-card__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.08) 0%,
        rgba(0,0,0,0.2) 40%,
        rgba(0,0,0,0.85) 100%
    );
    pointer-events: none;
}

.keto-card__arrow-icon {
    width: 24px;
    position: absolute;
    top: 36px;
    right: 36px;
    color: var(--e-global-color-4fd12c0);
    opacity: 0.75;
    transition: opacity 0.22s ease, transform .45s cubic-bezier(.15,.75,.5,1) 0s;
    pointer-events: none;
}

.keto-card--overlay:hover .keto-card__arrow-icon {
    opacity: 1;
    transform: rotate(45deg);
}

.keto-card__overlay-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px 20px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
}

/* Recipe variant — no gap between meta and title */
.keto-card--overlay-recipe .keto-card__overlay-body {
    gap: 0;
}

/* ── Hero / article CTA variant ────────────────────────────────────────────── */

/* Taller card, flex layout so top/bottom bars sit at edges */
.keto-card--overlay-article {
    height: 520px;
}

.keto-card--overlay-article .keto-card__overlay-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    isolation: isolate;   /* own stacking context — keeps z-index scoped */
}

/* Definitively layer bg/gradient below all content in hero variant */
.keto-card--overlay-article .keto-card__bg,
.keto-card--overlay-article .keto-card__gradient {
    z-index: 0;
}

/* Dual gradient: dark top + dark bottom, clear in the middle */
.keto-card--overlay-article .keto-card__gradient {
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.75) 0%,
        rgba(0,0,0,0)    26%,
        rgba(0,0,0,0)    42%,
        rgba(0,0,0,0.75) 100%
    );
}

/* Top bar: pill + optional meta, both left-aligned */
.keto-card__overlay-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Badge is an in-flow flex item in the top bar, not absolutely positioned */
.keto-card__overlay-top .keto-badge {
    position: static;
    top: auto;
    left: auto;
    pointer-events: auto;
}

/* Author meta: avatar + name + read time */
.keto-card__overlay-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--e-global-color-25f2e66);
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.keto-card__overlay-avatar {
    width: 36px;
    height: 36px;
    border-radius: 100% !important;
    object-fit: cover;
    flex-shrink: 0;
}

.keto-card__overlay-author-name {
    color: var(--e-global-color-25f2e66);
	font-weight: 400 !important;
}

.keto-card__overlay-meta .span-reading-time {
    color: var(--e-global-color-25f2e66);
    display: inline;
	margin-left: 8px;
	font-weight: 400 !important;
}

.keto-card__overlay-meta .rt-label,
.keto-card__overlay-meta .rt-time {
    color: var(--e-global-color-25f2e66);
}

/* Bottom bar: title + excerpt left, CTA button right */
.keto-card--overlay-article .keto-card__overlay-footer {
    pointer-events: none;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Button must be explicitly interactive since parent has pointer-events: none */
.keto-card--overlay-article .keto-card__overlay-footer .elementor-button {
    pointer-events: auto;
}

/* Hero headline */
.keto-card--overlay-article .keto-card__title--overlay {
    font-weight: 400 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.03em !important;
    -webkit-line-clamp: 2;
}

/* Subheadline excerpt */
.keto-card--overlay-article .keto-card__overlay-excerpt {
    -webkit-line-clamp: 2;
    margin: 12px 0 0;
}

/* Ghost CTA button — Elementor hover override */
.keto-card--overlay-article .keto-card__overlay-footer-row .elementor-button:hover {
    background: transparent !important;
    background-color: transparent !important;
}

/* Responsive */
@media (max-width: 768px) {
    .keto-card--overlay-article {
        height: auto;
        min-height: 480px;
    }

    .keto-card--overlay-article .keto-card__overlay-footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .keto-card--overlay-article .keto-card__title--overlay {
        font-size: 26px !important;
    }

    .keto-card__overlay-meta {
        display: none;
    }
}

.keto-card__title--overlay {
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 140% !important;
    letter-spacing: -1.12px !important;
    color: white !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: transform .45s cubic-bezier(.15,.75,.5,1) 0s;
}

.keto-card__overlay-excerpt {
    font-size: 16px;
    font-weight: 400;
    line-height: 160%;
    color: rgba(255,255,255,0.8);
    margin: 8px 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.keto-card__overlay-footer {
    display: flex;
}

.keto-card__overlay-footer-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.keto-card__overlay-text {
    flex: 1;
    min-width: 0;
}


/* ------------------------------------------------------------------
   Card: Row
   Horizontal list item — thumbnail + frosted pill + title + arrow
   Used by [ketology_product_mentions]
   ------------------------------------------------------------------ */

.keto-card--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--e-global-color-e6ca2f8, #f2f6f6);
    border-radius: 20px;
    overflow: hidden;
    padding-right: 24px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.keto-card--row:hover {
    opacity: 0.85;
}

.keto-card__row-thumb {
    position: relative;
    flex-shrink: 0;
    width: 164px;
    align-self: stretch;
    padding: 28px 36px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.keto-card__row-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.keto-card__row-pill {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9999px;
    background: rgba(106, 106, 106, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: auto;
}

.keto-card__row-pill svg {
    flex-shrink: 0;
}

.keto-card__row-pill span {
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #FAF8F5;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

/* Title + arrow — row on all sizes, body wrapper handles padding */
.keto-card__row-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.keto-card__row-title {
    flex: 1;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    color: var(--e-global-color-primary, #171f17);
}

.keto-card__row-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--e-global-color-primary, #171f17);
    transition: transform 0.2s ease;
}

.keto-card--row:hover .keto-card__row-arrow {
    transform: rotate(45deg);
}

/* Mobile: column layout — full-width image on top, title+arrow row below */
@media ( max-width: 768px ) {
    .keto-card--row {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-right: 0;
    }

    .keto-card__row-thumb {
        width: 100%;
        height: 100px;
        align-self: auto;
        padding: 12px 16px;
    }

    .keto-card__row-body {
        padding: 14px 16px;
    }

    .keto-card__row-title {
        font-size: 17px;
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        text-overflow: unset;
    }

    .keto-card__row-arrow {
        width: 40px;
        height: 40px;
    }
}

/* ------------------------------------------------------------------
   Pill — shared component
   ------------------------------------------------------------------ */
.keto-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

/* On image — frosted glass (standard overlay cards) */
.keto-pill--on-image {
    position: absolute;
    top: 24px;
    left: 24px;
    padding: 14px 20px;
    background: rgba(132,132,132,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--e-global-color-4fd12c0);
}

/* Badge — overlay card top bar */
.keto-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1;
    white-space: nowrap;
    position: absolute;
    top: 24px;
    left: 24px;
    padding: 14px 20px;
    background: rgba(132,132,132,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--e-global-color-4fd12c0) !important;
    text-decoration: none !important;
    z-index: 2;
    transition: opacity 0.3s ease;
}
.keto-badge:hover {
    opacity: 0.85;
    text-decoration: none !important;
}

/* On row card thumbnail */
.keto-pill--row {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 3px 7px;
    background: rgba(0,0,0,0.45);
    color: var(--e-global-color-4fd12c0);
    font-size: 10px;
}

/* Credential tag pill (product card) */
.keto-pill--tag {
    padding: 4px 10px;
    background: var(--e-global-color-25f2e66);
    color: var(--e-global-color-primary);
    border: 1px solid var(--e-global-color-58606c7);
    font-size: 11px;
}


/* ------------------------------------------------------------------
   Recipe / article meta row
   ------------------------------------------------------------------ */
.keto-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 8px;
}

.keto-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 400;
    color: var(--e-global-color-text);
	height: 16px;
}

.keto-meta-item--light {
    color: rgba(255,255,255,0.85);
}

.keto-meta-icon {
    margin-top: -2px;
    margin-right: 2px;
}

.keto-meta-item--light .keto-meta-icon {
    filter: brightness(0) invert(1);
}

.keto-card__meta--overlay {
    margin-bottom: 6px;
}

.keto-card__meta--standard {
    gap: 16px;
    margin: 0;
}

.keto-card__meta--standard .keto-meta-icon {
    filter: brightness(0);
}


/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .keto-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .keto-card__title {
        font-size: 15px;
    }

    .keto-card__overlay-footer-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .keto-card__overlay-text,
    .keto-card__overlay-text .keto-card__title--overlay,
    .keto-card__overlay-text .keto-card__overlay-excerpt {
        width: 100% !important;
        max-width: 100% !important;
    }

    .keto-card--overlay-article .elementor-button {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ------------------------------------------------------------------
   Drag cursor
   ------------------------------------------------------------------ */
.keto-drag-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 100%;
    color: var(--e-global-color-primary) !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    will-change: transform;
}

.keto-drag-cursor.is-visible {
    opacity: 1;
}

@media (max-width: 768px) {
    .keto-drag-cursor {
        display: none;
    }
}


/* ------------------------------------------------------------------
   Filtered Loop — [ketology_filtered_loop]
   ------------------------------------------------------------------ */

.keto-filtered {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
}

/* ── Filter bar (tabs + search) ── */

.keto-filtered__bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 1px solid var(--e-global-color-58606c7);
    gap: 24px;
    position: relative;
}

/* Non-scrolling wrapper — clips the track and hosts the fade overlay */
.keto-filtered__tabs-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.keto-filtered__tabs-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Scrollable inner track */
.keto-filtered__tabs-track {
    overflow-x: auto;
    scrollbar-width: none;
}

.keto-filtered__tabs-track::-webkit-scrollbar {
    display: none;
}

/* Prev / next nav buttons */
.keto-filtered__tabs-nav {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
}

.keto-filtered__nav-btn {
	margin-top: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 9999px !important;
/*     border: 2px solid var(--e-global-color-primary) !important; */
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer;
    color: var(--e-global-color-primary) !important;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    line-height: 1;
}

.keto-filtered__nav-btn:hover:not(:disabled) {
    background: none !important;
    opacity: 0.75;
}

.keto-filtered__nav-btn:disabled {
    border-color: transparent !important;
    opacity: 0.5;
    cursor: default;
}

.keto-filtered__tabs {
    display: flex;
    align-items: flex-end;
    width: max-content;
    padding-right: 10%;
}

/* Search toggle button — hidden on desktop, shown on mobile */
.keto-filtered__search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer;
    color: var(--e-global-color-text) !important; 
    opacity: 0.5;
    flex-shrink: 0;
    line-height: 1;
}

/* Close button — hidden by default, shown on mobile when search is open */
.keto-filtered__search-close {
    display: none;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer;
    color: var(--e-global-color-text) !important;
    opacity: 0.6;
    flex-shrink: 0;
    line-height: 1;
}

.keto-filtered__tab {
    padding: 16px 20px 20px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: -1px;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
    color: var(--e-global-color-primary) !important;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.keto-filtered__tab--active {
    border-bottom-color: var(--e-global-color-primary) !important;
    font-weight: 500 !important;
}

.keto-filtered__tab:hover:not(.keto-filtered__tab--active) {
    opacity: 0.6;
    background: none !important;
    background-color: transparent !important;
}

.keto-filtered__search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
/*     padding-bottom: 16px; */
    flex-shrink: 0;
	height: 54px;
}

.keto-filtered__search-icon {
    color: var(--e-global-color-text);
    opacity: 0.5;
    flex-shrink: 0;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.keto-filtered__search-wrap:focus-within .keto-filtered__search-icon {
    color: var(--e-global-color-primary) !important;
    opacity: 1;
}

.keto-filtered__search {
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    color: var(--e-global-color-primary) !important;
    width: 140px;
    transition: width 0.25s ease;
    -webkit-appearance: none;
}

.keto-filtered__search-wrap:focus-within .keto-filtered__search {
    width: 220px;
}

.keto-filtered__search::placeholder {
    color: var(--e-global-color-text);
    opacity: 0.5;
}

.keto-filtered__search:focus {
    background: none !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: var(--e-global-color-primary) !important;
}

.keto-filtered__search::-webkit-search-cancel-button {
    display: none;
}

/* ── Results count row ── */

.keto-filtered__count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: -20px;
}

.keto-filtered__count {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--e-global-color-accent);
    text-align: left;
    margin: 0;
}

.keto-filtered__pagination-top {
    flex-shrink: 0;
}

/* ── Grid ── */

.keto-filtered__grid {
    display: grid;
    width: 100%;
}

/* Loading state — fade grid, block interaction */
.keto-filtered--loading .keto-filtered__grid {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Empty state */
.keto-filtered__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 0;
    color: var(--e-global-color-text);
    opacity: 0.6;
    font-size: 16px;
}

/* ── Pagination ── */

.keto-filtered__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 36px;
}

.keto-filtered__page-btn {
    display: inline-block;
    text-decoration: none !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 6px 10px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
    color: var(--e-global-color-text) !important;
    transition: background 0.15s ease !important;
    min-width: 32px;
    text-align: center;
}

.keto-filtered__page-btn:hover:not([aria-disabled="true"]):not(.keto-filtered__page-btn--active) {
    background: var(--e-global-color-0cdc541) !important;
    background-color: var(--e-global-color-0cdc541) !important;
    color: var(--e-global-color-text) !important;
}

.keto-filtered__page-btn--active {
    font-weight: 600 !important;
    color: var(--e-global-color-accent) !important;
    cursor: default;
}

.keto-filtered__page-btn[aria-disabled="true"] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.keto-filtered__page-prev,
.keto-filtered__page-next {
    font-weight: 400 !important;
    padding: 6px 14px !important;
}

.keto-filtered__page-ellipsis {
    font-size: 14px;
    color: var(--e-global-color-text);
    padding: 6px 4px;
    line-height: 1.6;
    user-select: none;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
    .keto-filtered__grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .keto-filtered__grid {
        grid-template-columns: 1fr !important;
    }

    .keto-filtered__tab {
        font-size: 16px;
        padding: 12px 14px 16px;
    }

    .keto-filtered__tabs-nav {
        display: none;
    }

    /* Collapse search to icon button */
    .keto-filtered__search-icon,
    .keto-filtered__search {
        display: none !important;
    }

    .keto-filtered__search-toggle {
        display: flex;
    }
	
	.keto-filtered__search-wrap {
		width: 36px;
		padding-bottom: 4px;
	}

    /* Expanded search state — toggled via JS adding .search-open to the bar */
    .keto-filtered__bar.search-open .keto-filtered__tabs-wrap {
        display: none;
    }

    @keyframes keto-search-open {
        from { opacity: 0; transform: translateX(8px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    .keto-filtered__bar.search-open .keto-filtered__search-wrap {
        flex: 1;
        animation: keto-search-open 0.2s ease forwards;
    }

    .keto-filtered__bar.search-open .keto-filtered__search-icon {
        display: flex !important;
    }

    .keto-filtered__bar.search-open .keto-filtered__search {
        display: block !important;
        flex: 1;
        width: 100% !important;
        font-size: 16px;
    }

    .keto-filtered__bar.search-open .keto-filtered__search-toggle {
        display: none;
    }

    .keto-filtered__bar.search-open .keto-filtered__search-close {
        display: flex;
    }
}