/* ==================== MODERN HEADER STYLES ==================== */

/* Global Reset for Header */
.modern-header * {
    box-sizing: border-box;
}

/* Main Header Container */
.modern-header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    overflow: visible !important;
}

.header-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* ==================== TOP BAR ==================== */
.top-bar {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 30px;
    align-items: center;
}

/* Logo */
.header-logo img {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
    filter: brightness(0) saturate(100%) invert(20%) sepia(25%) saturate(2000%) hue-rotate(130deg) brightness(95%) contrast(95%);
}

.header-logo a:hover img {
    transform: scale(1.05);
    filter: brightness(0) saturate(100%) invert(30%) sepia(35%) saturate(1800%) hue-rotate(130deg) brightness(90%) contrast(90%);
}

/* ==================== SEARCH BAR ==================== */
.header-search {
    max-width: 600px;
    position: relative;
}

.header-search form {
    display: flex;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.header-search form:focus-within {
    border-color: #0A4B3E;
    box-shadow: 0 0 0 3px rgba(10, 75, 62, 0.1);
}

.header-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    background: transparent;
    font-size: 14px;
    color: #333;
}

.header-search input::placeholder {
    color: #999;
}

.header-search button {
    border: none;
    background: #0A4B3E;
    color: white;
    padding: 12px 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.header-search button:hover {
    background: #096354;
}

.header-search button i {
    font-size: 16px;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-suggestions.active {
    display: block;
}

.search-suggestions-header {
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item.keyboard-selected {
    background: #e9ecef;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
}

.suggestion-details {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.suggestion-sku {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.suggestion-category {
    color: #0A4B3E;
}

.suggestion-description {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.suggestion-price {
    color: #0A4B3E;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.no-suggestions {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.no-suggestions i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 10px;
}

.suggestion-loading {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

.suggestion-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== HEADER ACTIONS ==================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.action-btn:hover {
    background: #f8f9fa;
    color: #0A4B3E;
}

.action-btn i {
    font-size: 18px;
}

.action-btn .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #f8f9fa;
}

.mobile-menu-btn.active {
    background: rgba(10, 75, 62, 0.1);
    color: #0A4B3E;
}

/* ==================== MAIN NAVIGATION ==================== */
.modern-header .main-nav {
    background: #ffffff;
    position: relative;
    overflow: visible !important;
}

.modern-header .nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: visible !important;
}

.modern-header .nav-item {
    position: relative !important;
    overflow: visible !important;
    display: block !important;
}

.modern-header .nav-item.has-dropdown {
    position: relative !important;
}

.modern-header .nav-item.has-dropdown::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: transparent;
}

.modern-header .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 18px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-radius: 0;
    margin: 0;
}

.modern-header .nav-link:hover {
    color: #0A4B3E;
    background: rgba(10, 75, 62, 0.05);
}

.modern-header .nav-link.featured {
    background: rgba(10, 75, 62, 0.1);
    color: #0A4B3E;
    font-weight: 600;
    border-radius: 6px;
    margin-right: 10px;
}

.modern-header .nav-link i.fa-chevron-down {
    font-size: 10px;
    transition: transform 0.3s ease;
}

/* ── Category nav icons ─────────────────────────────── */
.modern-header .nav-cat-icon {
    font-size: 14px;
    color: #0A4B3E;
    width: 18px;
    text-align: center;
    transition: color 0.3s ease, transform 0.3s ease;
}
.modern-header .nav-link:hover .nav-cat-icon {
    color: #c9a96e;
    transform: scale(1.15);
}

.modern-header .nav-item.has-dropdown:hover .nav-link i.fa-chevron-down {
    transform: rotate(180deg);
}

/* ==================== DROPDOWN MENU ==================== */
.modern-header .dropdown-menu {
    position: absolute !important;
    top: calc(100% - 1px) !important;
    left: 0 !important;
    background: white !important;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transition-delay: 0s;
    z-index: 99999 !important;
    min-width: 700px;
    border-top: 3px solid #0A4B3E;
    pointer-events: none;
    display: block !important;
    margin-top: 0;
}

.modern-header .nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    transition-delay: 0.1s;
}

.modern-header .dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.modern-header .dropdown-col {
    min-width: 180px;
}

.modern-header .col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 600;
    color: #0A4B3E;
    text-decoration: none;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0A4B3E;
    transition: color 0.3s ease;
}

.modern-header .col-title:hover {
    color: #96722E;
}

/* Dropdown column header icon */
.modern-header .col-title-icon {
    font-size: 13px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 75, 62, 0.1);
    border-radius: 4px;
    color: #0A4B3E;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}
.modern-header .col-title:hover .col-title-icon {
    background: #c9a96e;
    color: #fff;
}

.modern-header .col-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-header .col-links li {
    margin-bottom: 8px;
}

.modern-header .col-links a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modern-header .col-links a:hover {
    background: rgba(10, 75, 62, 0.08);
    color: #0A4B3E;
    padding-left: 14px;
}

/* Sub-link icon */
.modern-header .col-link-icon {
    font-size: 11px;
    color: #c9a96e;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.modern-header .col-links a:hover .col-link-icon {
    transform: scale(1.2);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    .top-bar-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .header-logo {
        text-align: center;
    }
    
    .header-logo img {
        height: 40px;
    }
    
    .header-search {
        max-width: 100%;
    }
    
    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn {
        padding: 10px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .main-nav {
        display: none;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-content {
        flex-direction: column;
        padding: 10px 15px;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
        min-height: 44px;
    }

    /* Prevent search suggestions overflowing viewport on mobile */
    .search-suggestions {
        left: 0;
        right: 0;
        max-width: 100%;
    }
    
    .dropdown-menu,
    .modern-header .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        padding: 10px 20px;
        border-top: none;
        border-left: 3px solid #96722E;
        background: #f8f9fa;
        display: none;
        min-width: 0 !important;
        width: 100%;
        pointer-events: auto !important;
    }
    
    .nav-item.has-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 10px 0;
    }
    
    .header-logo img {
        height: 35px;
    }
    
    .header-search button {
        padding: 12px 18px;
    }
    
    .action-btn .badge {
        top: 2px;
        right: 2px;
        font-size: 10px;
        min-width: 16px;
        padding: 1px 4px;
    }

    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
}
