/* ==========================================================================
   TalatYai — corps de page commun à TOUT le site, calqué sur la page d'accueil.
   Chargé en dernier sur toutes les pages (voir tpl_layout.php).

   Une seule colonne pour l'en-tête, le contenu, les catégories du bas et le
   pied de page. Pour changer la largeur de tout le site d'un coup : --ty-col.
   Pour changer la taille du texte de base : --ty-base-font.
   ========================================================================== */
body.sp-site-page {
  --ty-col: min(92%, 1320px);
  --ty-base-font: 18px;
  background: #f4f6f8;
  color: #102e50;
  font-family: "Roboto Regular", "Noto Sans Thai", Arial, Tahoma, sans-serif;
  font-size: var(--ty-base-font);
  line-height: 1.5;
}
@media (max-width: 1023px) {body.sp-site-page {--ty-col: calc(100% - 36px);}}
@media (max-width: 700px)  {body.sp-site-page {--ty-col: calc(100% - 24px);}}

/* Le panneau « sp-site-surface » reprend le fond gris doux du site, et c'est
   la colonne qui fixe la largeur (comme sur l'accueil). */
body.sp-site-page main.sp-site-surface--content {
  box-sizing: border-box;
  width: var(--ty-col);
  max-width: none;
  margin-right: auto;
  margin-left: auto;
  padding-right: 0;
  padding-left: 0;
  background: #f4f6f8;
}
body.sp-site-page main.sp-site-surface--content > .container-100 > .container-100-child {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}
body.sp-site-page main.sp-site-surface--content > .container-100 > .sp-deposit-page {
  width: 100%;
  max-width: none;
}

/* En-tête, menu du compte, catégories du bas et pied de page : même colonne. */
body.sp-site-page header.header .sp-header-shell,
body.sp-site-page .footer .sp-footer-shell,
body.sp-site-page .categories .sp-category-footer,
body.sp-site-page .dashboard-menu {
  box-sizing: border-box;
  width: var(--ty-col);
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}
body.sp-site-page header.header .sp-header-shell .sp-header-main {
  width: 100%;
  max-width: none;
}
body.sp-site-page .dashboard-menu {padding-right: 0; padding-left: 0;}
body.sp-site-page .dashboard-menu ul {max-width: none;}

/* Texte courant des pages de contenu : un cran plus lisible. */
body.sp-site-page main.sp-site-surface--content :is(p, li, label, td, th, dd, dt) {
  line-height: 1.55;
}
body.sp-site-page main.sp-site-surface--content :is(input, select, textarea, button) {
  font-family: "Roboto Regular", "Noto Sans Thai", Arial, Tahoma, sans-serif;
}

/* ==========================================================================
   Même espace entre toutes les sections / catégories, sur toutes les pages.
   Pour l'ajuster : modifier --ty-section-gap.
   ========================================================================== */
body.sp-site-page {--ty-section-gap: 44px;}
@media (max-width: 700px) {body.sp-site-page {--ty-section-gap: 36px;}}

/* Accueil : catégories, annonces récentes, une section par catégorie, déjà vues.
   L'espace est toujours sous la section (plus de marge haute qui s'additionne). */
