/**
 * LFS shared site shell — tokens, reset, typography, header, footer, modal.
 * Loaded on every page. Page-specific sections live in per-route CSS files.
 */

/* ================================================================
   RESET + BASE (16px root — no legacy 62.5% hack)
   ================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--body, #475569);
    background: var(--surface-alt, #f8fafc);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--emerald, #10b981);
}

button,
input,
select,
textarea {
    font: inherit;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.visuallyhidden,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lfs-icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--emerald);
}

.lfs-icon-check svg {
    width: 1rem;
    height: 1rem;
}

/* ================================================================
   LAYOUT PRIMITIVES
   ================================================================ */
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--body);
}

#content h1,
#content h2,
#content h3,
.lfs-page-title {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    color: var(--text);
}

::selection {
    background: var(--emerald);
    color: #fff;
}

/* ================================================================
   LAYOUT PRIMITIVES
   ================================================================ */
.mid-content,
.lfs-content-offset,
#masthead .mid-content {
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.lfs-content-offset {
    padding-top: calc(var(--nav-h) + 1rem);
    padding-bottom: 0.5rem;
}

.lfs-solutions-page > .lfs-content-offset,
.lfs-shopify-page > .lfs-content-offset {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.lfs-solutions-page > .lfs-content-offset .lfs-page-title,
.lfs-shopify-page > .lfs-content-offset .lfs-page-title {
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media screen and (max-width: 768px) {
    .lfs-content-offset {
        padding-top: calc(var(--nav-h) + 0.75rem);
    }
}

.lfs-page-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin: 0;
    text-align: left;
    text-transform: none;
    letter-spacing: -0.02em;
}

#content > .lfs-content-offset + .lfs-section,
#content > .lfs-content-offset + main > .lfs-section:first-child,
main > .lfs-content-offset + .lfs-section {
    padding-top: 0;
}

.lfs-prose {
    margin: 0 0 1rem;
    color: var(--text);
    line-height: 1.65;
}

.lfs-prose--on-dark {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* ================================================================
   SHARED CTAs
   ================================================================ */
.lfs-cta-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    color: var(--emerald) !important;
    background: #fff;
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lfs-cta-primary:hover {
    transform: translateY(-1px);
    background: var(--emerald-soft);
    color: var(--lfs-teal-hover) !important;
}

.lfs-cta-shopify {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: #fff !important;
    background: var(--green);
    border-radius: var(--r-pill);
    border: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.lfs-cta-shopify:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
}

.lfs-cta-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.15rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: var(--emerald);
    border: 1.5px solid var(--emerald);
    border-radius: var(--r-pill);
    transition: background 0.15s, color 0.15s;
}

.lfs-cta-outline:hover {
    background: var(--emerald-soft);
}

.lfs-cta-outline--on-dark {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.lfs-cta-outline--on-dark:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.lfs-cta-teal {
    display: inline-flex;
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: var(--emerald) !important;
    background: var(--emerald-soft);
    border-radius: var(--r-pill);
}

.lfs-cta-teal:hover {
    background: #a7f3d0;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.site-footer .copy-right {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 0.875rem;
    color: var(--muted);
}

/* ================================================================
   MASTHEAD / SITE NAV (mockup single-row: logo | nav | login)
   ================================================================ */
#masthead {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
    padding: 0 !important;
    box-sizing: border-box !important;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.2s ease;
}

#masthead.is-scrolled {
    box-shadow: var(--shadow-sm);
}

#masthead .mid-content {
    height: 100%;
}

#masthead .flex-box {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 1.5rem !important;
    float: none !important;
    width: 100% !important;
    height: 100% !important;
}

#masthead #site-logo {
    flex: 0 0 auto !important;
    float: none !important;
}

#masthead #site-logo a {
    display: block !important;
    line-height: 0 !important;
}

#masthead #site-logo img {
    display: block !important;
    width: auto !important;
    height: 2.625rem !important;
    max-width: 100% !important;
}

#masthead .login-form-popup {
    flex: 0 0 auto !important;
    margin: 0 0 0 0.5rem !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    font-family: "Inter", system-ui, sans-serif !important;
    color: var(--emerald) !important;
    background: transparent !important;
    border: 1.5px solid var(--emerald) !important;
    border-radius: var(--r-pill) !important;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s !important;
    white-space: nowrap !important;
}

#masthead .login-form-popup:hover {
    background: var(--emerald) !important;
    color: #fff !important;
}

#masthead .main-navigation {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

#masthead .main-navigation .nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    align-items: center !important;
    gap: 0.15rem !important;
}

