/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #ff3b30;
    --gray-100: #f5f5f7;
    --gray-200: #e5e5e7;
    --gray-300: #d2d2d7;
    --gray-600: #86868b;
    --gray-900: #1d1d1f;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background-color: rgba(255, 255, 255, 0.8);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.cart-btn:hover {
    background-color: var(--gray-100);
}

.cart-icon {
    font-size: 24px;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* Main Layout */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.main-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background-color: var(--gray-100);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-btn {
    background: none;
    border: none;
    text-align: left;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-900);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.category-btn:hover {
    background-color: var(--secondary-color);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Content Area */
.content {
    flex: 1;
    min-width: 0;
}

.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.section-subtitle {
    font-size: 16px;
    color: var(--gray-600);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 64px;
}

.hot-sales-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Product Card */
.product-card {
    background-color: var(--secondary-color);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #ff9500);
    transform: scaleX(0);
    transition: var(--transition);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.price-original {
    font-size: 14px;
    color: var(--gray-600);
    text-decoration: line-through;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.add-to-cart:hover {
    background-color: var(--gray-900);
    transform: scale(1.05);
}

.add-to-cart:active {
    transform: scale(0.98);
}

/* Hot Sales Special Styling */
.hot-sales .product-card {
    border: 2px solid var(--accent-color);
}

.hot-sales .product-card::before {
    background: linear-gradient(90deg, var(--accent-color), #ff9500);
    transform: scaleX(1);
}

/* Footer */
.footer {
    background-color: var(--gray-100);
    padding: 32px 0;
    text-align: center;
    color: var(--gray-600);
    font-size: 14px;
    margin-top: 64px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--secondary-color);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 32px;
    color: var(--gray-600);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

.modal-body {
    padding: 32px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        gap: 32px;
    }

    .sidebar {
        width: 220px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 32px;
    }

    .sidebar:not(.mobile-open) {
        display: none;
    }

    .sidebar.mobile-open {
        display: block;
        animation: slideDown 0.3s ease;
    }

    .category-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .category-btn {
        flex: 1;
        min-width: 150px;
    }

    .section-title {
        font-size: 24px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .hot-sales-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .product-card {
        padding: 16px;
    }

    .product-name {
        font-size: 14px;
    }

    .price-current {
        font-size: 18px;
    }

    .add-to-cart {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .logo-text {
        font-size: 20px;
    }

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

    .product-image {
        font-size: 36px;
    }

    .product-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .add-to-cart {
        width: 100%;
    }

    .section-title {
        font-size: 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.product-card {
    animation: fadeIn 0.5s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }


