/* ===== NAVBAR STYLES - HOÀN CHỈNH ===== */

/* === CƠ BẢN NAVBAR === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #4facfe;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.navbar-brand img {
    height: 40px;
}

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

.search-icon {
    position: absolute;
    left: 95%;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 2;
}

.search-input {
    padding-left: 45px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    height: 45px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    outline: none;
    box-shadow: none;
}

.search-input:focus {
    border-color: #00cfff;
    box-shadow: 0 0 0 0.2rem rgba(0, 207, 255, 0.25);
}

/* === DESKTOP SEARCH OVERLAY === */
.desktop-search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.desktop-search-box {
    padding: 20px;
}

.suggest-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.suggest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.suggest-tag {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggest-tag:hover {
    background: #00cfff;
    color: white;
}

.suggest-campaign {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggest-campaign-item {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.suggest-brands {
    display: flex;
    gap: 10px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8f9fa;
}

/* === BOTTOM NAVIGATION === */
.nav-bottom {
    background: #4facfe;
    padding: 0;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 207, 255, 0.3);
}

.nav-bottom .container {
    padding: 0px;
    max-width: 1280px;
}

.nav-bottom a {
    text-decoration: none;
    color: #003d7a;
    font-weight: 600;
    padding: 15px 0;
    position: relative;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 13px;
}

.nav-bottom a:hover {
    color: #fff;
}

.nav-bottom a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    transition: width 0.3s ease;
}

.nav-bottom a:hover::after {
    width: 100%;
}

/* === DESKTOP DROPDOWN === */
.dropdown-custom {
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
}

.dropdown-custom>a {
    display: flex;
    align-items: center;
    height: 50px;
    color: #003d7a;
    text-decoration: none;
    padding: 0 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.dropdown-custom>a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

.dropdown-custom>a i {
    margin-right: 8px;
    font-size: 14px;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    border-radius: 12px;
    z-index: 9999;
    overflow: visible;
    animation: fadeIn 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-custom:hover .dropdown-content {
    display: block;
}

.main-category {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-category>li {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.main-category>li:last-child {
    border-bottom: none;
}

.main-category>li>a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 14px;
    text-transform: none;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.main-category>li:hover {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
}

.main-category>li:hover>a {
    color: white;
    padding-left: 25px;
}

.main-category>li:hover>a i {
    transform: translateX(5px);
}

/* === DESKTOP SUB CATEGORY === */
.sub-category {
    display: none;
    position: absolute;
    top: 0;
    left: calc(100% + 5px);
    width: 350px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    z-index: 10000;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 10px 0;
    transform: translateX(-10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.main-category>li:hover>.sub-category {
    display: block;
    transform: translateX(0);
    opacity: 1;
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(-15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.sub-category li {
    transition: all 0.3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sub-category li>a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 12px 20px;
    font-size: 13px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.sub-category li:hover {
    background: #f8f9fa;
}

.sub-category li:hover>a {
    color: #007bff;
    border-left-color: #007bff;
    padding-left: 25px;
}

/* === RIGHT LINKS === */
.right-links {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.right-links a {
    font-size: 13px;
    color: #003d7a;
    text-decoration: none;
    text-transform: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.right-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.right-links span {
    color: #003d7a;
    font-weight: normal;
}

/* === MOBILE SEARCH OVERLAY === */
.search-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: white !important;
    z-index: 99999 !important;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
}

.search-overlay.active {
    display: flex !important;
}

.search-header {
    background: #4facfe;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 0 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 50px;
    width: 100%;
}

.search-input {
    flex: 1;
    background: white;
    border: none;
    border-radius: 25px;
    padding: 12px 0;
    font-size: 16px;
    outline: none;
    min-height: 40px;
    width: 100%;
}

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

.search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    display: none;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-btn {
    color: white;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    margin-left: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
}

/* Search Results Section */
.search-results-section {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-result-price {
    color: #4facfe;
    font-weight: 600;
}

.search-loading,
.search-error,
.search-no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.search-loading {
    color: #4facfe;
    font-weight: 500;
}

.search-error {
    color: #dc3545;
}

.search-no-results {
    color: #6c757d;
    font-style: italic;
}

.search-section {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.search-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hot-keywords {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.keyword-tag {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 12px;
    font-size: 13px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 500;
}

.keyword-tag:hover {
    background: #00b894;
    color: white;
    border-color: #00b894;
    transform: translateY(-1px);
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.category-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 12px;
    text-align: center;
    text-decoration: none;
    color: #495057;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 500;
}

.category-item:hover {
    border-color: #4facfe;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
    color: #4facfe;
    text-decoration: none;
    transform: translateY(-1px);
}

.brand-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 12px;
    text-align: center;
    text-decoration: none;
    color: #495057;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 500;
}

.brand-item:hover {
    border-color: #4facfe;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
    color: #4facfe;
    text-decoration: none;
    transform: translateY(-1px);
}

.campaign-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.campaign-item {
    background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: #d32f2f;
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.2s;
    cursor: pointer;
}

.campaign-item:hover {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    transform: translateY(-1px);
}

.campaign-item.special {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: #ffcc02;
    color: #f57c00;
}

/* === MOBILE SEARCH BTN === */
.mobile-search-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    background: #00b894;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-search-btn:active {
    background: #00997a;
}

/* === MOBILE OFFCANVAS === */
.offcanvas-header {
    background: #4facfe;
    color: white;
    padding: 7px !important;
}

.offcanvas-title {
    font-weight: 600;
}

.offcanvas,
.offcanvas-header {
    z-index: 1101 !important;
}

.offcanvas-backdrop.fade.show~.navbar,
body .navbar {
    z-index: 1040 !important;
}

.btn-close {
    filter: brightness(0) invert(1);
}

.mobile-category-item {
    border-bottom: 1px solid #f0f0f0;
}

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

.mobile-category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.mobile-category-toggle:hover {
    background: #f8f9fa;
}

.mobile-category-toggle i {
    margin-right: 10px;
    color: #666;
}

.mobile-category-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

.mobile-category-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-sub-category {
    background: #f8f9fa;
    padding: 0;
}

.mobile-sub-category a {
    display: block;
    padding: 12px 20px 12px 50px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-sub-category a:hover {
    background: white;
    color: #007bff;
    border-left-color: #007bff;
}

/* === MOBILE SECTION HEADERS === */
.mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: none;
    width: 100%;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-section-header:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.mobile-section-header i.fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.mobile-section-header[aria-expanded="true"] i.fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-section-content {
    border-top: 1px solid #e9ecef;
}

/* === UTILITIES === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00b894;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* === RESPONSIVE BREAKPOINTS === */

/* Tablet và Mobile (≤ 991.98px) */
@media (max-width: 991.98px) {
    .nav-bottom {
        display: none;
    }

    .desktop-search-overlay {
        display: none !important;
    }

    .logo-responsive {
        height: 38px !important;
        margin-left: 10px !important;
    }

    .offcanvas.offcanvas-start.show,
    .offcanvas.offcanvas-start.showing {
        width: 260px !important;
        max-width: 90vw;
    }

    .navbar-toggler i,
    .navbar-toggler .navbar-toggler-icon {
        color: darkblue !important;
    }
}

/* Mobile nhỏ (≤ 767px) */
@media (max-width: 767px) {

    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Mobile siêu nhỏ (≤ 576px) */
@media (max-width: 576px) {

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

    .search-container {
        min-width: 120px;
    }

    .search-icon {
        left: 85%;
    }

    .search-input {
        font-size: 16px !important;
    }

    /* Mobile Search Overlay Responsive */
    .search-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999 !important;
    }

    .search-header {
        padding: 15px;
        background: #4facfe;
    }

    .search-input-container {
        width: 100%;
        border-radius: 25px;
        padding: 0 15px;
        min-height: 50px;
    }

    .search-input {
        font-size: 16px;
        padding: 12px 0;
    }

    .search-content {
        padding: 0;
        overflow-y: auto;
    }

    .search-section {
        padding: 15px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .hot-keywords {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .keyword-tag,
    .brand-item,
    .category-item {
        font-size: 13px;
        padding: 10px 12px;
        min-height: 44px;
    }

    .search-result-item {
        padding: 12px;
    }

    .search-result-item img {
        width: 40px;
        height: 40px;
    }

    .search-result-name {
        font-size: 14px;
    }

    .search-result-price {
        font-size: 14px;
    }
}

/* Desktop Search Overlay Responsive */
@media (min-width: 992px) {
    .search-overlay {
        display: none !important;
    }
}

/* === OVERRIDE STYLES (Remove hover effects) === */
.navbar-toggler,
.navbar-toggler:focus,
.navbar-toggler:active,

.cancel-btn,
.cancel-btn:focus,
.cancel-btn:active,
.search-clear,
.search-clear:focus,
.search-clear:active,
.mobile-category-toggle,
.mobile-category-toggle:hover,
.mobile-category-toggle:active,
.mobile-category-toggle:focus {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
    transition: none !important;
}



/* Webkit search input cleanup */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-clear-button {
    display: none;
    -webkit-appearance: none;
}