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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

/*  trang chủ  */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    font-family: 'Inter', Arial, sans-serif;
}

/* chia lam 4 cot */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}


.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.4s ease forwards;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}


.product-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
    background: transparent;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    min-height: 3em;
}
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars i {
    font-size: 0.8rem;
    color: var(--accent);
}

.rating-stars i.empty {
    color: var(--gray-300);
}

.rating-count {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.price-sale {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger);
}

.price-original {
    font-size: 0.95rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    padding: 0 20px 20px;
    margin-top: 16px;
    position: relative;
    z-index: 4;
}

.btn-add-to-cart {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-add-to-cart:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.7;
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--gray-500);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

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

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

    .product-image {
        height: 180px;
    }

    .product-info {
        padding: 16px;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .price-sale {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-image {
        height: 220px;
    }
}