/**
 * Smart Header Styles
 *
 * Transparent overlay header with hide-on-scroll behavior
 */

/* ==========================================================================
   Main Smart Header
   ========================================================================== */

.smart-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: transparent;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.smart-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* Logo */
.smart-header__logo {
    flex-shrink: 0;
}

.smart-header__logo img {
    height: 55px;
    width: auto;
    transition: filter 0.3s ease;
}

/* At top of page - logo might need light filter for visibility on dark hero */
.smart-header.headroom--top .smart-header__logo img {
    /* Optional: Add filter for light logo on dark backgrounds */
    /* filter: brightness(0) invert(1); */
}

/* Navigation */
.smart-header__nav {
    display: none;
    flex-grow: 1;
    justify-content: center;
    padding: 0 2rem;
}

@media (min-width: 992px) {
    .smart-header__nav {
        display: flex;
    }
}

.smart-header__menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.smart-header__menu li {
    margin: 0;
}

.smart-header__menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.smart-header__menu a:hover {
    color: #1a472a; /* Harfield green */
}

.smart-header__menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #1a472a;
    transition: width 0.2s ease;
}

.smart-header__menu a:hover::after {
    width: 100%;
}

/* At top - light text for visibility on hero */
.smart-header.headroom--top .smart-header__menu a {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.smart-header.headroom--top .smart-header__menu a:hover {
    color: #fff;
}

.smart-header.headroom--top .smart-header__menu a::after {
    background-color: #fff;
}

/* Actions (Shop button, menu toggle) */
.smart-header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.smart-header__shop-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background-color: #1a472a;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.smart-header__shop-btn:hover {
    background-color: #0d2415;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

/* Menu Toggle (Hamburger) */
.smart-header__menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

@media (min-width: 992px) {
    .smart-header__menu-toggle {
        display: none;
    }
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    transition: background-color 0.2s ease;
}

.smart-header.headroom--top .hamburger-line {
    background-color: #fff;
}

/* ==========================================================================
   Headroom States
   ========================================================================== */

/* Pinned - visible */
.smart-header.headroom--pinned {
    transform: translateY(0);
}

/* Unpinned - hidden */
.smart-header.headroom--unpinned {
    transform: translateY(-100%);
}

/* At top of page - transparent */
.smart-header.headroom--top {
    background-color: transparent;
    box-shadow: none;
}

/* Not at top - solid background */
.smart-header.headroom--not-top,
.smart-header.is-scrolled {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Floating Shop Button
   ========================================================================== */

.floating-shop-btn {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 0 1.5rem;
    display: flex;
    justify-content: flex-end;
    z-index: 1010;
    pointer-events: none;
}

.floating-shop-btn__link {
    pointer-events: auto;
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background-color: #1a472a;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-shop-btn__link:hover {
    background-color: #0d2415;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Mobile Menu Overlay
   ========================================================================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-overlay__content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background-color: #fff;
    padding: 2rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.is-open .mobile-menu-overlay__content {
    transform: translateX(0);
}

/* Close button */
.mobile-menu-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-line {
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #333;
}

.close-line:first-child {
    transform: rotate(45deg);
}

.close-line:last-child {
    transform: rotate(-45deg);
}

/* Mobile menu list */
.mobile-menu-overlay__menu {
    list-style: none;
    margin: 3rem 0 2rem;
    padding: 0;
}

.mobile-menu-overlay__menu li {
    margin: 0;
    border-bottom: 1px solid #eee;
}

.mobile-menu-overlay__menu a {
    display: block;
    padding: 1rem 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
}

.mobile-menu-overlay__menu a:hover {
    color: #1a472a;
}

/* Submenu */
.mobile-menu-overlay__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1rem;
}

.mobile-menu-overlay__menu .sub-menu a {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
}

/* Mobile menu actions */
.mobile-menu-overlay__actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu-overlay__shop-btn {
    display: block;
    padding: 1rem;
    background-color: #1a472a;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
}

.mobile-menu-overlay__shop-btn:hover {
    background-color: #0d2415;
    color: #fff;
    text-decoration: none;
}

.mobile-menu-overlay__phone {
    display: block;
    padding: 1rem;
    background-color: #f5f5f5;
    color: #333 !important;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
}

.mobile-menu-overlay__phone:hover {
    background-color: #eee;
    color: #333;
    text-decoration: none;
}

.mobile-menu-overlay__phone i {
    margin-right: 0.5rem;
}

/* Body class when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* ==========================================================================
   Page Content Offset
   ========================================================================== */

/* No offset needed since header overlays content */
body.has-smart-header .new-design-page {
    /* Content starts at top, header overlays */
}

/* Ensure admin bar compatibility */
.admin-bar .smart-header {
    top: 32px;
}

.admin-bar .floating-shop-btn {
    top: calc(32px + 1rem);
}

@media screen and (max-width: 782px) {
    .admin-bar .smart-header {
        top: 46px;
    }

    .admin-bar .floating-shop-btn {
        top: calc(46px + 1rem);
    }
}
