/* --- Base Header Wrapper --- */
:root {
    --mW:1440;
    --mWpx: calc(var(--mW) * 1px);
    --blockPaddingX: calc((100vw - var(--mWpx)) / 2);
    --blockPaddingY: 0;
    --blockPadding: var(--blockPaddingY) var(--blockPaddingX);
}

.s2s-header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), background 0.3s ease;
    padding: var(--blockPadding);
}
.header-content-container {
    display: flex;
    flex-direction: column;
    width:100%;
    padding: 0 1rem;
    gap:0;
}
.header-content-container > *:not(.logo) {
    width:100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-left: clamp(calc(2rem + 60px), calc(2rem + 8.5%), calc(2rem + 8.5%));
    z-index: 0;
    justify-content: center;
}
.s2s-header-wrapper .logo {
    position: absolute;
    z-index: 100;
    top: 0;
    left:1rem;
    width:8.5%;
    min-width: 85px;
    display: flex;
    flex-direction:column;
    padding: clamp(0.25rem, 0rem + 0.5556vw, 0.5rem);
    padding-bottom:calc(clamp(0.25rem, 0rem + 0.5556vw, 0.5rem) * 2);
    gap: clamp(0.25rem, 0rem + 0.5556vw, 0.5rem);
    justify-items: flex-end;
    letter-spacing: 0.015em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    background-color: #fff;
    border-radius: 0 0 clamp(0.5rem, 0rem + 1.1111vw, 1rem) clamp(0.5rem, 0rem + 1.1111vw, 1rem);
    transition:transform 0.3s ease;
}
.s2s-header-wrapper .logo span {
    text-align: right;
    display: flex;
    flex-direction: column;
    width: 100%;
    color: #333;
    font-size: 100%;
    position: relative;
    font-weight: 500;
    font-size: clamp(0.53125rem, 0.2813rem + 0.5208vw, 0.75rem);
}
.s2s-header-wrapper .logo:hover {
    text-decoration: none;
}

.header-content-container > .tagline {
    padding-right: clamp(calc(2rem + 60px), calc(2rem + 8.5%), calc(2rem + 8.5%));
    align-items: center;
    justify-content: center;
    padding: clamp(0.25rem, 0rem + 0.5556vw, 0.5rem) 0;
    font-size: clamp(0.65rem, 0.45rem + 0.4444vw, 0.85rem);
    position: relative;
}
.header-content-container > .tagline:before,
.ticker:before {
    position: absolute;
    top:0;
    left:50%;
    content:"";
    width:100vw;
    transform: translateX(-50%);
    height:100%;
    z-index: 0;
}
.header-content-container > .tagline:before {
    background-color: #5c667a;
    opacity: 0.1;
}
@media(max-width:500px){
    .header-content-container > .tagline {
        z-index: 999;
    }
    .s2s-header-wrapper .logo {
        top:18px;
    }
}

.header-hidden {
    transform: translateY(calc(-100%));
}
.header-hidden .logo {
    transform: translateY(-110%);
}

.header-scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* --- Scroll Progress Bar --- */
.progress-container {
    width: 100%;
    height: clamp(0.1875rem, -0.125rem + 0.6944vw, 0.5rem);
    background: transparent;
    position: absolute;
    top: 100%;
    left: 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg,rgba(149, 193, 31, 1) 0%, rgba(59, 168, 224, 1) 100%);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* --- Navigation Layout --- */
.header-content-container .s2s-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
@media(max-width:768px){
    .header-content-container .s2s-nav {
        justify-content: flex-end;
    }
}

.nav-links,
.nav-links ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0rem;
    margin: 0;
    padding: 0;
    height: auto;
    width: 100%;
    justify-content: space-between;
}
.nav-links ul {
    width:auto;
}
@media(max-width:768px){
    .nav-links ul, 
    .nav-links ul li {
        flex-direction: column;
        text-align: center;
    }
    .nav-links ul li .dropdown-menu {
        border:0.5px solid #5c667a;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        background: transparent;
    }
}
.nav-links ul:last-of-type {
    flex-grow: 0;
}
.nav-links li {
    list-style: none;
    padding: 0;
    width: auto;
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: row;

}
.nav-links li:before, 
.nav-links li:after {
    display: none;
}

.nav-links a {
    text-decoration: none;
    color: #5d677b;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: clamp(0.85rem, 0.3929rem + 0.9524vw, 1.25rem);
    font-weight: 400;
    line-height: clamp(0.85rem, 0.7rem + 0.3333vw, 1rem);
    margin: 0;
    padding: calc(clamp(0.85rem, 0.3929rem + 0.9524vw, 1.25rem) * 0.85) clamp(0.4rem, -1.4286rem + 3.8095vw, 2rem);
    letter-spacing: -0.03em;
    text-wrap: nowrap;
    position:relative;
    z-index: 1;
    text-transform: uppercase;
}
.nav-links a:before {
    position: absolute;
    top:auto;
    bottom:0;
    left:0;
    width: 100%;
    height: 0%;
    opacity: 0;
    background-color: #5c667a;
    transition: all 0.2s ease-out;
    content:"";
    z-index: -1;
}
.nav-links a:hover {
    color: #5d677b;
    text-decoration: underline;
}
.nav-links a:hover:before {
    opacity: 0.025;
    height: 100%;
}
.nav-links a.highlight {
    color:#fff;
}
.nav-links a.highlight:before {
    background-color: #95c11f;
    opacity: 1;
    height: 100%;
}
.nav-links a.highlight:hover {
    color: #fff;
}
.nav-links a.highlight:hover:before {
    opacity: 0.9;
}
@media(max-width:768px){
    .nav-links li,
    .nav-links a {
        width:100%;
    }
}

