/* ==========================================================================
   1. HERO BANNER SLIDER
   ========================================================================== */
.hero-slider {
    width: 100%;
    position: relative;
    overflow: hidden; /* บังคับไม่ให้ภาพที่ขยายเกิน 100% ล้นขอบเซกชัน */
}

/* ล้างสไตล์พื้นหลังแบบเก่าออกจาก .swiper-slide */
.heroSwiper .swiper-slide {
    height: 580px;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
    overflow: hidden; /* ล็อกขอบเขตสไลด์ย่อย */
    background-color: #000; /* ใส่พื้นหลังดำกันจังหวะภาพกระพริบตอนเปลี่ยนสไลด์ */
}

.slide-bg-zoom {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* วางไว้เลเยอร์ล่างสุด */
}

.slide-bg-zoom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* สถานะปกติเมื่อสไลด์นั้นไม่ได้แสดงผล: ขนาด 100% เท่าเดิม */
    transform: scale(1); 
    transition: transform 1.2s ease; /* ปรับขนาดกลับให้เนียนตามความเร็วสไลด์ */
}

.swiper-slide-active .slide-bg-zoom img {
    animation: heroSlideZoom 6s linear forwards;
}

@keyframes heroSlideZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.08); /* ค่อยๆ ขยายขึ้น 8% สไตล์พรีเมียม */
    }
}

.slide-content-wrap {
    display: flex;
    justify-content: flex-end; 
    position: relative;
    z-index: 2; /* ดันให้อยู่เหนือเลเยอร์รูปภาพ .slide-bg-zoom เสมอ */
    width: 100%;
}

.slide-caption {
    max-width: 650px;
    text-align: right;
    padding: 30px;
    /* ปรับแต่งสีพื้นหลังให้ทึบขึ้นเล็กน้อยเพื่อรองรับมิติภาพที่ขยายตัวเข้ามา */
    background: linear-gradient(to bottom, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.2) 100%);
    border-radius: 20px;
    display: none;
}


/* 🌟 ตั้งค่าเริ่มต้นของตัวหนังสือทุกตัวใน Caption ให้จมลงและโปร่งใส */
.slide-caption h1,
.slide-caption p,
.slide-caption .btn-primary {
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

/* 🌟 เมื่อสไลด์หน้านั้นแสดงผล (Active) ให้เริ่มทำแอนิเมชันแบบสเต็ปไล่ลำดับเวลา (Staggered Delay) */
.swiper-slide-active .slide-caption h1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s; /* หัวข้อมาก่อน */
}

.swiper-slide-active .slide-caption p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s; /* ข้อความรองตามมา */
}

.swiper-slide-active .slide-caption .btn-primary {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s; /* ปุ่มตามมาท้ายสุด */
}

