/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}
.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 14px!important;
}
/* Header Styles */
.header {
   /* position: sticky;*/
    top: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.top-header {
    background: linear-gradient(135deg,#77B6FF 0%, #77B6FF 100%) !important;
}

.main-header {
    border-bottom: 1px solid #e9ecef;
}

.search-box .form-control {
    border-radius: 25px 0 0 25px;
    border: 2px solid #e9ecef;
    padding: 12px 20px;
    font-size: 14px;
}

.search-box .btn {
    border-radius: 0 25px 25px 0;
    border: 2px solid#5577FD;
    padding: 12px 20px;
    background:#5577FD;
    border-left: none;
}

.search-box .btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Breadcrumb Styles */
.breadcrumb-section {
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    font-weight: bold;
}

.breadcrumb-item a {
    color:#5577FD;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #0056b3;
}

/* Sidebar Categories */
.sidebar-categories {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    overflow: visible !important; /* Cho phép mega-menu vượt ra ngoài */
    position: relative !important;
    z-index: 10;
}

.category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.category-list {
    overflow-y: auto; /* Scroll dọc */
    overflow-x: visible !important; /* Cho phép mega-menu hiển thị ngang */
}

.category-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.3s ease;
}

.category-item:hover,
.category-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    text-decoration: none;
    transform: translateX(5px);
}

.category-item.active {
    border-left: 4px solid#5577FD;
    font-weight: 600;
}

.category-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border-radius: 6px;
    object-fit: cover;
}

