/* my-php-website/assets/css/header_new.css */

/* ========================================================
   GLOBAL VARIABLES FOR NEW HEADER
   ======================================================== */
:root {
    --header-text-color: #ffffff;
    --header-text-hover: #d29a5a; /* Brownish/Orange color from the image */
    --badge-bg-color: #d29a5a;
    --topbar-bg: #111116; /* Very dark blue/black */
    --topbar-text: #b0b0b0;
    --dropdown-bg: #1a1a24;
    --font-family: 'Inter', sans-serif;
}
body {
    font-family: var(--font-family);
}

/* We removed the body padding-top overrides since header is now sticky */

/* ========================================================
   HEADER WRAPPER (Absolute positioning over the slider)
   ======================================================== */
.site-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

body.inner-page .site-header-overlay {
    position: sticky;
    top: 0;
    background-color: var(--topbar-bg);
}

@keyframes slideDownHeader {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.site-header-overlay.scrolled {
    position: fixed;
    background-color: var(--topbar-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Removed animation to prevent sliding jump */
}

/* Fix inner-page shake issue: keep it sticky instead of fixed */
body.inner-page .site-header-overlay.scrolled {
    position: sticky !important;
    top: 0 !important;
    animation: none !important;
}

/* Also prevent padding from changing to prevent height jump */
body.inner-page .site-header-overlay.scrolled .header-main-nav {
    padding: 20px 40px;
}

/* We removed the hiding of header-top-bar completely so it doesn't jump */

/* Inner page specific styles can remain here if needed, but header overlap padding is removed */

/* ========================================================
   TOP BAR
   ======================================================== */
.header-top-bar {
    background-color: var(--topbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: visible;
    opacity: 1;
    position: relative;
    z-index: 50;
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    min-height: 40px;
}

.site-header-overlay.scrolled .header-top-bar {
    transform: translateY(-100%);
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.top-bar-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    transition: padding 0.4s ease;
}

.site-header-overlay.scrolled .top-bar-container {
    padding-top: 0;
    padding-bottom: 0;
}

.top-bar-right {
    display: flex;
    gap: 25px;
    align-items: center;
}

.top-bar-right a {
    color: var(--topbar-text);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar-right a:hover {
    color: var(--header-text-hover);
}

.top-bar-dropdown {
    cursor: pointer;
    transition: color 0.3s;
}

.top-bar-dropdown:hover {
    color: var(--header-text-hover);
}

.top-bar-dropdown i {
    font-size: 10px;
    margin-left: 4px;
}

/* ========================================================
   MAIN NAVIGATION BAR
   ======================================================== */
.header-main-nav {
    padding: 20px 40px;
    transition: padding 0.3s ease;
    min-height: 80px;
    box-sizing: border-box;
}

.site-header-overlay.scrolled .header-main-nav {
    padding: 15px 40px;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Left: Navigation Menu --- */
.nav-left-menu {
    flex: 1; /* Takes up equal space on the left */
}

.desktop-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: clamp(10px, 1.5vw, 25px);
    flex-wrap: nowrap;
}

.desktop-menu > li {
    position: relative;
    height: 100%;
}

.desktop-menu > li > a {
    color: var(--header-text-color);
    text-decoration: none;
    font-size: clamp(11px, 1.1vw, 15px);
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.5;
}

.desktop-menu > li > a:hover {
    color: var(--header-text-hover);
}

.desktop-menu > li > a i {
    font-size: 11px;
    opacity: 0.7;
}

/* Dropdown Menu styling for dark theme */
.desktop-menu .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #111111; /* Dark background as in image */
    min-width: 200px;
    list-style: none;
    padding: 10px 0; /* Reduced padding from 15px to 10px for tighter spacing */
    margin: 10px 0 0 0;
    border-radius: 0; /* Four sharp corners, not rounded */
    border: 1px solid rgba(255, 255, 255, 0.08); /* Lighting edge design */
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15); /* Lighting effect behind the card */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.desktop-menu li:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Second level and deeper dropdowns */
.desktop-menu .dropdown-menu li {
    position: relative !important; /* Force relative position to align child sub-menus */
}
.desktop-menu .dropdown-menu .dropdown-menu {
    top: -10px !important; /* Aligns top border exactly with parent top card edge (compensates for 10px padding) */
    left: 100% !important;
    margin-top: 0 !important;
    margin-left: 0 !important; /* Touch directly to prevent mouse gap closure */
    border-radius: 0;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
    transform: translateX(5px); /* Reduced slide-in transition to keep cursor boundary safe */
}
.desktop-menu .dropdown-menu li:hover > .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
}

.desktop-menu .dropdown-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 25px; /* Reduced vertical padding from 7px to 5px for tighter spacing */
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-transform: capitalize;
    transition: background 0.3s, color 0.3s;
}

.desktop-menu .dropdown-menu li a i {
    font-size: 12px;
    opacity: 0.7;
    margin-left: auto !important; /* Force arrow to align to the far right */
    padding-left: 15px; /* Ensure gap between text and arrow */
}

.desktop-menu .dropdown-menu li a:hover {
    background-color: transparent;
    color: var(--header-text-hover);
}

/* --- Center: Logo --- */
.nav-center-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    text-align: center;
}

