/* Header */
header {
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(10px); /* Blur nền */
    -webkit-backdrop-filter: blur(10px); /* Hỗ trợ Safari */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* Viền mờ */
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    width: 150px; /* Điều chỉnh width logo theo kích thước file PNG của mày */
    height: auto; /* Giữ tỷ lệ */
}

nav ul {
    display: flex;
}

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    color: #333;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #e74c3c;
}

.quote-btn {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.quote-btn:hover {
    background: #c0392b;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.hero-slider .slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slider .slide.active {
    opacity: 1;
}

.hero-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider .slide-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
}

.hero-slider .slide-caption h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero-slider .slide-caption p {
    font-size: 18px;
}

.hero-slider .prev, .hero-slider .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: background 0.3s ease;
}

.hero-slider .prev:hover, .hero-slider .next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.hero-slider .prev { 
    left: 10px; 
}

.hero-slider .next { 
    right: 10px; 
}

/* Sections chung */
section {
    padding: 60px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: #2c3e50;
}

/* Jobs Section */
.jobs-section {
    background: #f8f9fa;
    padding: 80px 0; /* Tăng padding để fit hình to */
}

.jobs-content {
    display: flex;
    align-items: center;
    gap: 40px; /* Khoảng cách giữa hình và text */
    max-width: 1200px;
    margin: 0 auto;
}

.jobs-image {
    flex: 0 0 40%; /* Hình chiếm 40% width, không co giãn */
}

