/********** Template CSS **********/
:root {
            --primary: #7b0000;
            --bg-light: #f9f9f9;
            --text-dark: #222;
            --text-gray: #555;
}

.fw-medium {
    font-weight: 500 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-black {
    font-weight: 900 !important;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}


/*** Button ***/
.btn {
    font-weight: 500;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-outline-primary:hover {
    color: #FFFFFF;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-lg-square i {
    color: #fff !important;

}


.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

/*** Navbar ***/
.navbar.sticky-top {
    top: -100px;
    transition: .5s;
}

.navbar .navbar-brand,
.navbar a.btn {
    height: 75px;
}

.navbar .navbar-nav .nav-link {
    margin-right: 30px;
    padding: 25px 0;
    color: var(--dark);
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    outline: none;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link  {
        margin-right: 0;
        padding: 10px 0;
    }

    .navbar .navbar-nav {
        border-top: 1px solid #EEEEEE;
    }
}

@media (min-width: 992px) {

    /* ใช้กับ dropdown ปกติเท่านั้น */
    .navbar .nav-item:not(.mega-menu) .dropdown-menu {
        display: block;
        border: none;
        margin-top: 0;
        top: 150%;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
    }

    .navbar .nav-item:not(.mega-menu):hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        opacity: 1;
    }

    /* 👇 แยก Mega Menu ออกมา */
    .mega-menu .dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
        top: 100%;
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: .3s;
    }

    .mega-menu:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }
}


/*** Header ***/
.owl-carousel-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, .1);
}

@media (max-width: 768px) {
    .header-carousel .owl-carousel-item {
        position: relative;
        min-height: 500px;
    }

    .header-carousel .owl-carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .header-carousel .owl-carousel-item p {
        font-size: 16px !important;
    }
}

.header-carousel .owl-dots {
    position: absolute;
    width: 60px;
    height: 100%;
    top: 0;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-carousel .owl-dots .owl-dot {
    position: relative;
    width: 45px;
    height: 45px;
    margin: 5px 0;
    background: #FFFFFF;
    box-shadow: 0 0 30px rgba(255, 255, 255, .9);
    border-radius: 45px;
    transition: .5s;
}

.header-carousel .owl-dots .owl-dot.active {
    width: 60px;
    height: 60px;
}

.header-carousel .owl-dots .owl-dot img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 2px;
    border-radius: 45px;
    transition: .5s;
}

.page-header {
    background: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)), url(../img/carousel-1.jpg) center center no-repeat;
    background-size: cover;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--light);
}


/*** About ***/
@media (min-width: 992px) {
    .container.about {
        max-width: 100% !important;
    }

    .about-text  {
        padding-right: calc(((100% - 960px) / 2) + .75rem);
    }
}

@media (min-width: 1200px) {
    .about-text  {
        padding-right: calc(((100% - 1140px) / 2) + .75rem);
    }
}

@media (min-width: 1400px) {
    .about-text  {
        padding-right: calc(((100% - 1320px) / 2) + .75rem);
    }
}


/*** Service ***/
.service-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
}

.service-icon {
    position: relative;
    margin: -50px 0 25px 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: #FFFFFF;
    border-radius: 100px;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: .5s;
}

.service-item:hover .service-icon {
    color: #FFFFFF;
    background: var(--primary);
}


/*** Feature ***/
@media (min-width: 992px) {
    .container.feature {
        max-width: 100% !important;
    }

    .feature-text  {
        padding-left: calc(((100% - 960px) / 2) + .75rem);
    }
}

@media (min-width: 1200px) {
    .feature-text  {
        padding-left: calc(((100% - 1140px) / 2) + .75rem);
    }
}

@media (min-width: 1400px) {
    .feature-text  {
        padding-left: calc(((100% - 1320px) / 2) + .75rem);
    }
}


/*** Project Portfolio ***/
/* ===== FIX PORTFOLIO IMAGE (FINAL) ===== */

/* container กันล้น */
.portfolio-container {
    overflow: hidden;
}

/* card ของแต่ละรูป */
.portfolio-item {
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* กล่องรูป */
.portfolio-img {
    position: relative;
    width: 100%;
    height: 220px; /* ปรับได้ เช่น 200 / 250 */
    overflow: hidden;
}

/* รูปภาพ */
.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* สำคัญมาก */
    display: block;
    transition: transform 0.4s ease;
}

/* zoom ตอน hover */
.portfolio-item:hover img {
    transform: scale(1.08);
}

/* overlay effect (ของเดิม ปรับให้เนียนขึ้น) */
.portfolio-img::before,
.portfolio-img::after {
    position: absolute;
    content: "";
    width: 0;
    height: 100%;
    top: 0;
    background: rgba(0,0,0,0.6); /* ปรับให้โปร่ง */
    transition: 0.5s;
    z-index: 1;
}

.portfolio-img::before {
    left: 50%;
}

.portfolio-img::after {
    right: 50%;
}

.portfolio-item:hover .portfolio-img::before {
    width: 50%;
    left: 0;
}

.portfolio-item:hover .portfolio-img::after {
    width: 50%;
    right: 0;
}

/* ปุ่มกลางรูป */
.portfolio-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    z-index: 2;
    transition: 0.4s;
}

.portfolio-item:hover .portfolio-btn {
    opacity: 1;
}


/* ===== CSR NEWS IMAGE FIX ===== */

/* กล่องครอบรูป */
.news-img-box {
    width: 100%;
    height: 200px;              /* ปรับความสูงได้ตามต้องการ */
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;        /* กันรูปโหลดช้า */
    display: block;
}

/* รูปภาพ */
.news-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* ครอปภาพให้พอดี */
    object-position: center;    /* จัดภาพให้อยู่กลาง */
    display: block;
    transition: transform 0.3s ease;
}

/* เอฟเฟกต์ hover (optional) */
.news-img-box:hover img {
    transform: scale(1.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .news-img-box {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .news-img-box {
        height: 160px;
    }
}

@media (max-width: 576px) {
    .news-img-box {
        height: 140px;
    }
}


/*** Quote ***/
@media (min-width: 992px) {
    .container.quote {
        max-width: 100% !important;
    }

    .quote-text  {
        padding-right: calc(((100% - 960px) / 2) + .75rem);
    }
}

@media (min-width: 1200px) {
    .quote-text  {
        padding-right: calc(((100% - 1140px) / 2) + .75rem);
    }
}

@media (min-width: 1400px) {
    .quote-text  {
        padding-right: calc(((100% - 1320px) / 2) + .75rem);
    }
}


/*** Team ***/
.team-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
}

.team-item img {
    border-radius: 8px 60px 0 0;
}

.team-item .team-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: #FFFFFF;
    transition: .5s;
}


/*** Testimonial ***/
.testimonial-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.testimonial-carousel::after {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

@media (min-width: 768px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 200px;
    }
}

@media (min-width: 992px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 300px;
    }
}

.testimonial-carousel .owl-nav {
    position: absolute;
    width: 350px;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: .5s;
    z-index: 1;
}

.testimonial-carousel:hover .owl-nav {
    width: 300px;
    opacity: 1;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    position: relative;
    color: var(--primary);
    font-size: 45px;
    transition: .5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    color: var(--dark);
}

.testimonial-carousel .testimonial-img img {
    width: 100px;
    height: 100px;
}

.testimonial-carousel .testimonial-img .btn-square {
    position: absolute;
    bottom: -19px;
    left: 50%;
    transform: translateX(-50%);
}