.nav-center-logo .logo-text {
    font-size: 32px;
    font-weight: 700;
    color: var(--header-text-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-center-logo img {
    max-height: 40px;
    width: auto;
}

/* --- Right: Action Icons --- */
.nav-right-icons {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 22px;
}

.nav-right-icons a {
    color: var(--header-text-color);
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s;
}

.nav-right-icons a:hover {
    color: var(--header-text-hover);
}

/* Badges for Cart, Wishlist, Compare */
.icon-with-badge {
    position: relative;
    display: inline-flex;
}

.icon-with-badge .badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--badge-bg-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ========================================================
   SEARCH DROPDOWN (Toggled via JS or hover if preferred)
   ======================================================== */
.header-search-dropdown {
    position: absolute;
    top: 100%;
    right: 40px;
    background-color: var(--dropdown-bg);
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none; /* Add JS to toggle this */
    z-index: 1001;
    width: 300px;
}

.header-search-dropdown form {
    display: flex;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.header-search-dropdown input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 15px;
    width: 100%;
    outline: none;
}

.header-search-dropdown button {
    background: var(--header-text-hover);
    border: none;
    color: #fff;
    padding: 0 15px;
    cursor: pointer;
}

/* ========================================================
   MOBILE & TABLET RESPONSIVENESS
   ======================================================== */
.hamburger-menu {
    display: none;
}

@media (max-width: 767px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden !important;
    }

    .site-header-overlay,
    .header-main-nav,
    .nav-container {
        box-sizing: border-box !important;
    }

    .site-header-overlay {
        position: absolute !important;
        background-color: transparent !important;
    }
    
    body.inner-page .site-header-overlay,
    body.inner-page .site-header-overlay.scrolled {
        background-color: var(--topbar-bg) !important;
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1005 !important;
    }
    
    .site-header-overlay.scrolled {
        position: fixed !important;
        background-color: var(--topbar-bg) !important;
    }
    
    body.inner-page #main-content-area {
        padding-top: 110px !important; /* Increased padding to accommodate taller mobile header with top-bar */
    }
    
    .top-bar-container {
        padding: 10px 20px;
    }
    
    .header-main-nav {
        padding: 0 !important;
    }
    
    .site-header-overlay.scrolled .header-main-nav {
        padding: 0 !important;
    }
    
    .site-header-overlay.scrolled .header-main-nav .nav-container {
        padding: 8px 15px !important;
        gap: 12px !important;
    }
    
    .nav-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 8px 15px !important;
        flex-wrap: nowrap !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }
    
    .desktop-menu {
        display: none; /* Hide left menu on mobile */
    }
    
    .nav-left-menu {
        display: none !important; /* Hide completely on mobile */
    }
    
    .nav-center-logo {
        flex: 1 !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
        margin-right: auto !important;
        margin-left: 0 !important;
        overflow: hidden !important;
    }

    .nav-center-logo .logo-text {
        font-size: 18px !important;
        font-weight: 300 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        max-width: 100% !important;
        transform: none !important;
        transition: none !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }
    .nav-center-logo .logo-text:hover,
    .nav-center-logo .logo-text:active {
        transform: none !important;
    }
    
    .nav-right-icons {
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    .nav-right-icons a {
        font-size: 18px !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    .nav-right-icons a:hover,
    .nav-right-icons a:active {
        transform: scale(1.2) !important;
    }

    .user-avatar-trigger {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .user-avatar-trigger:hover,
    .user-avatar-trigger:active {
        transform: scale(1.2) !important;
    }
    .user-avatar-trigger .caret-icon {
        font-size: 8px !important;
    }

    .header-avatar-img,
    .header-avatar-placeholder {
        width: 22px !important;
        height: 22px !important;
        font-size: 10px !important;
    }
    
    .icon-with-badge .badge {
        font-size: 8px !important;
        height: 12px !important;
        width: 12px !important;
        top: -4px !important;
        right: -6px !important;
    }
    
    .search-icon-trigger {
        display: none !important;
    }
    
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px !important;
        height: 18px !important;
        cursor: pointer;
        margin-left: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .hamburger-menu:hover,
    .hamburger-menu:active,
    .hamburger-menu.active {
        transform: scale(1.25) !important;
    }

    .hamburger-menu .bar {
        width: 100% !important;
        height: 2.2px !important;
        background-color: var(--header-text-color);
        transition: 0.3s;
    }
    
    .header-top-bar {
        display: none; /* Usually top bar is hidden on mobile to save space */
    }
}

/* ========================================================
   MOBILE OFFCANVAS SIDEBAR (Dark Theme match)
   ======================================================== */
.mobile-nav-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px !important;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh; /* Fix for mobile browser toolbars */
    padding-bottom: 20px; /* Extra safe padding for bottom */
    background-color: #111111; /* Sleek black */
    z-index: 2000;
    transform: translateX(-100%) scale(0.9);
    transform-origin: left center;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0.35s;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.mobile-nav-sidebar.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-nav-header .logo-text {
    font-size: 20px !important;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.mobile-nav-header i {
    font-size: 22px !important;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s ease !important;
}
.mobile-nav-header i:hover {
    transform: scale(1.2) !important;
}

.mobile-sidebar-actions {
    padding: 15px 20px;
}

.search-form-sidebar {
    position: relative;
    width: 100%;
}

.search-form-sidebar input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 40px 10px 15px !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 30px;
    outline: none;
    font-size: 14px !important;
    transition: all 0.3s ease;
}

.search-form-sidebar input:focus {
    border-color: var(--header-text-hover);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(210, 154, 90, 0.2);
}

.search-form-sidebar button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s ease;
}

.search-form-sidebar button:hover {
    color: var(--header-text-hover);
}

/* ========================================================
   OVERLAY BACKDROP (Dark Blur Effect)
   ======================================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

body.no-scroll {
    overflow: hidden !important;
}

/* Hide header Compare & Wishlist icons on mobile screens */
@media (max-width: 767px) {
    .desktop-only-icon {
        display: none !important;
    }
}

.mobile-menu-list .badge {
    background-color: var(--badge-bg-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    height: 18px;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: 8px;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.mobile-menu-list > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px !important;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 15px !important;
}

.mobile-menu-list > li > a:hover {
    color: var(--header-text-hover);
    background: rgba(255,255,255,0.02);
}

.mobile-menu-list .dropdown-menu {
    display: none;
    list-style: none;
    padding-left: 20px;
    background: rgba(0,0,0,0.2);
}

.mobile-menu-list .dropdown-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px !important;
    color: #aaa;
    text-decoration: none;
    font-size: 14px !important;
    font-weight: 400;
    text-transform: capitalize;
}

.top-bar-dropdown {
    position: relative;
    display: inline-block;
}
.top-bar-dropdown:hover .dropdown-menu-custom {
    display: block;
}
.dropdown-menu-custom {
    display: none;
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    background: #fff;
    color: #333;
    padding: 5px 0;
    list-style: none;
    min-width: 90px;
    width: max-content;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 4px;
    margin-top: 5px;
}
.dropdown-menu-custom li a {
    padding: 8px 15px;
    display: block;
    color: #333;
    text-decoration: none;
    text-align: center;
}
.dropdown-menu-custom li a:hover {
    background: #f5f5f5;
}

/* ========================================================
   USER PROFILE HEADER DROPDOWN
   ======================================================== */
.header-user-dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-avatar-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
}

