/* EQO product components — Elementor/shortcode friendly, mobile-first. */
.eqo-product-page {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.eqo-product-page *,
.eqo-product-page *::before,
.eqo-product-page *::after {
    box-sizing: border-box;
}

/* Built-in fallback when the Elementor template has not been designed yet. */
.eqo-product-fallback-layout {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 14px 12px 42px;
}

.eqo-product-fallback-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.eqo-product-fallback-media,
.eqo-product-fallback-summary {
    min-width: 0;
}

.eqo-product-image {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 18px;
    background: #f5f6f3;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eqo-product-image-element {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eqo-product-image-placeholder {
    font-size: clamp(56px, 20vw, 110px);
    font-weight: 700;
    color: rgba(29, 67, 44, .28);
    background: linear-gradient(145deg, #eef5ee, #f8f5ea);
}

.eqo-product-brand {
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
    letter-spacing: .075em;
    text-transform: uppercase;
    color: #577060;
}

.eqo-product-name {
    margin: 0 0 12px;
    font-size: clamp(28px, 8.6vw, 44px);
    line-height: 1.05;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.eqo-product-info {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #5b625c;
}

.eqo-product-info a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.eqo-product-page .eqo-highlights,
.eqo-product-page .eqo-badges {
    margin-top: 10px;
}

.eqo-product-page .eqo-nutrition {
    width: 100%;
    max-width: 100%;
    margin: 24px 0 0;
    border-radius: 16px;
}

.eqo-product-section {
    width: 100%;
    margin-top: 18px;
    padding: 18px 16px;
    border: 1px solid rgba(30, 50, 37, .11);
    border-radius: 16px;
    background: #fff;
}

.eqo-product-section h2 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.2;
}

.eqo-product-prose,
.eqo-product-prose p {
    font-size: 15px;
    line-height: 1.62;
    overflow-wrap: anywhere;
}

.eqo-product-prose p:last-child {
    margin-bottom: 0;
}

.eqo-related-rankings ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.eqo-related-rankings li {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: #f7f8f5;
}

.eqo-related-rankings a {
    min-width: 0;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.eqo-related-ranking-badge {
    width: fit-content;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.25;
}

.eqo-similar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.eqo-similar-card {
    display: block;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(30, 50, 37, .1);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    background: #fff;
}

.eqo-similar-image {
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: #f4f5f2;
}

.eqo-similar-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eqo-similar-placeholder {
    font-size: 34px;
    font-weight: 700;
    color: rgba(29, 67, 44, .3);
}

.eqo-similar-name {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Mobile touch behaviour. */
.eqo-product-page a,
.eqo-product-page button {
    -webkit-tap-highlight-color: rgba(37, 103, 58, .12);
}

@media (min-width: 600px) {
    .eqo-product-fallback-layout {
        padding: 20px 18px 54px;
    }

    .eqo-product-section {
        padding: 22px 20px;
    }

    .eqo-related-rankings li {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .eqo-similar-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (min-width: 782px) {
    .eqo-product-fallback-layout {
        padding: 32px 24px 72px;
    }

    .eqo-product-fallback-hero {
        grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
        align-items: center;
        gap: clamp(28px, 5vw, 64px);
        margin-bottom: 34px;
    }

    .eqo-product-name {
        font-size: clamp(38px, 4vw, 58px);
    }
}

/* EQO mobile product chrome — v0.4.2. Inspired by the supplied floating-nav concept. */
.eqo-mobile-product-ui {
    --eqo-mobile-nav-bottom: 12px;
    --eqo-mobile-auth-top: max(7px, env(safe-area-inset-top));
}

.eqo-mobile-auth-cta,
.eqo-mobile-bottom-nav {
    display: none;
}

@media (max-width: 767px) {
    html {
        scroll-behavior: smooth;
    }

    body.eqo-virtual-product-page,
    body.eqo-product-mobile-ui-active {
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }

    .eqo-product-page,
    .eqo-product-page .eqo-badges,
    .eqo-product-page .eqo-nutrition,
    .eqo-product-page .eqo-product-info,
    .eqo-product-page .eqo-product-section {
        scroll-margin-top: 72px;
    }

    .eqo-mobile-auth-cta {
        position: absolute;
        top: var(--eqo-mobile-auth-top);
        left: 50%;
        z-index: 99991;
        display: inline-flex;
        min-height: 34px;
        max-width: min(58vw, 210px);
        padding: 0 13px;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transform: translateX(-50%);
        border: 1px solid rgba(255, 255, 255, .38);
        border-radius: 999px;
        background: linear-gradient(135deg, #246b45 0%, #34835a 100%);
        box-shadow: 0 5px 16px rgba(23, 73, 48, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
        color: #fff;
        font-size: 12px;
        line-height: 1;
        font-weight: 750;
        letter-spacing: .01em;
        text-decoration: none;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }

    .eqo-mobile-auth-cta:active {
        transform: translateX(-50%) scale(.97);
    }

    .eqo-mobile-auth-icon {
        display: inline-flex;
        width: 15px;
        height: 15px;
        flex: 0 0 15px;
    }

    .eqo-mobile-auth-icon svg,
    .eqo-mobile-nav-icon svg {
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .eqo-mobile-bottom-nav {
        position: fixed;
        right: auto;
        bottom: calc(var(--eqo-mobile-nav-bottom) + env(safe-area-inset-bottom));
        left: 50%;
        z-index: 99990;
        display: block;
        max-width: calc(100vw - 22px);
        transform: translateX(-50%);
        pointer-events: none;
    }

    .eqo-mobile-bottom-nav-inner {
        display: flex;
        min-height: 54px;
        max-width: 100%;
        padding: 7px;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: 1px solid rgba(39, 53, 45, .11);
        border-radius: 999px;
        background: rgba(255, 255, 255, .90);
        box-shadow: 0 14px 38px rgba(22, 37, 28, .18), 0 2px 8px rgba(22, 37, 28, .08);
        backdrop-filter: blur(18px) saturate(1.15);
        -webkit-backdrop-filter: blur(18px) saturate(1.15);
        pointer-events: auto;
    }

    .eqo-mobile-nav-item {
        appearance: none;
        display: inline-flex;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: #66706a;
        font: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .eqo-mobile-nav-item[hidden] {
        display: none !important;
    }

    .eqo-mobile-nav-pill {
        display: inline-flex;
        width: 40px;
        height: 40px;
        padding: 0;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border-radius: 999px;
        transition: width .22s ease, padding .22s ease, background-color .22s ease, color .22s ease, box-shadow .22s ease;
    }

    .eqo-mobile-nav-icon {
        display: inline-flex;
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }

    .eqo-mobile-nav-label {
        display: block;
        width: 0;
        overflow: hidden;
        opacity: 0;
        font-size: 10px;
        line-height: 1;
        font-weight: 800;
        white-space: nowrap;
        transition: width .22s ease, opacity .18s ease;
    }

    .eqo-mobile-nav-item.is-active .eqo-mobile-nav-pill {
        width: auto;
        min-width: 40px;
        padding: 0 12px;
        color: #fff;
        box-shadow: 0 5px 13px rgba(31, 45, 37, .16);
    }

    .eqo-mobile-nav-item.is-active .eqo-mobile-nav-label {
        width: auto;
        opacity: 1;
    }

    .eqo-mobile-nav-green.is-active .eqo-mobile-nav-pill { background: #3e8a5b; }
    .eqo-mobile-nav-amber.is-active .eqo-mobile-nav-pill { background: #d89a25; }
    .eqo-mobile-nav-rose.is-active .eqo-mobile-nav-pill { background: #d65f69; }
    .eqo-mobile-nav-slate.is-active .eqo-mobile-nav-pill { background: #596873; }

    .eqo-mobile-nav-item:focus-visible .eqo-mobile-nav-pill,
    .eqo-mobile-auth-cta:focus-visible {
        outline: 3px solid rgba(43, 113, 74, .28);
        outline-offset: 2px;
    }
}

@media (max-width: 370px) {
    .eqo-mobile-bottom-nav-inner {
        gap: 1px;
        padding-inline: 5px;
    }

    .eqo-mobile-nav-pill {
        width: 38px;
        height: 38px;
    }

    .eqo-mobile-nav-item.is-active .eqo-mobile-nav-pill {
        padding-inline: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .eqo-mobile-nav-pill,
    .eqo-mobile-nav-label,
    .eqo-mobile-auth-cta {
        transition: none;
    }
}

/* Premium editorial layer + expanded mobile navigation — v0.5.0 */
.eqo-premium-section {
    overflow-wrap: anywhere;
}

.eqo-premium-intro {
    padding: 14px 16px;
    border-left: 3px solid rgba(47, 120, 76, .45);
    background: rgba(244, 249, 245, .92);
}

.eqo-premium-intro .eqo-product-prose > :first-child,
.eqo-premium-section .eqo-product-prose > :first-child {
    margin-top: 0;
}

.eqo-premium-intro .eqo-product-prose > :last-child,
.eqo-premium-section .eqo-product-prose > :last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .eqo-mobile-bottom-nav {
        width: calc(100vw - 18px);
        max-width: 430px;
    }

    .eqo-mobile-bottom-nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x proximity;
    }

    .eqo-mobile-bottom-nav-inner::-webkit-scrollbar {
        display: none;
    }

    .eqo-mobile-nav-item {
        flex: 0 0 auto;
        scroll-snap-align: center;
    }

    .eqo-mobile-nav-pill {
        width: 40px;
        height: 40px;
    }

    .eqo-mobile-nav-item.is-active .eqo-mobile-nav-pill {
        max-width: 128px;
    }

    .eqo-mobile-nav-label {
        max-width: 84px;
        text-overflow: ellipsis;
    }

    .eqo-mobile-nav-violet.is-active .eqo-mobile-nav-pill { background: #7654a8; }
    .eqo-mobile-nav-blue.is-active .eqo-mobile-nav-pill { background: #3677a8; }
    .eqo-mobile-nav-teal.is-active .eqo-mobile-nav-pill { background: #2f8279; }
    .eqo-mobile-nav-orange.is-active .eqo-mobile-nav-pill { background: #c97c2f; }

    .eqo-mobile-nav-green[data-eqo-nav="plus"] .eqo-mobile-nav-pill {
        border: 1px solid rgba(62, 138, 91, .24);
        color: #2f7a4d;
        background: rgba(235, 247, 239, .96);
    }

    .eqo-mobile-nav-green[data-eqo-nav="plus"]:active .eqo-mobile-nav-pill {
        transform: scale(.96);
    }
}


/* AI element iframe — v0.5.1 */
.eqo-ai-iframe-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.eqo-ai-iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 120px;
    border: 0;
    background: transparent;
}

/* Product template refinements + isolated custom blocks — v0.5.2 */
.eqo-product-name,
.eqo-product-page h1 {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* The theme wrapper is affected only when product.css is loaded (EQO product/preview). */
#content {
    margin-top: 20px;
}

.eqo-code-iframe-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.eqo-code-iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 120px;
    border: 0;
    background: transparent;
}

.eqo-ai-section,
.eqo-premium-code-block {
    overflow: hidden;
}


/* Mobile navigation refinements — v0.5.3 */
@media (max-width: 767px) {
    .eqo-mobile-nav-item[data-eqo-nav="plus"] {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    .eqo-mobile-nav-item[data-eqo-nav="plus"] .eqo-mobile-nav-pill,
    .eqo-mobile-nav-item[data-eqo-nav="plus"].is-active .eqo-mobile-nav-pill {
        box-sizing: border-box;
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        height: 40px;
        padding: 0;
        flex: 0 0 40px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
    }

    .eqo-mobile-nav-item[data-eqo-nav="plus"] .eqo-mobile-nav-label {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        opacity: 0 !important;
    }

    .eqo-mobile-nav-item[data-eqo-nav="plus"] .eqo-mobile-nav-icon {
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
        margin: 0;
    }
}


/* Mobile layout tweak — v0.5.4 */
@media (max-width: 767px) {
    /* Compact auth CTA positioned in the free center-right area of the mobile header. */
    .eqo-mobile-auth-cta {
        top: calc(var(--eqo-mobile-auth-top) + 20px);
        left: 70%;
        background: #95c22b;
        box-shadow: 0 5px 16px rgba(104, 143, 24, .24), inset 0 1px 0 rgba(255, 255, 255, .22);
    }

    .eqo-mobile-auth-cta:active {
        transform: translateX(-50%) scale(.97);
    }

    /* Shrink the floating capsule to its visible buttons; keep scrolling only when needed. */
    .eqo-mobile-bottom-nav {
        width: max-content;
        max-width: calc(100vw - 18px);
    }

    .eqo-mobile-bottom-nav-inner {
        box-sizing: border-box;
        width: max-content;
        max-width: calc(100vw - 18px);
        justify-content: flex-start;
    }
}

/* Desktop theme sidebar integration — v0.6.0 */
.eqo-product-desktop-layout {
    width: 100%;
    min-width: 0;
}
.eqo-product-main-column {
    min-width: 0;
}
.eqo-product-theme-sidebar {
    display: none;
}
@media (min-width: 1024px) {
    .eqo-product-desktop-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
        gap: clamp(24px, 3vw, 42px);
        width: min(100% - 32px, 1240px);
        margin-inline: auto;
        align-items: start;
    }
    .eqo-product-desktop-layout.has-no-sidebar {
        display: block;
        width: 100%;
    }
    .eqo-product-theme-sidebar {
        display: block;
        min-width: 0;
        padding-top: 10px;
    }
    .eqo-product-desktop-layout .eqo-product-page,
    .eqo-product-desktop-layout #primary,
    .eqo-product-theme-sidebar #secondary,
    .eqo-product-theme-sidebar .widget-area {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Sidebar hardening — v0.6.1
 * Critical positioning also lives in templates/product.php so theme float/layout rules
 * cannot push the sidebar below the product content. These rules are kept here as the
 * normal stylesheet equivalent. */
.eqo-product-theme-sidebar {
    display: none !important;
}
@media screen and (min-width: 1024px) {
    .eqo-product-desktop-layout:not(.has-no-sidebar) {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: flex-start !important;
    }
    .eqo-product-desktop-layout:not(.has-no-sidebar) > .eqo-product-main-column {
        flex: 1 1 0 !important;
        width: 0 !important;
        min-width: 0 !important;
    }
    .eqo-product-desktop-layout:not(.has-no-sidebar) > .eqo-product-theme-sidebar {
        display: block !important;
        flex: 0 0 300px !important;
        width: 300px !important;
        max-width: 300px !important;
        min-width: 260px !important;
        float: none !important;
        clear: none !important;
    }
}
