/* ===== Mobile Form Actions (Reusable) =====
   Sticky bottom action bar pattern for mobile forms.
   Layout: [ Primary submit (≈60%) ][ Chat ngay ][ Gọi hỗ trợ ]

   Markup:
   <div class="mobile-form-actions">
       <div class="mobile-form-actions__row">
           <button type="submit" form="<form-id>" class="mobile-form-actions__submit">
               <span class="btn-text">...</span>
               <span class="btn-loader hidden"><span class="spinner"></span> ...</span>
           </button>
           <div class="mobile-form-actions__extras">
               <button type="button" class="mobile-form-actions__extra" onclick="openChatModal()">
                   <span class="mobile-form-actions__extra-icon"><i class="fas fa-comment"></i></span>
                   <span class="mobile-form-actions__extra-text">Chat ngay</span>
               </button>
               <button type="button" class="mobile-form-actions__extra" onclick="openCallModal('19005303')">
                   <span class="mobile-form-actions__extra-icon"><i class="fas fa-phone"></i></span>
                   <span class="mobile-form-actions__extra-text">Gọi hỗ trợ</span>
               </button>
           </div>
       </div>
   </div>
   <div class="mobile-form-actions-spacer" aria-hidden="true"></div>

   Pair with includes/chat-modal.html + includes/call-modal.html and
   utils/chat-modal.js + utils/call-modal.js for the helper modals.
*/

.mobile-form-actions {
    margin-top: var(--space-6, 1.5rem);
    margin-bottom: var(--space-4, 1rem);
}

.mobile-form-actions__row {
    display: flex;
    align-items: stretch;
    gap: var(--space-3, 0.75rem);
}

/* Primary submit — takes ~60% width like booking-actions-row */
.mobile-form-actions__submit {
    flex: 1;
    max-width: 60%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-full, 32px);
    background: var(--primary-blue, var(--color-primary, #0066cc));
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}

.mobile-form-actions__submit:hover:not(:disabled) {
    background: var(--primary-blue-dark, #0052a3);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.mobile-form-actions__submit:active:not(:disabled) {
    transform: scale(0.98);
}

.mobile-form-actions__submit:disabled {
    background: var(--color-gray-400, #999);
    cursor: not-allowed;
}

.mobile-form-actions__submit .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-form-actions__submit .btn-loader.hidden {
    display: none;
}

.mobile-form-actions__submit.loading .btn-text {
    display: none;
}

/* Extra actions group (chat / call) — vertical icon + label, identical
   to extra-action-item from property/job detail pages. */
.mobile-form-actions__extras {
    display: flex;
    align-items: stretch;
    gap: var(--space-2, 0.5rem);
    flex-shrink: 0;
}

.mobile-form-actions__extra {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #666);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-form-actions__extra:hover,
.mobile-form-actions__extra:focus {
    opacity: 0.7;
    color: var(--text-muted, #666);
    text-decoration: none;
}

.mobile-form-actions__extra-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.mobile-form-actions__extra-icon i {
    font-size: 18px;
}

.mobile-form-actions__extra-text {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

/* Spacer reserves vertical room so the fixed bar never overlaps the last
   form field on mobile. Render it directly after the actions block. */
.mobile-form-actions-spacer {
    display: none;
}

/* ===== Mobile: stick to bottom of viewport ===== */
@media (max-width: 991px) {
    .mobile-form-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-action-button, 1001);
        margin: 0;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    }

    .mobile-form-actions__row {
        gap: 0.5rem;
    }

    .mobile-form-actions__submit {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .mobile-form-actions__extra {
        min-width: 50px;
        padding: 0.25rem 0.5rem;
    }

    .mobile-form-actions__extra-text {
        font-size: 11px;
    }

    .mobile-form-actions-spacer {
        display: block;
        /* Approximate height of the sticky bar incl. safe-area inset. */
        height: calc(88px + env(safe-area-inset-bottom));
    }
}
