@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f1f3f6;
    line-height: 1.4;
}

:root {
    --primary-color: #2874f0;
    --secondary-color: #388e3c;
    --text-color: #212121;
    --text-light: #878787;
    --white: #ffffff;
    --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.23);
    --shadow-light: 0 1px 1px 0 rgba(0, 0, 0, 0.16);
}

.container {
    padding: 0 8px;
    max-width: 1280px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
header {
    background-color: var(--primary-color);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    gap: 10px;
}

header .logo {
    display: flex;
    min-width: 120px;
    justify-content: flex-end;
}

header .logo img {
    width: 75px;
    height: auto;
}

header .search {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

header .search-container {
    width: 100%;
    max-width: 540px;
    height: 36px;
    background-color: var(--white);
    border-radius: 2px;
    box-shadow: var(--shadow);
    display: flex;
}

header .search input {
    width: calc(100% - 32px);
    padding: 0 16px;
    outline: none;
    border: none;
    font-size: 14px;
    color: var(--text-color);
}

header .search button {
    width: 36px;
    height: 100%;
    padding: 0 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background-color: var(--white);
    border-radius: 0 2px 2px 0;
    cursor: pointer;
}

header .nav-item {
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
    padding: 0 10px;
    white-space: nowrap;
    cursor: pointer;
}

header .login button {
    width: 122px;
    padding: 5px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    background-color: var(--white);
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

header .more svg {
    margin-left: 4px;
    rotate: -90deg;
}

header .cart {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
    width: 100%;
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    padding: 12px 0;
    overflow-x: auto;
}

.categories-container {
    display: flex;
    justify-content: space-between;
    min-width: 1200px;
    padding: 0 16px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    min-width: 100px;
    transition: transform 0.2s;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* ===== BANNER SECTIONS ===== */
.banner-section {
    margin-top: 16px;
}

.banner {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 2px;
}

.small-banner {
    height: 122px;
    margin-top: 8px;
}

/* ===== PRODUCTS SECTION ===== */
.products-section {
    margin-top: 16px;
    background-color: var(--white);
    border-radius: 2px;
    padding: 16px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.view-all-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 24px;
    border: none;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background-color 0.2s;
}

.view-all-btn:hover {
    background-color: #1c64da;
}

.products-container {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 0 16px;
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f0f0f0;
}

.products-container::-webkit-scrollbar {
    height: 4px;
}

.products-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.products-container::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 2px;
}

.product-card {
    min-width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    transition: box-shadow 0.3s;
    text-decoration: none;
    color: var(--text-color);
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 12px;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    height: 40px;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.product-description {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.6;
    font-weight: 300;
}

/* ===== PROMO BANNERS ===== */
.promo-banners {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding: 0 8px;
}

.promo-banner {
    flex: 1;
    border-radius: 2px;
    overflow: hidden;
}

.promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== FOOTER ===== */
footer {
    margin-top: 32px;
    background-color: var(--white);
    padding: 32px;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    border-top: 1px solid #f0f0f0;
}

/* ===== CATEGORY HEADING ===== */
.category-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 32px 16px 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
    header .nav-container {
        padding: 0 12px;
        gap: 8px;
    }
    
    header .logo {
        min-width: 100px;
    }
    
    header .logo img {
        width: 65px;
    }
    
    header .nav-item {
        font-size: 14px;
        padding: 0 8px;
    }
    
    header .login button {
        width: 100px;
        padding: 5px 16px;
        font-size: 14px;
    }
    
    .categories-container {
        min-width: 1000px;
    }
    
    .category-item {
        min-width: 90px;
    }
    
    .category-item img {
        width: 56px;
        height: 56px;
    }
    
    .banner {
        height: 220px;
    }
    
    .small-banner {
        height: 100px;
    }
    
    .product-card {
        min-width: 200px;
    }
    
    .product-image {
        width: 160px;
        height: 160px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 4px;
    }
    
    header {
        height: 50px;
    }
    
    header .nav-container {
        padding: 0 8px;
        gap: 4px;
    }
    
    header .logo {
        min-width: 80px;
    }
    
    header .logo img {
        width: 55px;
    }
    
    header .search-container {
        height: 32px;
    }
    
    header .search input {
        font-size: 12px;
        padding: 0 12px;
    }
    
    header .nav-item {
        font-size: 12px;
        padding: 0 6px;
    }
    
    header .login button {
        width: 80px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    header .cart span {
        display: none;
    }
    
    .categories-section {
        padding: 8px 0;
    }
    
    .categories-container {
        min-width: 800px;
        padding: 0 8px;
    }
    
    .category-item {
        min-width: 70px;
        font-size: 12px;
        gap: 4px;
    }
    
    .category-item img {
        width: 48px;
        height: 48px;
    }
    
    .banner {
        height: 160px;
        margin-top: 8px;
    }
    
    .small-banner {
        height: 80px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .view-all-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .products-container {
        padding: 0 8px;
        gap: 12px;
    }
    
    .product-card {
        min-width: 160px;
        padding: 12px;
    }
    
    .product-image {
        width: 140px;
        height: 140px;
    }
    
    .product-title {
        font-size: 12px;
        height: 36px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .product-description {
        font-size: 10px;
    }
    
    .promo-banners {
        flex-direction: column;
        gap: 4px;
    }
    
    .category-heading {
        font-size: 22px;
        margin: 24px 12px 12px;
    }
    
    footer {
        padding: 24px 16px;
        font-size: 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    header .become-seller,
    header .more {
        display: none;
    }
    
    header .logo {
        min-width: 60px;
    }
    
    header .logo img {
        width: 45px;
    }
    
    .categories-container {
        min-width: 600px;
    }
    
    .category-item {
        min-width: 60px;
        font-size: 10px;
    }
    
    .category-item img {
        width: 40px;
        height: 40px;
    }
    
    .banner {
        height: 120px;
    }
    
    .small-banner {
        height: 60px;
    }
    
    .product-card {
        min-width: 140px;
    }
    
    .product-image {
        width: 120px;
        height: 120px;
    }
    
    .product-title {
        font-size: 11px;
        height: 32px;
    }
}
