/* ==========================================================================
   PAGE RÉSULTATS (Louer) — resultat.css (v. embellie)
   Structure :
   0) Reset / helpers
   1) Variables (couleurs, rayons, tailles)
   2) Typos / corps
   3) Layout de base
   4) Header (compat admin-bar)
   5) Hero (image + voile)
   6) Searchbar (Ligne 1)
   7) Filtres (Ligne 2 : Types | Capacité | Prix)
   8) Actions (Ligne 3 : Réinitialiser + Rechercher)
   9) Toolbar (compteur + tri)
   10) Grille & cartes résultats
   11) Pagination
   12) Footer (rappel)
   13) Responsives (hooks à compléter si besoin)
   ========================================================================== */


/* ========== 0) RESET / HELPERS ========== */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
:root { --control-h: 40px; }               /* Hauteur uniforme des champs */
img { max-width: 100%; display: block; }   /* images sûres */
a { color: inherit; }                      /* couleur héritée par défaut */


/* ========== 1) VARIABLES ========== */
:root{
  /* Couleurs */
  --blue:   #2aaaff;
  --indigo: #554dff;
  --text:   #111827;
  --muted:  #6B7280;
  --line:   #E5E7EB;
  --bg-soft:#F9FAFB;

  /* UI */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 2px 12px rgba(0,0,0,.06);
  --shadow-md: 0 10px 24px rgba(0,0,0,.15);

  /* Slider (prix) */
  --range-track-h: 6px;   /* épaisseur piste */
  --range-thumb:   16px;  /* diamètre poignée */
}


