/* Mobile Cards CSS Fix */
@media (max-width: 768px) {

    /* Mobile cards implementation */
    .filter-main {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .filter-group {
        text-align: center;
        align-items: center;
    }

    .filter-group label {
        text-align: center;
    }

    .filter-group input {
        text-align: center;
        width: 200px;
        margin: 0 auto;
    }

    .filter-quick {
        display: flex !important;
        justify-content: center;
    }

    .btn .btn-text {
        display: none;
    }

    .filter-group input {
        width: 100%;
        min-width: auto;
    }

    /* Switch to mobile cards */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .inspections-cards-container {
        display: block !important;
    }

    .card-body {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .card-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .card-btn {
        min-height: 48px;
    }

    /* Override aggressive button styling for photo remove button */
    #nova-inspecao .form-section .vehicle-photo-preview .btn-remove-photo {
        width: 18px !important;
        height: 18px !important;
        min-width: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        top: -5px !important;
        right: -5px !important;
        background: #ff4757 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: none !important;
    }

    /* WhatsApp Mobile Optimization */
    #whatsapp .whatsapp-container {
        height: calc(100vh - 140px) !important;
        position: relative;
        overflow: hidden;
    }

    #whatsapp .whatsapp-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transition: transform 0.3s ease;
        z-index: 10;
    }

    #whatsapp .whatsapp-chat {
        width: 100% !important;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 20;
    }

    /* State: Chat Open */
    #whatsapp .whatsapp-container.chat-open .whatsapp-sidebar {
        transform: translateX(-100%);
    }

    #whatsapp .whatsapp-container.chat-open .whatsapp-chat {
        transform: translateX(0);
    }

    #whatsapp .wa-back-btn {
        display: flex !important;
    }

    #whatsapp .whatsapp-chat-header {
        padding: 12px 15px !important;
    }

    #whatsapp .whatsapp-input-area {
        padding: 10px 12px !important;
        background: var(--bg-card) !important;
        border-top: 1px solid var(--border-color) !important;
    }

    #whatsapp .wa-input-container {
        gap: 8px !important;
        align-items: center !important;
    }

    #whatsapp .wa-attach-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }

    #whatsapp #whatsapp-message-input {
        border-radius: 12px !important;
        padding: 10px 14px !important;
        font-size: 0.95rem !important;
        min-height: 40px !important;
        max-height: 100px !important;
        background: var(--bg-input) !important;
        border: 1px solid var(--border-color) !important;
    }

    #whatsapp .wa-send-btn {
        width: 80px !important;
        height: 40px !important;
        min-width: 80px !important;
        min-height: 40px !important;
        border-radius: 8px !important;
        background: #DCA553 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        box-shadow: 0 2px 8px rgba(220, 165, 83, 0.3) !important;
    }

    #whatsapp .wa-send-btn i {
        font-size: 1.1rem !important;
    }
}