* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: #ffd700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.cart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cart-count {
    background: #ffd700;
    color: #333;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    animation: pulse 0.5s ease;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #ffd700;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 120px 0 80px;
    margin-top: 70px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.cta-button:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Products Section */
.products {
    padding: 80px 0;
}

.products h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
    font-weight: 700;
}

.category {
    margin-bottom: 4rem;
}

.category h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.category h3 i {
    color: #764ba2;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.product-image {
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    background: #f8f9fa;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

/* Fallback cho hình ảnh không tải được */
.product-image img:not([src]), 
.product-image img[src=""],
.product-image img[src*="error"] {
    display: none;
}

.product-image:has(img:not([src])), 
.product-image:has(img[src=""]),
.product-image:has(img[src*="error"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    padding: 2rem 1rem;
}

/* Fallback styling */
.image-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
}

.image-fallback i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.image-fallback span {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Cải thiện hiển thị hình ảnh */
.product-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
    border-radius: 8px;
}

.product-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Loading state */
.product-image img[style*="opacity: 0"] {
    background: #f8f9fa;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.product-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.product-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.buy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
    text-align: center;
}

.footer h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #ffd700;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-3px);
}

.contact-item i {
    font-size: 1.5rem;
    color: #ffd700;
}

.contact-item a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.contact-item a:hover {
    color: #ffd700;
}

.footer p {
    opacity: 0.8;
    border-top: 1px solid #34495e;
    padding-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .products h2 {
        font-size: 2rem;
    }
    
    .category h3 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cart-content {
        width: 95%;
        margin: 1rem;
    }
    
    .checkout-content {
        width: 95%;
        margin: 1rem;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .contact-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .product-card {
        padding: 1.5rem;
    }
    
    .product-image img {
        height: 120px;
    }
    
    .image-fallback {
        height: 120px;
        font-size: 0.8rem;
    }
    
    .image-fallback i {
        font-size: 1.5rem;
    }
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.cart-modal.show {
    display: flex;
}

.cart-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cart-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-cart:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-items {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.cart-item-price {
    color: #667eea;
    font-weight: 500;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.remove-item:hover {
    background: #c82333;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cart-total {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.clear-cart, .checkout-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.clear-cart {
    background: #6c757d;
    color: white;
}

.clear-cart:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.checkout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.checkout-modal.show {
    display: flex;
}

.checkout-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.checkout-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-checkout {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-checkout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.checkout-body {
    padding: 2rem;
    text-align: center;
}

.checkout-message {
    margin-bottom: 2rem;
}

.checkout-message i {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.checkout-message h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.checkout-message p {
    color: #666;
    line-height: 1.6;
}

.contact-options h5 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.contact-btn.facebook {
    background: #1877f2;
}

.contact-btn.telegram {
    background: #0088cc;
}

.contact-btn.email {
    background: #ea4335;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Empty cart message */
.cart-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.cart-empty i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animation for product cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }
