/* === Global Color Variables === */
:root {
    --color-bg-dark: #f5f5f5;
    --color-bg-header: #f5f5f5;
    --color-bg-nav: #e0e7ef;
    --color-bg-dropdown: #182630;
    --color-bg-mega: #182630;
    --color-bg-mega-col: #ffcf99;
    --color-bg-tab: #ffcf99;
    --color-bg-tab-hover: #ffd699;
    --color-bg-btn: #df7b4a;
    --color-bg-btn-hover: #fff;
    --color-bg-btn-alt: #fff;
    --color-bg-tab-content-hover: #df7b4a;
    --color-bg-menu-icon: #222;
    --color-bg-menu-mobile: #f5f5f5;

    --color-text-main: #222;
    --color-text-muted: #3bb54a;
    --color-text-btn: #fff;
    --color-text-btn-hover: #df7b4a;
    --color-text-tab: #df7b4a;
    --color-text-tab-active: #222;
    --color-text-link-hover: #3bb54a;
    --color-text-tab-content-hover: #fff;

    --color-border-tab-content: #df7b4a;
    --color-border-nav-mobile: #df7b4a;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--color-bg-header);
    transition: 0.5s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    height: 80px;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: relative;
}

.logo a {
    text-decoration: none;
    font-size: 26px;
    font-weight: bold;
    color: var(--color-text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s ease;
    position: relative;
}

.logo img{
    width: 50px;
    height: 50px;
}

.logo a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--color-text-main);
    transition: width 0.3s;
}

.logo a:hover::after {
    width: 100%;
}

.logo a:hover {
    color: var(--color-text-muted);
}

nav {
    flex-grow: 1;
    margin-left: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    position: relative;
    padding-right: 160px;
}

.nav-links li {
    position: relative;
}

/* Contact nav item floats right */
.nav-links > li:last-child {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    margin-right: 40px;
    display: flex;
    align-items: center;
}

/* Contact button styles */
.contact-btn {
    background-color: var(--color-bg-btn);
    color: var(--color-text-btn);
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-left: 10px;
    outline: none;
    display: block;
}
.contact-btn:hover,
.contact-btn:focus {
    background: var(--color-bg-btn-hover);
    color: var(--color-text-btn-hover);
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-main);
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 10px 15px;
    display: block;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--color-text-main);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-dropdown);
    border-radius: 4px;
    min-width: 220px;
    padding: 10px 0;
    list-style: none;
    z-index: 1000;
    overflow-x: hidden;
}

/* Mega menu styles */
.mega-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    grid-auto-flow: dense;
    gap: 40px 40px;
    min-width: 600px;
    max-width: 900px;
    padding: 30px 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-mega);
    border-radius: 10px;
}

.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Diagonal effect: offset every other column */
}
.mega-menu-column:nth-child(2) {
    margin-top: 30px;
}
.mega-menu-column:nth-child(3) {
    margin-top: 60px;
}

/* Align columns at the top for services mega menu */
.services-mega-menu .mega-menu-column:nth-child(2),
.services-mega-menu .mega-menu-column:nth-child(3) {
    margin-top: 0;
}

.mega-menu-title {
    font-weight: bold;
    color: var(--color-text-tab);
    margin-bottom: 8px;
    font-size: 1.1em;
    text-transform: uppercase;
}

.mega-menu a {
    color: var(--color-text-main);
    padding: 8px 0;
    font-size: 15px;
    text-transform: none;
    transition: color 0.2s;
    text-decoration: none;
}

.mega-menu a:hover {
    color: var(--color-text-link-hover);
    background: none;
}

/* Make services-mega-menu wider on desktop */
.services-mega-menu {
    display: flex;
    flex-direction: column;
    min-width: 600px; /* was 400px */
    max-width: 900px; /* was 600px */
    padding: 24px 32px;
    gap: 0;
    background: var(--color-bg-mega);
}

.services-tab-content {
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start; /* Align columns at the top */
    gap: 32px;
    padding: 16px 0 0 0;
    border-top: 2px solid var(--color-border-tab-content);
}

