/* ==========================================================================
   KHELLO HEADER COMPONENT STYLES
   ========================================================================== */

/* Enable robust position: sticky by preventing legacy overflow-x from breaking viewport scroll */
html, body {
    overflow-x: clip !important;
}

/* Header Wrapper - Sticky container */
.khello-header-wrapper {
    position: sticky !important;
    top: -41px !important;
    z-index: 1025 !important;
    background-color: #ffffff;
}

@media (max-width: 768px) {
    .khello-header-wrapper {
        top: 0 !important;
    }
}

/* 1. Top Announcement & Trust Bar */
.khello-top-bar {
    background-color: #f4f8fc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12.5px;
    padding: 9px 0;
}

.khello-top-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.khello-top-left {
    justify-self: start;
}

.khello-top-center {
    justify-self: center;
}

.khello-top-right {
    justify-self: end;
}

.khello-top-text {
    color: #334155;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.khello-top-dot {
    color: #94a3b8;
    font-size: 11px;
    margin: 0 4px;
}

.khello-top-link {
    color: #334155;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.khello-top-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .khello-top-grid {
        display: flex;
        justify-content: space-between;
    }
    .khello-top-center {
        display: none !important;
    }
}

/* 2. Main Navigation Bar */
.khello-main-nav {
    position: relative !important;
    background-color: #ffffff !important;
    padding: 4px 0;
}

.khello-brand-logo {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Navigation Links */
.khello-nav-link {
    color: #0f172a !important;
    font-weight: 600 !important;
    font-size: 14.5px !important;
    text-decoration: none !important;
    padding: 6px 0;
    transition: color 0.15s ease;
    cursor: pointer;
}

.khello-nav-link:hover,
.khello-nav-link.active {
    color: #2563eb !important;
}

/* Categories Mega Menu Dropdown */
.khello-cat-dropdown-group {
    position: relative;
    padding: 10px 0;
}

.khello-mega-menu {
    border-color: #e2e8f0 !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1) !important;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateY(6px);
    z-index: 1050;
    left: -20px;
    top: 100%;
    width: 780px;
}

.khello-mega-menu::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}

.khello-cat-dropdown-group:hover .khello-mega-menu,
.khello-cat-dropdown-group:focus-within .khello-mega-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.khello-cat-chevron {
    transition: transform 0.2s ease;
}

.khello-cat-dropdown-group:hover .khello-cat-chevron {
    transform: rotate(180deg);
}

.khello-mega-parent-title {
    font-size: 14.5px;
    color: #0f172a !important;
    transition: color 0.15s ease;
}

.khello-mega-parent-title:hover {
    color: #2563eb !important;
}

.khello-mega-child-link {
    font-size: 13px;
    color: #64748b !important;
    transition: color 0.15s ease;
}

.khello-mega-child-link:hover {
    color: #2563eb !important;
}

/* 3. Modern Pill Search Box */
.khello-search-pill {
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 15px;
    height: 46px;
    padding: 4px 5px 4px 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.khello-search-pill:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background-color: #ffffff;
}

.khello-search-input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px;
    color: #1e293b;
    padding: 0 8px 0 0;
    width: 100%;
}

.khello-search-input::placeholder {
    color: #94a3b8 !important;
    font-size: 14px;
}