/* ========== 2) TYPOS / CORPS ========== */
h1, h2, h3 { font-family: 'Poppins', sans-serif; }
body, p, label, input, select, button {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--text);
}
label { color:#374151; font-size: 12px; }
small { color: var(--muted); }


/* ========== 3) LAYOUT DE BASE ========== */
.container { max-width:1200px; margin:0 auto; padding:0 20px; }


/* ========== 4) HEADER (compat admin-bar) ========== */
@media (min-width: 783px){ body.admin-bar .pp-header{ top:32px; } }
.pp-header{ 
    position: sticky; top:0; z-index:1000;
}

/* ========== 5) HERO (image + voile) ========== */
.res-hero{
  position:relative; min-height:60vh; display:flex; align-items:center; overflow:hidden;
}
.res-hero-bg{ position:absolute; inset:0; z-index:0; }
.res-hero-bg img{ width:100%; height:100%; object-fit:cover; filter:brightness(65%); }
.res-hero::after{
  content:""; position:absolute; inset:0; z-index:0;
  background:linear-gradient(180deg,
    rgba(17,24,39,.75) 0%,
    rgba(31,41,55,.5) 50%,
    rgba(17,24,39,.75) 100%);
}
.res-hero-inner{ position:relative; z-index:1; width:100%; }
.res-hero h1{ color:#fff; text-align:center; font-size:36px; line-height:1.25; margin:0 0 18px; }
.res-hero h1 span{ color:var(--blue); }


/* ========== 6) SEARCHBAR — LIGNE 1 ========== */
/* Grille : Localisation | Date | Durée | Filtres (CTA en ligne 3) */
.res-search{
  display:grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 44px;
  gap:10px;
  background:#fff; border-radius: var(--radius); padding:12px;
  box-shadow: var(--shadow-md);
  width:100%; max-width:760px; margin:12px auto 0;
  align-items:end;
}
.res-field{ display:flex; flex-direction:column; gap:6px; }
.res-field input, .res-field select{
  height:var(--control-h); padding:0 10px; border:1px solid var(--line);
  border-radius: var(--radius-sm); font-size:14px; transition: box-shadow .2s, border-color .2s;
}
.res-field input:focus, .res-field select:focus{
  outline:none; border-color:#93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* Localisation + bouton "cible" */
.res-loc-group{ display:flex; gap:8px; align-items:center; }
.res-loc-group input{ flex:1 1 auto; }
.btn-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--control-h); height:var(--control-h);
  padding:0; line-height:1; border:1px solid var(--line); border-radius: var(--radius-sm);
  background:#fff; color:#4B5563; cursor:pointer; transition: border-color .2s, box-shadow .2s, color .2s;
  -webkit-appearance:none; appearance:none;
}
.btn-icon:hover{ color:#111827; border-color:#cfd6df; }
.btn-icon:focus{ outline:none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.btn-icon svg{ width:18px; height:18px; display:block; }
.btn-icon:disabled{ opacity:.6; cursor:progress; }

/* Icône Filtres */
.res-filter{
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--control-h); height:var(--control-h);
  border:1px solid var(--line); border-radius: var(--radius-sm);
  background:#fff; color:#4B5563; align-self:end; transition: border-color .2s, box-shadow .2s, color .2s;
}
.res-filter:hover{ color:#111827; border-color:#cfd6df; }
.res-filter:focus{ outline:none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* CTA générique (utilisé en ligne 3) */
.btn-gradient{
  background:linear-gradient(90deg, var(--blue), var(--indigo));
  color:#fff; border:none; border-radius: var(--radius-sm); height:var(--control-h);
  padding:0 16px; display:inline-flex; align-items:center; justify-content:center; font-weight:600; cursor:pointer;
  transition: transform .05s ease, filter .2s ease;
}
.btn-gradient:hover{ filter:brightness(1.03); }
.btn-gradient:active{ transform: translateY(1px); }
.btn-gradient:focus{ outline:none; box-shadow: 0 0 0 3px rgba(59,130,246,.25); }


/* ========== 7) FILTRES — LIGNE 2 (Types | Capacité | Prix) ========== */
/* Grille 3 colonnes pour un alignement pixel-perfect */
.res-inline-filters{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns: 1fr 120px minmax(260px, 1fr);  /* Types | Capacité | Prix */
  gap:10px;
  align-items:end;
  margin-top:8px;
  margin-bottom:22px;  /* espace pour les valeurs de prix */
}

/* Flatten l’ex-wrapper si présent (HTML historique) */
.res-inline-right{ display: contents; }

/* Colonne "Types" : une seule ligne scrollable */
.res-inline-filters > .res-field{
  min-width:0; display:flex; flex-direction:column; justify-content:flex-end;
}
.res-type-checks{
  display:flex; flex-wrap:nowrap; gap:14px; overflow-x:auto; padding-bottom:4px;
  -webkit-overflow-scrolling:touch; scrollbar-width:thin; overscroll-behavior-x:contain;
}
.res-type-checks::-webkit-scrollbar{ height:6px; }
.res-type-checks::-webkit-scrollbar-track{ background:transparent; }
.res-type-checks::-webkit-scrollbar-thumb{ background:#E5E7EB; border-radius:999px; }

/* Item type (checkbox + libellé) */
.res-check{
  display:inline-flex; align-items:center; gap:6px; font-size:14px; color:var(--text);
  white-space:nowrap; cursor:pointer;
}
.res-check input{ width:16px; height:16px; accent-color: var(--blue); }
.res-check span{ font-weight:400; }

/* Capacité */
.res-inline-filters .res-field input{ width:100%; }

/* Colonne "Prix" : jauge double */
.res-price{ position:relative; min-width:260px; }

/* Piste + remplissage */
.price-range{ position:relative; height: calc(var(--range-thumb) + 10px); }
.price-range .range-track{
  position:absolute; left:0; right:0; top:50%;
  height:var(--range-track-h); border-radius:999px; background:#E5E7EB; transform:translateY(-50%);
}
.price-range .range-fill{
  position:absolute; top:50%; height:var(--range-track-h); border-radius:999px;
  background:linear-gradient(90deg, var(--blue), var(--indigo));
  transform:translateY(-50%); left:0; right:0;  /* JS ajuste left/right */
}

/* Deux range superposés — aucune bordure native */
.price-range input[type="range"]{
  position:absolute; inset:0; width:100%; height:100%;
  background:transparent !important; border:0 !important; outline:none !important;
  pointer-events:none; -webkit-appearance:none; appearance:none; margin:0;
}
/* Tracks */
.price-range input[type="range"]::-webkit-slider-runnable-track{ background:transparent; border:0; height:var(--range-track-h); }
.price-range input[type="range"]::-moz-range-track{ background:transparent; border:0; height:var(--range-track-h); }
.price-range input[type="range"]::-ms-track{ background:transparent; border-color:transparent; color:transparent; height:var(--range-track-h); }
/* Thumbs */
.price-range input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; pointer-events:auto;
  width:var(--range-thumb); height:var(--range-thumb); border-radius:50%;
  border:2px solid #fff; background:linear-gradient(90deg, var(--blue), var(--indigo));
  box-shadow:0 1px 3px rgba(0,0,0,.25);
  margin-top: calc((var(--range-thumb) - var(--range-track-h)) / -2);
}
.price-range input[type="range"]::-moz-range-thumb{
  pointer-events:auto; width:var(--range-thumb); height:var(--range-thumb); border-radius:50%;
  border:2px solid #fff; background:linear-gradient(90deg, var(--blue), var(--indigo));
  box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.price-range input[type="range"]:focus{ outline:none; }

/* Valeurs (sorties du flux pour ne pas casser l’alignement) */
.price-values{
  position:absolute; left:0; right:0; top:calc(100% + 6px);
  display:flex; justify-content:space-between; font-size:13px; color:#374151; margin:0;
}


/* ========== 8) ACTIONS — LIGNE 3 ========== */
.res-filters-actions{
  grid-column:1 / -1; display:flex; justify-content:center; align-items:flex-end; gap:10px; margin-top:8px;
}
.res-filters-actions .btn-gradient, .res-filters-actions .btn-reset{ height:var(--control-h); }
.btn-reset{
  background:#fff; border:1px solid var(--line); color:#111827;
  border-radius: var(--radius-sm); padding:0 14px; font-size:14px; cursor:pointer; transition: background .2s, border-color .2s;
}
.btn-reset:hover{ background:#f3f4f6; border-color:#cfd6df; }
.btn-reset:focus{ outline:none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }


/* ========== 9) TOOLBAR (titre + compteur + tri) ========== */
.res-toolbar{ display:flex; align-items:end; justify-content:space-between; gap:20px; padding:22px 0 10px; }
.res-toolbar-left{ display:flex; align-items:baseline; gap:12px; }
.res-toolbar-left h2{ font-size:20px; margin:0; }
.res-count{ color:var(--muted); font-size:14px; }
.res-toolbar-right{ display:flex; gap:14px; align-items:center; }
.res-toolbar-right .res-field{ flex-direction:row; align-items:center; gap:8px; }
.res-toolbar-right select{
  height:36px; border:1px solid var(--line); border-radius: var(--radius-sm); padding:0 10px;
  transition: box-shadow .2s, border-color .2s;
}
.res-toolbar-right select:focus{ outline:none; border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.15); }


/* ========== 10) GRILLE & CARTES RÉSULTATS ========== */
.res-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; padding-bottom:30px; }
.res-card{
  background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .2s ease;
}
.res-card:hover{ transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,.10); }

.res-card-media{ position:relative; aspect-ratio:4 / 3; overflow:hidden; }
.res-card-media img{ width:100%; height:100%; object-fit:cover; }
.res-fav{
  position:absolute; top:10px; right:10px; z-index:1;
  background:rgba(255,255,255,.95); border:none; border-radius:999px; width:34px; height:34px;
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.15);
}

.res-card-body{ padding:12px 14px 14px; }
.res-tags{ display:flex; gap:6px; margin-bottom:6px; }
.tag{ font-size:12px; background:#F3F4F6; color:#374151; padding:2px 8px; border-radius:999px; }

.res-card-title{ margin:6px 0 10px; font-size:16px; }
.res-card-title a{ text-decoration:none; color:var(--text); }
.res-card-title a:hover{ text-decoration:underline; }

.res-distance{
  display:inline-flex; align-items:center; gap:6px; margin:2px 0 10px; font-size:13px; color:#1f2937;
  background:#F3F4F6; border:1px solid #E5E7EB; border-radius:999px; padding:4px 10px;
}

.res-meta{ display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:14px; color:#374151; }
.price{ color:#0ea5e9; font-weight:700; }
.price small{ font-weight:400; color:#64748b; }
.rating{ display:inline-flex; align-items:center; gap:6px; color:#111827; }
.rating .star{ color:#FBBF24; }


/* ========== 11) PAGINATION ========== */
.res-pagination{ padding:10px 0 60px; }
.res-pagination ul{ list-style:none; margin:0; padding:0; display:flex; gap:8px; }
.res-pagination button{
  min-width:34px; height:34px; border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.res-pagination button:hover{ background:#111827; color:#fff; border-color:#111827; }
.res-pagination button.active{ background:#111827; color:#fff; border-color:#111827; }


/* ========== 12) FOOTER (rappel) ========== */
.pp-footer{ background:#111827; color:#fff; font-size:.95rem; }
.pp-footer-top{ display:grid; grid-template-columns:repeat(4,1fr); gap:30px; padding:40px 20px; }
.pp-footer-block h4{ color:#fff; font-weight:700; margin-bottom:15px; }
.pp-footer-block p{ color:#d1d5db; margin-bottom:15px; }
.pp-footer-block ul{ list-style:none; padding:0; margin:0; }
.pp-footer-block ul li{ margin-bottom:8px; }
.pp-footer-block ul li a{ color:#d1d5db; text-decoration:none; transition:color .2s; }
.pp-footer-block ul li a:hover{ color:#fff; }
.pp-footer-logo{ max-width:120px; display:block; margin:0 auto 10px; }
.pp-footer-socials{ display:flex; justify-content:center; gap:12px; margin-top:10px; }
.icon-social{ width:24px; height:24px; fill:#fff; transition:opacity .2s; }
.pp-footer-socials a:hover .icon-social, .pp-footer-socials a:hover img{ opacity:.8; }
.pp-footer-bottom{ border-top:1px solid #1f2937; text-align:center; padding:15px 20px; font-size:.85rem; color:#9ca3af; }


/* ========== 13) RESPONSIVES — exemples à activer si besoin ========== */
/*
@media (max-width: 1024px){
  .res-grid{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px){
  .res-search{ max-width:none; }
  .res-inline-filters{
    grid-template-columns: 1fr;        // Types
    margin-bottom: 28px;
  }
  .res-price{ min-width: 0; }
}
@media (max-width: 480px){
  .res-grid{ grid-template-columns: 1fr; }
}
*/

/* ==========================================================================
   RESPONSIVE — Ajouts mobile-first (resultat.css)
   ========================================================================== */

/* 🔹 Ultra-petits téléphones (<= 360px) */
@media (max-width: 359.98px){
  .container{ padding: 0 14px; }
  .res-hero h1{ font-size: 22px; margin-bottom: 12px; }
  .res-search{ padding: 10px; gap: 8px; }
  .res-toolbar{ gap: 12px; }
  .res-toolbar-left h2{ font-size: 18px; }
  .res-grid{ gap: 16px; }
  .res-card-body{ padding: 10px 12px; }
  .pp-footer-top{ gap: 18px; padding: 28px 14px; }
}

/* 🔹 Petits téléphones (<= 480px) */
@media (max-width: 480px){
  /* Hero */
  .res-hero{ min-height: 46vh; }
  .res-hero h1{ font-size: 24px; line-height: 1.3; }

  /* Search (ligne 1) : on stack proprement */
  .res-search{
    grid-template-columns: 1fr;
    max-width: none;
  }
  .res-loc-group{ gap: 6px; }
  .btn-icon{ width: var(--control-h); height: var(--control-h); }

  /* Filtres (ligne 2) : une seule colonne */
  .res-inline-filters{
    grid-template-columns: 1fr;
    margin-bottom: 20px;
  }
  .res-type-checks{ gap: 10px; padding-bottom: 2px; }
  .res-price{ min-width: 0; }
  .price-values{ top: calc(100% + 4px); font-size: 12px; }

  /* Actions (ligne 3) */
  .res-filters-actions{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .res-filters-actions .btn-gradient,
  .res-filters-actions .btn-reset{ width: 100%; }

  /* Toolbar */
  .res-toolbar{
    flex-direction: column;
    align-items: stretch;
    padding-top: 16px;
  }
  .res-toolbar-left{ align-items: center; justify-content: space-between; }
  .res-toolbar-right{ justify-content: space-between; }

  /* Grille résultats */
  .res-grid{ grid-template-columns: 1fr; gap: 18px; }

  /* Pagination : cibles plus larges */
  .res-pagination ul{ justify-content: center; flex-wrap: wrap; row-gap: 6px; }
  .res-pagination button{
    min-width: 38px; height: 38px; border-radius: 10px;
  }

  /* Footer */
  .pp-footer-top{
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* 🔹 Téléphones “moyens” (>= 390px) */
@media (min-width: 390px){
  .container{ padding: 0 20px; }
  .res-hero h1{ font-size: 26px; }
}

/* 🔹 À partir de 640px (sm) */
@media (min-width: 640px){
  .res-hero h1{ font-size: 30px; }
  .res-grid{ grid-template-columns: repeat(2,1fr); }
}

/* 🔹 Tablettes (>= 768px) */
@media (min-width: 768px){
  /* Search en 2/3 colonnes selon place : on repasse à la grille initiale */
  .res-search{
    grid-template-columns: 1.2fr 1fr 0.8fr 44px;
    max-width: 760px;
    margin-left: auto; margin-right: auto;
  }

  /* Filtres sur 3 colonnes comme défini */
  .res-inline-filters{
    grid-template-columns: 1fr 120px minmax(260px, 1fr);
  }

  /* Toolbar en ligne */
  .res-toolbar{
    flex-direction: row;
    align-items: end;
  }
}

/* 🔹 Petits laptops (>= 1024px) */
@media (min-width: 1024px){
  .res-hero h1{ font-size: 34px; }
  .res-grid{ grid-template-columns: repeat(3,1fr); }
  .pp-footer-top{ grid-template-columns: repeat(4,1fr); }
}

/* 🔹 ≥ 1280px */
@media (min-width: 1280px){
  .container{ max-width: 1200px; }
  .res-hero h1{ font-size: 36px; }
}

/* 🔹 Orientation paysage très basse (téléphones) */
@media (orientation: landscape) and (max-height: 480px){
  .res-hero{ min-height: 38vh; }
  .res-hero h1{ font-size: 22px; }
  .res-search{ margin-top: 8px; }
}

/* 🔹 Écrans à faible hauteur */
@media (max-height: 700px){
  .res-toolbar{ padding-top: 14px; }
}

/* 🔹 Safe areas (iPhone notch, etc.) */
@supports (padding: max(0px)){
  .container{
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* 🔹 Accessibilité */
@media (prefers-reduced-motion: reduce){
  .res-card{ transition: none; }
  .res-card:hover{ transform:none; box-shadow: var(--shadow-sm); }
}