body.sp-home-page .index-container :is(.sp-home-categories, .sp-home-latest, .sp-home-ad-section, .sp-home-seen) {
  margin-top: 0;
  margin-bottom: var(--ty-section-gap);
}
body.sp-home-page .index-container .sp-home-premium-heading {
  margin-top: 0;
}
body.sp-home-page .index-container :is(.sp-home-latest, .sp-home-ad-section, .sp-home-seen) > :is(.list-premium, .sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Toutes les pages : catégories du bas de page, même rythme vertical. */
body.sp-site-page .categories .sp-category-footer {row-gap: var(--ty-section-gap);}
body.sp-site-page .categories .sp-category-footer-group {margin-bottom: var(--ty-section-gap);}
body.sp-site-page .categories .sp-category-footer-column > .sp-category-footer-group:last-child {margin-bottom: 0;}

/* ==========================================================================
   En-tête : barre de recherche plus grosse, en-tête adapté à sa hauteur.
   Identique sur toutes les pages (accueil comprise).
   Pour ajuster : --ty-header-h (hauteur de l'en-tête) et --ty-search-h (barre).
   ========================================================================== */
body.sp-site-page {--ty-header-h: 88px; --ty-search-h: 58px;}

@media (min-width: 961px) {
  body.sp-site-page header.header {height: var(--ty-header-h);}
  body.sp-site-page .header-end {height: var(--ty-header-h);}
  body.sp-site-page header.header .sp-header-shell {
    height: var(--ty-header-h);
    grid-template-rows: var(--ty-header-h);
  }
  body.sp-site-page header.header .sp-header-shell > .sp-header-main {
    display: grid;
    height: var(--ty-header-h);
    min-height: var(--ty-header-h);
    /* DOM order: logo, deposit button, search, account links, language. */
    grid-template-columns: 155px 250px minmax(220px, 1fr) max-content 55px;
    grid-template-rows: var(--ty-header-h);
    gap: clamp(16px, 1.5vw, 24px);
  }
  body.sp-site-page header.header .sp-header-main > .header-logo {grid-column: 1; grid-row: 1;}
  body.sp-site-page header.header .sp-header-main > .sp-header-deposit {grid-column: 2; grid-row: 1;}
  body.sp-site-page header.header .sp-header-main > .sp-header-search-wrap {grid-column: 3; grid-row: 1;}
  body.sp-site-page header.header .sp-header-main > .header-links {grid-column: 4; grid-row: 1;}
  body.sp-site-page header.header .sp-header-main > .header-flags {grid-column: 5; grid-row: 1;}
  body.sp-site-page header.header .sp-header-main .header-logo {width: 155px; min-width: 0;}
  body.sp-site-page header.header .sp-header-main .header-logo img {width: 150px;}

  /* La barre de recherche : même aspect partout. */
  body.sp-site-page header.header .sp-header-shell .sp-header-main .sp-header-search {
    width: 100%;
    max-width: none;
    height: var(--ty-search-h);
    border: 1px solid #cad8e5;
    border-radius: 14px;
    background: #fff;
  }
  body.sp-site-page header.header .sp-header-main > .sp-header-search-wrap {
    width: 100%;
    max-width: 500px;
    min-width: 0;
    justify-self: center;
  }
  body.sp-site-page header.header .sp-header-search input[type="search"] {
    padding: 0 20px;
    font-size: 19px;
  }
  body.sp-site-page header.header .sp-header-shell .sp-header-search button[type="submit"] {
    flex: 0 0 68px;
    align-self: stretch;
    width: 68px;
    height: 100%;
    margin: 0;
    border-radius: 0 13px 13px 0;
  }
  body.sp-site-page header.header .sp-header-shell .sp-header-search button[type="submit"] svg {
    width: 26px;
    height: 26px;
  }

  /* Le reste de l'en-tête suit : liens et bouton « Déposer » un cran plus grands. */
  body.sp-site-page header.header .sp-header-main .header-links .menu > a {font-size: 16px;}
  body.sp-site-page header.header .sp-header-main > .sp-header-deposit {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 250px;
    min-width: 0;
    min-height: 54px;
    padding: 0 12px;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
  }
}

@media (min-width: 961px) and (max-width: 1350px) {
  body.sp-site-page header.header .sp-header-shell > .sp-header-main {
    grid-template-columns: 125px 220px minmax(160px, 1fr) max-content 45px;
    gap: 10px;
  }
  body.sp-site-page header.header .sp-header-main .header-logo {width: 125px;}
  body.sp-site-page header.header .sp-header-main .header-logo img {width: 120px;}
  body.sp-site-page header.header .sp-header-main > .sp-header-deposit {width: 220px; font-size: 14px;}
}

/* Tablette / mobile : barre un peu plus haute et texte plus lisible. */
@media (max-width: 960px) {
  body.sp-site-page header.header .sp-header-shell .sp-header-main .sp-header-search {height: 48px;}
  body.sp-site-page header.header .sp-header-search input[type="search"] {font-size: 17px;}
  body.sp-site-page header.header .sp-header-shell .sp-header-search button[type="submit"] {width: 48px; height: 48px; flex-basis: 48px;}
}

/* ==========================================================================
   Accueil : le méga-menu des catégories s'ouvre sur toute la largeur de la
   colonne (même largeur que la rangée d'icônes), au lieu d'une fenêtre centrée.
   ========================================================================== */
@media (min-width: 701px) {
  body.sp-home-page .sp-home-category-mega {
    right: 0;
    left: 0;
    width: 100%;
    max-height: min(62vh, 520px);
    transform: none;
    grid-template-columns: clamp(200px, 22%, 300px) minmax(0, 1fr);
  }
  body.sp-home-page .sp-home-category-mega-content {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 26px 40px;
    padding: 30px 40px 34px;
  }
  body.sp-home-page .sp-home-category-mega-aside {padding: 30px 24px;}
}

/* ==========================================================================
   Header : Mes recherches / Favoris / compte — trois icônes identiques,
   alignées, avec un libellé foncé et plus grand (plus lisible).
   ========================================================================== */
@media (min-width: 961px) {
  body.sp-site-page header.header .sp-header-main .header-links .menu {gap: 6px; align-items: center;}
  body.sp-site-page header.header .sp-header-main .header-links .menu > :is(.ring, .selection, .connexion:not(.sp-header-login)) {
    position: relative;
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 116px;
    min-width: 116px;
    max-width: 116px;
    height: 74px;
    margin: 0;
    padding: 52px 4px 0;
    overflow: visible;
    color: #102e50;
    font: 600 16px/1.2 "Roboto Regular", "Noto Sans Thai", Arial, Tahoma, sans-serif;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
  }
  body.sp-site-page header.header .sp-header-main .header-links .menu > :is(.ring, .selection, .connexion:not(.sp-header-login)):is(:hover, :focus-visible) {
    color: #2477c9;
  }
  body.sp-site-page header.header .sp-header-main .header-links .menu > :is(.ring, .selection, .connexion:not(.sp-header-login))::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 46px;
    height: 46px;
    flex: none;
    margin: 0 0 0 -23px;
    border: 0;
    border-radius: 50%;
    background-color: #eaf3ff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 28px 28px;
    -webkit-mask: none;
    mask: none;
  }
  body.sp-site-page header.header .sp-header-main .header-links .menu > :is(.ring, .selection, .connexion:not(.sp-header-login)):is(:hover, :focus-visible)::before {
    background-color: #d9eaff;
  }
  /* Icône du compte : même bleu et même pastille que les deux autres. */
  body.sp-site-page header.header .sp-header-main .header-links .menu > .connexion:not(.sp-header-login)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232477c9' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8'/%3E%3C/svg%3E");
  }
}