.testimonial-carousel .owl-item .testimonial-text {
    margin-bottom: 30px;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transform: scale(.8);
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text {
    transform: scale(1);
}


/*** Contact ***/
@media (min-width: 992px) {
    .container.contact {
        max-width: 100% !important;
    }

    .contact-text  {
        padding-left: calc(((100% - 960px) / 2) + .75rem);
    }
}

@media (min-width: 1200px) {
    .contact-text  {
        padding-left: calc(((100% - 1140px) / 2) + .75rem);
    }
}

@media (min-width: 1400px) {
    .contact-text  {
        padding-left: calc(((100% - 1320px) / 2) + .75rem);
    }
}


/*** Footer ***/
.footer .btn.btn-social {
    margin-right: 5px;
    color: #9B9B9B;
    border: 1px solid #9B9B9B;
    border-radius: 38px;
    transition: .3s;
}

.footer .btn.btn-social:hover {
    color: var(--primary);
    border-color: var(--light);
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: #9B9B9B;
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: #FFFFFF;
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .copyright {
    padding: 25px 0;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: var(--light);
}

.footer .copyright a:hover {
    color: var(--primary);
}


/* ===== MEGA MENU ===== */
.mega-menu {
    position: static;
}

.mega-menu .dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
    top: 100%;
    border: none;
    background: #F6F7F8;
    opacity: 0;
    visibility: hidden;
    display: block;
    transition: .3s;
    max-height: 600px;
    overflow-y: auto;
}

.mega-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.mega-title {
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.mega-title a {
    color: #1A2A36;
    text-decoration: none;
}

.mega-title a:hover {
    color: #bb2a39;
}

.mega-menu .dropdown-item {
    padding: 5px 0;
    font-size: 14px;
    white-space: normal;
}

.mega-menu .dropdown-item:hover {
    color: var(--primary);
    background: none;
}

/* Mobile */
@media (max-width: 991.98px) {

    .mega-menu .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .mega-menu .dropdown-menu.show {
        display: block;
    }
}


.note-video-clip {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
}

.note-video-clip iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.fa, 
.far, 
.fab,
.fas {
    color: #bb2a39 !important;

}

/* Policy */
/* group title */
/*
.bg-light h6 {
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
}
*/
/* submenu */
.bg-light ul li a {
    display: block;
    padding: 4px 0;
    font-size: 14px;
}

/* hover */
.bg-light ul li a:hover {
    color: #0d6efd;
    padding-left: 5px;
    transition: 0.2s;
}

a[data-bs-toggle="collapse"]::after {
    content: "▸";
    float: right;
    transition: 0.2s;
}

a[aria-expanded="true"]::after {
    transform: rotate(90deg);
}


/* ===== Solution Card Style ===== */
.solution-card{
    position: relative;
    height: 100%;
    padding: 30px 25px;
    border: 1px solid rgba(255, 0, 0, 0.6);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s ease;
}

.solution-card::before{
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            135deg,
            rgba(255,0,0,0.10),
            transparent 45%
        );
    opacity: 0;
    transition: 0.35s;
}

.solution-card:hover{
    transform: translateY(-6px);
    border-color: #ff0000;
    box-shadow:
        0 0 15px rgba(255,0,0,0.25),
        0 0 30px rgba(255,0,0,0.12);
}

.solution-card:hover::before{
    opacity: 1;
}

.solution-icon{
    width: 72px;
	height: 72px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff0000;
    font-size: 34px;
    margin-bottom: 25px;
    transition: 0.3s;
}

.solution-card:hover .solution-icon{
    background: rgba(255,0,0,0.08);
    border-color: #ff0000;
}



.solution-readmore{
    position: absolute;
    right: 25px;
    bottom: 20px;
    color: #ff0000;
    font-size: 24px;
    text-decoration: none;
    transition: 0.3s;
}

.solution-readmore:hover{
    color: #ffffff;
    transform: translateX(5px);
}

@media (max-width: 991px){

    .solution-card{
        padding: 25px 20px;
    }

    .solution-card h5{
        font-size: 20px;
        min-height: auto;
    }

}


/* ===============================
   POLICY CARD STYLE
================================= */

.policy-card {

    border: 1px solid #ff0000;
    border-radius: 14px;
    padding: 22px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all .3s ease;
    box-shadow: 0 0 15px rgba(255,0,0,0.12);
}

.policy-card:hover {
    transform: translateY(-5px);
    border-color: #ff2d2d;
    box-shadow: 0 0 25px rgba(255,0,0,0.30);
}

/* เส้นแดงด้านบน */
.policy-card:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #ff0000, #ff4d4d);
}

/* title */
.policy-card h5 {
    
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.5;
}

.policy-card h5 i {
    
    margin-right: 8px;
}

/* detail */
.policy-card p {
    
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* ดันปุ่มลงล่างสุด */
.policy-footer {
    margin-top: auto;
}

/* button pdf */
.policy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: linear-gradient(180deg, #ff1a1a, #c40000);
    color: #ffffff !important;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 700;
    transition: all .3s ease;
    box-shadow: 0 4px 12px rgba(255,0,0,0.25);
}

.policy-btn:hover {
    background: linear-gradient(180deg, #ff3333, #ff0000);
    color: #ffffff !important;
    transform: scale(1.02);
}

.policy-btn i {
	color: #fff !important;
    font-size: 20px;
}

/* Responsive */
@media (max-width: 991px) {
    .policy-card {
        margin-bottom: 20px;
    }
}

/* ===== CONTACT MOBILE FIX ===== */
.contact-info .btn-lg-square{
    min-width: 48px;
    width: 48px;
    height: 48px;
    flex-shrink: 0; /* สำคัญมาก ป้องกัน icon ถูกบีบ */
}

.contact-info .d-flex{
    align-items: flex-start;
}

.contact-info a{
    word-break: break-word;
}

/* มือถือ */
@media (max-width: 576px){

    .contact-info .ms-4{
        margin-left: 15px !important;
    }

    .contact-info p,
    .contact-info a{
        font-size: 15px;
        line-height: 1.6;
    }
}








