:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #f59e0b;
    --navbar-height: 56px;
    --navbar-height-mobile: 50px;
    --top-banner-height: 32px;
}

.top-contact-banner {
    background: var(--top-banner-bg, var(--primary-color));
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1051 !important;
    height: var(--top-banner-height);
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.top-contact-banner .container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 24px;
}

.top-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: white;
    width: 100%;
}

.top-banner-left,
.top-banner-center,
.top-banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-banner-left .contact-link,
.top-banner-right .social-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.top-banner-left .contact-link:hover,
.top-banner-right .social-link:hover {
    opacity: 1;
    text-decoration: none;
}

.top-banner-center .banner-text {
    font-weight: 500;
}

@media (max-width: 767px) {
    .top-banner-left,
    .top-banner-right {
        display: none;
    }
    .top-banner-center {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

.webcommerce-navbar {
    position: fixed !important;
    top: var(--top-banner-height, 32px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #fff !important;
    z-index: 1050 !important;
    transition: box-shadow 0.3s ease;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
    transform: translateY(0) !important; /* Always visible - no scroll hide */
}

.webcommerce-navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 24px;
    box-sizing: border-box;
    overflow: visible;
}

.navbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    gap: 20px;
    width: 100%;
    overflow: visible;
}

.navbar-spacer {
    height: var(--navbar-height);
}

.top-contact-banner ~ .webcommerce-navbar ~ .navbar-spacer,
.has-top-banner .navbar-spacer {
    height: calc(var(--navbar-height) + var(--top-banner-height));
}

@media (max-width: 767px) {
    .navbar-spacer {
        height: calc(var(--navbar-height-mobile) + 70px);
    }
    .top-contact-banner ~ .webcommerce-navbar ~ .navbar-spacer,
    .has-top-banner .navbar-spacer {
        height: calc(var(--navbar-height-mobile) + var(--top-banner-height) + 70px);
    }
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    flex-shrink: 0;
}

.brand-logo {
    max-height: 36px;
    width: auto;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-search {
    flex: 1;
    max-width: 500px;
    min-width: 200px;
    position: relative;
}

.navbar-search.desktop-only {
    display: block;
    margin: 0 auto;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.search-input-wrapper:focus-within {
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: none;
    outline: none;
}

.search-input {
    flex: 1;
    border: none !important;
    background: transparent;
    padding: 8px 14px;
    font-size: 14px;
    outline: none !important;
    box-shadow: none !important;
    min-width: 0;
}

.search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: var(--primary-color);
    border: none;
    padding: 8px 14px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0 6px 6px 0;
    margin: -2px -2px -2px 0;
}

.search-btn:hover {
    filter: brightness(0.9);
}

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

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1060;
    margin-top: 4px;
    border: 1px solid #e5e7eb;
    border-top: none;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f3f4f6;
}

.clear-recent {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    text-transform: none;
    font-weight: 500;
}

.clear-recent:hover {
    text-decoration: underline;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: #374151;
    transition: background 0.2s;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #f9fafb;
    text-decoration: none !important;
}

.suggestion-item.recent i {
    color: #9ca3af;
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.suggestion-item.product .suggestion-image {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    flex-shrink: 0;
}

.suggestion-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.suggestion-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

.suggestion-item.view-all {
    border-top: 1px solid #f3f4f6;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

.suggestion-item.view-all i {
    color: var(--primary-color);
}

.suggestions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #6b7280;
    font-size: 14px;
}

.suggestions-loading i {
    color: var(--primary-color);
}

.no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 14px;
    color: #6b7280;
    font-size: 14px;
}

.no-results i {
    color: #9ca3af;
}

.mobile-search .search-suggestions {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--top-banner-height, 32px) + var(--navbar-height-mobile, 50px) + 60px);
    max-height: 60vh;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    overflow: visible;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    color: #374151;
    text-decoration: none !important;
    border-radius: 6px;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-width: 50px;
}

.action-btn:hover {
    background: #f3f4f6;
    color: var(--primary-color);
    text-decoration: none !important;
}

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

.action-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.action-label {
    font-size: 10px;
    font-weight: 500;
    margin-top: 1px;
}

