/* ==========================================================================
   EQM MODAL TOUCH RESIZE - SYSTEME GLOBAL
   Tous les modaux Equimondo : redimensionnables avec le pouce (drag).
   Pas de snap : le modal reste ou le doigt lache.
   Swipe bas rapide pour fermer.
   Complemente css/eqm-modal.css (charge avant ce fichier).
   ========================================================================== */

.eqm-touch-handle { display:none }

@media (max-width:1024px) {

    /* ------ Drag handle injecte par JS (touch-resize) ------ */
    .eqm-touch-handle {
        display:flex;
        align-items:center;
        justify-content:center;
        padding:10px 0 4px;
        cursor:grab;
        touch-action:none;
        flex-shrink:0;
        user-select:none;
        -webkit-user-select:none;
        position:sticky;
        top:0;
        z-index:10;
        background:white;
    }
    .eqm-touch-pill {
        width:36px; height:4.5px;
        border-radius:3px;
        background:#d1d5db;
        transition:background .2s, width .2s;
    }
    .eqm-touch-handle:active .eqm-touch-pill {
        background:#94a3b8;
        width:48px;
    }

    /* ------ Override max-height pour permettre le drag jusqu'a 95vh ------ */
    .modal-box,
    .detail-box,
    .eqm-modal-content,
    .plch-confirm-box,
    .filter-panel,
    .val-panel,
    .se-chat-popup,
    .st-chat-popup,
    .sr-chat-popup {
        max-height: 95vh !important;
        max-height: calc(95dvh - env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ------ Etat dragging : desactive toutes transitions ------ */
    .modal-overlay.eqm-dragging .modal-box,
    .detail-overlay.eqm-dragging .detail-box,
    .eqm-modal.eqm-dragging .eqm-modal-content,
    .plch-confirm-overlay.eqm-dragging .plch-confirm-box,
    .eqm-dragging .filter-panel,
    .eqm-dragging .val-panel,
    .eqm-dragging .se-chat-popup,
    .eqm-dragging .st-chat-popup,
    .eqm-dragging .sr-chat-popup {
        transition:none !important;
        animation:none !important;
    }

    /* ------ Confirm overlay : bottom-sheet sur mobile ------ */
    .plch-confirm-overlay.open {
        align-items:flex-end !important;
        justify-content:flex-end !important;
    }
    .plch-confirm-overlay.open .plch-confirm-box {
        border-radius:1.25rem 1.25rem 0 0;
    }
}