/* ==========================================================================
   Cartes d'annonces (résultats de recherche) : caractéristiques en bandeau
   propre (Année · Kilométrage · Carburant · Transmission), séparées par de
   fines lignes, et pied de carte (vendeur / date) séparé du reste.
   ========================================================================== */
body.sp-site-page .sp-ad-card-specs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e1e8ef;
  border-radius: 12px;
  background: #f6f9fc;
}
body.sp-site-page .sp-ad-card-specs > div {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 16px 12px;
  border-left: 1px solid #e1e8ef;
}
body.sp-site-page .sp-ad-card-specs > div:first-child {border-left: 0;}
body.sp-site-page .sp-ad-card-specs dt {
  margin: 0 0 4px;
  color: #6b7b8d;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}
body.sp-site-page .sp-ad-card-specs dd {
  margin: 0;
  color: #102e50;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
body.sp-site-page .sp-ad-card-bottom {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf1f5;
}
@media (max-width: 700px) {
  body.sp-site-page .sp-ad-card-specs {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));}
  body.sp-site-page .sp-ad-card-specs > div:nth-child(odd) {border-left: 0;}
  body.sp-site-page .sp-ad-card-specs > div:nth-child(n+3) {border-top: 1px solid #e1e8ef;}
  body.sp-site-page .sp-ad-card-specs > div {padding: 10px 12px;}
}

/* Alignement final, typographie lisible et orange immuable. */
body.sp-site-page {
  --ty-col: min(94%, 1400px);
  --talatyai-orange-hover: #f58220;
  --ty-header-orange-dark: #f58220;
}

body.sp-site-page main.sp-site-surface--content > .container-100,
body.sp-site-page main.sp-site-surface--content :is(.ad-page-container, .search-results-container) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

@media (min-width: 931px) {
  body.sp-site-page .ad-page-parent-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    align-items: start;
    gap: 32px;
  }
  body.sp-site-page .ad-page-parent-container > :is(.ad-page-large-container, .ad-page-small-container) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  body.sp-site-page .ad-page-small-container {
    padding-top: 60px;
  }
}

