:root {
    --wipi-bg-light: linear-gradient(339deg, #e1efff, #ffffff);
    --wipi-bg-dark: linear-gradient(339deg, #03172e, #000000);
    --panel-height: 60px;
    --btn-height: 38px;
    --btn-active-height: 38px;
}

body {
    transition: background 0.5s ease;
    min-height: 100vh;
}

body.light-theme {
    background: var(--wipi-bg-light) fixed;
    color: #1d1d1f;
}

body.dark-theme {
    background: var(--wipi-bg-dark) fixed;
    color: #f5f5f7;
}

.wipi-headmenu-section {
    width: 100%;
    height: var(--panel-height);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background 0.3s ease;
}

body.dark-theme .wipi-headmenu-section {
    background: rgba(0, 0, 0, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wipi-main-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: relative;
    height: 100%;
    gap: 20px;
}

/* Scroll Area (Unified) */
.wipi-scroll-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.wipi-scroll-wrapper.menu-hidden {
    opacity: 0;
    transform: scale(0.95) translateX(-20px);
    pointer-events: none;
    max-width: 0;
}

.wipi-menu-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 12px;
    padding: 0 40px;
    scroll-behavior: smooth;
    align-items: center;
    width: 100%;
    height: 60px;
}

.wipi-menu-container::-webkit-scrollbar {
    display: none;
}

/* Service Items */
.wipi-menu-item {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.06);
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 13px;
    height: var(--btn-height);
    border: 1px solid transparent;
}

body.dark-theme .wipi-menu-item {
    background: rgba(255, 255, 255, 0.1);
}

.wipi-menu-item i {
    font-size: 15px;
    margin-right: 6px;
    line-height: 1;
}

.wipi-menu-item:hover {
    background: rgba(0, 113, 227, 0.2);
    transform: translateY(-1px);
}

/* Active Service Style */
.wipi-menu-item.active {
    background: #0071e3;
    color: #ffffff;
    height: var(--btn-active-height);
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 5px rgba(0, 113, 227, 0.3);
}

.wipi-menu-item.active i {
    font-size: 18px;
}

/* Navigation Arrows */
.scroll-nav-btn {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

body.dark-theme .scroll-nav-btn {
    background: rgba(45, 45, 45, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f5f5f7;
}

.scroll-nav-btn:hover {
    background: #0071e3;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.scroll-nav-left {
    left: 5px;
}

.scroll-nav-right {
    right: 5px;
}

/* Right Actions */
.wipi-headmenu-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: fit-content;
}

.theme-toggle-btn-desktop,
.menu-toggle-btn-desktop,
.avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark-theme .theme-toggle-btn-desktop,
body.dark-theme .menu-toggle-btn-desktop,
body.dark-theme .avatar-btn {
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle-btn-desktop.active {
    background: #0071e3 !important;
    color: #ffffff !important;
}

.avatar-btn {
    background: #0071e3;
    color: #ffffff;
}

.wipi-user-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    min-width: 220px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 2000;
}

body.dark-theme .dropdown-menu {
    background: rgba(28, 28, 28, 0.98);
    border-color: rgba(255, 255, 255, 0.12);
}

.dropdown-menu.active {
    display: flex;
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 113, 227, 0.1);
    color: #0071e3;
}

@media (max-width: 768px) {
    .wipi-main-container {
        padding: 0 15px;
    }

    .scroll-nav-btn,
    .theme-toggle-btn-desktop {
        display: none;
    }

    .wipi-menu-container {
        padding: 0 15px;
    }
}

/* Premium Dark Theme Item Hovers */
body.dark-theme .wipi-menu-item-food:hover {
    background: #6b0000;
}

body.dark-theme .wipi-menu-item-tube:hover {
    background: #800000;
}

body.dark-theme .wipi-menu-item-learn:hover {
    background: #004d00;
}

body.dark-theme .wipi-menu-item-medx:hover {
    background: #00004d;
}

body.dark-theme .wipi-menu-item-shop:hover {
    background: #4d2e00;
}

body.dark-theme .wipi-menu-item-link:hover {
    background: #004d4d;
}