/* ส่วนสไตล์ปุ่มเดิม */
.slide-caption h1 {
    font-size: 28px;
    font-weight: 400;
    color: #0c7fea;
    line-height: 1.3;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

.slide-caption p {
    font-size: 22px;
    font-weight: 300;
    color: #333333;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-caption .btn-primary {
    display: inline-block;
    font-size: 16px;
    font-weight: 300;
    color: #FFFFFF;
    background-color: #0c7fea;
    padding: 10px 35px;
    border-radius: 33px;
}

.slide-caption .btn-primary:hover {
    background-color: #ea8b2c;
}

/* Swiper custom arrows styles */
.heroSwiper .swiper-button-next,
.heroSwiper .swiper-button-prev {
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.heroSwiper .swiper-button-next:hover,
.heroSwiper .swiper-button-prev:hover {
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(0, 0, 0, 0.5);
}

.heroSwiper .swiper-button-next::after,
.heroSwiper .swiper-button-prev::after {
    font-size: 20px;
}


/* ==========================================================================
   2. OUR PRODUCTS SECTION
   ========================================================================== */
.our-products {
    padding: 50px 0;
    background:url("../images/bg-service.jpg") no-repeat bottom; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #FFF; 
    background-blend-mode: multiply;
}

.product-slider-container {
    position: relative;
    padding: 0 50px;
}

.product-card {
    border-radius: var(--border-radius-custom);
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.product-img-box {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    /* height: 380px; */
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease; 
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(52, 62, 95, 0.6);
    padding: 7px 15px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.35s;
}

.product-overlay h3 {
    font-size: 15px;
    font-weight: 400;
    color: #FFFFFF;
    line-height: 1.4;
}

.product-img-box:hover .product-overlay {
    opacity: 1; /* ค่อยๆ สว่างขึ้นจนชัด 100% */
    visibility: visible;
    transform: translateY(0);
}

.product-img-box:hover img {
    transform: scale(1.05);
}

/* จัดให้อยู่ในแถวเดียวกันแบ่งซ้ายขวาตามภาพดีไซน์ */
.product-content-wrapper {
    display: flex;
    align-items: center;    /* จัดแนวให้ตรงกลางในแนวตั้งร่วมกัน */
    gap: 40px;              /* ระยะห่างระหว่างบล็อกข้อความและบล็อกสไลเดอร์ */
    width: 100%;
}

.product-topic {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.product-topic .section-title {
    font-size: 30px;
    color: #0c7fea;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom:0;
}

/* ควบคุมพื้นที่ฝั่งซ้าย (ข้อความคำอธิบาย) */
.product-info-side {
    flex: 35%;          /* ให้พื้นที่ฝั่งข้อความกว้างประมาณ 35% ของหน้าจอ */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.product-info-side .section-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
}

.product-slider-side {
    flex: 65%;
    width: 100%;
    position: relative;
    padding: 0 0 45px 0; 
    overflow: hidden;
}

.product-slider-side .productSwiper {
    width: 100%;
}

/* --------------------------------------------------
   สไตล์สำหรับจุดควบคุมสไลเดอร์สินค้า (Swiper Pagination)
----------------------------------------------------- */
.product-slider-side .prod-pagination {
    bottom: 5px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* ลักษณะของจุดกลมปกติ */
.product-slider-side .prod-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background-color: #cccccc;
    opacity: 0.6;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.product-slider-side .prod-pagination .swiper-pagination-bullet-active {
    background-color: #0c7fea;
    width: 24px;
    opacity: 1;
}

/* navigation next prev */
/* .product-slider-side {
    flex: 0 0 calc(65% - 5px);
    width: 100%;
    position: relative;
    padding: 0 40px;
    overflow: hidden;
}
.product-slider-side .productSwiper {
    width: 100%;
}

.product-slider-side .prod-prev {
    left: 0;
    color: #333;
}
.product-slider-side .prod-next {
    right: 0;
    color: #333;
} */




/* ==========================================================================
   3. ABOUT COMPANY SECTION
   ========================================================================== */
/* พื้นหลังของเซกชันคงเดิม แต่เคลียร์ padding ด้านล่างออกเพื่อให้ภาพโลกติดขอบ */
.about-company {
    width: 100%;
    padding: 50px 0 0 0; 
    background-image: url('../images/bg-cloud.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    overflow: hidden; /* ซ่อนส่วนเกินของลูกโลกที่อาจล้นออกด้านล่าง */
}

/* ➔ แถวบน: ปรับกล่องหัวข้อให้เต็ม 100% และจัดตัวอักษรให้อยู่ตรงกลางหน้าจอ */
.about-topic {
    width: 100%;
    text-align: center;
    margin-bottom: 10px; /* ระยะห่างระหว่างหัวข้อใหญ่กับกลุ่มเนื้อหาด้านล่าง */
}

.about-topic h2 {
    font-size: 22px;
    color: #0e39a9;
    font-weight: 400;
    line-height: 1.2;
}

.about-topic p {
    font-size: 16px;
    color: #555555;
    margin: 0;
}

/* ➔ แถวล่าง: คอนเทนเนอร์รวมกลุ่มแบบ 3 คอลัมน์ขนานกัน */
.about-content-bottom {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr; /* ให้พื้นที่ลูกโลกตรงกลางกว้างกว่าเล็กน้อย */
    align-items: flex-end; /* บังคับให้ทุก Element ยึดฐานจากขอบล่างสุดร่วมกัน */
    gap: 30px;
}

/* ➔ แถวล่าง: คอนเทนเนอร์รวมกลุ่มแบบ 3 คอลัมน์ */
.about-content-bottom {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 30px;
    
    /* 1. เอา align-items: flex-end; ตัวเดิมออก */
    /* 2. เปลี่ยนมาใช้ stretch เพื่อให้ทุกคอลัมน์มีความสูงยืดเต็มพื้นที่เท่ากันโดยอัตโนมัติ */
    align-items: stretch; 
}

/* ➔ ปรับบล็อกข้อความทั้งสองฝั่งให้วิ่งไปชิดขอบบนสุด */
.about-text {
    /* สั่งจัดแนวตัวเอง (Vertical Alignment) ให้ยึดขอบบนสุด */
    align-self: flex-start; 
    
    /* สามารถเอา margin-bottom: 60px; ตัวเดิมออกได้เลย */
    margin-bottom: 0; 
    
    /* เพิ่ม padding-top เล็กน้อยเพื่อให้ระยะเยื้องลงมาจากหัวข้อบริษัทดูโปร่งสบายตา */
    padding-top: 10px; 
    margin-bottom: 50px;
}

.about-text p {
    font-size: 16px;
    line-height: 1.4;
    color: #333333;
    font-weight:300;
    text-align: center; /* คงค่าจัดเนื้อหาอักษรกึ่งกลางไว้ตามดีไซน์ */
}

/* ➔ บล็อกสื่อตรงกลางและรูปลูกโลกให้ตรึงอยู่ขอบล่างสุด */
.about-center-media {
    display: flex;
    justify-content: center;
    
    /* สั่งจัดแนวตัวเอง (Vertical Alignment) ให้ดิ่งลงมาแนบชิดฐานล่างสุด */
    align-self: flex-end; 
    margin-bottom: 0; 
}

.about-center-media .earth-img {
    width: 100%;
    max-width: 440px;
    height: auto;
    display: block;
    position: relative;
    bottom: 0; /* แนบสนิทพอดีกับขอบล่างสุดของเซกชัน */
}


/* ==========================================================================
   4. NEWS & EVENTS SECTION
   ========================================================================== */
.news-events {
    padding: 50px 0;
    background-color: #ffffff;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.news-card {
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius-custom, 15px);
}

.news-img-box {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.news-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img-box img {
    transform: scale(1.05);
}

.news-info {
    padding: 20px 15px 10px 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    background-color: #f8f8f8;
}

.news-info h3 {
    font-size: 14px;
    font-weight: 300;
    color: #333333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}





/* คอนเทนเนอร์หลักต้องซ่อนส่วนที่ล้นออกไปข้างๆ */
.productSwiper, .customerSwiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* บังคับให้สไลด์แต่ละใบเกาะกลุ่มกันเป็นแถวหน้ากระดานเรียงหนึ่ง */
.productSwiper .swiper-wrapper, 
.customerSwiper .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* ห้ามให้การ์ดตกบรรทัดลงมาเด็ดขาด */
}

/* ตั้งค่าให้ภาพข้างในไม่ไปกวนการคำนวณขนาดของสไลเดอร์ */
.product-card, .swiper-slide {
    flex-shrink: 0; /* ป้องกันไม่ให้การ์ดโดนบีบจนบี้ */
    box-sizing: border-box;
}

@media (max-width: 1300px) {
    /* ดึงปุ่มกลับเข้ามาลอยทับอยู่เหนือภาพตัวการ์ดสินค้าด้านในเพื่อความปลอดภัย */
    .product-slider-side .prod-prev {
        left: 5px;
    }
    .product-slider-side .prod-next {
        right: 5px;
    }
}

/* Laptop Screens (Under 1200px till Laptop Boundary) */
@media (max-width: 1200px) {
    .about-container-grid {
        grid-template-columns: 1fr 300px 1fr;
    }
}

/* Laptop Mode Breakpoint (1024px) */
@media (max-width: 1024px) { 

    .heroSwiper .swiper-slide { height: 460px; }
    .slide-caption h1 { font-size: 32px; }
    

    .pt-large { padding-top: 0; }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-topic{
        margin-bottom: 25px;
    }

    /* 1. เปลี่ยนการเรียงตัวจาก 3 คอลัมน์ ให้ยุบเหลือ 1 คอลัมน์แนวตั้ง */
    .about-content-bottom {
        grid-template-columns: 1fr; 
        gap: 20px;
        align-items: center; /* จัดให้เนื้อหาทุกตัวอยู่กึ่งกลาง */
    }

    /* 2. จัดระเบียบกล่องข้อความไม่ให้ผอมบีบตัว */
    .about-text {
        width: 100%;
        max-width: 700px; /* จำกัดความกว้างให้อ่านง่ายพอดีสายตา */
        margin: 0 auto; /* จัดกล่องข้อความให้อยู่กึ่งกลางหน้าจอ */
        padding-top: 0;
        margin-bottom: 0; /* ลดช่องไฟระยะห่างลง */
    }

    .about-text p {
        font-size: 15.5px; /* ปรับขนาดฟอนต์ให้กระชับขึ้นเล็กน้อยสำหรับแท็บเล็ต */
        line-height: 1.5;  /* เพิ่มระยะห่างระหว่างบรรทัดให้อ่านง่ายสบายตา */
        text-align: center;
    }

    /* 3. จัดการให้รูปโลกอยู่กึ่งกลางอย่างสมดุล ไม่จมหรือลอยแยกตัว */
    .about-center-media {
        align-self: center;
        width: 100%;
        margin: 0;
        order: 2; /* ใช้คุณสมบัติ order เพื่อบังคับให้รูปโลกอยู่ระหว่างข้อความที่ 1 และ 2 */
    }

    .about-center-media .earth-img {
        max-width: 320px; /* ย่อขนาดรูปโลกลงให้พอเหมาะกับหน้าจอขนาดเล็ก */
        margin: 0 auto;
    }
    .text-part-1 { order: 1; }
    .about-center-media { order: 3; }
    .text-part-2 { order: 2; }
    
}

@media (max-width: 991px) {
   
    .about-center-media .earth-img {
        max-width: 280px; /* ย่อขนาดรูปลูกโลกลงเพื่อให้พอดีกับจอมือถือ */
    }
}

/* Tablet Mode Breakpoint (768px) */
@media (max-width: 768px) {
    
    /* Product list downscale column counts */
    .product-img-box { height: 320px; }
    

    .text-right { text-align: left; }

    /* .product-info-side{
        flex: 0 0 calc(100%);
    }
    .product-slider-side{
        flex: 0 0 calc(100%);
    } */
    
}

@media (max-width: 576px) {
    .section-title { font-size: 26px; }
    
    .heroSwiper .swiper-slide { height: 360px; }
    .slide-caption h1 { font-size: 24px; }
    .slide-caption p { font-size: 16px; }
    
    .product-slider-container { padding: 0 20px; }


    .product-content-wrapper {
        display: flex;
        flex-direction: column;
        gap: 30px;
        width: 100%;
    }

    .product-info-side {
        flex: 0 0 100%;
        width: 100%;
        align-items: center;
    }

    /* ปรับขนาดตัวอักษรและระยะบรรทัดให้อ่านง่ายขึ้นบนหน้าจอขนาดเล็ก */
    .product-info-side .section-desc {
        font-size: 14.5px;
        line-height: 1.5;
        text-align: justify;
        margin: 0;
    }

    
    /* .product-slider-side {
        width: 100%;
        position: relative;
        padding: 0 35px;
    } */

    .product-slider-side {
        padding: 0 0 35px 0;
    }

    .product-card {
        border-radius: var(--border-radius-custom, 15px);
        overflow: hidden;
    }

    .product-slider-side .prod-prev {
        left: -5px;
    }
    .product-slider-side .prod-next {
        right: -5px;
    }
    .prod-next, .prod-prev {
        width: 40px !important;
        height: 40px !important;
    }
    
    .prod-next::after, .prod-prev::after {
        font-size: 30px !important;
    }
    
    
    /* News list grid collapse completely into vertical 1 column cards */
    .news-grid {
        grid-template-columns: 1fr;
    }

    .about-topic h2 {
        font-size: 19px; /* ปรับลดขนาดหัวข้อบริษัท */
    }
    .about-topic p {
        font-size: 14px;
    }
    .about-text p {
        font-size: 14.5px;
        text-align: justify; /* ปรับเคาะข้อความกระจายตัวเต็มบรรทัดสำหรับมือถือ */
    }
    .about-center-media .earth-img {
        max-width: 260px; /* ย่อขนาดรูปโลกลงอีกเล็กน้อยบนสมาร์ทโฟน */
    }

}