/**
 * Navigation Styles for Royal Thai Experiences
 * Dropdown menu and navigation components
 */

/* Фіксована ширина для навігації */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}

.main-navigation li {
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.main-navigation > ul > li {
    height: 80px;
    display: flex;
    align-items: center;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    flex-shrink: 0;
    min-width: 180px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 0.5rem;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.75rem;
    margin-right: 0.25rem;
    border-right: 1px solid;
}

/* Темна тема для language switcher */
body:not(.light-theme) .lang-switcher {
    border-right-color: #2C3E50;
}

/* Світла тема для language switcher */
body.light-theme .lang-switcher {
    border-right-color: #E0E0E0;
}

.lang-switcher a {
    font-size: 0.875rem;
    text-transform: uppercase;
    transition: color 0.2s ease;
    padding: 0.25rem 0.4rem;
    font-weight: 600;
}

/* Темна тема для мовного перемикача */
body:not(.light-theme) .lang-switcher a {
    color: #BDC3C7;
}

body:not(.light-theme) .lang-switcher a.active {
    color: #E67E22;
    font-weight: 700;
}

body:not(.light-theme) .lang-switcher a:not(.active):hover {
    color: #E67E22;
}

/* Світла тема для мовного перемикача */
body.light-theme .lang-switcher a {
    color: #1A1A1A;
    font-weight: 700;
}

body.light-theme .lang-switcher a.active {
    color: #E67E22;
    font-weight: 700;
}

body.light-theme .lang-switcher a:not(.active):hover {
    color: #E67E22;
}

.lang-switcher span {
    font-size: 0.875rem;
}

/* Темна тема для розділювача */
body:not(.light-theme) .lang-switcher span {
    color: #4A5568;
}

/* Світла тема для розділювача */
body.light-theme .lang-switcher span {
    color: #CCCCCC;
}

/* WhatsApp icon */
.whatsapp-icon {
    font-size: 1.5rem;
    transition: color 0.2s ease;
}

/* Темна тема для WhatsApp */
body:not(.light-theme) .whatsapp-icon {
    color: #BDC3C7;
}

body:not(.light-theme) .whatsapp-icon:hover {
    color: #E67E22;
}

/* Світла тема для WhatsApp */
body.light-theme .whatsapp-icon {
    color: #1A1A1A;
}

body.light-theme .whatsapp-icon:hover {
    color: #E67E22;
}

/* ========== ДРОПДАУН МЕНЮ ========== */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.menu-item-has-children > a svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

/* Контейнер для підменю - не перехоплює події миші */
.sub-menu-container {
    position: absolute;
    left: 0;
    top: 100%;
    padding-top: 0;
    z-index: 50;
    pointer-events: none;
}

/* Підменю - перехоплює події миші */
.sub-menu {
    position: relative;
    min-width: 220px;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
}

/* Показуємо підменю ТІЛЬКИ при ховері на пункт меню */
.menu-item-has-children:hover .sub-menu-container {
    pointer-events: auto;
}

.menu-item-has-children:hover .sub-menu-container .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Анімація стрілки */
.menu-item-has-children:hover > a svg {
    transform: rotate(180deg);
}

/* ========== ТЕМНА ТЕМА ДЛЯ ПІДМЕНЮ ========== */
body:not(.light-theme) .sub-menu {
    background-color: #141D26 !important;
    border: 1px solid #2C3E50;
}

body:not(.light-theme) .sub-menu li {
    border-bottom: 1px solid #2C3E50;
}

body:not(.light-theme) .sub-menu li:last-child {
    border-bottom: none;
}

body:not(.light-theme) .sub-menu a {
    color: #FFFFFF !important;
    background-color: transparent !important;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

body:not(.light-theme) .sub-menu a:hover {
    background-color: #E67E22 !important;
    color: #0C1218 !important;
}

/* ========== СВІТЛА ТЕМА ДЛЯ ПІДМЕНЮ ========== */
body.light-theme .sub-menu {
    background-color: #FFFFFF !important;
    border: 1px solid #D0D0D0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body.light-theme .sub-menu li {
    border-bottom: 1px solid #E0E0E0;
}

body.light-theme .sub-menu li:last-child {
    border-bottom: none;
}

body.light-theme .sub-menu a {
    color: #1A1A1A !important;
    background-color: transparent !important;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

/* Ховер у світлій темі: оранжевий фон, БІЛІ букви */
body.light-theme .sub-menu a:hover {
    background-color: #E67E22 !important;
    color: #FFFFFF !important;
}

/* ========== СПІЛЬНІ СТИЛІ ДЛЯ ПІДМЕНЮ ========== */
.sub-menu li {
    list-style: none;
    white-space: nowrap;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

.sub-menu a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    height: 3rem;
    padding: 0 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
    line-height: 3rem;
    box-sizing: border-box;
}

/* Стилі для емодзі в субменю */
.sub-menu a img.emoji {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
    display: inline-block;
}

/* ========== ОСНОВНІ ПОСИЛАННЯ МЕНЮ ========== */
.main-navigation a {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    transition: color 0.2s ease;
    padding: 0.5rem 0.25rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Темна тема для основного меню */
body:not(.light-theme) .main-navigation a {
    color: #ECF0F1;
}

body:not(.light-theme) .main-navigation a:hover {
    color: #E67E22;
}

/* Світла тема для основного меню */
body.light-theme .main-navigation a {
    color: #1A1A1A;
    font-weight: 700;
}

body.light-theme .main-navigation a:hover {
    color: #E67E22;
}

/* Hover effects - підкреслення */
.menu-item-has-children > a {
    position: relative;
}

.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #E67E22, #FF9B33);
    transition: width 0.3s ease;
}

.menu-item-has-children:hover > a::after,
.menu-item-has-children > a:hover::after {
    width: 100%;
}

/* Анімація появи пунктів меню (тільки для появи, не для кольору) */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-menu li {
    animation: fadeInDown 0.2s ease forwards;
    opacity: 0;
}

.sub-menu li:nth-child(1) { animation-delay: 0.05s; }
.sub-menu li:nth-child(2) { animation-delay: 0.1s; }
.sub-menu li:nth-child(3) { animation-delay: 0.15s; }
.sub-menu li:nth-child(4) { animation-delay: 0.2s; }
.sub-menu li:nth-child(5) { animation-delay: 0.25s; }

/* Mobile menu styles */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.active {
    display: block;
}

#mobile-menu-toggle.active svg {
    transform: rotate(90deg);
}

/* Cart icon styles */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
}

/* Темна тема для корзини */
body:not(.light-theme) .cart-icon svg {
    stroke: #BDC3C7;
}

body:not(.light-theme) .cart-icon:hover svg {
    stroke: #E67E22;
}

/* Світла тема для корзини */
body.light-theme .cart-icon svg {
    stroke: #1A1A1A;
}

body.light-theme .cart-icon:hover svg {
    stroke: #E67E22;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #E67E22;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9999px;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Темна тема для лічильника */
body:not(.light-theme) .cart-count {
    background-color: #E67E22;
    color: #0C1218;
}

/* Світла тема для лічильника */
body.light-theme .cart-count {
    background-color: #E67E22;
    color: #FFFFFF;
}

/* ========== АДАПТАЦІЯ ДЛЯ РОСІЙСЬКОЇ МОВИ ========== */
body.ru-lang .main-navigation ul {
    gap: 0.4rem !important;
}

body.ru-lang .main-navigation li:not(.menu-item-has-children) a,
body.ru-lang .menu-item-has-children > a {
    padding: 0 0.15rem;
    font-size: 1rem;
}

body.ru-lang .lang-switcher {
    gap: 0.25rem !important;
    padding-right: 0.3rem !important;
    margin-right: 0.15rem !important;
}

body.ru-lang .lang-switcher a {
    padding: 0.15rem 0.2rem !important;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
    body.ru-lang .main-navigation ul {
        gap: 0.3rem !important;
    }
    
    .main-navigation ul {
        gap: 0.5rem;
    }
    
    .main-navigation a {
        font-size: 0.75rem;
    }
}

@media (max-width: 1024px) {
    .main-navigation {
        display: none;
    }
    
    .menu-item-has-children.active .sub-menu {
        display: flex;
        flex-direction: column;
    }
    
    .menu-item-has-children > a svg {
        margin-left: auto;
    }
    
    .header-actions {
        gap: 0.75rem;
    }
    
    .sub-menu a {
        height: 2.75rem;
        padding: 0 1.5rem;
        font-size: 0.85rem;
        line-height: 2.75rem;
    }
    
    body.ru-lang .main-navigation ul {
        gap: 0.2rem !important;
    }
    
    .main-navigation > ul > li {
        height: auto;
    }
}