@media (min-width: 961px) {
  body.sp-site-page header.header .sp-header-search input[type="search"] {
    color: #17324d;
    font-size: 19px;
    font-weight: 600;
  }
  body.sp-site-page header.header .sp-header-search input[type="search"]::placeholder {
    color: #526b82;
    opacity: 1;
  }
  body.sp-site-page header.header .sp-header-main .header-links .menu > a,
  body.sp-site-page.sp-modern-header header.header .sp-header-main .header-links .connexion.sp-header-login,
  body.sp-site-page.sp-modern-header header.header .sp-header-main .header-links .connexion.sp-header-login:is(:visited, :hover, :focus, :active) {
    font-size: 18px;
    font-weight: 700;
  }
  body.sp-site-page header.header .sp-header-main > .sp-header-deposit {
    box-sizing: border-box;
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    min-height: 54px;
    padding: 0 12px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
  }
}

body.sp-site-page .search-results-container .listing-infos.sp-listing-summary h1 {
  color: #102e50;
  font: 700 31px/1.25 "Roboto Regular", "Noto Sans Thai", Arial, Tahoma, sans-serif;
  letter-spacing: -.025em;
}
body.sp-site-page .search-results-container .sp-listing-summary .sp-listing-summary-row {
  gap: 12px;
  padding: 14px;
}
body.sp-site-page .sp-listing-summary-search {
  height: 52px;
}
body.sp-site-page .sp-listing-summary-search > input[type="search"] {
  height: 48px;
  font-size: 19px;
  font-weight: 500;
}
body.sp-site-page .search-results-container .sp-listing-summary :is(.sp-location-trigger, .sp-modern-select-trigger, .sp-listing-summary-save) {
  height: 52px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 600;
}
body.sp-site-page .search-results-container .sp-listing-summary .sp-listing-summary-filter,
body.sp-site-page .search-results-container .sp-listing-summary .sp-listing-summary-filter:is(:hover, :focus, :active) {
  font-size: 18px;
  font-weight: 700;
}

body.sp-site-page header.header .sp-header-main :is(.sp-header-deposit, .sp-mobile-deposit),
body.sp-site-page header.header .sp-header-main :is(.sp-header-deposit, .sp-mobile-deposit):is(:hover, :focus, :active),
body.sp-site-page header.header .sp-header-search button[type="submit"],
body.sp-site-page header.header .sp-header-search button[type="submit"]:is(:hover, :focus, :active),
body.sp-site-page :is(.sp-account-orange, .sp-visual-options-submit),
body.sp-site-page :is(.sp-account-orange, .sp-visual-options-submit):is(:hover, :focus, :active) {
  border-color: #f58220 !important;
  background-color: #f58220 !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 930px) {
  body.sp-site-page .ad-page-small-container {padding-top: 0;}
}
@media (max-width: 700px) {
  body.sp-site-page {--ty-col: calc(100% - 24px);}
  body.sp-site-page .search-results-container .listing-infos.sp-listing-summary h1 {font-size: 25px;}
}

/* Images toujours nettes au survol. */
body.sp-site-page .sp-mosaic-tile:hover img,
body.sp-site-page .sp-mosaic-tile:focus-visible img,
body.sp-home-page .index-container .sp-home-category-card:is(:hover, :focus-visible) > img,
body.sp-home-page .index-container .background-ads-premium:is(:hover, :focus-visible) img {
  filter: none !important;
  opacity: 1 !important;
}

