:root {
    --primary-color: #ff6a00;
    --secondary-color: #003580;
    --success-color: #00a854;
    --warning-color: #ffc107;
    --danger-color: #f04134;
    --dark-color: #2a2a2a;
    --light-color: #f8f9fa;
    --border-color: #e8e8e8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--dark-color);
    background: #f5f5f5;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(90deg, var(--secondary-color), #0047ab);
    font-size: 0.9rem;
}

.top-bar a {
    text-decoration: none;
    transition: opacity 0.3s;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    text-decoration: none;
    color: inherit;
}

.logo:hover {
    color: inherit;
}

.search-bar {
    position: relative;
}

.search-bar .input-group {
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.search-bar .form-control {
    border: none;
    padding: 12px 15px;
}

.search-bar .search-category {
    border-right: 1px solid var(--border-color);
    border-radius: 0;
}

.search-bar .btn-danger {
    background: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 25px;
    font-weight: 600;
}

.search-bar .btn-danger:hover {
    background: #e55a00;
    border-color: #e55a00;
}

.trending-searches a {
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 8px;
}

.trending-searches a:hover {
    background: #e9ecef !important;
}

/* Navigation */
.nav-categories {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-categories .nav-item {
    flex-shrink: 0;
}

.nav-categories .nav-link {
    padding: 15px 20px;
    color: var(--dark-color);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-categories .nav-link:hover,
.nav-categories .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(255, 106, 0, 0.05);
}

.dropdown-menu.mega-menu {
    width: 100%;
    padding: 20px;
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.mega-menu h6 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.mega-menu .dropdown-item {
    padding: 8px 0;
    color: #555;
    transition: color 0.3s;
}

.mega-menu .dropdown-item:hover {
    color: var(--primary-color);
    background: transparent;
}

/* Carousel */
.hero-swiper {
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-swiper .swiper-slide {
    position: relative;
}

.hero-swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 40px;
    left: 40px;
    text-align: left;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.carousel-caption h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.carousel-caption p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Side Promotions */
.side-promotions {
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.promo-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--radius);
    transition: transform 0.3s;
}

.promo-card:hover {
    transform: translateY(-2px);
    background: white;
    box-shadow: var(--shadow);
}

.promo-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 1.2rem;
}

/* Quick Categories */
.quick-categories {
    background: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.category-card {
    text-align: center;
    padding: 20px 10px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    color: inherit;
}

.category-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.category-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.category-count {
    font-size: 0.9rem;
    color: #666;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.product-info {
    padding: 15px;
}

.product-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 50px;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.product-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    margin-left: 8px;
}

.product-rating {
    color: var(--warning-color);
    font-size: 0.9rem;
}

.product-sales {
    color: #666;
    font-size: 0.85rem;
}

.product-actions {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* Supplier Cards */
.supplier-card {
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
}

.supplier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.supplier-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 2px solid var(--border-color);
}

.supplier-card h6 {
    font-weight: 600;
    margin-bottom: 5px;
}

.rating {
    margin-bottom: 5px;
}

/* Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 8px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: #666;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: white;
}

.social-icons a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Modal */
.modal-content {
    border-radius: var(--radius);
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-swiper {
        height: 250px;
    }
    
    .carousel-caption {
        bottom: 20px;
        left: 20px;
    }
    
    .carousel-caption h3 {
        font-size: 1.5rem;
    }
    
    .nav-categories {
        padding: 10px 0;
    }
    
    .nav-categories .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-bar .input-group {
        flex-wrap: nowrap;
    }
    
    .search-bar .search-category {
        max-width: 100px;
        font-size: 0.8rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Badge */
.badge-new {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Loader */
.loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animations */
.animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__bounce {
    animation-name: bounce;
}

@keyframes bounce {
    from, 20%, 53%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0);
    }

    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -30px, 0);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }

    90% {
        transform: translate3d(0,-4px,0);
    }
}