/* Custom Floating Header Base Styles */
body {
    padding-top: 100px;
    /* Default height + gap */
    transition: padding-top 0.4s ease;
}

@media (max-width: 1280px) {
    body {
        padding-top: 90px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }
}

.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    padding: 8px;
    pointer-events: none;
}

.header-container {
    pointer-events: auto;
    margin-left: auto;
    margin-right: auto;
    max-width: 80rem;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #f1f5f9;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


@media (min-width: 768px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
}

@media (min-width: 1280px) {
    .header-container {
        padding: 0.75rem 2rem;
    }
}

.header-scrolled {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1) !important;
}

/* Logo Details */
.header-logo-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none !important;
}

.header-logo-img {
    position: absolute;
    height: 4.5rem;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo-container:hover .header-logo-img {
    transform: scale(1.05);
}

/* Navigation System */
.header-nav {
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
}

@media (min-width: 1024px) {
    .header-nav {
        display: flex;
        margin-left: 3rem;
        gap:2px;
    }
}

@media (min-width: 1400px) {
    .header-nav {
        gap: 1rem;
    }
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
    color: inherit;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link-active {
    color: var(--brand-primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--brand-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link-active::after {
    width: 80%;
}

.nav-link:hover svg,
.nav-link-active svg {
    stroke: var(--brand-primary);
}

.nav-icon {
    width: 18px;
    height: 18px;
    stroke: var(--brand-primary);
}

/* Dropdown System */
.header-dropdown-wrap {
    position: relative;
}

.header-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    min-width: 15rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 100;
}

.header-dropdown-menu.mega-menu {
    min-width: 35rem;
    max-height: 400px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 1rem;
}

/* Custom Scrollbar for Mega Menu */
.header-dropdown-menu.mega-menu::-webkit-scrollbar {
    width: 6px;
}

.header-dropdown-menu.mega-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 0 12px 12px 0;
}

.header-dropdown-menu.mega-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.header-dropdown-menu.mega-menu::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

.header-dropdown-wrap:hover .header-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(15px);
}

.header-dropdown-wrap:hover>.nav-link {
    color: var(--brand-primary) !important;
}

.header-dropdown-wrap:hover>.nav-link::after {
    width: 80%;
}

.dropdown-item-link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-link:hover {
    background-color: #f1f5f9;
    color: var(--brand-primary) !important;
}

/* Right Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .header-actions {
        gap: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .header-actions {
        gap: 1.25rem;
    }
}

@media (max-width: 991.98px) {
    body {
        padding-top: 60px !important;
    }

    .frontend-mobile-header {
        display: block;
    }

    .frontend-mobile-header .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1038;
        background: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(2px);
    }

    .frontend-mobile-header .mobile-nav-backdrop.active {
        display: block;
    }

    .frontend-mobile-header .famous-header-mobile {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1055;
        background: #ffffff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    }

    .frontend-mobile-header .famous-header-mobile .container {
        max-width: 100% !important;
        padding: 0 16px;
    }

    .frontend-mobile-header .famous-header-mobile .header-row,
    .frontend-mobile-header #header.famous-header-mobile .mobile-header-row {
        min-height: 60px !important;
        display: flex;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
    }

    .frontend-mobile-header #header.famous-header-mobile .mobile-header-brand {
        flex: 0 1 auto !important;
        min-width: 0;
        max-width: calc(100% - 52px);
        z-index: 2;
    }

    .frontend-mobile-header #header.famous-header-mobile .mobile-header-drawer {
        flex: 0 0 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .frontend-mobile-header .famous-header-mobile .logo {
        padding: 0 !important;
        flex: 0 0 auto !important;
        display: block !important;
    }

    .frontend-mobile-header .famous-header-mobile .logo a {
        display: block !important;
    }

    .frontend-mobile-header .famous-header-mobile .logo img {
        height: 72px !important;
        width: auto !important;
        object-fit: contain !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute;
        top: -35px;
    }

    .frontend-mobile-header .famous-header-mobile .nav-toggler,
    .frontend-mobile-header #header.famous-header-mobile .mobile-header-toggler {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 8px !important;
        border-radius: 10px !important;
        margin-left: auto !important;
        transition: background 0.2s ease;
        flex: 0 0 auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .frontend-mobile-header .famous-header-mobile .nav-toggler span {
        display: block !important;
        width: 22px !important;
        height: 2px !important;
        background: #363636 !important;
        border-radius: 2px !important;
        transition: all 0.3s ease;
        color: transparent !important;
        font-size: 0 !important;
    }

    .frontend-mobile-header #header.famous-header-mobile .navbar-toggler,
    .frontend-mobile-header #header.famous-header-mobile .nav-toggler {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 3;
        flex-shrink: 0 !important;
    }

    .frontend-mobile-header #header.famous-header-mobile .navbar-toggler-icon {
        display: none !important;
    }

    .frontend-mobile-header #header.famous-header-mobile .primary-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        flex-wrap: nowrap !important;
        flex-grow: 0 !important;
        flex-basis: auto !important;
        z-index: auto !important;
    }

    .frontend-mobile-header #header.famous-header-mobile .primary-menu::before {
        display: none !important;
        content: none !important;
    }

    .frontend-mobile-header #header.famous-header-mobile .primary-menu > .navbar-collapse.mobile-nav-panel {
        position: fixed;
        display: block;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        background: #ffffff;
        border: none;
        border-top: 1px solid #e8ecf4;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        z-index: 1045;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
    }

    .frontend-mobile-header #header.famous-header-mobile .primary-menu > #header-nav.mobile-nav-panel:not(.show) {
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
    }

    .frontend-mobile-header #header.famous-header-mobile .primary-menu > #header-nav.mobile-nav-panel.show {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .frontend-mobile-header .famous-header-mobile .primary-menu ul.navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
    }

    .frontend-mobile-header .famous-header-mobile .primary-menu ul.navbar-nav > li > a,
    .frontend-mobile-header .famous-header-mobile .primary-menu ul.navbar-nav > li > button.dropdown-toggle.header-menu-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 13px 20px !important;
        color: var(--text-high) !important;
        font-weight: 600;
        font-size: 0.9rem;
        border-radius: 0 !important;
        border-bottom: 1px solid #f5f5f5;
        transition: background 0.18s ease, color 0.18s ease;
        text-decoration: none !important;
    }

    .frontend-mobile-header .famous-header-mobile .primary-menu ul.navbar-nav > li > a:hover,
    .frontend-mobile-header .famous-header-mobile .primary-menu ul.navbar-nav > li > button.dropdown-toggle.header-menu-link:hover,
    .frontend-mobile-header .famous-header-mobile .primary-menu ul.navbar-nav > li.active > a {
        background: var(--light-bg);
        color: var(--brand-primary) !important;
    }

    .frontend-mobile-header .famous-header-mobile .header-menu-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: rgba(24, 164, 248, 0.1);
        border-radius: 8px;
        flex-shrink: 0;
    }

    .frontend-mobile-header .famous-header-mobile .header-menu-icon i {
        font-size: 0.85rem;
        color: var(--brand-primary) !important;
    }

    .frontend-mobile-header #header.famous-header-mobile #header-nav .dropdown {
        position: relative;
    }

    .frontend-mobile-header #header.famous-header-mobile #header-nav .dropdown-menu {
        position: static !important;
        float: none !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: var(--light-bg);
        padding: 4px 0 4px 52px;
        margin: 0;
        width: 100%;
        transform: none !important;
    }

    .frontend-mobile-header #header.famous-header-mobile #header-nav .dropdown-menu .dropdown-item {
        font-size: 0.83rem;
        font-weight: 500;
        color: var(--text-medium) !important;
        padding: 9px 16px;
        border-radius: 0;
        white-space: normal;
        transition: color 0.18s ease;
    }

    .frontend-mobile-header #header.famous-header-mobile #header-nav .dropdown-menu .dropdown-item:hover {
        background: transparent;
        color: var(--brand-primary) !important;
    }

    .frontend-mobile-header .famous-header-mobile .popular-routes-panel {
        position: static !important;
        display: block !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        padding: 0 0 0 12px;
        max-height: 220px;
        overflow-y: auto;
        background: transparent;
        width: 100% !important;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px 20px;
        background: linear-gradient(135deg, rgba(24, 164, 248, 0.08) 0%, rgba(24, 164, 248, 0.02) 100%);
        border-bottom: 1px solid #e8ecf4;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-avatar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        flex-shrink: 0;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: var(--brand-box-shadow, 0 4px 14px rgba(24, 164, 248, 0.18));
        color: var(--brand-primary);
        font-size: 1.2rem;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-info {
        flex: 1;
        min-width: 0;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-name {
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--text-high);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-sub {
        font-size: 0.78rem;
        color: var(--text-medium);
        margin-top: 2px;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-sub-link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 0.78rem;
        color: var(--brand-primary) !important;
        font-weight: 600;
        margin-top: 2px;
        text-decoration: none !important;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-sub-link i {
        font-size: 0.65rem;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-account-cta {
        flex-shrink: 0;
        padding: 8px 14px;
        border-radius: 999px;
        background: var(--brand-primary);
        color: #fff !important;
        font-size: 0.78rem;
        font-weight: 700;
        text-decoration: none !important;
        white-space: nowrap;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-quicklinks {
        display: flex;
        gap: 10px;
        padding: 8px 20px;
        border-bottom: 1px solid #e8ecf4;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-quicklink {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 10px 8px;
        border-radius: 14px;
        background: var(--light-bg);
        color: var(--text-high) !important;
        font-size: 0.76rem;
        font-weight: 600;
        text-decoration: none !important;
        text-align: center;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-quicklink i {
        color: var(--brand-primary);
        font-size: 1rem;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-divider {
        margin: 8px 20px;
        border-top: 1px solid #eef1f5;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-contact-strip {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-top: 4px;
        padding: 10px 20px 14px;
        border-top: 1px solid #e8ecf4;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-contact-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 0;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--text-medium) !important;
        text-decoration: none !important;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-contact-item i {
        width: 18px;
        color: var(--brand-primary);
        font-size: 0.82rem;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-social {
        display: flex;
        gap: 10px;
        margin-top: 10px;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-social-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--light-bg);
        color: var(--brand-primary) !important;
        font-size: 0.9rem;
        text-decoration: none !important;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-logout {
        padding: 4px 20px 20px;
    }

    .frontend-mobile-header .famous-header-mobile .mnav-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px;
        border-radius: 14px;
        border: 1px solid rgba(202, 2, 52, 0.25);
        background: rgba(202, 2, 52, 0.06);
        color: var(--alert, #ca0234) !important;
        font-weight: 700;
        font-size: 0.85rem;
        text-decoration: none !important;
    }
}

.header-phone {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none !important;
    transition: color 0.2s;
}

@media (min-width: 1280px) {
    .header-phone {
        display: flex;
    }
}

.header-phone:hover {
    color: var(--brand-primary) !important;
}

.header-phone-icon {
    padding: 0.375rem;
    background-color: #f1f5f9;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-phone-icon svg {
    width: 14px;
    height: 14px;
    color: var(--brand-primary);
    stroke: var(--brand-primary);
}

/* Language Switcher */
.lang-switcher {
    background-color: #f1f5f9;
    padding: 0.25rem;
    border-radius: 9999px;
    display: flex;
    gap: 0.25rem;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.lang-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.3s;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    line-height: normal;
}

.lang-btn:hover {
    color: #475569 !important;
}

.lang-btn.active {
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    color: var(--brand-primary) !important;
}

/* Divider */
.header-divider {
    display: none;
    height: 1.5rem;
    width: 1px;
    background-color: #e2e8f0;
}

@media (min-width: 768px) {
    .header-divider {
        display: block;
    }
}

/* Action/Login Button */
.header-btn {
    background: var(--bg-gradient);
    color: white !important;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none !important;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    line-height: normal;
}

@media (min-width: 768px) {
    .header-btn {
        padding: 0.625rem 1.75rem;
    }
}

.header-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.header-btn:active {
    transform: scale(0.95);
}

/* User Profile Mini Display */
.header-user-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem 0.375rem 0.375rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}

.header-user-display:hover {
    background-color: #f1f5f9;
}

.header-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.header-user-avatar svg {
    width: 16px;
    height: 16px;
}

.header-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
