/* =========================================================
   Best Ever Medical — Global Custom Styles
   Ported from the original static site (site-wide elements
   confirmed present across Home, About, Contact, Products,
   Product detail, Events & News, and event pages).
   Loaded via functions.php on top of Hello Elementor.
   ========================================================= */

:root {
    /* --- BEM Clinical Luxury Palette --- */
    --primary-dark: #0c4d29;
    --primary: #197b47;
    --bg-cream: #fdfcee;
    --white: #ffffff;
    --text-dark: #1e293b;
    --card-gold: #e6b022;
    --footer-bg: #062e17;

    /* --- Editorial Accents --- */
    --base-dark: #0D1F17;
    --ivory: #F5F0E8;
    --border-color: rgba(0,0,0,0.08);
}

/* --- Base + Film Grain Overlay --- */
body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 90;
}

/* --- Ethereal Preloader --- */
.preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: var(--bg-cream);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preloader-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}
.preloader-logo {
    height: 90px !important;
    width: auto !important;
    opacity: 0;
    transform: translateY(30px);
}

/* --- Header + Hero Reveal (starting state, animated in via GSAP) --- */
.hero-content h1,
.hero-content p,
.cta-group,
.hero-eyebrow {
    opacity: 0;
    transform: translateY(40px);
}
.header-wrapper {
    opacity: 0;
    transform: translateY(-20px);
}

/* --- Magnetic Trailing Cursor --- */
.custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 24px; height: 24px;
    background-color: var(--card-gold);
    opacity: 0.8;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999999;
    transform: translate(-50%, -50%);
    transition:
        width 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        background-color 0.3s ease,
        border 0.3s ease,
        opacity 0.3s ease;
    mix-blend-mode: normal;
    border: 0px solid transparent;
}
.custom-cursor.hover-active {
    width: 64px; height: 64px;
    background-color: rgba(230, 176, 34, 0.2);
    border: 2px solid var(--card-gold);
    opacity: 1;
}

/* Hide the custom cursor on touch devices — it's a desktop-only effect */
@media (max-width: 1024px) {
    .custom-cursor { display: none !important; }
}

/* --- Header & Nav --- */
.header-wrapper {
    width: 100%; position: fixed; top: 0; left: 0; z-index: 100;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05); box-sizing: border-box;
}
.header-wrapper.scrolled {
    background-color: rgba(253, 252, 238, 0.95); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06); box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}
.floating-header {
    width: 100%; max-width: 1400px; margin: 0 auto; display: flex; align-items: center;
    justify-content: space-between; padding: 20px 5vw; transition: padding 0.4s ease; box-sizing: border-box;
}
.header-wrapper.scrolled .floating-header { padding: 15px 5vw; }
.logo { display: flex; align-items: center; text-decoration: none; transition: opacity 0.3s ease; height: 45px; position: relative; z-index: 101; }
.logo:hover { opacity: 0.8; }
.brand-logo-img {
    height: 45px !important;
    width: auto !important;
    max-width: none;
    transform: scale(1.5); transform-origin: left center; filter: brightness(0) invert(1); transition: filter 0.4s ease;
}
.header-wrapper.scrolled .brand-logo-img, body.menu-open .brand-logo-img { filter: none; }

.nav-links { display: flex; gap: 35px; align-items: center; height: 100%; }
.nav-item { position: relative; height: 40px; display: flex; align-items: center; }
.nav-item > a { color: var(--white); text-decoration: none; font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; position: relative; transition: color 0.4s ease; }
.header-wrapper.scrolled .nav-item > a { color: var(--text-dark); }
.nav-item > a::after { content: ''; position: absolute; width: 100%; height: 1px; bottom: -4px; left: 0; background-color: var(--white); transform: scaleX(0); transform-origin: right; transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.4s ease; }
.header-wrapper.scrolled .nav-item > a::after { background-color: var(--primary); }
.nav-item:hover > a::after { transform: scaleX(1); transform-origin: left; }
.nav-item:hover > a { opacity: 0.8; }
.header-wrapper.scrolled .nav-item:hover > a { color: var(--primary); opacity: 1; }
.nav-item > a svg { width: 12px; height: 12px; transition: transform 0.3s ease; stroke: currentColor; }
.nav-item:hover > a svg { transform: rotate(180deg); }

