diff --git a/src/App.css b/src/App.css index 506e4f5..8f4339f 100644 --- a/src/App.css +++ b/src/App.css @@ -1113,3 +1113,85 @@ wcs-textarea::part(textarea) { max-width: none !important; } } + +/* ============================================= + RESPONSIVE MODALS (PWA / TABLETTE / MOBILE) + ============================================= */ +@media (max-width: 900px) { + /* Sur tablette, la modale prend plus de place */ + .modal-content { + max-width: 90vw; + max-height: 90vh; + } + .modal-content.modal-small { + max-width: 60vw; + } +} + +@media (max-width: 600px) { + /* Sur mobile, la modale passe en plein écran (façon app native) */ + .modal-overlay { + padding: 0 !important; + align-items: flex-end; + } + + .modal-content, + .modal-content.modal-small, + .modal-large, + .modal-xlarge { + width: 100vw !important; + max-width: 100vw !important; + height: 100vh !important; + max-height: 100vh !important; + border-radius: 0 !important; + display: flex; + flex-direction: column; + padding-top: env(safe-area-inset-top); + overflow: hidden !important; /* Empêche le conteneur principal de scroller */ + } + + .modal-header { + padding: 16px; + background: #fff; + z-index: 10; + /* Plus besoin de sticky, le layout flex s'en charge */ + } + + .modal-body { + flex: 1; + overflow-y: auto; + padding: 16px; + -webkit-overflow-scrolling: touch; + } + + /* Rendre les onglets collants en dessous du header si présents */ + .gares-modal-tabs { + position: sticky; + top: 0; + background: #fff; + z-index: 5; + } + + .modal-footer { + padding: 16px; + padding-bottom: calc(16px + env(safe-area-inset-bottom)); + background: #fff; + z-index: 10; + flex-direction: column-reverse; /* Boutons de validation en haut, annulation en bas */ + gap: 8px; + border-top: 1px solid #e5e7eb; + display: flex; + } + + .modal-footer wcs-button { + width: 100%; + margin: 0 !important; + } +} + +/* ============================================= + Z-INDEX FIX (Empêche le AppHeader de passer au-dessus des modales) + ============================================= */ +body:has(.modal-overlay) .app-header-shell { + z-index: 1 !important; +} diff --git a/src/components/HoraireModal/HoraireModal.jsx b/src/components/HoraireModal/HoraireModal.jsx index 996a2e3..538bcb0 100644 --- a/src/components/HoraireModal/HoraireModal.jsx +++ b/src/components/HoraireModal/HoraireModal.jsx @@ -386,9 +386,9 @@ const handleSave = async () => { } } - const INP = { width: '100%', padding: '9px 12px', border: '1px solid #d1d5db', borderRadius: 6, fontSize: 14, boxSizing: 'border-box', outline: 'none', fontFamily: 'inherit' }; - const LBL = { display: 'block', fontWeight: 600, fontSize: 13, color: '#374151', marginBottom: 6 }; - const SEC = { fontSize: 13, fontWeight: 700, color: '#374151', textTransform: 'uppercase', letterSpacing: '0.06em', margin: '20px 0 12px', paddingBottom: 6, borderBottom: '1px solid #e5e7eb' }; + const INP = { width: '100%', padding: '9px 12px', border: '1px solid var(--wcs-gray-300, #d1d5db)', borderRadius: 6, fontSize: 14, boxSizing: 'border-box', outline: 'none', fontFamily: 'inherit', background: 'inherit', color: 'inherit' }; + const LBL = { display: 'block', fontWeight: 600, fontSize: 13, color: 'inherit', marginBottom: 6 }; + const SEC = { fontSize: 13, fontWeight: 700, color: 'inherit', textTransform: 'uppercase', letterSpacing: '0.06em', margin: '20px 0 12px', paddingBottom: 6, borderBottom: '1px solid var(--wcs-gray-200, #e5e7eb)' }; const TABS = ['general', 'gares', 'jours', 'materiel', 'substitution']; const TAB_LABELS = { general: 'Général', gares: 'Gares desservies', jours: 'Calendrier de circulation', materiel: 'Matériel roulant', substitution: 'Substitution' }; @@ -795,12 +795,12 @@ const handleSave = async () => {