/* 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 (max-width: 1280px) {
    .header-container {
        max-width: 60rem;
    }
}

@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;
    }
}

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

.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;
    }
}

.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;
}