.category-item span {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

/* Mobile Categories */
.mobile-categories {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.mobile-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-category-item:hover {
    background: #f8f9fa;
    color:#5577FD;
    text-decoration: none;
    transform: translateY(-2px);
}

.category-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.category-icon-wrapper img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.category-name {
    font-size: 12px;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* Category Page Header */
.category-page-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
}

.category-stats .badge {
    background: linear-gradient(135deg, #5577FD 0%, #ff9800 100%);
    border: none;
    padding: 8px 16px;
    font-size: 14px;
}

/* Filters Section */
.filters-section {
    background: white;
    border: 1px solid #e9ecef;
}

.filters-section .btn-group .btn {
    border-radius: 20px;
    margin: 0 2px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
}

    .filters-section .btn-check:checked + .btn {
        background: linear-gradient(135deg, #5577FD 0%, #77B6FF 100%);
        border-color: #5577FD;
        color: white;
    }

.filters-section .form-select {
    border-radius: 20px;
    border: 2px solid #e9ecef;
    padding: 6px 16px;
    font-size: 14px;
    min-width: 150px;
}

/* Banner Section */
.banner-section {
    margin: 20px 0;
}

.banner-swiper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.banner-item {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-pagination-bullet {
    background: white;
    opacity: 0.7;
}

.swiper-pagination-bullet-active {
    background:#5577FD;
    opacity: 1;
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(0,0,0,0.3);
    width: 40px!important;
    height: 40px!important;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(0,0,0,0.5);
}

/* Product Sections */
.product-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.product-swiper {
    padding: 10px 0;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    height: auto!important;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.product-badge:not([class*="bg-"]) {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}
.product-badge2 {
    position: absolute;
    top: 40px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

    .product-badge2:not([class*="bg-"]) {
        background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    }
.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-actions .btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.product-actions .btn:hover {
    background: white;
    transform: scale(1.1);
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.product-rating .fas.fa-star {
    color: #5577FD;
    font-size: 12px;
}

.product-rating .far.fa-star {
    color: #e9ecef;
    font-size: 12px;
}

.product-price {
    margin-bottom: 12px;
}

.current-price {
    font-size: 16px;
    font-weight: 700;
    color:#5577FD;
}

.old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-meta {
    font-size: 12px;
    color: #666;
}

.product-card .btn {
    margin-top: auto;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.product-card .btn:hover {
    transform: translateY(-2px);
}

/* Products Grid */
.products-grid {
    margin-bottom: 30px;
}

/* Pagination */
.pagination-section {
    margin-top: 40px;
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #e9ecef;
    color:#5577FD;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: #e3f2fd;
    border-color:#5577FD;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #5577FD 0%, #77B6FF 100%);
    border-color: #5577FD;
    color:white!important
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 10px;
}

.notification-content i {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-content span {
    flex: 1;
    font-size: 14px;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: #f8f9fa;
    color: #333;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-success i {
    color: #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-error i {
    color: #dc3545;
}

.notification-warning {
    border-left: 4px solid #5577FD;
}

.notification-warning i {
    color: #5577FD;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-info i {
    color: #17a2b8;
}

/* Quick View Modal */
.quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.product-quick-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.product-quick-view .product-image {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

.product-quick-view .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-quick-view .product-details h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-quick-view .price {
    font-size: 24px;
    font-weight: 700;
    color:#5577FD;
    margin-bottom: 15px;
}

.product-quick-view .description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #f8f9fa;
    border-color:#5577FD;
}

.quantity-selector input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

/* Footer Styles */
.footer {
    border-top: 1px solid #dee2e6;
}

.footer-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color:#5577FD;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #5577FD 0%, #ff9800 100%);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    color: white;
}

.newsletter h6 {
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.newsletter .input-group {
    border-radius: 8px;
    overflow: hidden;
}

.newsletter .form-control {
    border: 1px solid #dee2e6;
    padding: 10px 15px;
}

.newsletter .btn {
    border-radius: 0 8px 8px 0;
    padding: 10px 20px;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .sidebar-categories {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .banner-item {
        height: 200px;
    }
    
    .product-image {
        height: auto;
    }
    
    .product-quick-view {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 767.98px) {
    .top-header {
        display: none !important;
    }
    
    .search-box {
        margin: 15px 0;
    }
    
    .banner-item {
        height: 180px;
    }
    
    .product-section {
        padding: 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .filters-section .btn-group {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .filters-section .btn-group .btn {
        margin: 2px;
    }
}

@media (max-width: 575.98px) {
    .banner-item {
        height: 150px;
    }
    
    .product-image {
        height: auto;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .product-card .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .product-actions .btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Custom Scrollbar */
.category-list::-webkit-scrollbar {
    width: 6px;
}

.category-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #5577FD 0%, #ff9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg,#5577FD 0%, #0056b3 100%) 1;
}

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #5577FD 0%, #ff9800 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.btn-outline-primary {
    border: 2px solid#5577FD;
    color:#5577FD;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background:#5577FD;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

/* Form Controls */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color:#5577FD;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Card Enhancements */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Badge Styles */
.badge {
    border-radius: 12px;
    font-weight: 600;
    padding: 2px 6px;
}

.badge-primary {
    background: linear-gradient(135deg, #5577FD 0%, #ff9800 100%);
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #5577FD 0%, #fd7e14 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Category Item Wrapper */
.category-item-wrapper {
    display: block;
}

.category-item-wrapper .category-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.3s ease;
}

.category-item-wrapper .category-item:hover,
.category-item-wrapper .category-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    text-decoration: none;
    transform: translateX(5px);
}

.category-item-wrapper .category-item.active {
    border-left: 4px solid#5577FD;
    font-weight: 600;
}

/* Mega Menu Flyout */
/* Mega Menu Flyout - CORRECTED VERSION */
.mega-menu {
    /* POSITIONING - Quan trọng nhất */
    position: absolute;
    left: 98%; /* Hiển thị bên phải category-item */
    top: 0;
    height:100%;
    z-index: 1000;
    /* SIZING */
    width: 700px;
    min-width: 600px;
    /* STYLING */
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    padding: 20px;
    /* LAYOUT */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    /* VISIBILITY & ANIMATION */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    /* INTERACTION */
    pointer-events: none;
}

/* HOVER STATE - Hiển thị mega-menu */
.mega-menu {
    /* POSITIONING */
    position: absolute;
    left: 98%; /* Hiển thị bên phải category-item */
    top: 0;
    height: 100%;
    z-index: 1000;
    /* SIZING */
    width: 700px;
    min-width: 600px;
    /* STYLING */
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    padding: 20px;
    /* LAYOUT */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    align-items: stretch; /* Các cột cao bằng nhau */
    /* VISIBILITY & ANIMATION */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    /* INTERACTION */
    pointer-events: none;
}

/* HOVER STATE - Hiển thị mega-menu */
.category-item-wrapper:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(10px);
    transition-delay: 0.1s;
    pointer-events: auto;
}

/* MEGA MENU COLUMNS */
.mega-menu-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%; /* Cột chiếm toàn bộ chiều cao */
}

.mega-menu-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 14px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #5577FD;
    padding-bottom: 8px;
    width: 100%;
}

.mega-menu-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    align-self: center;
}

.mega-menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    flex-grow: 1; /* Đẩy link căng đều trong cột */
}

    .mega-menu-links li {
        margin-bottom: 8px;
    }

    .mega-menu-links a {
        display: block;
        padding: 6px 0;
        color: #666;
        font-size: 13px;
        text-decoration: none;
        transition: all 0.2s ease;
        border-radius: 4px;
    }

        .mega-menu-links a:hover {
            color: #5577FD;
            background: rgba(0, 123, 255, 0.1);
            padding-left: 8px;
            text-decoration: none;
        }

    .mega-menu-links .view-more {
        color: #5577FD;
        font-weight: 600;
        margin-top: 10px;
        border-top: 1px solid #f0f0f0;
        padding-top: 10px !important;
    }

        .mega-menu-links .view-more:hover {
            background: #5577FD;
            color: white;
            padding: 8px 12px !important;
            border-radius: 20px;
        }

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 1400px) {
    .mega-menu {
        width: 600px;
        min-width: 500px;
    }
}

@media (max-width: 1200px) {
    .mega-menu {
        width: 500px;
        min-width: 400px;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991.98px) {
    .sidebar-categories {
        display: none;
    }

    .mega-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: 1px solid #f0f0f0;
        margin-top: 10px;
        padding: 15px;
        grid-template-columns: 1fr;
        pointer-events: auto;
    }

    .category-item-wrapper:hover .mega-menu {
        transform: none;
    }
}


.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    z-index: 9999;
}

    .mobile-bottom-nav .nav-item {
        flex: 1;
        text-align: center;
        color: #666;
        text-decoration: none;
        font-size: 12px;
    }

        .mobile-bottom-nav .nav-item i {
            display: block;
            font-size: 20px;
            margin-bottom: 2px;
        }

        .mobile-bottom-nav .nav-item.active {
            color: #5577FD;
        }
.category-main {
    width: 35%;
    border-right: 1px solid #eee;
    background: #fafafa;
    overflow-y: auto;
    padding-bottom: 55px;
}

.category-main-item {
    padding: 12px;
    text-align: center;
    cursor: pointer;
}

    .category-main-item img {
        width: 32px;
        height: 32px;
        object-fit: cover;
        margin-bottom: 4px;
    }

    .category-main-item span {
        display: block;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .category-main-item.active {
        background: #fff;
        font-weight: bold;
        border-left: 3px solid #007bff;
    }

.category-sub {
    width: 65%;
    padding: 8px;
    overflow-y: auto;
    height: calc(100vh - 60px); /* full chiều cao */
}

.category-sub-panel {
    margin-bottom: 20px;
}

.cat-title {
    font-weight: bold;
    margin: 10px 0;
}

.cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-sub-item {
    width: 30%;
    text-align: center;
    text-decoration: none;
    color: #333;
}

    .category-sub-item img {
        width: 60px;
        height: 60px;
        margin-bottom: 4px;
        border-radius: 8px;
        object-fit: cover;
    }
.nav-item {
    position: relative;
}

    .nav-item .badge {
        position: absolute;
        top: -3px;
        right: 30px;
        background: red;
        color: #fff;
        font-size: 12px;
        border-radius: 50%;
        padding: 2px 6px;
    
    }

#cart-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex; /* mặc định hiện */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: radial-gradient( circle 150px at center, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.6) 60%, rgba(255, 255, 255, 1) 100% );
    transition: opacity 0.6s ease; /* mượt hơn */
    opacity: 1;
    visibility: visible;
}

    #cart-loader.hide {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.6s ease, visibility 0s linear 0.6s;
    }    #cart-loader .loader {
        --s: 40px;
        --g: 5px;
        height: calc(1.353*var(--s) + var(--g));
        aspect-ratio: 3;
        display: grid;
        justify-items: end;
        overflow: hidden;
        --_m: linear-gradient(90deg,#0000,#000 15px calc(100% - 15px),#0000);
        -webkit-mask: var(--_m);
        mask: var(--_m);
    }

        #cart-loader .loader:before {
            content: "";
            width: calc(4*100%/3);
            background: conic-gradient(from -90deg at var(--s) calc(0.353*var(--s)), #5577FD 135deg,#77B6FF 0 270deg,#5577FD 0);
            --_m: linear-gradient(to bottom right, #0000 calc(0.25*var(--s)),#000 0 calc(100% - calc(0.25*var(--s)) - 1.414*var(--g)),#0000 0), conic-gradient(from -90deg at right var(--g) bottom var(--g),#000 90deg,#0000 0);
            -webkit-mask: var(--_m);
            mask: var(--_m);
            background-size: calc(100%/4) 100%;
            -webkit-mask-size: calc(100%/4) 100%;
            mask-size: calc(100%/4) 100%;
            -webkit-mask-composite: source-in;
            mask-composite: intersect;
            animation: l8 1s infinite linear;
        }

@keyframes l8 {
    to {
        transform: translate(calc(100%/4))
    }
}
