/* ===== Header Styles ===== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Announcement Bar */
.announcement-bar {
    background: linear-gradient(135deg, #e0523c 0%, #d43d2a 100%);
    color: #fff;
    font-size: 0.8125rem;
    overflow: hidden;
    transition: all 0.3s ease;
    max-height: 48px;
}

.announcement-bar.hidden {
    max-height: 0;
    padding: 0;
}

.announcement-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    position: relative;
}

.announcement-icon {
    font-size: 1rem;
    animation: bounce 2s infinite;
}

.announcement-text {
    font-weight: 500;
    text-align: center;
}

.announcement-link {
    color: inherit;
    text-decoration: none;
}

.announcement-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.announcement-text strong {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.announcement-close {
    position: absolute;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Header Main */
.header-main {
    height: 64px;
}

@media (min-width: 1024px) {
    .header-main {
        height: 72px;
    }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-image {
    width: 70px;
    /* height: 40px; */
    transition: transform 0.3s ease;
}

@media (min-width: 1024px) {
    .logo-image {
        width: 100px;
        /* height: 48px; */
    }
}

.header-logo:hover .logo-image {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a1a;
    display: none;
}

@media (min-width: 768px) {
    .logo-text {
        display: inline;
    }
}

/* Desktop Navigation */
.nav-desktop {
    display: none;
    align-items: center;
    gap: 0.125rem;
}

@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #737373;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.nav-link:hover {
    color: #1a1a1a;
    background: #f5f5f5;
}

.nav-link.active {
    color: #1a1a1a;
    background: #f5f5f5;
}

.nav-icon {
    flex-shrink: 0;
}

.nav-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega Menu */
.mega-menu {
    left: -50%;
    min-width: 550px;
    padding: 1.5rem;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 1.5rem;
}

.mega-menu-heading {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a3a3a3;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.mega-menu-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #404040;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.mega-menu-link:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.featured-product-card {
    background: linear-gradient(135deg, #fef2f0 0%, #fff 100%);
    border: 1px solid #fed7d0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.featured-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #e0523c;
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.featured-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
    text-wrap: nowrap;
}

.featured-price {
    font-size: 0.8125rem;
    color: #e0523c;
    font-weight: 500;
}

.mega-menu-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #e0523c, #d43d2a);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.mega-menu-cta:hover {
    transform: translateY(-1px);
}

/* Header Actions (Desktop) */
.header-actions {
    display: none;
    align-items: center;
    gap: 0.375rem;
}

@media (min-width: 1024px) {
    .header-actions {
        display: flex;
    }
}

.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #404040;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
}

.header-icon-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.cart-btn {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: #e0523c;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

.sign-in-btn {
    margin-left: 0.25rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    height: 36px;
    gap: 0.375rem;
}

.supplier-btn {
    display: none !important;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    height: 32px;
    gap: 0.25rem;
}

@media (min-width: 1160px) {
    .supplier-btn {
        display: inline-flex !important;
    }
}

/* Desktop Search */
.search-container {
    position: relative;
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 250px;
}

.search-trigger:hover {
    border-color: #e5e5e5;
    background: #fff;
}

.search-placeholder {
    font-size: 0.8125rem;
    color: #a3a3a3;
    flex: 1;
}

.search-shortcut {
    font-size: 0.6875rem;
    background: #fff;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    color: #737373;
    font-family: inherit;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 480px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 200;
    overflow: hidden;
}

.search-dropdown.active {
    display: block;
    animation: searchSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes searchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
    display: none;
}

.search-overlay.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-form {
    position: relative;
}

.search-form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a3a3a3;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    outline: none;
    color: #1a1a1a;
}

.search-input::placeholder {
    color: #a3a3a3;
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-clear:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.search-results-wrapper {
    padding: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
}

.search-initial-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #a3a3a3;
}

.search-initial-state p {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

/* User Dropdown */
.user-dropdown .nav-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 240px;
}

.user-menu {
    padding: 0.25rem;
}

.user-menu-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 0.25rem;
}

.user-menu-greeting {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.user-menu-email {
    font-size: 0.75rem;
    color: #a3a3a3;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #404040;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.dropdown-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 0.25rem 0;
}


.text-danger {
    color: #dc2626;
}

/* Mobile Actions */
.header-mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1024px) {
    .header-mobile-actions {
        display: none;
    }
}

.mobile-menu-btn .menu-icon-close {
    display: none;
}

.mobile-menu-btn.is-active .menu-icon-open {
    display: none;
}

.mobile-menu-btn.is-active .menu-icon-close {
    display: block;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: none;
}

.mobile-search-overlay.active {
    display: flex;
    flex-direction: column;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    height: 60px;
}

.mobile-search-back {
    background: none;
    border: none;
    color: #1a1a1a;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-form {
    flex: 1;
    position: relative;
}

.mobile-search-input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a3a3a3;
}

.mobile-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.5rem;
    background: #f5f5f5;
    border: none;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    color: #1a1a1a;
}

.mobile-search-clear {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
}

.mobile-menu-panel.active {
    transform: translateX(0);
}

.mobile-menu-top {
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.mobile-user-avatar {
    width: 44px;
    height: 44px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-user-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.mobile-user-email {
    font-size: 0.75rem;
    color: #737373;
}

.mobile-nav {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #404040;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: #f5f5f5;
    color: #1a1a1a;
}

.mobile-nav-item.highlight {
    color: #e0523c;
    font-weight: 600;
}

/* Mobile Accordion */
.mobile-accordion-trigger .accordion-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.mobile-accordion-trigger[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
}

.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 2.5rem;
}

.mobile-accordion-content.active {
    max-height: 400px;
}

.mobile-nav-subitem {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #737373;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.mobile-nav-subitem:hover {
    color: #1a1a1a;
    background: #f5f5f5;
}

.mobile-menu-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 0.5rem 1rem;
}

/* Mobile Menu Section Label - ADD THIS */
.mobile-menu-section-label {
    padding: 0.5rem 1rem 0.25rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a3a3a3;
}

.mobile-menu-bottom {
    padding: 0.5rem;
    padding-bottom: 2rem;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 900;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive */
@media (max-width: 1023px) {
    .nav-desktop,
    .header-actions {
        display: none;
    }
    
    .header-mobile-actions {
        display: flex;
    }
}

@media (max-width: 639px) {
    .announcement-text {
        font-size: 0.75rem;
    }
}

/* Logout Button */
.logout-btn {
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.logout-btn:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.logout-btn .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #dc2626;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
}

.logout-btn .dropdown-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Logout Spinner */
.logout-spinner {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile logout button */
.mobile-nav-item.text-danger {
    color: #dc2626 !important;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

.mobile-nav-item.text-danger:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}