#masthead .main-navigation .nav li {
    margin: 0 !important;
    padding: 0 !important;
}

#masthead .main-navigation .nav li a {
    display: block !important;
    padding: 0.4rem 0.65rem !important;
    font-family: "Inter", system-ui, sans-serif !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--body) !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: background 0.15s, color 0.15s !important;
    white-space: nowrap !important;
    text-transform: none !important;
}

#masthead .main-navigation .nav li a:hover {
    background: var(--surface-alt) !important;
    color: var(--text) !important;
}

#masthead .main-navigation .nav li.current a {
    color: var(--emerald) !important;
    background: var(--emerald-soft) !important;
    font-weight: 600 !important;
}

#masthead .main-navigation .nav li.current a:hover {
    background: var(--emerald-soft) !important;
    color: var(--emerald) !important;
}

.menu-toggle {
    display: none !important;
}

@media (min-width: 1001px) {
    .menu-toggle {
        display: none !important;
    }
}

@media (max-width: 1000px) {
    #masthead .mid-content {
        position: relative !important;
    }

    #masthead .flex-box {
        gap: 0.5rem !important;
    }

    #masthead #site-logo {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 52% !important;
    }

    #masthead #site-logo img {
        max-height: 3rem !important;
        height: auto !important;
    }

    .menu-toggle {
        display: block !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
        appearance: none !important;
        background: var(--surface-alt) !important;
        border: 1px solid var(--border) !important;
        padding: 0 !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        width: 2.75rem !important;
        height: 2.75rem !important;
        position: relative !important;
        text-indent: -9999px !important;
        overflow: hidden !important;
    }

    .menu-toggle:before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 1.25rem;
        height: 2px;
        background: var(--text);
        box-shadow: 0 -6px 0 var(--text), 0 6px 0 var(--text);
        border-radius: 1px;
    }

    #masthead .main-navigation {
        flex: 0 0 auto !important;
        position: static !important;
    }

    #masthead .main-navigation .nav {
        position: absolute !important;
        top: calc(100% + 0.35rem) !important;
        right: 1rem !important;
        min-width: 14rem !important;
        max-width: calc(100vw - 2rem) !important;
        background: var(--surface) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--r) !important;
        box-shadow: var(--shadow-md) !important;
        z-index: 10001 !important;
        flex-direction: column !important;
        padding: 0.35rem !important;
    }

    #masthead .main-navigation .nav:not(.is-open) {
        display: none !important;
    }

    #masthead .main-navigation .nav.is-open {
        display: flex !important;
    }

    #masthead .main-navigation .nav li {
        display: block !important;
        width: 100% !important;
    }

    #masthead .main-navigation .nav li a {
        text-align: left !important;
        padding: 0.65rem 0.85rem !important;
    }

    #masthead .login-form-popup {
        margin-left: 0 !important;
        padding: 0.35rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
}

/* ================================================================
   BACK TO TOP
   ================================================================ */
#go-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

#go-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#go-top a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--emerald);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: background 0.15s ease, transform 0.15s ease;
}

#go-top a:hover {
    background: var(--lfs-teal-hover);
    transform: translateY(-2px);
}

#go-top svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ================================================================
   LOGIN MODAL
   ================================================================ */
.lfs-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6rem 1rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.lfs-modal[hidden] {
    display: none !important;
}

body.lfs-modal-open {
    overflow: hidden;
}

.lfs-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 28rem;
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.lfs-modal__title {
    margin: 0 0 1rem;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.lfs-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 8px;
    background: var(--surface-alt);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.lfs-modal__close:hover {
    background: var(--border);
}

.lfs-login-input {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.lfs-login-input:focus {
    outline: 2px solid var(--emerald-soft);
    border-color: var(--emerald);
}

.lfs-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: var(--r-pill);
    background: var(--emerald);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.lfs-login-submit:hover {
    background: var(--lfs-teal-hover);
}

.lfs-login-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.lfs-login-links a {
    color: var(--emerald);
}

.cookies-ploicies {
    margin-top: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface-alt);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.cookies-ploicies.hide-cookies {
    display: none;
}

.cookies-action {
    margin-top: 0.65rem;
}

.accept-cookies {
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: var(--r-pill);
    background: var(--emerald);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.lfs-reveal,
#main-shopify-app .reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: calc(var(--stagger, 0) * 80ms);
}

.lfs-reveal.is-visible,
#main-shopify-app .reveal.is-visible {
    opacity: 1;
    transform: none;
}