/* --- Dropdown Menu --- */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    gap: 0.25rem !important;
    justify-items: flex-start;
    flex-direction: column;
    margin-top: -3px;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    
}

.dropdown-menu li {list-style: none;
                   width: 100%;}
.dropdown-menu li a {
    padding: 0.8rem 1.5rem;
    display: block;
    width:100%
}

/* --- CTA Button --- */
.cta-button {
    background-color: #4a7c44;
    color: #fff !important;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
}

/* --- Mobile Toggle --- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    height: 35px;
}

.hamburger, .hamburger::before, .hamburger::after {
    display: block;
    width: 25px;
    height: 3px;
    background: #4a7c44;
    position: relative;
    transition: all 0.3s;
}

.hamburger::before { content: ''; position: absolute; top: -8px; left: 0; }
.hamburger::after { content: ''; position: absolute; bottom: -8px; left: 0; }

.is-open .hamburger { background: transparent; }
.is-open .hamburger::before { transform: rotate(45deg); top: 0; }
.is-open .hamburger::after { transform: rotate(-45deg); bottom: 0; }

/* Prevent background scrolling */
html.nav-open {
    overflow: hidden !important;
    position: relative;
    touch-action: none; /* Disables touch scrolling on mobile */
}

/* Force header to stay put when menu is active */
.s2s-header-wrapper.is-open-active {
    transform: translateY(0) !important;
    transition: none; /* Instant snap to stay visible */
}

/* Ensure the nav-links don't shift when body padding is added */
.nav-links {
    /* ... existing styles ... */
    box-sizing: border-box;
}

/* --- Mobile Viewports --- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 90%;
        background: rgba(255,255,255,0.95);
        flex-direction: column;
        padding: 80px 0px;
        transition: right 0.4s ease;
        overflow-y: auto;
        box-shadow: 0 0 10px rgba(0,0,0,0.15);
    }
    .nav-links.nav-active { right: 0; }
    .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        transform: none;
    }
    .dropdown-open .dropdown-menu { display: block; }
}

/* Ticker Container */
.ticker {
    position:relative;
    padding-right: clamp(calc(1rem + 60px), calc(1rem + 8.5%), calc(1rem + 8.5%));
    width:100%;
    display: flex;
    flex-direction: row;
}
.ticker::before {
    background-color: var(--blue);
}
.s2s-ticker-wrapper {
    /* background: var(--blue); */
    color: #ffffff;
    font-size: 0.85rem;
    height: 35px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 1001;
    transition: margin-top 0.3s ease, opacity 0.3s ease;
    width: 100%;
}

.s2s-ticker-wrapper .round-btn {
    min-width: auto !important;
    font-size: clamp(0.65rem, 0.45rem + 0.4444vw, 0.85rem);
    flex-grow: 0;
    padding: 3.5px 0.85rem;
    font-weight: 500;
}
/* Logic for dismissing */
.s2s-ticker-wrapper.ticker-hidden {
    margin-top: -35px;
    opacity: 0;
    pointer-events: none;
}

.ticker-content {
    flex: 1;
    position: relative;
    height: 100%;
}

.ticker-item {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px; /* Space for the X button */
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap:0.5em;
    font-weight: 500;
    font-size: clamp(0.65rem, 0.45rem + 0.4444vw, 0.85rem);
    pointer-events: none;
    z-index: 1;
}

.ticker-item.active { opacity: 1; transform: translateY(0); z-index: 2; pointer-events:all;}
.ticker-item.exit { opacity: 0; transform: translateY(-15px); }

/* The Close Button */
.ticker-close {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ticker-close:hover { opacity: 1; }

/* Ticker Button Styling */
.ticker-btn {
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s ease;
    margin:0;
}

.ticker-btn:hover {
    background: var(--blue);
    color: #fff;
    text-decoration: none !important;
}

/* Ensure the wrapper respects the pause */
.s2s-ticker-wrapper:hover {
    cursor: pointer;
}

/* Responsive adjustment for buttons */
@media (max-width: 600px) {
    .s2s-ticker-wrapper {
        display: none;
    }
    .ticker-item {
        gap: 5px;
        height: auto;
        padding: 5px 40px;
    }
}

/* Responsive Tweak */
@media (max-width: 480px) {
    .ticker-item {
        font-size: 0.75rem;
        padding: 0 35px 0 15px; /* Tighter padding for mobile */
        justify-content: flex-start; /* Left align on mobile for better readability */
    }
}