/* ==========================================================================
   Header & Footer Styles (header-footer.css)
   ========================================================================== */
nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    top: 2vh;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background-color 0.3s ease-in-out;
}

nav div {
    display: flex;
    align-items: center;
}

nav div:nth-child(2) {
    justify-content: center;
}

nav div:nth-child(3) {
    justify-content: flex-end;
    gap: 1rem; /* Add gap for potential multiple items */
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding-left: 0;
    gap: 50px;
    padding: 10px 20px;
    border-radius: 100px;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

nav button {
    background-color: #3a2616;
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 8px 15px;
}

.nav-link {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: inherit;
}

.nav-link span {
    display: inline-block;
    height: 8px;
    width: 8px;
    background-color: #3a2616;
    border-radius: 50px;
    visibility: hidden;
}

.nav-link.active span {
    visibility: visible;
}

.navbar-brand {
    padding: 10px 20px;
    border-radius: 100px;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar-brand h5 {
    margin-bottom: 0;
}

/* NEW: Mobile Menu Toggle Button Styles */
.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    color: #3a2616;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.5rem;
}

/* Styles for when the header is scrolled */
nav.scrolled ul,
nav.scrolled .navbar-brand {
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(14px) brightness(0.9);
}

@media only screen and (max-width: 800px) {
    nav {
        /* UPDATED: Change grid to position brand left, burger right */
        grid-template-columns: 1fr auto;
        padding: 0 1rem; /* Add some horizontal padding for mobile */
    }

    nav ul {
        display: none !important; /* This will hide the ul regardless of scroll on mobile */
    }

    nav div:nth-child(2) {
        display: none; /* Hide the desktop nav container */
    }

    .header-phone-btn {
        display: none; /* Hide the desktop phone button */
    }

    .mobile-menu-toggle {
        display: block; /* Show the burger menu button */
    }
}

/* ==========================================================================
   MEGA MENU STYLES
   ========================================================================== */

body.megamenu-active {
    overflow: hidden;
}

.mega-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background-color: rgba(58, 38, 22, 0.3);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mega-menu.is-open {
    opacity: 1;
    visibility: visible;
}

.mega-menu__content {
    position: relative;
    top: 12vh;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) brightness(1.05);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    transform: translateY(-20px);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.mega-menu.is-open .mega-menu__content {
    transform: translateY(0);
}

.mega-menu__close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: #3a2616;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.mega-menu__close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* UPDATED: Container for all link categories */
.mega-menu__main-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mega-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem 2.5rem;
}

/* NEW: Styles for the main navigation links when inside the mega menu */
.mega-menu__category--main-nav {
    /* This makes it span the full width of the grid */
    grid-column: 1 / -1;
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(58, 38, 22, 0.15);
}
.mega-menu__category--main-nav .mega-menu__sub-list {
    flex-direction: row; /* Display links side-by-side if space allows */
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2.5rem; /* Row and column gap */
}
.mega-menu__category--main-nav a {
    font-size: 1.25rem; /* Larger font for primary links */
    font-weight: 600;
    opacity: 1;
    padding: 0.5rem;
}
.mega-menu__category--main-nav a:hover {
    transform: none; /* No indent on hover for these main links */
}

.mega-menu__category-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(58, 38, 22, 0.15);
}

.mega-menu__category-title a {
    color: #3a2616;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mega-menu__category-title a:hover {
    color: #5c442e;
}

.mega-menu__sub-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-menu__sub-list a {
    display: block;
    color: #3a2616;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    padding: 0.25rem 0;
    transition: color 0.2s ease, transform 0.2s ease;
    opacity: 0.85;
}

.mega-menu__sub-list a:hover {
    color: #e91e63;
    opacity: 1;
    transform: translateX(3px);
}

.mega-menu__feature {
    background-color: rgba(58, 38, 22, 0.05);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feature-image-placeholder {
    font-size: 3rem;
    color: #3a2616;
    margin-bottom: 1rem;
}
.mega-menu__feature h5 {
    font-size: 1.25rem;
    color: #3a2616;
    margin: 0 0 0.5rem 0;
}
.mega-menu__feature p {
    font-size: 0.95rem;
    color: #5c442e;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    max-width: 300px;
}
.btn-feature {
    background-color: #3a2616;
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(58, 38, 22, 0.3);
}

@media (max-width: 992px) {
    .mega-menu__content {
        grid-template-columns: 1fr;
        top: 10vh;
        padding: 2rem;
        max-height: 85vh; /* Prevent menu from being too long */
        overflow-y: auto; /* Allow scrolling if content overflows */
    }
    .mega-menu__feature {
        margin-top: 2rem;
    }
}

@media (max-width: 800px) {
    .mega-menu__list {
        grid-template-columns: 1fr;
    }
    /* Stack the main nav links vertically on smaller screens */
    .mega-menu__category--main-nav .mega-menu__sub-list {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   MOBILE NAVIGATION PANEL STYLES
   ========================================================================== */

/* This class on the body prevents scrolling when the mobile menu is open */
body.mobile-menu-active {
    overflow: hidden;
}

/* The dark overlay behind the panel */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998; /* Below the panel, above the content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* The slide-in navigation panel itself */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85%;
    background-color: #ffffff;
    z-index: 1001; /* Highest z-index */
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    /* Start off-screen */
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.mobile-nav.is-open {
    transform: translateX(0);
}

.mobile-nav__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.mobile-nav__header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #3a2616;
}

.mobile-nav__close {
    background: none;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    color: #3a2616;
    padding: 0;
    opacity: 0.7;
    cursor: pointer;
}

.mobile-nav__content {
    flex-grow: 1; /* Take up remaining space */
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto; /* Allow scrolling if content is long */
}

.mobile-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.mobile-nav__list a {
    display: block;
    padding: 1rem 0;
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    color: #3a2616;
    border-bottom: 1px solid #f1f3f5;
    transition: color 0.2s ease;
}

.mobile-nav__list a:hover {
    color: #e91e63; /* Accent color */
}

.mobile-nav__cta {
    margin-top: 2rem;
    text-align: center;
    text-decoration: none;
}

.mobile-nav__cta button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 12px;
    color: #fff;
    background-color: #3a2616;
}
