/* ============================================
   STICKY BUTTONS FOR MOBILE (ALL STEPS)
   ============================================ */

@media (max-width: 767px) {
    /* -------------------------------------------
       STEP 3 (Confirmation)
       ------------------------------------------- */
    
    /* ซ่อนแถบ Sticky Step 3 ไว้ก่อน (จะแสดงเมื่อหน้า Confirm active เท่านั้น) */
    .box-btn_cf {
        display: none !important;
    }

    /* แสดงเฉพาะเมื่อ #confirm-section มีคลาส active */
    #confirm-section.active .box-btn_cf {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1) !important;
        padding: 20px !important;
        z-index: 9999 !important;
        margin: 0 !important;
        max-width: 100% !important;
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }

    /* จัดการ Form ภายในกล่องปุ่ม */
    .box-btn_cf form {
        margin: 0 !important;
        width: 100% !important;
    }

    /* จัดวางปุ่มคู่ (Confirm & Edit) */
    .box-btn_cf .couple-link {
        display: flex !important;
        flex-direction: row-reverse !important; /* ให้ Confirm อยู่ขวา */
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* สไตล์สำหรับปุ่มทั้งสองใน Step 3 */
    .box-btn_cf button,
    .box-btn_cf .edit-booking_btn {
        flex: 1 !important;
        margin: 0 !important;
        min-height: 50px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        padding: 0 15px !important;
    }

    /* ปุ่ม Confirm (สีน้ำเงิน) */
    #confirm-btn {
        background: #146AFF !important;
        color: #ffffff !important;
        border: none !important;
        flex: 1.2 !important; /* กว้างกว่านิดหน่อย */
    }

    /* ปุ่ม Edit (สีขาว) */
    #edit-confirm {
        background: #f5f5f5 !important;
        color: #333333 !important;
        border: 1px solid #e0e0e0 !important;
    }

    /* เพิ่มพื้นที่ด้านล่างของเนื้อหาเพื่อไม่ให้ปุ่มบัง */
    #confirm-section {
        padding-bottom: 120px !important;
    }


    /* -------------------------------------------
       STEP 1 & 2 (Standard Navigation)
       ------------------------------------------- */

    /* Container รวมปุ่มกด */
    .step-navigation {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1) !important;
        padding: 20px !important;
        z-index: 9990 !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 10px !important;
        margin: 0 !important;
        border-top: none !important;
        flex-direction: row;
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }
    /* ซ่อน Navigation ของ JS ใน Step 3 (เพราะใช้ .box-btn_cf แทนแล้ว) */
    #confirm-section .step-navigation,
    .status-bar_confirm ~ .step-navigation {
        display: none !important;
    }

    /* Style ปุ่มใน Step Navigation */
    .step-navigation button {
        flex: 1 !important;
        height: 50px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: all 0.3s ease !important;
    }

    /* ปุ่ม Previous (ซ้าย - เหมือน Edit Step 3) */
    .step-navigation .btn-prev {
        background: #f5f5f5 !important;
        color: #333333 !important;
        border: 1px solid #e0e0e0 !important;
        order: 1;
    }

    /* ปุ่ม Next (ขวา - เหมือน Confirm Step 3) */
    .step-navigation .btn-next {
        background: #146AFF !important;
        color: #ffffff !important;
        border: none !important;
        order: 2;
        margin-left: 0 !important;
        flex: 1.2 !important; /* ให้ปุ่มไปต่อเด่นกว่า */
    }
    
    /* ปุ่ม Next ที่ Disabled */
    .step-navigation .btn-next:disabled,
    .step-navigation .btn-next.disabled {
        background: #e0e0e0 !important;
        color: #999999 !important;
        cursor: not-allowed !important;
        box-shadow: none !important;
    }

    /* ซ่อน SVG ไอคอนในปุ่ม (ถ้าต้องการให้เหมือนรูปตัวอย่างที่ไม่มีไอคอน หรือปรับขนาด) */
    .step-navigation button svg {
        display: none !important; /* ซ่อนไอคอนเพื่อให้ text เด่นเหมือนรูปตัวอย่าง */
    }
    
    /* เพิ่มพื้นที่ด้านล่างให้ Step 1 & 2 ไม่โดนบัง */
    .main-content,
    .transfer-list,
    .car-results {
        padding-bottom: 120px !important;
    }
}