.action-btn.login-btn {
    background: var(--primary-color);
    color: white !important;
    padding: 8px 16px;
    flex-direction: row;
    gap: 6px;
}

.action-btn.login-btn:hover {
    background: var(--primary-color);
    filter: brightness(0.9);
    color: white !important;
}

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

.action-btn.login-btn .action-label {
    margin-top: 0;
    font-size: 13px;
    font-weight: 600;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.action-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    transform: translateX(0);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 220px;
    padding: 8px 0;
    margin-top: 8px;
    z-index: 9999;
    display: none;
}

.dropdown-menu[style*="display: block"],
.dropdown-menu:not([x-cloak])[style*=""],
.action-dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-header .user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.dropdown-header .user-email {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none !important;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f9fafb;
    color: var(--primary-color);
    text-decoration: none !important;
}

.dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #6b7280;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item.logout-item {
    color: #ef4444;
}

.dropdown-item.logout-item i {
    color: #ef4444;
}

.dropdown-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #f3f4f6;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    padding: 8px;
    color: #374151;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 20px;
}

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

.mobile-search {
    padding: 8px 12px 12px;
    border-top: 1px solid #f3f4f6;
    width: 100%;
    box-sizing: border-box;
}

.mobile-search .search-input-wrapper {
    background: #f9fafb;
    width: 100%;
}

.mobile-search .search-input {
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
}

.mobile-search .search-btn {
    padding: 10px 14px;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #fff;
    z-index: 1061;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 600;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    padding: 8px;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 20px;
}

.mobile-menu-close:hover {
    background: #f3f4f6;
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.mobile-menu-user {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-user .user-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.mobile-menu-user-info .user-name {
    font-weight: 600;
    color: #1f2937;
}

.mobile-menu-user-info .user-email {
    font-size: 12px;
    color: #6b7280;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #374151;
    text-decoration: none !important;
    font-size: 15px;
    transition: background 0.2s;
}

.mobile-menu-item:hover {
    background: #f9fafb;
    text-decoration: none !important;
}

.mobile-menu-item.text-danger {
    color: #ef4444;
}

.mobile-menu-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: #6b7280;
}

.mobile-menu-item:hover i {
    color: var(--primary-color);
}

.mobile-menu-item.text-danger i {
    color: #ef4444;
}

.mobile-menu-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.mobile-menu-divider {
    margin: 12px 20px;
    border: none;
    border-top: 1px solid #f3f4f6;
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .navbar-main {
        height: var(--navbar-height-mobile);
        gap: 12px;
    }

    .navbar-container {
        padding: 0;
    }

    .navbar-main {
        padding: 0 12px;
    }

    .brand-logo {
        max-height: 32px;
    }

    .brand-text {
        font-size: 1.25rem;
    }

    .action-btn {
        padding: 8px;
        min-width: auto;
    }

    .action-btn .action-label {
        display: none;
    }

    .navbar-actions {
        gap: 4px;
    }

    .mobile-search {
        display: block !important;
        width: 100%;
        padding: 8px 12px 12px;
    }

    .mobile-search .navbar-search {
        max-width: 100%;
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .navbar-search {
        max-width: 300px;
    }
}

[x-cloak] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .webcommerce-navbar,
    .search-input-wrapper,
    .action-btn,
    .dropdown-item,
    .mobile-menu,
    .mobile-menu-overlay {
        transition: none;
    }
}

.action-btn:focus-visible,
.search-input:focus-visible,
.mobile-menu-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.webcommerce-navbar .navbar-main {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}

.webcommerce-navbar .navbar-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.webcommerce-navbar .action-btn:not(.login-btn) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.webcommerce-navbar .action-btn.login-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

.webcommerce-navbar .navbar-search.desktop-only {
    display: block !important;
}

.webcommerce-navbar .mobile-only,
.navbar-search.mobile-search.mobile-only {
    display: none !important;
}

.webcommerce-navbar .mobile-menu-btn.mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    .webcommerce-navbar .mobile-only,
    .navbar-search.mobile-search.mobile-only {
        display: flex !important;
    }

    .webcommerce-navbar .mobile-menu-btn.mobile-only {
        display: flex !important;
    }

    .webcommerce-navbar .navbar-search.desktop-only {
        display: none !important;
    }
}