/* Annonces d'accueil : vignettes type « Pour vous », cinq par ligne. */
@media (min-width: 961px) {
  body.sp-home-page .index-container .list-premium:is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards),
  body.sp-home-page .index-container .sp-home-ad-section .list-premium,
  body.sp-home-page .index-container > .list-premium {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
  }
  body.sp-home-page .index-container .sp-home-ad-section .list-premium > a:nth-child(n+5),
  body.sp-home-page .index-container > .list-premium > a:nth-child(n+5) {display: block;}
  body.sp-home-page .index-container .list-premium > a.background-ads-premium > .sp-premium-photo,
  body.sp-home-page .index-container .list-premium > a.background-ads-premium > .sp-premium-photo > img,
  body.sp-home-page .index-container .list-premium > a.background-ads-premium > img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5 !important;
    object-fit: cover;
  }
}

/* Filtres au-dessus des vignettes : même gabarit que « Voir tout ». */
body.sp-home-page .sp-home-latest-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
body.sp-home-page .sp-home-latest-filters a,
body.sp-home-page .sp-home-latest-filters a.sp-home-latest-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 46px;
  margin-left: 0;
  padding: 0 18px;
  border: 1.5px solid #2f80c3;
  border-radius: 10px;
  background: #fff;
  color: #2477c9;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
body.sp-home-page .sp-home-latest-filters a.is-active,
body.sp-home-page .sp-home-latest-filters a.is-active:is(:hover, :focus, :active) {
  border-color: #2f80c3;
  background: #2f80c3;
  color: #fff;
}
body.sp-home-page .sp-home-latest-filters a:not(.is-active):is(:hover, :focus, :active) {
  border-color: #2f80c3;
  background: #fff;
  color: #2477c9;
}
@media (max-width: 700px) {
  body.sp-home-page .sp-home-latest-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  body.sp-home-page .sp-home-latest-filters {
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
  }
  body.sp-home-page .sp-home-latest-filters a,
  body.sp-home-page .sp-home-latest-filters a.sp-home-latest-all {
    display: inline-flex !important;
    min-height: 44px;
    padding: 0 15px;
    font-size: 17px;
  }
}
@media (min-width: 1181px) {
  body.sp-home-page .index-container .sp-home-categories-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
  }
}

/* Titres des rangées et lien « Voir tout » harmonisés. */
body.sp-home-page .index-container .sp-home-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}
body.sp-home-page .index-container .sp-home-section-heading h2,
body.sp-home-page .index-container .sp-home-section-heading h2 a {
  margin: 0;
  color: #102e50;
  font: 700 32px/1.2 "Roboto Regular", "Noto Sans Thai", Arial, Tahoma, sans-serif;
  letter-spacing: -.02em;
  text-decoration: none;
}
body.sp-home-page .index-container .sp-home-section-heading > a,
body.sp-home-page .index-container .sp-home-latest-all {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 46px;
  margin-left: auto;
  padding: 0 18px;
  border: 1.5px solid #2f80c3;
  border-radius: 10px;
  background: #fff;
  color: #2477c9;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
body.sp-home-page .index-container .sp-home-section-heading > a:is(:hover, :focus, :active),
body.sp-home-page .index-container .sp-home-latest-all:is(:hover, :focus, :active) {
  border-color: #2f80c3;
  background: #fff;
  color: #2477c9;
}
body.sp-home-page .index-container .sp-home-section-heading > a span,
body.sp-home-page .index-container .sp-home-latest-all span {
  margin-left: 8px;
  font-size: 20px;
  line-height: 1;
}
@media (max-width: 700px) {
  body.sp-home-page .index-container .sp-home-section-heading {
    gap: 12px;
    margin-bottom: 16px;
  }
  body.sp-home-page .index-container .sp-home-section-heading h2,
  body.sp-home-page .index-container .sp-home-section-heading h2 a {font-size: 25px;}
  body.sp-home-page .index-container .sp-home-section-heading > a,
  body.sp-home-page .index-container .sp-home-latest-all {
    min-height: 44px;
    padding: 0 15px;
    font-size: 17px;
  }
}

/* Lisibilité de l'accueil : catégories, filtres et textes sous les vignettes. */
body.sp-home-page .sp-home-latest-filters a,
body.sp-home-page .sp-home-latest-filters a.sp-home-latest-all {
  min-height: 50px;
  padding-right: 21px;
  padding-left: 21px;
  font-size: 20px;
}
body.sp-home-page .index-container :is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) .sp-premium-title {
  font-size: 21px;
  line-height: 1.35;
}
body.sp-home-page .index-container :is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) .sp-premium-price {
  font-size: 24px;
  line-height: 1.25;
}
body.sp-home-page .index-container :is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) .sp-premium-location {
  font-size: 17px;
  line-height: 1.4;
}
body.sp-home-page .sp-home-featured-category > span,
body.sp-home-page .index-container .sp-home-category-card > span {
  font-size: 19px;
}
body.sp-home-page .sp-home-category-shortcut-link {font-size: 18px;}
body.sp-home-page .sp-home-category-mega-group h3 {font-size: 20px;}
body.sp-home-page .sp-home-category-mega-group li a {font-size: 17px;}
body.sp-home-page .sp-home-category-mega-all {font-size: 16px;}