.khello-search-clear-btn {
    position: absolute;
    right: 54px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.khello-search-clear-btn:hover {
    color: #475569;
}

.khello-search-submit-btn {
    width: 44px;
    height: 36px;
    border-radius: 10px;
    background-color: #2563eb;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.khello-search-submit-btn:hover {
    background-color: #1d4ed8;
    transform: scale(1.02);
}

/* 4. Right Action Icons */
.khello-action-icon {
    color: #1e293b !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
    text-decoration: none !important;
    cursor: pointer;
}

.khello-action-icon:hover {
    color: #2563eb !important;
    transform: translateY(-1px);
}

/* 5. Orange "+ Sell an Item" Button */
.khello-sell-btn {
    background: #ff6200 !important;
    background: linear-gradient(135deg, #ff6c00 0%, #ff5500 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    border-radius: 10px !important;
    padding: 10px 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    border: none !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 14px rgba(255, 98, 0, 0.32) !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
}

.khello-sell-btn:hover {
    background: linear-gradient(135deg, #f55d00 0%, #e64d00 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(255, 98, 0, 0.42) !important;
    color: #ffffff !important;
}

.khello-sell-btn:active {
    transform: translateY(0) !important;
}

.khello-plus-symbol {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

/* Mobile Toggle & Sell Button */
.khello-sell-btn-sm {
    background: #ff6200;
    color: #fff !important;
    font-weight: 700;
    font-size: 13px;
    border-radius: 8px;
    padding: 6px 14px;
    text-decoration: none;
}

.khello-mobile-toggle-btn {
    background: none;
    border: none;
    color: #1e293b;
    padding: 0;
    cursor: pointer;
}

/* 6. Desktop & Mobile Offcanvas Isolation */
@media (min-width: 992px) {
    #offcanvasMenu,
    .offcanvas#offcanvasMenu,
    .offcanvas.offcanvas-start#offcanvasMenu,
    div#offcanvasMenu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        top: -99999px !important;
        left: -99999px !important;
        width: 0 !important;
        height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
}

@media (max-width: 991.98px) {
    #offcanvasMenu.offcanvas {
        position: fixed !important;
        bottom: 0 !important;
        z-index: 1050 !important;
        display: flex !important;
        flex-direction: column !important;
        max-width: 100% !important;
        width: 320px !important;
        background-color: #fff !important;
        background-clip: padding-box !important;
        outline: 0 !important;
        transition: transform .3s ease-in-out !important;
        top: 0 !important;
        left: 0 !important;
        transform: translateX(-100%) !important;
        visibility: hidden !important;
    }
    #offcanvasMenu.offcanvas.show {
        transform: none !important;
        visibility: visible !important;
        display: flex !important;
    }
}

/* 7. User Profile Dropdown */
.user-dropdown-menu {
    min-width: 250px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 10px !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12) !important;
    margin-top: 10px !important;
    background-color: #ffffff !important;
}

.user-dropdown-header {
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
    background-color: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
}

.user-dropdown-avatar-circle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background-color: #eff6ff !important;
    color: #2563eb !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.user-dropdown-menu .dropdown-item {
    border-radius: 10px !important;
    padding: 9px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.15s ease !important;
    margin: 3px 0 !important;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-menu .dropdown-item i {
    font-size: 16px !important;
    color: #64748b !important;
    transition: color 0.15s ease !important;
    width: 20px;
    text-align: center;
}

.user-dropdown-menu .dropdown-item:hover,
.user-dropdown-menu .dropdown-item:focus {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.user-dropdown-menu .dropdown-item:hover i {
    color: #2563eb !important;
}

.user-dropdown-menu .dropdown-item.text-danger {
    color: #dc2626 !important;
}

.user-dropdown-menu .dropdown-item.text-danger i {
    color: #dc2626 !important;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
}

.user-dropdown-menu .dropdown-divider {
    margin: 6px 0 !important;
    border-top: 1px solid #f1f5f9 !important;
    opacity: 1 !important;
}

/* 8. PHP-Flasher Notification Position & Z-Index Fix */
.fl-wrapper,
div.fl-wrapper,
.fl-main-container {
    z-index: 999999 !important;
}

.fl-wrapper[data-position^="top-"],
div.fl-wrapper[data-position^="top-"],
.fl-wrapper.fl-top-right,
.fl-wrapper.fl-top-left,
.fl-wrapper.fl-top-center {
    top: 115px !important;
}

.fl-container,
.fl-flasher,
.fl-flasher.fl-show {
    z-index: 999999 !important;
    pointer-events: auto !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

@media (max-width: 768px) {
    .fl-wrapper[data-position^="top-"],
    div.fl-wrapper[data-position^="top-"],
    .fl-wrapper.fl-top-right,
    .fl-wrapper.fl-top-left,
    .fl-wrapper.fl-top-center {
        top: 75px !important;
    }
}