/* Talaria — WebApp : mises en page Tablette (768–1180 px) et Mobile (< 768 px) d'après les maquettes Figma
   « Tablette · 834 px » et « Mobile · 390 px ». Chargé après webapp-responsive.css. */

/* ───────────────────────── Accueil ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .page { padding-top: var(--espace-xl); padding-bottom: var(--espace-2xl); gap: var(--espace-xl); }
    .ligne-principale { flex-direction: column; gap: var(--espace-lg); }
    .prochain { min-height: 466px; }
    .colonne-laterale { flex-direction: row; align-items: flex-start; width: 100%; gap: var(--espace-lg); }
    .colonne-laterale > * { flex: 1 1 0; min-width: 0; }
    .grille-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-md); }
}
@media (max-width: 767px) {
    .page { padding: var(--espace-lg) var(--espace-md); gap: var(--espace-xl); }
    .page-entete .t-titre { font-size: 36px; }
    .ligne-principale { flex-direction: column; gap: var(--espace-lg); }
    .prochain { min-height: 466px; padding: var(--espace-lg) var(--espace-md); }
    .prochain__haut { flex-direction: column; align-items: flex-start; gap: var(--espace-sm); }
    .prochain__bas { flex-direction: column; align-items: flex-start; gap: var(--espace-md); }
    .prochain__bas > .btn { width: auto; align-self: flex-start; }
    .colonne-laterale { width: 100%; }
    /* cartes de voyages et de bons plans : défilement horizontal (cartes de 260 px) */
    .grille-4 { display: flex; gap: var(--espace-md); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: var(--espace-md); margin: 0 calc(var(--espace-md) * -1); padding: 0 var(--espace-md) var(--espace-2xs); scrollbar-width: none; }
    .grille-4::-webkit-scrollbar { display: none; }
    .grille-4 > * { flex: 0 0 260px; scroll-snap-align: start; }
    .carte-photo__img { height: 140px; }
}

/* ───────────────────────── Découvrir ───────────────────────── */
.pill--filtres, .carte-locate { display: none; }
@media (max-width: 1180px) {
    .liste-lieux:not(.filtres-ouverts) > label.saisie, .liste-lieux:not(.filtres-ouverts) > .ac { display: none; }
}
@media (min-width: 768px) and (max-width: 1180px) {
    .page--split { padding: 0; gap: 0; }
    .liste-lieux { width: 320px; padding: var(--espace-lg); }
    #position { display: none; }
    .pill--filtres { display: inline-flex; }
    .carte-filtres { right: 76px; flex-wrap: wrap; }
    .fiche-lieu { left: var(--espace-md); right: auto; bottom: var(--espace-lg); width: 360px; }
    .carte-locate { position: absolute; right: var(--espace-lg); top: 132px; z-index: 5; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; filter: drop-shadow(0 10px 15px rgba(79, 32, 62, 0.1)); }
}
@media (max-width: 767px) {
    .page--split { padding: 0; gap: 0; }
    .page--split > .carte-zone { height: 380px; min-height: 380px; flex: none; }
    .liste-lieux { padding: var(--espace-lg); border-top: 0; }
    #position { display: none; }
    .pill--filtres { display: inline-flex; }
    .carte-filtres { left: var(--espace-lg); top: var(--espace-lg); right: 76px; flex-wrap: wrap; overflow: visible; }
    .zoom { right: var(--espace-lg); top: var(--espace-lg); }
    .carte-locate { position: absolute; right: var(--espace-lg); top: 132px; z-index: 5; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; filter: drop-shadow(0 10px 15px rgba(79, 32, 62, 0.1)); }
}

/* ───────────────────────── Mes voyages ───────────────────────── */
@media (max-width: 767px) {
    .page-entete { gap: var(--espace-md); }
    .page-entete__actions { flex-direction: column; align-items: flex-start; gap: var(--espace-sm); }
    .page-entete__actions > .btn, .page-entete__actions > .onglets, .page-entete__actions .btn { flex: none; width: auto; }
    .voyages-grille { gap: var(--espace-lg); }
    .nouveau-voyage { min-height: 220px; }
}

