/* #211 : sélection d'offres, comparateur, alertes. Feuille propre au lot : aucune règle de styles.css n'est modifiée.
   Variables (--c-*, --r-*, --tap…) : celles de styles.css. */

/* Bouton « Garder » d'une carte d'offre : au-dessus du lien qui couvre la carte (z-index 1) */
.sel-btn { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border: 1px solid var(--c-border, #E2E8F0); border-radius: 999px; background: rgba(255, 255, 255, .95);
    color: var(--c-text-body, #1E293B); box-shadow: var(--sh-1, 0 1px 2px rgba(15, 23, 42, .08)); cursor: pointer; }
.sel-btn:hover { background: #fff; color: var(--c-action, #0066CC); }
.sel-btn:focus-visible, .sel-pastille:focus-visible { outline: 2px solid var(--ui-focus, #1d4ed8); outline-offset: 2px; }
.sel-btn[aria-pressed="true"] { color: var(--c-action, #0066CC); border-color: var(--c-action, #0066CC); }
.sel-btn[aria-pressed="true"] svg { fill: currentColor; }
.sel-btn[hidden], .sel-pastille[hidden] { display: none; }
.sel-btn-texte[aria-pressed="true"] svg { fill: currentColor; }

/* Pastille « Ma sélection » */
.sel-pastille { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--c-action, #0066CC); color: #fff; font-size: 14px; font-weight: 600;
    text-decoration: none; box-shadow: 0 8px 24px rgba(15, 23, 42, .22); max-width: calc(100vw - 32px); }
.sel-pastille:hover { color: #fff; filter: brightness(.94); }
.sel-pastille__n { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
    background: #fff; color: var(--c-action, #0066CC); font-size: 13px; font-variant-numeric: tabular-nums; }
/* fiche d'offre sur téléphone : la barre d'action collante occupe le bas de l'écran */
@media (max-width: 1023.98px) { body:has(.ui-actionbar) .sel-pastille { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
.sel-annonce { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sel-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pages */
.sel-page { padding-bottom: 96px; min-width: 0; }
.sel-etroit { max-width: 760px; }
.sel-entete { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 20px; }
.sel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.sel-actions form { margin: 0; }
.sel-encart { padding: 16px 20px; margin: 0 0 20px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 20px; }
.sel-encart p { margin: 0; }
.sel-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; }
.sel-outils .ui-help { flex: 1 1 200px; }
.sel-alerte-cta { margin: 0 0 16px; }
.sel-alerte-cta .ui-btn { white-space: normal; text-align: left; height: auto; padding-top: 8px; padding-bottom: 8px; }

/* Liste « Ma sélection » */
.sel-offres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.sel-offre { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; min-width: 0; }
@media (min-width: 768px) {
    .sel-offre { grid-template-columns: 200px minmax(0, 1fr) auto; align-items: start; column-gap: 20px; }
    .sel-offre__coche, .sel-offre__note { grid-column: 1 / -1; }
}
.sel-offre__coche { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; width: fit-content; }
.sel-offre__coche input, .sel-choix input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--c-action, #0066CC); }
.sel-offre__media { aspect-ratio: 16 / 10; background: var(--c-bg-2, #F1F5F9); border-radius: var(--r-sm, 8px); overflow: hidden; }
.sel-offre__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-offre__corps { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sel-offre__titre { font-size: 18px; line-height: 26px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.sel-offre__titre a { color: var(--c-text, #0F172A); text-decoration: none; }
.sel-offre__titre a:hover { text-decoration: underline; }
.sel-offre__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sel-offre__ligne, .sel-offre__prix { margin: 0; font-size: 14px; line-height: 20px; color: var(--c-text-2, #475569); overflow-wrap: anywhere; }
.sel-offre__prix { font-weight: 700; color: var(--c-text, #0F172A); font-size: 15px; }
.sel-offre__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 768px) { .sel-offre__actions { flex-direction: column; align-items: stretch; } }
.sel-offre__note { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sel-offre__note .ui-label { margin: 0; }
.sel-note { min-height: 64px; padding: 8px 12px; resize: vertical; font: inherit; font-size: 16px; }
.sel-pied { display: flex; flex-direction: column; gap: 20px; margin: 24px 0 0; }
.sel-exports { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sel-exports__titre { font-size: 14px; font-weight: 600; margin-right: 4px; }
.sel-partage { max-width: 640px; }
.sel-partage__ligne { display: flex; flex-wrap: wrap; gap: 8px; }
.sel-partage__ligne .ui-input { flex: 1 1 220px; min-width: 0; padding: 0 12px; }
.sel-partage .ui-help { margin-top: 6px; }
.sel-source { margin: 24px 0 0; font-size: 13px; color: var(--c-text-2, #475569); }

/* Comparateur : première colonne fixe, défilement horizontal contenu dans le cadre (jamais la page) */
.sel-table-cadre { overflow-x: auto; max-width: 100%; border: 1px solid var(--c-border, #E2E8F0); border-radius: var(--r-md, 12px); background: #fff;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sel-table-cadre:focus-visible { outline: 2px solid var(--ui-focus, #1d4ed8); outline-offset: 2px; }
.sel-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; font-size: 14px; line-height: 20px; }
.sel-table--2 { min-width: 520px; }
.sel-table--3 { min-width: 720px; }
.sel-table--4 { min-width: 920px; }
.sel-table__legende { caption-side: top; text-align: left; padding: 12px 16px; font-weight: 600; color: var(--c-text-2, #475569); }
.sel-table th, .sel-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--c-border, #E2E8F0); overflow-wrap: anywhere; }
.sel-table td + td, .sel-table th + th, .sel-table th + td { border-left: 1px solid var(--c-border, #E2E8F0); }
.sel-table tbody th, .sel-table__coin { position: sticky; left: 0; z-index: 1; width: 132px; background: #F8FAFC; font-weight: 600; color: var(--c-text-body, #1E293B); }
.sel-table tbody th { overflow-wrap: normal; word-break: normal; hyphens: auto; }   /* « Transaction » jamais coupé en plein mot */
.sel-table__offre { font-weight: 400; }
.sel-table__photo { aspect-ratio: 16 / 10; background: var(--c-bg-2, #F1F5F9); border-radius: var(--r-sm, 8px); overflow: hidden; margin-bottom: 8px; }
.sel-table__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-table__titre { display: block; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--c-text, #0F172A); }
.sel-table__retirer { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--c-action, #0066CC); }
.sel-table__reserve td { background: #F8FAFC; }
.sel-table__reserve p { margin: 0 0 12px; color: var(--c-text-2, #475569); }
.sel-table__reserve p:last-child { margin: 0; }
/* texte et boutons lisibles sans faire défiler la cellule (elle couvre toutes les colonnes) */
.sel-table__reserve td > p { position: sticky; left: 148px; max-width: min(560px, calc(100vw - 196px)); }
@media (max-width: 639.98px) { .sel-table__reserve td > p { left: 132px; max-width: calc(100vw - 172px); } }
@media print { .sel-table__reserve td > p { position: static; max-width: none; } }
@media (max-width: 639.98px) {
    .sel-table tbody th, .sel-table__coin { width: 120px; }
    .sel-table th, .sel-table td { padding: 10px 12px; }
}

/* Alertes */
.sel-formulaire { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sel-formulaire > p { margin: 0; }
.sel-criteres { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sel-criteres .ui-badge { height: auto; min-height: 24px; padding: 2px 10px; white-space: normal; overflow-wrap: anywhere; }
.sel-choix { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 15px; line-height: 22px; cursor: pointer; }
.sel-choix input { margin-top: 1px; }
.sel-consentement { padding: 12px; border: 1px solid var(--c-border-field, #8391A5); border-radius: var(--r-sm, 8px); }
.sel-erreur { margin: 0; padding: 10px 12px; border-radius: var(--r-sm, 8px); background: #FEF2F2; color: #991B1B; font-size: 14px; font-weight: 600; }
.sel-alerte { padding: 20px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.sel-alerte--inactive { background: #F8FAFC; }
.sel-alerte .ui-h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sel-alerte__actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 8px; }
.sel-alerte__actions form { margin: 0; }
.sel-alerte__frequence { flex: 1 1 280px; min-width: 0; }
.sel-alerte__frequence .ui-input { padding: 0 12px; }
.sel-badge--gris { background: #E2E8F0; color: #334155; }
.sel-donnees { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--c-border, #E2E8F0); display: flex; flex-direction: column; gap: 12px; }

/* Impression : le contenu seul, tableau entier */
@media print {
    #main-nav, footer, .sel-noprint, .sel-pastille, .sel-btn, #preprod-banner { display: none !important; }
    .sel-page { padding-bottom: 0; }
    .sel-table-cadre { overflow: visible; border: 0; }
    .sel-table { min-width: 0 !important; font-size: 10pt; }
    .sel-table tbody th, .sel-table__coin { position: static; }
    .sel-table tr, .sel-offre { break-inside: avoid; }
    .sel-offre { box-shadow: none; }
    .sel-note { border: 0; padding: 0; resize: none; }
}
