/* =============================================================
   BWD Services — style.css
   ============================================================= */

/* ===== CSS VARIABLES ===== */
:root {
    --orange:       #ff6404;
    --orange-dark:  #e55a00;
    --dark:         #121212;
    --gray:         #f4f4f4;
    --light-gray:   #e8e8e8;
    --mid-gray:     #999;
    --white:        #ffffff;

    /* Layout */
    --content-max:  1400px;
    --side-pad:     clamp(20px, 5vw, 80px);
    --nav-height:   70px;

    /* Type */
    --text-xs:   11px;
    --text-sm:   13px;
    --text-base: 15px;
    --text-md:   18px;
    --text-lg:   22px;
    --text-xl:   40px;

    /* Transitions */
    --ease: 0.22s ease;
}

/* ===== RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== BASE ===== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-width: 320px;
}

body.no-scroll {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--side-pad);
}

/* ===== SECTION ===== */
.section {
    padding: clamp(60px, 8vw, 100px) var(--side-pad);
}

.section h2 {
    font-size: clamp(28px, 4vw, var(--text-xl));
    text-align: center;
    margin-bottom: 12px;
    color: var(--orange);
}

.section-sub {
    text-align: center;
    margin-bottom: clamp(32px, 5vw, 60px);
    color: #555;
    font-size: var(--text-base);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== GRID ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(20px, 3vw, 35px);
}

/* ===== CARDS ===== */
.card {
    background: var(--gray);
    padding: clamp(24px, 3vw, 40px);
    border-radius: 14px;
    border: 1px solid transparent;
    transition: transform var(--ease), border-color var(--ease);
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--orange);
}

.card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.card h3 {
    font-size: var(--text-lg);
    color: var(--orange);
}

/* ===== BUTTON ===== */
.btn {
    background: var(--orange);
    color: var(--white);
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-md);
    display: inline-block;
    transition: background var(--ease);
    white-space: nowrap;
}

.btn:hover {
    background: var(--orange-dark);
}

/* ===== ANNOUNCEMENT BANNER ===== */
.announcement-bar {
    background: var(--orange);
    color: #fff;
    text-align: center;
    padding: 9px var(--side-pad);
    font-size: var(--text-sm);
    font-weight: 550;
    letter-spacing: 0.2px;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 60px;
}

.announcement-bar a {
    color: inherit;
}

.announcement-bar a:hover {
    text-decoration: underline;
}

.announcement-bar.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* ===== STICKY NAV WRAPPER ===== */
#navbar {
    position: sticky;
    top: 0;
    z-index: 500;
}

/* ===== HEADER ===== */
header {
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
    position: relative;
    z-index: 500;
}

.header-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 8%;          /* was: 0 var(--side-pad) */
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 0;
}

/* ===== LOGO ===== */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 40px;
}

.logo img {
    height: 52px;
    width: auto;
}

/* ===== MAIN NAV ===== */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

/* ===== NAV LINKS ===== */
.nav-link {
    color: var(--dark);
    font-weight: 600;
    font-size: var(--text-base);
    padding: 8px 12px;
    border-radius: 6px;
    transition: color var(--ease), background var(--ease);
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--orange);
    background: rgba(255, 100, 4, 0.06);
}

/* Active page indicator */
.nav-link.is-active {
    color: var(--orange);
}

.nav-link.is-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--orange);
    border-radius: 2px;
}

/* Services also becomes active when on any /services/ subpage */
.nav-link.is-active-parent {
    color: var(--orange);
}

/* Dropdown caret */
.dropdown-caret {
    display: inline-flex;          /* treat like icon, not text */
    align-items: center;
    justify-content: center;

    font-size: 16px;               /* slightly smaller looks better */
    line-height: 1;

    margin-left: 4px;

    position: relative;
    top: 1px;                      /* vertical optical alignment fix */

    transform-origin: 50% 45%;     /* rotate around center, not baseline */
    transition: transform var(--ease);
}

.dropdown:hover .dropdown-caret,
.dropdown:focus-within .dropdown-caret {
    transform: rotate(180deg);
}

/* ===== HEADER ACTIONS (desktop right side) ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.desktop-account {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    color: var(--orange);
    transition: background var(--ease), color var(--ease);
    flex-shrink: 0;
}

.desktop-account:hover {
    background: var(--orange);
    color: var(--white);
}

/* ===== HAMBURGER ===== */
.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--ease);
    flex-shrink: 0;
    margin-left: auto;
    padding: 0;
}

.hamburger:hover {
    background: var(--light-gray);
}

.hamburger img {
    height: 26px;
    width: auto;
}

/* ===== MEGA MENU (desktop) ===== */
.dropdown {
    position: static;
    padding-bottom: 8px;  /* ADD THIS — bridges the transform gap */
    margin-bottom: -8px;  /* ADD THIS — keeps layout unchanged */
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: clamp(32px, 4vw, 60px) 8%;
    box-shadow: 0 20px 48px rgba(0,0,0,0.12);
    border-top: 3px solid var(--orange);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
    z-index: 400;
    pointer-events: none;
}

.dropdown:hover .mega-menu,
.dropdown:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(32px, 5vw, 80px);
}

.mega-column {
    display: flex;
    flex-direction: column;
}

.mega-column h4 {
    color: var(--orange);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-gray);
}

.mega-item {
    display: block;
    padding: 9px 0;
    color: var(--dark);
    text-decoration: none;
    transition: color var(--ease);
    border-radius: 4px;
}

.mega-item:hover {
    color: var(--orange);
}

.mega-item:hover .mega-desc {
    color: #888;
}

.mega-title {
    display: block;
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: 2px;
    transition: color var(--ease);
}

.mega-desc {
    display: block;
    font-size: var(--text-sm);
    color: #888;
    line-height: 1.45;
    transition: color var(--ease);
}

.mega-item.view-all {
    margin-top: auto;
    padding-top: 14px;
}

.mega-item.view-all .mega-title {
    color: var(--orange);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mega-item.view-all:hover .mega-title {
    color: var(--orange-dark);
    text-decoration: underline;
}

/* Hide mobile-only elements on desktop */
.mobile-menu-top,
.mobile-divider,
.mobile-only,
.mobile-back {
    display: none !important;
}

/* Nav overlay (mobile) */
.nav-overlay {
    display: none;
}

/* ===== FOOTER ===== */
footer {
    background: #121212;
    color: #ccc;
    padding: clamp(40px, 6vw, 60px) var(--side-pad) clamp(24px, 3vw, 30px);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: clamp(24px, 3vw, 40px);
    margin-bottom: clamp(24px, 3vw, 40px);
}

.footer-column h4 {
    color: var(--white);
    margin-bottom: 14px;
    font-size: var(--text-base);
}

.footer-column a {
    display: block;
    color: #aaa;
    text-decoration: none;
    margin-bottom: 8px;
    font-size: var(--text-sm);
    transition: color var(--ease);
}

.footer-column a:hover {
    color: var(--orange);
}

.footer-bottom {
    border-top: 1px solid #222;
    padding-top: 18px;
    text-align: center;
    font-size: var(--text-xs);
    color: #777;
}

/* =============================================================
   RESPONSIVE — MOBILE NAV  (≤ 960px)
   ============================================================= */
@media (max-width: 960px) {

    /* Show hamburger, hide desktop account in header */
    .hamburger {
        display: flex;
    }

    .header-actions {
        display: none;
    }

    /* ---- Off-canvas nav ---- */
    .main-nav {
        position: fixed;
        inset: 0;
        width: min(360px, 100vw);
        height: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 600;
        overflow-y: auto;
        box-shadow: 4px 0 32px rgba(0,0,0,0.15);
    }

    .main-nav.is-open {
        transform: translateX(0);
    }

    /* Mobile top bar */
    .mobile-menu-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 12px 20px;
        border-bottom: 1px solid var(--light-gray);
        flex-shrink: 0;
    }

    .mobile-menu-top img {
        height: 44px;
        width: auto;
    }

    .hamburger-x {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: none;
        cursor: pointer;
        border-radius: 8px;
        transition: background var(--ease);
        padding: 0;
    }

    .hamburger-x:hover {
        background: var(--light-gray);
    }

    .hamburger-x img {
        height: 20px;
        width: auto;
    }

    /* Nav links */
    .nav-link {
        display: block;
        padding: 14px 20px;
        font-size: var(--text-md);
        border-radius: 0;
        border-bottom: 1px solid var(--light-gray);
    }

    .nav-link.is-active::after {
        display: none;
    }

    .nav-link.is-active {
        color: var(--orange);
        background: rgba(255, 100, 4, 0.05);
    }

    /* Dropdown caret hidden on mobile */
    .dropdown-caret {
        display: none;
    }

    /* Mobile mega menu — full-screen panel */
    .mega-menu {
        position: fixed;
        inset: 0;
        width: min(360px, 100vw);
        height: 100%;
        padding: 0;
        box-shadow: none;
        border-top: none;
        transform: translateX(-100%);
        opacity: 1;
        visibility: visible;
        pointer-events: none;
        overflow-y: auto;
        z-index: 700;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mega-menu.is-open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .mobile-back {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 14px 20px;
        font-size: var(--text-md);
        font-weight: 600;
        border: none;
        background: none;
        cursor: pointer;
        color: var(--dark);
        border-bottom: 1px solid var(--light-gray);
        width: 100%;
        text-align: left;
        transition: color var(--ease);
    }

    .mobile-back:hover {
        color: var(--orange);
    }

    .mega-inner {
        display: block;
        padding: 0 0 20px;
    }

    .mega-column {
        padding: 16px 20px 0;
        margin-bottom: 8px;
    }

    .mega-column h4 {
        font-size: var(--text-xs);
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .mega-item {
        padding: 10px 0;
        border-bottom: 1px solid var(--light-gray);
    }

    .mega-item:last-child {
        border-bottom: none;
    }

    .mega-title {
        font-size: var(--text-base);
    }

    .mega-desc {
        display: none; /* Keep mobile clean */
    }

    .mega-item.view-all {
        margin-top: 4px;
        padding-top: 10px;
    }

    /* Mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    .mobile-divider {
        display: block !important;
        border: none;
        border-top: 1px solid var(--light-gray);
        margin: 4px 20px;
    }

    .nav-link-mobile-login {
        display: block;
        margin: 4px 20px;
        padding: 12px 16px;
        text-align: center;
        border: 2px solid var(--dark);
        border-radius: 8px;
        font-weight: 600;
        font-size: var(--text-base);
        transition: background var(--ease), color var(--ease);
    }

    .nav-link-mobile-login:hover {
        background: var(--dark);
        color: var(--white);
    }

    .nav-link-mobile-quote {
        display: block;
        margin: 6px 20px;
        padding: 12px 16px;
        text-align: center;
        background: var(--orange);
        color: var(--white);
        border-radius: 8px;
        font-weight: 700;
        font-size: var(--text-base);
        transition: background var(--ease);
    }

    .nav-link-mobile-quote:hover {
        background: var(--orange-dark);
    }

    .switch-commercial {
        padding: 8px 20px;
        font-size: var(--text-sm);
        color: var(--mid-gray);
        cursor: pointer;
    }

    /* Overlay */
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 590;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Very small screens ===== */
@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}