/* about-vision: จอเล็ก (<992px) เลิกใช้ background+spacer ตำแหน่งตายตัว
   ให้รูป swoosh ไหลตามเนื้อหาเป็น <img> เต็มจอ → ไม่ทับข้อความ ไม่มีพื้นที่โล่ง */
@media (max-width: 991px) {
    .vision-mission-wrapper {
        background-image: none !important;
    }

    .vision-spacer {
        display: none !important;
    }

    .vision-img-mobile {
        width: 100%;
        height: auto;
        display: block;
        margin: 1rem auto 2rem;
    }
}

/* Small devices (มือถือแนวนอน) */
@media (max-width: 767px) {
    /* แท็บ service-online: บนมือถือให้ 2 แถบอยู่แถวเดียว แบ่งครึ่งเท่ากัน (ข้อความตัดบรรทัดในแถบ) */
    #serviceTabs {
        flex-wrap: nowrap;
        gap: 8px;
    }

    #serviceTabs .nav-item {
        flex: 1 1 0;
        min-width: 0;
    }

    #serviceTabs .tab-custom {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 12px 8px;
        font-size: 0.9rem;
    }

    /* การ์ด CTA (service.php): มือถือเรียงแนวตั้ง รูปอยู่บน-ข้อความอยู่ล่าง จัดกลาง + ลด padding
       ใช้ !important เพราะ style.css โหลดทีหลัง responsive.css */
    .cta-col {
        flex-direction: column !important;
        text-align: center;
        padding: 40px 24px !important;
        gap: 16px !important;
    }

    /* แถบรูป "เช่ารถกับ KCAR ดีกว่าที่คิด" (service.php): มือถือ 3 รูป/แถว ให้พอดีจอ
       ใช้ !important เพราะ style.css โหลดทีหลัง responsive.css */
    .whykcar-inner {
        margin: 24px 16px !important;
    }

    /* จัดรูปเป็นกริด 3 คอลัมน์ ขนาดเท่ากันเป๊ะ ระยะห่างเท่ากันทุกด้าน */
    .benefit-img-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .benefit-img-row > .col-img-strip {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .benefit-img-strip {
        width: 100%;
        height: auto !important;
        aspect-ratio: 1 / 1;
        border: none !important;
    }

    /* ลดขนาดหัวข้อ/ฟอนต์ที่ใหญ่เกินไปบนมือถือ (มีผลทุกหน้า)
       ใช้ !important เพราะ style.css โหลดทีหลัง responsive.css */
    .hero-title {
        font-size: 2.4rem !important;
        letter-spacing: 1px !important;
    }

    .hero-subtitle {
        font-size: 1.05rem !important;
    }

    .car-name {
        font-size: 1.35rem !important;
    }

    .car-cc {
        font-size: 0.9rem !important;
        margin-bottom: 12px !important;
    }

    .price-val {
        font-size: 1.8rem !important;
    }

    .card-table {
        display: none;
    }
    .flatpickr-calendar {
        width: 100% !important;
        max-width: 320px !important;
        font-size: 14px !important;
    }
    /* .dropdown-menu.show {
        display: none !important;
    } */
    /* .flatpickr-months {
        flex-direction: column !important;
    } */
    
    .flatpickr-month {
        width: 100% !important;
        margin-bottom: 5px;
    }
    
    .flatpickr-day {
        height: 32px !important;
        line-height: 32px !important;
        font-size: 12px !important;
    }
    
    .flatpickr-today-header {
        padding: 10px !important;
        font-size: 16px !important;
    }
    
    .flatpickr-footer-buttons {
        padding: 10px !important;
    }
    .img-service{
        object-fit: cover !important;
    }
    /* Home banner (mobile): แสดงเต็มภาพตามสัดส่วนจริง ไม่ให้โดน crop */
    .hero-carousel {
        height: auto !important;
        max-height: none !important;
    }

    .hero-images {
        height: auto !important;
    }

    /* แบนเนอร์ที่ไม่ active วางทับซ้อนกัน (absolute) ส่วนตัว active อยู่ใน flow เพื่อกำหนดความสูงของกล่อง */
    .hero-img-mobile {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: auto !important;
        max-height: none !important;
    }

    .hero-img-mobile.active {
        position: relative;
    }

    .hero-img-mobile img {
        height: auto !important;
        object-fit: contain !important;
    }
    .flatpickr-day {
        height: 38px;
        line-height: 38px;
    }

    .div-btn {
        margin: 0 !important;
    }

    hr {
        display: none;
    }

    .footer-copyright {
        padding-bottom: 80px;
    }

    .contact-area {
        display: none !important;
    }

    .promo-section .btn-grad,
    .section-news .btn-grad {
        width: 60%;
    }

    .promo-section {
        padding: 40px 0;
    }

    .search-btn.search-car-btn {
        width: 60% !important;
    }

    .search-btn.search-car-btn img {
        width: 10% !important;
    }

    .promo-card img {
        width: 100%;

        height: auto;

    }

    .rental-card-content {
        /* width: 50%; */
        flex-direction: column;
    }

    .headline .right {
        font-size: 32px;
    }

    .headline {
        gap: 0;
    }

    .section-service {
        min-height: 500px !important;

    }

    .section-service h2 {
        top: 30px;
        font-size: 24px;
    }

    .service-carousel-wrapper {
        width: 95%;
        max-width: 500px;
    }

    .rental-card-content {
        width: 85%;
        margin: auto;
        flex-direction: column;
        min-height: auto;
    }

    .image-section {
        flex: 0 0 auto;
        width: 100%;
        height: 250px;
    }

    .image-section img {
        object-position: center;
    }

    .text-section {
        flex: 1;
        padding: 25px 20px;
        width: 100%;
    }

    .title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .description {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.6;
    }



    .service-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .service-btn.prev {
        left: -10px;
    }

    .service-btn.next {
        right: -10px;
    }

    .section-service img {
        object-fit: cover;
        object-position: center;
    }

    .quick-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        background: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding: 10px;
        padding-bottom: 0px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid #e0e0e0;
        z-index: 1000;
        gap: 0;
        padding-bottom: 10px;
        height: 70px;
    }

    .quick-menu .btn {
        opacity: 1;
        transform: none;
        visibility: visible;
        margin: 0;
        padding: 8px 0px;
        font-size: 12px;
        border-radius: 15px;
        flex: 1;
        margin: 0 5px;
    }

    .quick-menu .circle {
        display: none;
    }

    .response-tab {
        margin-left: 10px;
        gap: 0 !important;
        justify-content: flex-start !important;
    }

    .tab-content {
        margin: 0 !important;
    }

    .hero-section-ir img {
        width: 100%;
        height: 300px !important;
        object-fit: cover;
    }



    .search-btn img {
        width: 10% !important;
    }

    .image-section {
        flex: 0 0 100%;
        height: 0px;
    }

    .service-btn.service-btns {
        top: 40%;
    }

    .service-btn {
        top: 60%;
    }

    /* .rent-card {
        flex: 0 0 330px !important;
    } */

    .text-section {
        padding: 30px 25px;
    }

    .title {
        font-size: 20px;
    }

    .text-section {
        max-width: 100%;
    }

    .description {
        font-size: 14px;
    }

    .btn-more {
        padding: 10px 40px;
        font-size: 15px;
    }

    .section-service {
        height: 800px;
    }


    .section-news {
        margin-top: 1rem;
        padding-top: 0;
    }

    .nav-link.tab-custom {
        width: 165px;
        max-width: 200px;
    }

    .nav-link.tab-grad {
        width: 180px;
    }

    .btn-grad {
        margin: 20px auto !important;
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    .hero-arrow {
        display: none;
    }

    .booking-btn {

        margin: 0 auto !important;
        text-align: center;

        display: block;
    }

    /* กล่องจองรถเช่าบนมือถือ: ไหลตามปกติใต้รูป (เลิกใช้ตำแหน่งลอย + ตัวเลข magic ที่หล่นเพี้ยน)
       ใส่พื้นหลังน้ำเงินที่ hero-section ให้การ์ดอยู่บนพื้นน้ำเงินเหมือนเดิม
       ใช้ !important ให้ชนะทุก breakpoint ย่อยของมือถือ (-840/-600/-580 ฯลฯ) */
    .hero-section {
        background-color: var(--blue2-color);
    }

    .bg-blue {
        display: none !important;
    }

    .booking-container {
        position: static !important;
        transform: none !important;
        bottom: auto !important;
        left: auto !important;
        width: 92%;
        max-width: 480px;
        margin: 0 auto;
        padding-bottom: 28px;
    }

    .div-btn-search {

        width: 100%;
    }


    .arrow {
        display: none;
    }

    .arrow-rent {
        display: block !important;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 18px;
        z-index: 10;
        cursor: pointer;
    }

    .arrow-rent.left {
        left: 10px;
    }

    .arrow-rent.right {
        right: 10px;
    }

    /* .rent-card:nth-child(n+2) {
        display: none;
    } */

    .rent-slider {
        /* justify-content: center; */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        justify-content: center;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin: 1rem 0 0 1.2rem;
        justify-content: start;

    }

    .promo-slider-container {
        margin: 0;
    }

    .promo-slider {
        margin: 0;
    }

    .promo-slider {
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin: 1rem 0 0 0;
    }

    .promo-section p {
        margin-bottom: 0;
    }

    .promo-slider::-webkit-scrollbar,
    .rent-slider::-webkit-scrollbar {
        display: none;
    }

    /* .rent-card{
        flex: 0 0 100px;
        min-width: 80%;
        scroll-snap-align: start;
        padding: 10px;
    } */

    .rent-card {
        padding: 5px;
        margin: 10px;
        flex: 0 0 100%;
    }

    .div-rent {
        padding: 15px !important;
    }

    .rent-card h5 {
        font-size: 16px;
    }

    .rent-card p {
        font-size: 13px;
    }

    .rent-card .btn-grad {
        padding: 8px 15px;
        font-size: 12px;
        width: 80%;
    }

    .rent-slider {

        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .rent-slider .rent-card {
        scroll-snap-align: start;
    }

    .div-rent {
        text-align: start;
        padding: 20px !important;
    }

    .promo-card {
        /* flex: 0 0 100px; */
        min-width: 100%;
        scroll-snap-align: start;

    }

    .div-new-index {
        margin: 0px 20px;
    }

    .arrow {
        display: block;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 18px;
        z-index: 10;
        cursor: pointer;
    }

    .bg-blue {
        height: 130vh;
    }

    .arrow.arrow-rent.left {
        left: 0px;
        top: 1900px
    }

    .arrow.arrow-rent.right {
        right: 10px;
        top: 1900px
    }

    .stocks {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .stocks img {
        width: 100%;
        max-width: 300px;
    }



}



/* Medium devices (แท็บเล็ต) */
@media (min-width: 768px) and (max-width: 991px) {
    .card-calendar {
        display: none;
    }
    .menu-footer .col-md-12 {
        margin-bottom: 0;
    }

    .search-btn.search-car-btn {
        width: 100% !important;
    }

    .search-btn.search-car-btn img {
        width: 10% !important;
    }

    .contact-area {
        display: none !important;
    }

    .section-service {
        height: 450px !important;
        padding: 0px 15px;
    }


    .image-section {
        flex: 0 0 40%;
    }

    .text-section {
        padding: 30px 35px;
    }

    .service-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .hero-carousel {
        height: 400px;
    }

    .hero-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .hero-arrow.left {
        left: 10px;
    }

    .hero-arrow.right {
        right: 10px;
    }

    .booking-container {
        bottom: -750px;
        width: 85%;
    }

    .booking-btn {
        width: 160px;
        font-size: 16px;
        padding: 10px 30px;
        margin-left: 1rem;
    }

    .search-card {
        padding: 20px;
    }

    .div-btn-search {
        width: 100%;
        margin-bottom: 15px;
    }

    .bg-blue {
        height: 690px;
        max-height: 750px;
    }



    .search-btn img {
        width: 15% !important;
    }

    .arrow.arrow-rent.left {
        left: 200px;
        top: 2000px;
    }



    .arrow.arrow-rent.right {
        right: 10px;
        top: 2000px;
    }



    .search-btn img {
        width: 10% !important;
    }

    .booking-btn {
        margin: auto;
    }



    .booking-container {
        bottom: -680px;

    }

    .div-btn-search {
        width: 100%;
    }



}


/* Large devices (เดสก์ท็อป) */
@media (min-width: 992px) {
    .card-calendar {
        display: none;
    }
    .top-bar {
        display: block;
        width: 40%;
    }

    .response-tab {
        justify-content: flex-start !important;
    }

    .bg-blue {
        height: 20vh;
    }

    .booking-container {
        bottom: -130px;

    }

    .hero-carousel {
        height: 50vh;
        min-height: 0;
    }

    .hero-img {
        object-fit: cover;
        object-position: center;
    }

    .d-flex.flex-wrap {
        flex-wrap: nowrap;
    }

    .d-flex.flex-wrap>div {
        /* flex: 1; */
        min-width: 0;
    }

    /* .rent-card:nth-child(n+4) {
        display: block;
    } */

}

/* Extra Large devices (เดสก์ท็อปใหญ่) */
@media (min-width: 1200px) and (max-width: 1400px) {
    .top-bar {
        width: 40%;
        background-color: var(--main-color);
        padding: 8px 20px;
        font-size: 14px;
        border-bottom: 1px solid #e0e0e0;
        margin-left: auto;
        border-bottom-left-radius: 10px;
        color: white;
    }

    /* .rent-card:nth-child(n+3) {
        display: none;
    } */

    .footer-contact {
        padding-left: 4rem;
    }

    .hero-carousel {
        height: 70vh;
        min-height: 0;
    }

    .hero-img {
        object-fit: cover;
        object-position: center;
    }

}


@media (max-width: 1440px) {

    .menu-nav {
        flex-wrap: wrap !important;
        justify-content: space-between;
    }

    .container-nav .navbar-nav {
        flex-wrap: wrap;
        width: 100%;
        justify-content: start;
        /* margin-top: 10px; */
        font-size: 12px;
    }

    .container-nav .navbar-nav .dropdown-menu {
        font-size: 12px;
    }

    .container-nav .nav-item {
        /* margin: 5px 10px; */
    }
}

/* Extra Extra Large devices (จอใหญ่มาก) */
@media (min-width: 1400px) {
   
   

    .container-nav {
        padding: 0 !important;
    }

    .hero-img {
        object-fit: fill;
    }

    .hero-carousel {
        height: 800px;
        max-height: 800px;
    }

    .booking-container {
        bottom: -130px;
    }

    .bg-blue {
        height: 250px;
        max-height: 300px;
    }
    .navbar-nav {
        font-size: 14px;
    }
    .navbar-nav .dropdown-menu {
        font-size: 14px;
    }
}

@media (min-width:1600px) {
    .navbar-nav {
        font-size: 16px;
    }
    .navbar-nav .dropdown-menu {
        font-size: 16px;
    }
}


@media (min-width: 1200px) and (max-width: 1399px) {
    .hero-carousel {
        height: 600px;
    }

    .booking-container {
        bottom: -120px;
    }

    .bg-blue {
        height: 250px;
        max-height: 350px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .hero-carousel {
        height: 500px;
    }

    .booking-container {
        bottom: -130px;
    }

    .bg-blue {
        height: 220px;
    }

    .search-card {
        padding: 25px;
    }

    .div-btn-search {
        flex: 1 1 calc(50% - 1rem);
    }

    .text-section {
        padding: 35px 40px;
    }

    .service-btn.prev {
        left: -20px;
    }

    .service-btn.next {
        right: -20px;
    }

    .navbar .navbar-collapse {
        width: 100%;
        flex-basis: 100%;
    }

    .navbar {
        flex-wrap: wrap;
    }

    .container-nav {
        /* flex-direction: column; */
        /* align-items: stretch; */
    }

    .navbar-collapse {
        order: 1;
        width: 100%;
    }

    .contact-area {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        border-top: 1px solid #eee;
        padding-top: 1rem;
    }

    .contact-area .text-end {
        text-align: center !important;
    }

    .contact-area .vr {
        display: none;
    }

    .navbar-brand {
        margin-bottom: 0.5rem;
    }

    /*     
    .container-nav {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .navbar-collapse.gap-4 {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-start;
    } */
}




@media (min-width: 576px) and (max-width: 767px) {
    .hero-carousel {
        height: 320px;
    }


    .hero-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .hero-arrow.left {
        left: 8px;
    }

    .hero-arrow.right {
        right: 8px;
    }

    .booking-container {
        bottom: -600px;
        width: 85%;
    }

    .booking-btn {
        width: 140px;
        font-size: 14px;
        padding: 8px 20px;
        margin: 0 auto;
    }

    .search-card {
        padding: 20px 15px;
    }

    .div-btn-search {
        width: 100%;
    }

    .bg-blue {
        height: 620px;
        max-height: 700px;
    }



    .search-btn img {
        width: 20% !important;
    }
}

/* Extra Small (<576px) - Mobile Portrait */
@media (max-width: 575px) {

    .ir-card {
        max-width: 100% !important;
    }

    .service-btns .prev {
        left: -10px !important;
    }

    /* .service-btn{
        top: 40%;
    } */

    .promo-slider-container {
        padding: 0;
        margin: 0;
    }

    .section-service h2 {
        top: 25px;
        font-size: 22px;
    }

    .service-carousel-wrapper {
        width: 40%;
    }

    .image-section {
        height: 220px;
    }

    .text-section {
        padding: 20px 15px;
    }

    .title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .description {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .btn-grad {
        padding: 10px 18px;
        font-size: 13px;

    }

    .service-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* 
    .service-btn.prev {
        left: -35px;
    }

    .service-btn.next {
        right: -35px;
    } */

    .hero-carousel {
        height: 280px;
    }

    .service-carousel-wrapper {
        width: 90%;
    }

    .text-section {
        padding: 20px;
    }

    .title {
        font-size: 18px;
    }

    .description {
        font-size: 13px;
    }

    .image-section {
        height: 200px;
    }

    .hero-arrow {
        display: none;
    }

    .booking-container {
        bottom: -580px;
        width: 85%;
    }

    .booking-btn {
        width: 180px;
        max-width: 250px;
        font-size: 16px;
        padding: 8px 15px;
        margin: 0 auto;
    }

    .search-card {
        padding: 15px;
    }

    .div-btn-search {
        width: 100%;
    }

    .bg-blue {
        height: 600px;
        max-height: 750px;
    }

    .search-btn {
        width: 100% !important;
        padding: 10px 15px;
        font-size: 13px;
    }

    .search-btn img {
        width: 25% !important;
    }

    .form-select,
    .form-control {
        padding: 12px 16px;
        font-size: 13px;
    }

    .form-label {
        font-size: 12px;
    }


    .hero-section {
        z-index: 1;
    }

    .booking-container {
        z-index: 100;
    }


    .bg-blue {
        transition: height 0.3s ease;
    }


    .hero-carousel,
    .hero-img {
        transition: height 0.3s ease;
    }
}