/* Custom CSS for ICYAIR Website */

:root {
    --primary-blue: rgb(0, 153, 222); /* Bootstrap primary color */
    --light-blue: #e6f2ff; /* Lighter shade for backgrounds */
    --dark-blue: rgb(0, 50, 109); /* Darker shade for hover states */
    --text-color: #333;
    --light-bg: #f8f9fa; /* Bootstrap light background */
    --white: #fff;
    --gray-dark: rgb(0, 50, 109); /* For footer */
}

/* General Body & Typography */
body {
    font-family: 'Kanit', sans-serif; /* Google Font for Thai */
    line-height: 1.7; /* Slightly more line height for readability */
    color: var(--text-color);
    background-color: var(--light-bg);
    overflow-x: hidden; /* Prevent horizontal scroll from AOS */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700; /* Bold for headings */
    color: var(--primary-blue);
    line-height: 1.3;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-blue);
}

.text-primary {
    color: var(--primary-blue) !important;
}

/* bg */
.bg-gradient-blue {
    background: linear-gradient(-135deg, var(--primary-blue), var(--dark-blue));
}

/* Header & Navbar Customization */
.navbar-brand {
    font-size: 2.2rem !important; /* Slightly larger logo */
    letter-spacing: -1px;
}

.navbar-nav .nav-link {
    font-weight: 400; /* Regular weight for nav links */
    color: var(--text-color);
    padding: 0.5rem 1rem; /* Adjust padding */
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: .25rem;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-blue);
    background-color: rgba(0, 123, 255, 0.05); /* Very light blue hover */
}

.navbar-nav .btn.btn-primary {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.navbar-nav .btn.btn-primary:hover {
    background-color: var(--dark-blue) !important;
    border-color: var(--dark-blue) !important;
    transform: translateY(-2px);
}

/* Main Content Padding (for fixed header) */
main {
    padding-top: 25px; /* Adjust based on header height */
}

/* sections */
#products, #features, #services, #gallery, #articles, #cta, #energy-saving {
    padding: 8rem 0;
}

/* Section Titles */
.section-title, .section-title-white {
    font-size: 2.8rem; /* Larger section titles */
    margin-bottom: 3rem; /* More space below title */
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 70px; /* Shorter underline */
    height: 4px;
    background-color: var(--primary-blue);
    border-radius: 2px;
}

.section-title .d-block {
    font-size: 1.25rem !important;
    font-weight: 300 !important; /* Light weight for sub-title */
    /* color: #6c757d !important; */
    margin-top: 0.5rem;
}

.section-title-white::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 70px; /* Shorter underline */
    height: 4px;
    background-color: var(--white);
    border-radius: 2px;
}

.section-title-white .d-block {
    font-size: 1.25rem !important;
    font-weight: 300 !important; /* Light weight for sub-title */
    color: #ffffff !important;
    margin-top: 0.5rem;
}


/* Hero Slider */
.hero-slider {
    min-height: 80vh; /* Takes 80% of viewport height */
    position: relative;
    overflow: hidden;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Text shadow for readability */
}

.carousel-item {
    height: 80vh; /* Match slider height */
    background-size: cover;
    background-position: center;
    position: relative;
}

.carousel-item::before { /* Overlay for text readability */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0); /* Darker overlay */
    z-index: 1;
}

.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.carousel-caption h1 {
    font-size: 3.8rem;
    color: var(--white);
}

.carousel-caption p {
    font-size: 1.5rem;
    font-weight: 300; /* Lighter font weight for lead text */
}

