:root {
    --primary-color: #27ae60;
    --primary-hover: #219150;
    --dark-color: #2c3e50;
    --light-bg: #f4f7f6;
    --accent-color: #e67e22;
    --text-color: #333;
}

* { box-sizing: border-box; transition: all 0.3s ease; }

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    scroll-behavior: smooth;
}

header {
    background: white;
    padding: 15px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

nav { display: flex; align-items: center; }

nav a {
    margin-left: 25px;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    position: relative;
}

nav a:hover { color: var(--primary-color); }
header nav a.nav-download { color: var(--primary-color); font-weight: 700; }
header nav a.nav-download:hover { color: var(--primary-hover); }

.cart-icon { position: relative; color: #333; font-size: 1.2rem; }
.user-icon { margin-left: 16px; color: var(--dark-color); text-decoration:none; font-size: 1rem; display:inline-flex; align-items:center; gap:6px; cursor: pointer; }
.user-icon i { font-size: 18px; }

.cart-count {
    position: absolute;
    top: -10px;
    right: -12px;
    background: red;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
}

.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
                url('../images/hero-bg.svg');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 0 20px;
}

.hero h2 { font-size: 3.5rem; margin-bottom: 20px; animation: fadeInUp 1s; }
.hero p { font-size: 1.3rem; margin-bottom: 30px; max-width: 700px; }

.btn-main {
    background: var(--primary-color);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-main:hover { background: var(--primary-hover); transform: scale(1.05); }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 80px 8%;
    background: white;
    text-align: center;
}

.feature-item { padding: 20px; border-radius: 10px; }
.feature-item i { font-size: 50px; color: var(--primary-color); margin-bottom: 20px; }
.feature-item h3 { margin-bottom: 10px; }

.container { padding: 80px 8%; background: var(--light-bg); }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 2.5rem; position: relative; padding-bottom: 15px; }

.section-title h2::after {
    content: '';
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.product-card > a {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.product-card img { 
    width: 100%; 
    height: 280px; 
    object-fit: contain; 
    background: #fff; 
    padding: 15px; 
    display: block; 
    image-rendering: -webkit-optimize-contrast;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
}

.product-info { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 1.1rem; margin: 8px 0; height: 2.4rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.product-info p { 
    font-size: 0.85rem; 
    margin-bottom: 10px; 
    overflow: hidden; 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    line-height: 1.4;
    height: 3.8rem; /* Fixed height for 3 lines to ensure alignment */
}
.price { color: #e74c3c; font-size: 1.3rem; font-weight: bold; margin: auto 0 10px 0; }

.btn-add {
    width: 100%;
    padding: 8px;
    background: var(--dark-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-add:hover { background: var(--primary-color); }

.product-actions {
    padding: 0 15px 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-details {
    width: 100%;
    padding: 8px;
    background: #fff;
    border: 1.5px solid var(--dark-color);
    color: var(--dark-color);
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.contact { padding: 80px 8%; text-align: center; background: white; }
.contact-form { max-width: 600px; margin: 0 auto; display: grid; gap: 15px; }
.contact-form input, .contact-form textarea, .contact-form select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
    font-family: inherit;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

footer { background: var(--dark-color); color: #bdc3c7; text-align: center; padding: 50px 8%; }
footer h3 { color: white; }
.social-icons { margin: 20px 0; }
.social-icons a { color: white; font-size: 24px; margin: 0 10px; text-decoration: none; }

.user-dropdown { position: relative; display: inline-block; margin-left: 16px; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1001;
}
.dropdown-content a {
    color: var(--dark-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    margin: 0;
    font-size: 14px;
}
.dropdown-content a:hover { background: #f8f9fa; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.d-mobile-only { display: none; }
.d-desktop-only { display: inline-block; }

@media (max-width: 768px) {
    .d-mobile-only { display: inline-block !important; }
    .d-desktop-only { display: none !important; }
    header { padding: 10px 5%; }
    
    /* Hiển thị Menu Mobile */
    .mobile-menu-btn { 
        display: block !important; 
        font-size: 24px; 
        cursor: pointer; 
        color: var(--dark-color);
    }
    
    nav { 
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
    }
    
    nav.active { display: flex; }
    nav a { margin: 10px 0; font-size: 1.1rem; }
    
    .hero { height: 60vh; }
    .hero h2 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    
    .container { padding: 40px 5%; }
    .section-title h2 { font-size: 1.8rem; }
    
    /* Lưới sản phẩm 2 cột trên Mobile */
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 12px; 
    }
    
    .product-card img { height: 160px; padding: 10px; }
    .product-info { padding: 10px; }
    .product-info h3 { font-size: 0.9rem; height: 2.2rem; margin: 5px 0; }
    .product-info p { display: none; } /* Ẩn mô tả ngắn trên mobile để gọn */
    .price { font-size: 1rem; margin-bottom: 8px; }
    
    .product-actions { padding: 0 10px 10px; gap: 8px; }
    .btn-details, .btn-add { font-size: 0.9rem; padding: 10px 5px; font-weight: 600; }
    
    .features { padding: 40px 5%; gap: 20px; }
    .feature-item i { font-size: 35px; }
    .feature-item h3 { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .product-grid { gap: 8px; }
    .product-info h3 { font-size: 0.85rem; }
    .price { font-size: 0.9rem; }
}