@media (max-width: 900px) {
    .mega-menu {
        grid-template-columns: 1fr;
        gap: 20px;
        min-width: 0;
        max-width: 100vw;
        padding: 20px 10px;
    }
    .mega-menu-column,
    .mega-menu-column:nth-child(2),
    .mega-menu-column:nth-child(3) {
        margin-top: 0;
    }
    .services-mega-menu {
        min-width: 0;
        max-width: 100vw;
        padding: 16px 8px;
        width: 100vw;
        left: 0 !important;
        transform: none !important;
        border-radius: 0;
        position: static !important;
        box-shadow: none;
    }
    .mega-menu {
        min-width: 0;
        max-width: 100vw;
        width: 100vw;
        left: 0 !important;
        transform: none !important;
        border-radius: 0;
        position: static !important;
        box-shadow: none;
    }
    .dropdown-menu {
        min-width: 0;
        max-width: 100vw;
        width: 100vw;
        left: 0 !important;
        transform: none !important;
        border-radius: 0;
        position: static !important;
        box-shadow: none;
    }
    .menu-toggle {
        display: block;
        z-index: 3000;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    .logo {
        text-align: left;
        width: auto;
        overflow: visible;
        display: flex;
        align-items: center;
    }
    .container {
        padding: 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    header {
        height: 60px;
        padding: 8px 0;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: #111;
        position: absolute;
        top: 80px; /* match header height */
        left: 0;
        width: 100vw;
        padding: 10px 0;
        gap: 0;
        padding-right: 0;
        z-index: 2000;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links > li:last-child {
        position: static;
        margin-right: 0;
        width: 100%;
        justify-content: center;
    }
    .dropdown-menu,
    .mega-menu,
    .services-mega-menu {
        position: static !important;
        left: 0 !important;
        transform: none !important;
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 2100;
    }
    .dropdown-menu li,
    .mega-menu-column,
    .services-mega-menu .services-tab-content a {
        width: 100%;
        text-align: center;
    }
    .services-mega-menu {
        padding: 10px 0;
    }
    .services-tabs-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 10px;
    }
    .services-tab {
        border-radius: 0;
        width: 100%;
        text-align: center;
        margin-bottom: 2px;
    }
    .services-tab-content {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        border-top: none;
        padding: 0;
    }
    .menu-toggle {
        display: block;
        z-index: 3000;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    .logo {
        text-align: left;
        width: auto;
        overflow: visible;
        display: flex;
        align-items: center;
    }
    .container {
        padding: 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    header {
        height: 60px;
        padding: 8px 0;
    }
}

/* Hamburger menu styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    z-index: 3000;
}
.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    background: var(--color-bg-menu-icon);
    height: 4px;
    width: 28px;
    border-radius: 2px;
    position: absolute;
    left: 6px;
    transition: all 0.3s;
    content: '';
}
.menu-icon {
    position: relative;
}
.menu-icon::before {
    content: '';
    position: absolute;
    top: -10px;
}
.menu-icon::after {
    content: '';
    position: absolute;
    top: 10px;
}
.menu-toggle.active .menu-icon {
    background: transparent;
}
.menu-toggle.active .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}
.menu-toggle.active .menu-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile nav overlay */
@media (max-width: 900px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: #111;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px);
        padding: 0;
        gap: 0;
        z-index: 2000;
        overflow-y: auto;
        align-items: stretch;
        justify-content: flex-start;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links > li {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0;
    }
    .nav-links > li:last-child {
        position: static;
        margin-right: 0;
        width: 100%;
        justify-content: center;
    }
    .nav-header,
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 18px 0;
        font-size: 1.1em;
        border-bottom: 1px solid var(--color-border-nav-mobile);
    }
    .dropdown-menu,
    .mega-menu,
    .services-mega-menu {
        position: static !important;
        left: 0 !important;
        transform: none !important;
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 2100;
        background: var(--color-bg-menu-mobile);
        padding: 0;
    }
    .dropdown-menu.active,
    .mega-menu.active,
    .services-mega-menu.active {
        display: block;
    }
    .dropdown-menu li,
    .mega-menu-column,
    .services-mega-menu .services-tab-content a {
        width: 100%;
        text-align: center;
    }
    .services-mega-menu {
        padding: 0;
    }
    .services-tabs-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }
    .services-tab {
        border-radius: 0;
        width: 100%;
        text-align: center;
        margin-bottom: 2px;
        padding: 14px 0;
        font-size: 1em;
    }
    .services-tab-content {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        border-top: none;
        padding: 0;
    }
    .mega-menu-title {
        margin-top: 10px;
    }
}

/* Ensure menu toggle is visible on mobile */
@media (max-width: 900px) {
    .menu-toggle {
        display: block;
        z-index: 3000;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    .logo {
        text-align: left;
        width: auto;
        overflow: visible;
        display: flex;
        align-items: center;
    }
    .container {
        padding: 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    header {
        height: 60px;
        padding: 8px 0;
    }
}

.nav-header::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--color-text-main);
    transition: width 0.3s;
}

.nav-header:hover::after {
    width: 100%;
}

.dropdown-toggle {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 10px 15px;
    cursor: pointer;
    display: block;
    text-align: left;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-dropdown);
    border-radius: 4px;
    min-width: 220px;
    padding: 10px 0;
    list-style: none;
    z-index: 1000;
    overflow-x: hidden;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    color: var(--color-text-main);
    padding: 12px 20px;
    font-size: 14px;
    text-transform: uppercase;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: var(--color-bg-mega-col);
}

/* Services mega menu tab row */
.services-mega-menu {
    display: flex;
    flex-direction: column;
    min-width: 600px; /* was 400px */
    max-width: 900px; /* was 600px */
    padding: 24px 32px;
    gap: 0;
    background: var(--color-bg-mega);
}

.services-tabs-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 18px;
}

.services-tab {
    background: none;
    border: none;
    color: var(--color-text-tab);
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    padding: 8px 24px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s, color 0.2s;
    outline: none;
}

.services-tab.active,
.services-tab:hover {
    background: var(--color-bg-tab-hover);
    color: var(--color-text-tab-active);
}

.services-tab-content {
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start; /* Align columns at the top */
    gap: 32px;
    padding: 16px 0 0 0;
    border-top: 2px solid var(--color-border-tab-content);
}

.services-tab-content.active {
    display: flex;
}

.services-tab-content a {
    color: var(--color-text-main);
    background: var(--color-bg-mega-col);
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 1em;
    text-transform: none;
    margin: 0 4px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    font-weight: 500;
}

.services-tab-content a:hover {
    background: var(--color-bg-tab-content-hover);
    color: var(--color-text-tab-content-hover);
}

.dropdown-menu,
.mega-menu,
.services-mega-menu {
    display: none;
}

.dropdown-menu.active,
.mega-menu.active,
.services-mega-menu.active {
    display: block;
}

.services-tab-content {
    display: none;
}

.services-mega-menu.active .services-tab-content.active {
    display: flex;
}

@media (max-width: 900px) {
    .services-mega-menu {
        min-width: 0;
        max-width: 100vw;
        padding: 16px 8px;
        width: 100vw;
        left: 0 !important;
        transform: none !important;
        border-radius: 0;
        position: static !important;
        box-shadow: none;
    }
    .services-tabs-row {
        gap: 10px;
    }
    .services-tab-content {
        gap: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .services-mega-menu {
        min-width: 0;
        max-width: 100vw;
        padding: 10px 0;
    }
    .services-tabs-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 10px;
    }
    .services-tab {
        border-radius: 0;
        width: 100%;
        text-align: center;
        margin-bottom: 2px;
    }
    .services-tab-content {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        border-top: none;
        padding: 0;
    }
}

/* Mobile backgrounds for contrast */
@media (max-width: 900px) {
    .nav-links,
    .dropdown-menu,
    .mega-menu,
    .services-mega-menu {
        background: #ffe0b2;
    }
}

@media (max-width: 768px) {
    .nav-links,
    .dropdown-menu,
    .mega-menu,
    .services-mega-menu {
        background: #ffd699;
    }
}

.nav-header {
    width: 100%;
    text-align: center;
    padding: 15px;
    border: none;
    background: none;
    display: block;
}

.nav-header:hover {
    cursor: pointer;
}

.nav-links.active {
    display: flex;
}

.menu-toggle.active .menu-icon {
    background-color: transparent;
}

.menu-toggle.active .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.active .menu-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

.dropdown-menu.active {
    display: block;
}