.mega-menu {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(10px);
    background: rgba(253, 252, 238, 0.95); backdrop-filter: blur(12px); border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.05);
    padding: 15px; min-width: 240px; opacity: 0; visibility: hidden; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; gap: 5px;
}
.mega-menu::before { content: ''; position: absolute; top: -20px; left: 0; width: 100%; height: 20px; }
.nav-item:hover .mega-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.mega-link { display: flex; flex-direction: column; padding: 12px 16px; border-radius: 6px; text-decoration: none; color: var(--text-dark); transition: background 0.2s ease; }
.mega-link:hover { background-color: rgba(0,0,0,0.03); }
.mega-link strong { font-size: 14px; color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.mega-link span { font-size: 12px; color: #64748b; }

.header-btn {
    background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.4); padding: 12px 28px;
    border-radius: 4px; font-weight: 600; font-size: 14px; text-decoration: none; transition: all 0.4s ease; display: inline-block;
}
.header-btn:hover { background: var(--white); color: var(--base-dark); border-color: var(--white); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.header-wrapper.scrolled .header-btn { background: var(--base-dark); color: var(--white); border: 1px solid rgba(0,0,0,0.1); }
.header-wrapper.scrolled .header-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.mobile-menu-btn {
    display: none; background: transparent; border: none; width: 40px; height: 40px; cursor: pointer; position: relative; z-index: 101;
}
.hamburger { width: 24px; height: 18px; position: relative; margin: 0 auto; }
.hamburger span { display: block; position: absolute; height: 2px; width: 100%; background: var(--white); border-radius: 2px; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); left: 0; }
.header-wrapper.scrolled .hamburger span, body.menu-open .hamburger span { background: var(--text-dark); }
.hamburger span:nth-child(1) { top: 0px; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }
body.menu-open .hamburger span:nth-child(1) { top: 8px; transform: rotate(45deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* --- Mobile Responsive Nav (matches original breakpoint) --- */
@media (max-width: 1024px) {
    .mobile-menu-btn { display: block; }
    .header-btn { display: none; }
    .nav-links {
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: var(--bg-cream);
        flex-direction: column; padding: 120px 5vw 40px 5vw; gap: 0;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.6s cubic-bezier(0.77, 0, 0.175, 1);
        align-items: flex-start; justify-content: flex-start;
        overflow-y: auto; z-index: 100;
        box-sizing: border-box;
    }
    .nav-links.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    .nav-item {
        width: 100%; height: auto; flex-direction: column; align-items: flex-start;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .nav-item > a {
        width: 100%; color: var(--text-dark) !important; font-family: 'Cormorant Garamond', serif; font-size: 28px; padding: 24px 0; justify-content: space-between;
        box-sizing: border-box;
    }
    .nav-item > a::after { display: none; }
    .nav-item > a svg { width: 24px; height: 24px; transition: transform 0.3s ease; }
    .nav-item.active > a svg { transform: rotate(180deg); color: var(--primary); }

    .mega-menu {
        position: static !important; transform: none !important; box-shadow: none !important; border: none !important; background: transparent !important; width: 100% !important;
        padding: 0 0 0 15px !important; display: flex !important; flex-direction: column !important; gap: 15px !important; max-height: 0 !important; opacity: 0 !important;
        visibility: hidden !important; pointer-events: none !important; overflow: hidden !important; transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, visibility 0.4s !important; box-sizing: border-box;
    }
    .mega-menu::before { display: none !important; }
    .nav-item.active .mega-menu { max-height: 600px !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; padding-bottom: 24px !important; }
    .mega-link { padding: 0; }
    .mega-link strong { font-size: 18px; color: var(--text-dark); font-weight: 500; font-family: 'DM Sans', sans-serif; }
    .mega-link span { display: none; }
}

/* --- Mega Footer Block --- */
.mega-footer-block {
    background-color: var(--footer-bg); border-top-left-radius: 60px; border-top-right-radius: 60px;
    padding-top: 120px; position: relative; z-index: 95; color: var(--white); margin-top: -20px; overflow: hidden;
}
.footer-section { padding: 80px 5vw 40px 5vw; }
.footer-container { max-width: 1300px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px; }
.footer-contact-info { display: flex; flex-direction: column; gap: 30px; }
.contact-block { display: flex; flex-direction: column; gap: 8px; }
.contact-block span:first-child { color: rgba(255, 255, 255, 0.5); font-size: 14px; }
.contact-block a { color: var(--white); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; transition: opacity 0.3s ease; }
.contact-block a:hover { opacity: 0.8; }
.footer-links-group { display: flex; gap: 100px; flex-wrap: wrap; }
.footer-col h4 { font-size: 14px; color: rgba(255, 255, 255, 0.5); margin: 0 0 20px 0; font-weight: 400; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.footer-links a { color: var(--white); text-decoration: none; font-size: 16px; font-weight: 500; transition: color 0.3s ease, opacity 0.3s ease; }
.footer-links a:hover { opacity: 0.7; }
.social-links-large { display: flex; gap: 15px; }
.social-link-l { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); display: flex; align-items: center; justify-content: center; color: var(--white); transition: background 0.3s ease, transform 0.3s; }
.social-link-l:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.social-link-l svg { width: 20px; height: 20px; fill: currentColor; }
.footer-bottom { max-width: 1300px; margin: 100px auto 0 auto; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; }
.bottom-brand { display: flex; flex-direction: column; gap: 15px; }
.bottom-brand p { margin: 0; color: rgba(255, 255, 255, 0.5); font-size: 13px; }
.bottom-legal { display: flex; gap: 30px; color: rgba(255, 255, 255, 0.5); font-size: 13px; }
.bottom-legal a { color: inherit; text-decoration: none; transition: color 0.3s; }
.bottom-legal a:hover { color: var(--white); }
.bottom-credit { color: rgba(255, 255, 255, 0.5); font-size: 13px; }

/* Mobile responsive footer */
@media (max-width: 1024px) {
    .mega-footer-block { padding-top: 80px; border-top-left-radius: 40px; border-top-right-radius: 40px; }
    .bottom-legal { flex-direction: column; gap: 15px; }
}

/* =========================================================
   NOTE: This file holds only the GLOBAL/site-wide styles
   (preloader, film grain, cursor, header reveal states).
   Page-specific animation styles (horizontal scroller,
   sticky stack cards, stat counters, etc.) belong in a
   separate stylesheet scoped to that page/template — add
   them as you build each template rather than dumping
   everything here.
   ========================================================= */