/* Fixed Header Styles - Оптимізований та очищений */

/* Основні стилі фіксованого хедера */
.fixed-header-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    height: auto;
}

.fixed-header-overlay.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.fixed-header-overlay .navbar {
    background: transparent;
    padding: 15px 0;
    margin: 0;
    min-height: auto;
    height: auto;
}

.fixed-header-overlay .navbar-brand img {
    height: 40px;
    transition: height 0.3s ease;
}

.fixed-header-overlay .nav-link,
.fixed-header-overlay .navbar-nav .nav-link,
.fixed-header-overlay .main-menu ul li a,
.fixed-header-overlay .main-menu ul .menu-item a {
    color: #282828 !important;
    transition: color 0.3s ease;
}

.fixed-header-overlay .nav-link:hover,
.fixed-header-overlay .navbar-nav .nav-link:hover,
.fixed-header-overlay .main-menu ul li a:hover,
.fixed-header-overlay .main-menu ul .menu-item a:hover {
    color: #FF0000 !important;
}

/* Мега-меню у фіксованому хедері - ЦЕНТРОВАНЕ ВІДНОСНО VIEWPORT */
.fixed-header-overlay .mega-menu {
    position: relative;
}

.fixed-header-overlay .mega-menu-content {
    position: fixed !important;
    top: 70px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-10px) !important;
    background: white !important;
    border: 1px solid #E5E5E5 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    padding: 30px !important;
    display: none !important;
    width: 1200px !important;
    max-width: calc(100vw - 80px) !important;
    min-width: 300px !important;
    z-index: 10000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
}

/* Створюємо невидимий "міст" між меню та випадаючим меню у фіксованому хедері */
.fixed-header-overlay .mega-menu .mega-menu-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 30%;
    right: 30%;
    height: 20px;
    background: transparent;
    z-index: -1;
}

/* Спеціальний міст для першого мега-меню (Residential) у фіксованому хедері */
.fixed-header-overlay .mega-menu:first-of-type .mega-menu-content::before {
    left: 20%;
    right: 20%;
}

.fixed-header-overlay .mega-menu:hover .mega-menu-content {
    display: flex !important;
    gap: 40px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
}

.fixed-header-overlay .mega-menu-column {
    flex: 1;
    min-width: 150px;
}

.fixed-header-overlay .mega-menu-column h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #FF0000;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fixed-header-overlay .mega-menu-column h4 a {
    color: #FF0000;
    text-decoration: none;
    transition: opacity 0.3s ease;
    font-weight: 600;
    font-size: 15px;
}

.fixed-header-overlay .mega-menu-column h4 a:hover {
    opacity: 0.8;
    color: #FF0000;
}

.fixed-header-overlay .mega-menu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
    visibility: visible;
    opacity: 1;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

.fixed-header-overlay .mega-menu-column ul li {
    margin-bottom: 8px;
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
}

.fixed-header-overlay .mega-menu-column ul li a {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

.fixed-header-overlay .mega-menu-column ul li a:hover {
    color: #FF0000;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

/* Підменю у фіксованому хедері */
.fixed-header-overlay .submenu {
    position: relative;
}

.fixed-header-overlay .submenu-content {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(-10px);
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 15px;
    display: none;
    width: 200px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fixed-header-overlay .submenu:hover .submenu-content {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fixed-header-overlay .submenu-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fixed-header-overlay .submenu-content ul li {
    margin-bottom: 8px;
}

.fixed-header-overlay .submenu-content ul li:last-child {
    margin-bottom: 0;
}

.fixed-header-overlay .submenu-content ul li a {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 4px 0;
}

.fixed-header-overlay .submenu-content ul li a:hover {
    color: #FF0000;
}

/* Locations мега-меню - горизонтальний layout */
.fixed-header-overlay .mega-menu:last-of-type .mega-menu-content {
    width: auto;
    max-width: 500px;
    min-width: 400px;
    padding: 20px 30px;
}

.fixed-header-overlay .locations-column {
    width: 100%;
    text-align: center;
}

.fixed-header-overlay .locations-column h4 {
    text-align: center;
    margin-bottom: 20px;
}

.fixed-header-overlay .locations-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 15px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fixed-header-overlay .locations-list li {
    margin-bottom: 0;
}

.fixed-header-overlay .locations-list a {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}


/* Адаптивність */
@media (max-width: 1199px) {
    .fixed-header-overlay .mega-menu-content {
        width: 1000px;
        max-width: calc(100vw - 60px);
        gap: 30px;
        padding: 25px;
    }
}

@media (max-width: 1024px) {
    .fixed-header-overlay .mega-menu-content {
        width: 900px;
        max-width: calc(100vw - 60px);
        gap: 25px;
        padding: 20px;
    }
}

@media (max-width: 800px) {
    .fixed-header-overlay .mega-menu-content {
        width: 700px;
        max-width: calc(100vw - 40px);
        gap: 20px;
        padding: 15px;
    }
}

/* Повністю приховати фіксований хедер на мобільних пристроях */
@media (max-width: 991px) {
    .fixed-header-overlay {
        display: none;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }
}