/**
 * Mobile Sticky Bottom Bar
 * สำหรับ [tour_booking_actions_btn01] shortcode
 * Layout: 2 แถว - ดูโปรแกรม + 3 ปุ่มในแถวเดียว
 */

/* ซ่อน bar บน desktop */
.tba-mobile-bottom-bar-btn01 {
    display: none;
}

/* แสดงเฉพาะบน Mobile */
@media (max-width: 768px) {
    /* ซ่อนปุ่มใน card เดิม */
    .tba-buttons-btn01 {
        display: none !important;
    }

    /* Sticky Bottom Bar Container - 2 แถว */
    .tba-mobile-bottom-bar-btn01 {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 2147483647 !important;
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        gap: 8px;
        pointer-events: auto !important;
    }

    /* แถวที่ 1: ปุ่มดูโปรแกรม */
    .tba-mobile-row-primary-btn01 {
        display: flex;
        width: 100%;
        pointer-events: auto !important;
    }

    /* แถวที่ 2: ปุ่มรอง - 3 ปุ่มในแถวเดียว */
    .tba-mobile-row-secondary-btn01 {
        display: flex;
        flex-direction: row;
        gap: 8px;
        width: 100%;
        pointer-events: auto !important;
    }

    /* Base Button Style */
    .tba-mobile-btn-btn01 {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 48px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        text-decoration: none;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto !important;
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
        position: relative;
        z-index: 1;
    }

    .tba-mobile-btn-btn01 svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        pointer-events: none;
    }

    /* ปุ่มดูโปรแกรม - สีแดง เต็มความกว้าง */
    .tba-mobile-btn-primary-btn01 {
        flex: 1;
        background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
        color: #ffffff;
        font-size: 16px;
        font-weight: 700;
        height: 50px;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }

    .tba-mobile-btn-primary-btn01:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(239, 68, 68, 0.2);
    }

    /* ปุ่มจองเว็บ - สีเทา */
    .tba-mobile-btn-secondary-btn01 {
        flex: 1;
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
    }

    .tba-mobile-btn-secondary-btn01:active {
        background: #e2e8f0;
        transform: scale(0.98);
    }

    /* ปุ่มโทร - สีเขียว */
    .tba-mobile-btn-phone-btn01 {
        flex: 1;
        background: #ecfdf5;
        color: #059669;
        border: 1px solid #10b981;
    }

    .tba-mobile-btn-phone-btn01:active {
        background: #10b981;
        color: #ffffff;
        transform: scale(0.98);
    }

    /* ปุ่ม LINE - สีเขียว LINE */
    .tba-mobile-btn-line-btn01 {
        flex: 1;
        background: #00b900;
        color: #ffffff;
    }

    .tba-mobile-btn-line-btn01:active {
        background: #009a00;
        transform: scale(0.98);
    }

    /* เพิ่ม padding ล่างให้ content ไม่โดน bar บัง (2 แถว) */
    body.has-mobile-bottom-bar {
        padding-bottom: 140px !important;
    }

    /* Default body padding for pages with bottom bar */
    body {
        padding-bottom: 140px;
    }
}

/* หน้าจอเล็ก */
@media (max-width: 400px) {
    .tba-mobile-bottom-bar-btn01 {
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        gap: 6px;
    }

    .tba-mobile-row-secondary-btn01 {
        gap: 6px;
    }

    .tba-mobile-btn-btn01 {
        font-size: 12px;
        gap: 4px;
        height: 42px;
    }

    .tba-mobile-btn-btn01 svg {
        width: 16px;
        height: 16px;
    }

    .tba-mobile-btn-primary-btn01 {
        font-size: 14px;
        height: 46px;
    }

    body.has-mobile-bottom-bar,
    body {
        padding-bottom: 130px !important;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .tba-mobile-bottom-bar-btn01 {
        background: #1f2937 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .tba-mobile-btn-secondary-btn01 {
        background: #374151;
        color: #e5e7eb;
        border-color: #4b5563;
    }

    .tba-mobile-btn-secondary-btn01:active {
        background: #4b5563;
    }

    .tba-mobile-btn-phone-btn01 {
        background: #064e3b;
        color: #34d399;
        border-color: #10b981;
    }

    .tba-mobile-btn-phone-btn01:active {
        background: #10b981;
        color: #ffffff;
    }
}