.hero-slider .btn-primary {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.hero-slider .btn-primary:hover {
    background-color: var(--dark-blue) !important;
    border-color: var(--dark-blue) !important;
    transform: translateY(-3px);
}

.hero-slider .btn-outline-light {
    border-color: var(--white) !important;
    color: var(--white) !important;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.hero-slider .btn-outline-light:hover {
    background-color: var(--white) !important;
    color: var(--primary-blue) !important;
    transform: translateY(-3px);
}

/* Page */
.page-hero {
    padding: 100px 0 50px 0;
}

/* Introduction Section */
#introduction {
    background-color: var(--white);
    padding-top: 10rem;
}
.introduction-content img, #products img {
    /* border-radius: 12px; */
    /* box-shadow: 0 8px 25px rgba(0,0,0,0.15); */
    transition: transform 0.3s ease;
}
.introduction-content img:hover, #products img:hover {
    transform: scale(1.02);
}
.introduction-content p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Features Section */
.feature-item {
    background: var(--white);
    padding: 2.5rem; /* More padding */
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.feature-item i {
    color: var(--primary-blue);
    margin-bottom: 1.5rem; /* More space below icon */
    font-size: 3.5rem; /* Larger icons */
}

.feature-item h3 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.feature-item p {
    font-size: 0.95rem;
    color: #555;
}

/* Energy Saving */
.energy-saving {
    background: var(--white);
}

/* Products Section */
.product-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* height: 100%; */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.product-card .img-wrap {
    height: 40vh;
    width: 100%; /* ทำให้ div ยืดเต็มความกว้างของ parent */
    max-width: 800px; /* สมมติว่าต้องการให้ div กว้างสุด 800px */
    overflow: hidden;
    display: flex; /* เพื่อจัดกึ่งกลางรูปภาพถ้า div กว้างกว่ารูป */
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.product-card .img-wrap img {
    height: 100%;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.product-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-body h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.product-card-body p {
    font-size: 0.95rem;
    color: #6c757d;
}

/* Services Section */
.service-item {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.service-item i {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-size: 3.5rem;
}

.service-item h3 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.service-item p {
    font-size: 0.95rem;
    color: #555;
}

/* Gallery Section */
#gallery {
    background: var(--white);
}
.gallery-item img {
    width: 100%;
    height: 250px; /* Taller for better impact */
    object-fit: cover;
    display: block;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.gallery-item img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Lightbox styles (using a custom class and basic JS) */
.lightbox {
    display: none; /* <--- THIS IS CRUCIAL: Ensures it's hidden by default */
    position: fixed;
    z-index: 2000; /* High z-index to be on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker overlay */
    overflow: hidden; /* Prevent scroll on background */
    justify-content: center; /* Use flexbox for centering */
    align-items: center;    /* Use flexbox for centering */
    padding: 20px;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    display: block;
    object-fit: contain; /* Ensure image fits within bounds */
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 3.5rem; /* Larger 'X' */
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    opacity: 0.7;
    background: none;
    box-shadow: none;
    border: none;
}

.close-btn:hover {
    color: var(--primary-blue);
    opacity: 1;
}

/* Articles Section */
.article-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.article-card img {
    width: 100%;
    height: 220px; /* Consistent image height */
    object-fit: cover;
    display: block;
}

.article-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.article-card-content p {
    font-size: 0.9rem;
    color: #6c757d;
}

.article-card-content .btn {
    align-self: flex-start; /* Align button to start */
}

.pagination button {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    margin: 0 0.5rem;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pagination button:hover:not(.active) {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
}

.pagination button.active {
    background-color: var(--dark-blue);
    cursor: default;
    box-shadow: none; /* Remove shadow when active */
}

/* CTA Section */
#cta {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue)); /* More dynamic gradient */
}
.cta-content {
    color: var(--white);
    /* padding: 4rem; */
    /* border-radius: 1.5rem; */
    /* box-shadow: 0 15px 40px rgba(0,0,0,0.2); */
}

.cta-content .section-title {
    color: var(--white);
    margin-bottom: 2.5rem;
}

.cta-content .section-title::after {
    background-color: var(--white); /* White underline for CTA title */
}

.cta-content .lead {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.cta-button {
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--primary-blue);
    padding: 1rem 2.5rem;
    border-radius: 2rem; /* Fully rounded */
    font-weight: 700;
    font-size: 1.25rem;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.cta-button:hover {
    background: var(--light-blue);
    color: var(--dark-blue);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.cta-content .mt-4.lead {
    font-size: 1.2rem;
    margin-top: 1.5rem !important;
}

.cta-content .mt-4.lead a {
    color: var(--white);
    font-weight: 700;
}

.cta-content .mt-4.lead a:hover {
    color: var(--light-blue);
}

/* Footer */
footer {
    background: var(--gray-dark);
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: 2.5rem 1rem;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.5rem;
}
footer a {
    color: rgba(255,255,255,0.8);
}
footer a:hover {
    color: var(--primary-blue);
}


/* Responsive adjustments for smaller screens */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--white);
        border-top: 1px solid #eee;
        padding-bottom: 10px;
    }
    .navbar-nav {
        text-align: center;
        width: 100%;
    }
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
    .section-title {
        font-size: 2.2rem;
    }
    .section-title .d-block {
        font-size: 1rem !important;
    }
    .hero-slider, .carousel-item {
        min-height: 60vh;
        height: 60vh;
    }
    .carousel-caption h1 {
        font-size: 2.8rem;
    }
    .carousel-caption p {
        font-size: 1.2rem;
    }
    .hero-slider .btn {
        padding: 0.8rem 1.8rem;
        font-size: 1rem;
    }
    .introduction-content {
        flex-direction: column;
    }
    .introduction-content .text-column,
    .introduction-content .image-column {
        width: 100%;
    }
    .feature-item, .product-card, .service-item, .article-card {
        padding: 2rem;
    }
    .cta-content {
        padding: 3rem 1.5rem;
    }
    .cta-content .section-title {
        font-size: 2rem;
    }
    .cta-content .lead {
        font-size: 1.1rem;
    }
    .cta-button {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.8rem !important;
    }
    .hero-slider, .carousel-item {
        min-height: 100vh;
        height: 100vh;
    }
    .carousel-item img {
        width: 80%;
        height: auto;
        max-width: 100%;
    }
    .carousel-caption h1 {
        font-size: 2rem;
    }
    .carousel-caption p {
        font-size: 1rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .section-title .d-block {
        font-size: 0.9rem !important;
    }
    .feature-item i, .service-item i {
        font-size: 3rem;
    }
    .feature-item h3, .service-item h3 {
        font-size: 1.4rem;
    }
    .product-card img {
        /* height: 200px; */
    }
    .gallery-item img {
        height: 200px; /* Adjusted from 250px to 200px for consistency on smaller screens */
    }
    .article-card img {
        height: 180px;
    }
    .article-card-content h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .row {
        padding-left: 3%;
        padding-right: 3%;
    }
    .hero-slider, .carousel-item {
        min-height: 80vh;
        height: 80vh;
    }
    .carousel-caption h1 {
        font-size: 1.5rem;
    }
    .carousel-caption p {
        font-size: 0.9rem;
    }
    .hero-slider .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .section-title::after {
        width: 50px;
        height: 3px;
    }
    .feature-item, .product-card, .service-item, .article-card {
        padding: 1.5rem;
    }
    .feature-item i, .service-item i {
        font-size: 2.5rem;
    }
    .product-card img {
        /* height: 180px; */
    }
    .gallery-item img {
        height: 150px; /* Further adjusted for very small screens */
    }
    .cta-content {
        padding: 2rem 1rem;
    }
    .cta-button {
        font-size: 1rem;
    }
}