/* ───────────────────────── Amis ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .amis-colonnes { gap: var(--espace-lg); }
    .amis-lateral { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-lg); align-items: start; width: 100%; }
    .amis-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-md); }
    .amis-outils { flex-wrap: nowrap; }
    .amis-outils .saisie { flex: 1 1 auto; }
}
@media (max-width: 767px) {
    .page--serree .page-entete__actions { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: var(--espace-xs); width: 100%; }
    .page--serree .page-entete__actions .btn { flex: 1 1 0; width: auto; min-width: 0; height: 44px; padding: 0 var(--espace-sm); font-size: 14px; white-space: nowrap; }
    .amis-outils .saisie { flex: 1 1 100%; }
    .amis-outils .btn { align-self: flex-start; }
}

/* ───────────────────────── Recherche (volet) ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .suggestions { flex-direction: row; gap: var(--espace-xl); }
    .suggestions__liste { flex: 1.1; }
    .suggestions__cote { width: auto; flex: 1; }
}

/* ───────────────────────── Où partir ? (carte des prix) ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .panneau-explorer { width: 380px; }
    .panneau-explorer .criteres-2 { flex-direction: column; }
    .monde-scene { transform: scale(0.4) !important; }
    .filtres-carte { right: 76px; flex-wrap: wrap; }
    .fiche-dest { left: var(--espace-md); bottom: var(--espace-lg); width: 340px; }
}
@media (max-width: 767px) {
    .page--split > .carte-zone:has(.monde) { height: 356px; min-height: 356px; }
    .panneau-explorer { padding: var(--espace-lg); }
    .monde-scene { transform: scale(0.4) !important; }
    .filtres-carte { left: var(--espace-lg); top: var(--espace-lg); right: 76px; flex-wrap: wrap; overflow: visible; }
    .carte-boutons { display: flex !important; flex-direction: column; gap: var(--espace-xs); right: var(--espace-lg); top: var(--espace-lg); }
    .legende-carte { display: none; }
}

/* ───────────────────────── Résultats de vols ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .calendrier-prix { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--espace-sm); }
}
@media (max-width: 767px) {
    /* maquette mobile : les filtres restent affichés dans la page (pas de volet) et la carte de l'itinéraire est visible */
    .btn-filtres { display: none; }
    .filtres-vols, .filtres-vols.ouvert { display: flex; position: static; inset: auto; z-index: auto; padding: 0; overflow: visible; background: none; animation: none; width: 100%; }
    .filtres-fermer, .filtres-appliquer { display: none !important; }
    .mini-carte { display: block; height: 180px; }
}