/* Short pages: keep the footer at the viewport bottom instead of leaving a white tail. */
body.sp-site-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
body.sp-site-page > main.sp-site-surface--content {flex: 1 0 auto;}
body.sp-site-page > footer.footer {flex: 0 0 auto; margin-top: auto;}

/* Keep header geometry fixed during hover, focus and click. */
body.sp-site-page header.header .sp-header-main :is(.header-logo a, .sp-header-login, .sp-header-deposit, .sp-header-search, .sp-header-search button, .header-flags > div) {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: none;
  transform: none;
  transition: none;
}
body.sp-site-page header.header .sp-header-main :is(.header-logo a, .sp-header-login, .sp-header-deposit, .sp-header-search, .sp-header-search button, .header-flags > div):is(:hover, :focus, :focus-within, :active) {
  animation: none;
  transform: none;
  transition: none;
}
@media (min-width: 961px) {
  html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
  }
  /* Une publicité de fond ne doit jamais devenir le conteneur du header. */
  body.sp-site-page #background-block > header.header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: none;
  }
  body.sp-site-page #background-block > header.header .sp-header-shell > .sp-header-main {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }
  body.sp-site-page #background-block > .header-end {height: var(--ty-header-h);}
  body.sp-site-page header.header .sp-header-main .header-links .connexion.sp-header-login,
  body.sp-site-page header.header .sp-header-main .header-links .connexion.sp-header-login:is(:visited, :hover, :focus, :active) {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
  }
}

/* Keep every header control visible on compact desktop widths. */
@media (min-width: 961px) and (max-width: 1300px) {
  body.sp-site-page header.header .sp-header-shell {width: calc(100% - 32px);}
  body.sp-site-page header.header .sp-header-shell > .sp-header-main {
    grid-template-columns: 125px 220px minmax(140px, 1fr) max-content 48px;
    gap: 12px;
  }
  body.sp-site-page header.header .sp-header-main .header-logo {width: 125px;}
  body.sp-site-page header.header .sp-header-main .header-logo img {width: 120px;}
  body.sp-site-page header.header .sp-header-main .header-links .menu > :is(.ring, .selection, .connexion:not(.sp-header-login), .deconnexion) {
    width: 86px;
    min-width: 86px;
    max-width: 86px;
    font-size: 15px;
  }
  body.sp-site-page header.header .sp-header-main .header-links .menu > .connexion.sp-header-login {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 15px;
  }
  body.sp-site-page header.header .sp-header-main > .sp-header-deposit {
    box-sizing: border-box;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    justify-content: center;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }
  body.sp-site-page header.header .sp-header-main .header-flags {flex-basis: 48px;}
}

@media (max-width: 700px) {
  body.sp-home-page .sp-home-latest-filters a,
  body.sp-home-page .sp-home-latest-filters a.sp-home-latest-all {
    min-height: 46px;
    padding-right: 17px;
    padding-left: 17px;
    font-size: 18px;
  }
  body.sp-home-page .index-container :is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) .sp-premium-title {font-size: 18px;}
  body.sp-home-page .index-container :is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) .sp-premium-price {font-size: 21px;}
  body.sp-home-page .index-container :is(.sp-home-latest-cards, .sp-home-category-ads, .sp-home-seen-cards) .sp-premium-location {font-size: 16px;}
  body.sp-home-page .sp-home-featured-category > span,
  body.sp-home-page .index-container .sp-home-category-card > span {font-size: 16px;}
  body.sp-home-page .sp-home-category-shortcut-link {font-size: 16px;}
}