.header-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    flex-shrink: 0;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--header-text-hover);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: none;
    flex-shrink: 0;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.user-avatar-trigger:hover .header-avatar-img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.user-avatar-trigger:hover .header-avatar-placeholder {
    transform: scale(1.05);
    background-color: #ffffff;
    color: #000000;
}

.user-avatar-trigger .caret-icon {
    font-size: 10px;
    color: var(--header-text-color);
    transition: color 0.3s ease, transform 0.3s ease;
}

.user-avatar-trigger:hover .caret-icon {
    color: var(--header-text-hover);
}

/* SLEEK BLACK DROPDOWN MENU */
.header-user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #111111; /* Sleek Black */
    min-width: 200px;
    list-style: none;
    padding: 10px 0;
    margin: 15px 0 0 0;
    border: 1px solid rgba(255, 255, 255, 0.08); /* Lighting edge design */
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15); /* Glow effect */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    border-radius: 0px;
}

/* Show dropdown either on hover or when it has active class */
.header-user-dropdown-container:hover .header-user-dropdown-menu,
.header-user-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-user-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    transition: background 0.3s, color 0.3s;
    justify-content: flex-start;
}

.header-user-dropdown-menu li a i {
    font-size: 14px;
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.header-user-dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--header-text-hover);
}

/* ========================================================
   MOBILE BOTTOM ACTIONS (Wishlist, Compare)
   ======================================================== */
.mobile-bottom-actions {
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #111111;
    margin-top: auto;
    padding-bottom: max(env(safe-area-inset-bottom), 15px);
}

.mobile-bottom-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    position: relative;
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
    transition: color 0.3s;
}

.mobile-bottom-link:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-bottom-link i {
    font-size: 20px;
    margin-bottom: 6px;
    color: #fff;
}

.mobile-bottom-link:hover, .mobile-bottom-link:hover i {
    color: var(--header-text-hover);
}

.mobile-bottom-link .badge {
    position: absolute;
    top: 5px;
    right: 50%;
    margin-right: -20px;
    background-color: var(--badge-bg-color);
    color: #fff;
    font-size: 10px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========================================================
   TABLET RESPONSIVENESS OVERRIDES (768px - 1024px)
   ======================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .desktop-menu {
        gap: 12px !important;
    }
    .desktop-menu > li > a {
        font-size: 13px !important;
        gap: 4px !important;
    }
    .nav-center-logo .logo-text {
        font-size: 24px !important;
    }
    .nav-right-icons {
        gap: 12px !important;
    }
}