/* ───────────────────────── Détail du voyage ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .jours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--espace-sm); overflow: visible; margin: 0; padding: 0; }
    .jour-p { width: auto; }
    .vote__btns .btn { white-space: nowrap; padding-inline: var(--espace-sm); }
}
@media (max-width: 767px) {
    /* en-tête du voyage : retour, actions avec libellés, titre, participants (empilés) */
    .voyage-entete { min-height: 255px; gap: var(--espace-md); padding: var(--espace-md); }
    .voyage-entete__haut { flex-direction: column; align-items: flex-start; flex-wrap: wrap; gap: var(--espace-sm); }
    .voyage-entete__actions { display: flex; gap: var(--espace-xs); }
    .voyage-entete__actions .btn-sur-photo { width: auto; padding: 0 var(--espace-md); font-size: 15px; gap: var(--espace-xs); justify-content: center; }
    .voyage-entete h1 { font-size: 40px; }
    .cols__main > .section-titre { flex-direction: column; align-items: flex-start; gap: var(--espace-md); }
    /* planning : ligne = heure · photo · texte (étiquette et menu masqués) */
    .act { flex-wrap: nowrap; row-gap: 0; }
    .act__h { width: 44px; flex: none; }
    .act__photo { width: 64px; height: 64px; flex: none; }
    .act__txt { flex: 1 1 auto; min-width: 0; }
    .act > .tag, .act > .btn-points { display: none; }
    /* budget : chaque dépense sur deux lignes (poste · catégorie, puis payeur · montant) */
    .table-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'poste cat' 'par mnt'; row-gap: var(--espace-sm); align-items: center; padding: var(--espace-md); }
    .table-ligne .poste { grid-area: poste; }
    .table-ligne .cat, .table-ligne--titres span:nth-child(2) { grid-area: cat; display: flex; width: auto; justify-content: flex-end; }
    .table-ligne .par, .table-ligne--titres span:nth-child(3) { grid-area: par; display: flex; width: auto; }
    .table-ligne .mnt { grid-area: mnt; width: auto; }
    .depenses__entete { flex-direction: column; align-items: flex-start; gap: var(--espace-sm); }
    .depenses__filtres { flex-wrap: wrap; }
    /* votes : cartes en défilement horizontal */
    .votes-resume .btn { width: auto; align-self: flex-start; }
    .votes-grille { display: flex; gap: var(--espace-md); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: var(--espace-md); margin: 0 calc(var(--espace-md) * -1); padding: 0 var(--espace-md) var(--espace-2xs); scrollbar-width: none; }
    .votes-grille::-webkit-scrollbar { display: none; }
    .votes-grille > * { flex: 0 0 284px; scroll-snap-align: start; }
    .vote__btns { flex-direction: column; }
    .vote__btns .btn { flex: none; width: 100%; }
    .chat-msgs { max-height: 70dvh; }
}

/* ───────────────────────── Création de voyage ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .recap { display: block; }
    .recap > img { display: none; }
}
@media (max-width: 767px) {
    .page-entete:has(#brouillon) { flex-direction: column; align-items: stretch; }
    #brouillon { width: 100%; justify-content: center; }
    .etapes-wizard { justify-content: flex-start; }
    .etape-w > div, .etape-w--actif > div { display: flex; }
    .etape-w { padding: 4px 16px 4px 4px; }
    .etape-w--actif small { display: block; }
    .participants-ligne { flex-direction: column; align-items: stretch; }
    .participants-ligne .btn { width: 100%; justify-content: center; }
    .nav-etapes { flex-direction: column; align-items: stretch; }
    .nav-etapes .btn { width: 100%; }
    .nav-etapes #annuler { width: auto; align-self: flex-start; }
}

/* ───────────────────────── Profil ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .profil-infos { flex-wrap: nowrap; align-items: flex-start; }
    .profil-boutons { flex-direction: column; width: auto; align-self: flex-start; padding-top: var(--espace-xl); }
    .profil-boutons .btn { flex: none; }
    .profil-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-sm); padding: 0 var(--espace-lg) var(--espace-lg); }
    .profil-droite { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-lg); align-items: start; width: 100%; }
}
@media (max-width: 767px) {
    .profil-infos { align-items: flex-start; text-align: left; padding: 0 var(--espace-md) var(--espace-md); }
    .profil-identite { align-items: flex-start; }
    .profil-meta { justify-content: flex-start; }
    .profil-boutons { flex-direction: column; align-items: flex-start; width: auto; }
    .profil-boutons .btn { flex: none; width: auto; min-width: 0; }
    .profil-onglets { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
    .grille-voy-p { display: flex; gap: var(--espace-sm); overflow-x: auto; scroll-snap-type: x proximity; margin: 0 calc(var(--espace-md) * -1); padding: 0 var(--espace-md) var(--espace-2xs); scrollbar-width: none; }
    .grille-voy-p::-webkit-scrollbar { display: none; }
    .grille-voy-p > * { flex: 0 0 158px; scroll-snap-align: start; }
    .article { flex-direction: column; align-items: flex-start; }
    .article img { width: 100%; height: 120px; }
    .profil-medaille .medaille-bloc .medaille { width: 104px; height: auto; }
    .legende-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .medaille-pub .medaille { width: 76px; height: auto; }
    /* Barre d'onglets flottante : dégage le bas du contenu du profil (sinon elle recouvre la dernière carte) */
    body[data-vue='profil'] .main { padding-bottom: 0; }
    body[data-vue='profil'] #contenu > .page { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
}