.jobs-image img {
    width: 100%;
    height: 400px; /* Chiều cao to bằng khung text */
    object-fit: cover; /* Giữ tỷ lệ, crop nếu cần */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.jobs-text {
    flex: 1; /* Text chiếm phần còn lại, nhích sang phải tự động */
    text-align: left; /* Giữ left align cho text */
}

.jobs-text h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.jobs-text p {
    font-size: 16px;
    margin-bottom: 20px;
    max-width: none; /* Để text full width phần phải */
}

.jobs-text .btn {
    display: inline-block;
}

.jobs-section p {
    max-width: 800px;
    margin: 0 auto 20px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    transition: background 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background: #c0392b;
}

/* Partners Section */
.partners-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.partners-grid img {
    height: 80px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.partners-grid img:hover {
    filter: grayscale(0%);
}

/* About Section */
.about-section {
    background: #f8f9fa;
    padding: 80px 0;
}

.about-content {
    display: flex;
    align-items: flex-start; /* Align top cho text dài */
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-image {
    flex: 0 0 35%; /* Hình chiếm 35% width */
}

.about-image img {
    width: 100%;
    height: 400px; /* To bằng khung text */
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 1;
    text-align: left;
}

.about-text h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.about-text p {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #666;
}

.about-text .btn {
    display: inline-block;
    margin-top: 20px;
}

/* Projects Slider - Multi-item Carousel */
.projects-slider {
    background: #f8f9fa;
    padding: 60px 0;
}

.projects-slider .container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* --- Projects Slider (3 items per slide, no gap) --- */
.projects-slider {
    background: #f8f9fa;
    padding: 60px 0;
    position: relative;
}

.projects-slider .container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.project-carousel {
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.project-track {
    display: flex;
    transition: transform 0.6s ease-in-out;
    gap: 0; /* ✅ Không có khoảng trắng giữa item */
}

.project-item {
    flex: 0 0 calc(100% / 3); /* ✅ 3 item mỗi slide */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.project-item a {
    display: block;
    height: 100%;
    text-decoration: none;
}

.project-item img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    display: block;
}

.project-caption {
    height: 20%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.project-caption h3 {
    margin: 0;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Nút điều hướng --- */
.project-prev, .project-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 10;
}

.project-prev:hover, .project-next:hover {
    background: rgba(0,0,0,0.8);
}

.project-prev { left: 10px; }
.project-next { right: 10px; }


/* Pricing Section - Cập nhật */
.pricing-section {
    padding: 80px 0;
}

.category {
    margin-bottom: 60px;
}

.category h3 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* ⚡ magic line */
    gap: 20px;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.product-item {
    text-align: center;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-item img {
    width: 100%;
    height: auto; /* Default cho desktop */
    aspect-ratio: 16/9; /* Giữ tỷ lệ đẹp, thay bằng 1/1 nếu ảnh vuông */
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
    display: block
}

.product-item h4 {
    font-size: 18px;
    margin: 10px 0;
    color: #2c3e50;
    font-weight: bold;
}

.price-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    margin-top: 5px;
}

.price-note {
    font-size: 0.9rem; /* chữ nhỏ hơn */
    font-style: italic; /* in nghiêng */
    color: #ff0000; /* màu xám nhẹ */
    margin-top: -5px;
    margin-bottom: 10px;
}

.old-price {
    font-size: 14px; /* Nhỏ hơn */
    color: #999; /* Màu xám */
    text-decoration: line-through; /* Strikethrough */
}

.new-price {
    font-size: 20px; /* Nổi bật hơn */
    color: #e74c3c; /* Màu đỏ */
    font-weight: bold;
}

.view-more {
    text-align: center;
    margin-top: 20px;
}

/* Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
}

/* About Page */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h1 {
    font-size: 40px;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Products Main Page */
.product-category-link {
    display: block;
    text-align: center;
    margin: 20px 0;
}

.product-category-link a {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

.product-category-link a:hover {
    background: #c0392b;
}

/* Projects Page */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.project-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    transition: transform 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
}

.project-images {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
}

.project-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-desc {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-desc h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.project-desc p {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
}

/* News Page */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.news-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateY(-5px);
}

.news-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 20px;
}

.news-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.news-summary {
    color: #666;
    margin-bottom: 15px;
}

.news-readmore {
    color: #e74c3c;
    font-weight: bold;
}

/* Full News Article */
.article-header {
    text-align: center;
    margin-bottom: 40px;
}

.article-header h1 {
    font-size: 36px;
    color: #2c3e50;
}

.article-meta {
    color: #999;
    font-size: 14px;
    margin-top: 10px;
}

.article-body {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}

.article-body p {
    margin-bottom: 20px;
}

/* Contact Page */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.contact-form input,
.contact-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.contact-info {
    margin-top: 40px;
    text-align: left;
}

/* SEO: General for all pages */
body {
    background-color: #fff;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Dropdown Menu */
.nav-product {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 101;
    display: none; /* Default ẩn cho mobile */
}

.dropdown ul {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.dropdown li {
    padding: 10px 20px;
}

.dropdown a {
    color: #333;
    display: block;
    transition: color 0.3s ease;
}

.dropdown a:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

html, body {
    overflow-x: hidden;
}

#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 25px;
    background-color: #333;
    color: white;
    border: none;
    outline: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 9999;
    display: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#scrollTopBtn:hover {
    background-color: #555;
    transform: scale(1.1);
}

/* Responsive */

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 per row tablet */
    }

    .product-item img {
        height: 180px; /* Trung bình cho tablet */
    }

    .product-item h4 {
        font-size: 17px;
    }

    .jobs-image {
        flex: 0 0 35%;
    }

    .jobs-image img {
        height: 350px;
    }

    .about-image {
        flex: 0 0 30%;
    }

    .about-image img {
        height: 350px;
    }

    /* Projects Slider Responsive */
    .project-carousel {
        height: 300px;
    }
    
    .project-track {
        width: 300%;  /* Cho 2 items visible */
    }
    
    .project-item {
        width: 50%;  /* Exact 50% for 2 visible */
        height: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .project-caption h3 {
        font-size: 18px;
    }
}

/* Hover cho desktop */
@media (min-width: 769px) {
    .nav-product:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        display: block;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Căn chỉnh lại header/nav */
    body {
        overflow-x: hidden; /* Không scroll ngang */
    }

    .fade-in {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }

    header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px;
        transition: transform 0.9s ease;
    }

    .logo {
        width: 120px;
    }

    nav {
        width: 100%;
        overflow: visible;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;              /* Cho phép xuống dòng */
        justify-content: center;      /* Canh giữa */
        align-items: center;
        gap: 10px;
        margin: 0;
        padding: 0;
        list-style: none;
        width: 100%;
    }

    nav ul li {
        margin: 0;
        flex: 0 1 auto;               /* Cho phép co giãn */
        text-align: center;
    }

    nav ul li a {
        display: inline-block;
        padding: 8px 10px;
        color: #333;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    nav ul li a:hover {
        color: #e74c3c;
    }

    .quote-btn {
        margin-top: 5px;
        display: inline-block;
    }
    
    header nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .nav-product {
        position: relative;
        width: 100%;
        overflow: visible !important;
    }

    /* Nút “Sản phẩm” hiển thị bình thường */
    .nav-product-link {
        display: block;
        text-align: center;
        padding: 10px 0;
        color: #333;
    }

    /* Dropdown menu trên mobile */
    .dropdown {
        position: absolute; /* nằm ngay dưới “Sản phẩm” */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(6px);
        border-radius: 6px;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
        list-style: none;
        margin: 4px 0 0 0;
        padding: 6px 0;
        width: 100%;
        z-index: 9999;

        /* Ẩn mặc định */
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: all 0.2s ease;
    }

    /* Khi toggle bằng JS, thêm class .show */
    .dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Các item trong dropdown */
    .dropdown li {
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .dropdown li a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px 0;
        color: #333;
        text-decoration: none;
        font-size: 15px;
    }

    .dropdown li a:hover {
        background: rgba(231, 76, 60, 0.08);
        color: #e74c3c;
    }

    /* Cải thiện cảm giác chạm */
    a, button {
        -webkit-tap-highlight-color: transparent;
    }

    /* Projects Slider Mobile */
    .projects-slider {
        padding: 40px 0;
    }
    
    .project-carousel {
        height: 220px;
    }
    
    .project-track {
        width: 600%; /* Fix: Cho mobile show 1, width lớn hơn để slide full (6 items * 100%) */
    }
    
    .project-item {
        flex: 0 0 100%;
    }
    
    .project-item img {
        height: 70%;  /* Tăng img space on mobile */
    }
    
    .project-caption {
        height: 30%;
    }
    
    .project-caption h3 {
        font-size: 14px;
    }
    
    .projects-slider .project-prev, 
    .projects-slider .project-next {
        font-size: 16px;
        padding: 8px 10px;
        top: 45%;
    }
    
    .project-prev, .project-next {
        font-size: 20px;
        padding: 8px;
        top: 45%;
    }

    /* Hero Slider Mobile */
    .hero-slider {
        height: 400px;
    }

    .hero-slider .slide-caption h1 {
        font-size: 24px;
    }

    .hero-slider .slide-caption p {
        font-size: 16px;
    }

    .hero-slider .prev, .hero-slider .next {
        font-size: 20px;
        padding: 8px;
    }
}