.btn--deconnexion { color: var(--color-texte-danger); }

/* ───────────────────────── Paramètres : pas de recherche de voyage, menu fixe ───────────────────────── */
body[data-vue='parametres'] .topbar__recherche { display: none; }
body[data-vue='parametres'] .topbar { justify-content: flex-end; }
@media (min-width: 1101px) {
    /* page figée à la hauteur de l'écran : seul le contenu de l'onglet de réglages défile, le menu reste fixe */
    body[data-vue='parametres'] .app, body[data-vue='parametres'] .main { height: 100dvh; overflow: hidden; }
    body[data-vue='parametres'] #contenu { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    body[data-vue='parametres'] #contenu > .page { flex: 1; min-height: 0; padding-bottom: var(--espace-lg); }
    body[data-vue='parametres'] .params-cols { flex: 1; min-height: 0; align-items: stretch; }
    body[data-vue='parametres'] .params-menu { align-self: stretch; overflow: hidden; }
    body[data-vue='parametres'] .params-panneau { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (max-width: 767px) {
    body[data-vue='parametres'] .topbar { justify-content: space-between; }
}
@media (min-width: 1101px) {
    /* menu : toutes les entrées (et « Se déconnecter ») visibles sans défiler */
    body[data-vue='parametres'] .params-menu { gap: 0; padding: var(--espace-sm) var(--espace-md); }
    body[data-vue='parametres'] .params-entree { height: 42px; }
    body[data-vue='parametres'] .params-groupe { padding-top: var(--espace-sm); }
    body[data-vue='parametres'] .params-user { padding-bottom: var(--espace-xs); }
}

/* Paramètres : le titre prend la place de l'ancienne recherche dans la barre du haut, le contenu gagne toute la hauteur */
@media (min-width: 768px) {
    body[data-vue='parametres'] .topbar::before { content: 'Paramètres'; margin-right: auto; font: 600 28px/1.2 var(--font-titre); letter-spacing: -0.28px; color: var(--color-texte-principal); }
    body[data-vue='parametres'] #contenu > .page > .page-entete__titre { display: none; }
    body[data-vue='parametres'] #contenu > .page { padding-top: var(--espace-lg); }
}

/* ───────────────────────── Profil : Mon grade ───────────────────────── */
@media (min-width: 768px) and (max-width: 1180px) {
    .grade-bloc { padding: var(--espace-lg); gap: var(--espace-md); }
    .grade-bloc__embleme .grade-embleme { width: 96px; }
    .grade-bloc__embleme::before { width: 132px; height: 132px; }
    .grade-nom { font-size: 34px; }
}
@media (max-width: 767px) {
    .grade-bloc { flex-direction: column; align-items: center; text-align: center; padding: var(--espace-lg) var(--espace-md); gap: var(--espace-sm); }
    .grade-bloc__texte { align-items: center; width: 100%; }
    .grade-points { width: 100%; }
    .grade-nom { font-size: 32px; }
    .grade-palier { align-items: flex-start; text-align: left; }
    .grade-echelle { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--espace-lg) var(--espace-md); align-items: start; }
    .grade-palier .grade-embleme { width: 42px; }
    .grade-palier--actuel .grade-embleme { width: 54px; }
    .grade-action { padding: var(--espace-sm); }
    .grade-ligne { padding: var(--espace-sm); }
    .grade-ligne__txt small { font-size: 12px; }
}
