:root {
  --blue: #1c1cc6;
  --blue-dark: #101078;
  --green: #01ffaa;
  --ink: #060624;
  --white: #ffffff;
  --lavender: #f4f4ff;
  --section-bg: #ededfb;
  --line: #dfdffc;
  --muted: #696980;
  --shadow: 0 22px 58px rgba(20, 20, 105, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  overflow-y: hidden;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--section-bg);
  color: var(--ink);
  font-family: "Poppins", Arial, sans-serif;
  overflow-y: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--section-bg);
}

.section-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.section-background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.search-hero {
  position: relative;
  z-index: 1;
  isolation: isolate;
  padding: clamp(58px, 7vw, 92px) 24px 18px;
  background: transparent;
}

.search-hero::before {
  display: none;
}

.ambient {
  display: none;
}

.ambient-one {
  width: 270px;
  height: 270px;
  top: -150px;
  left: -90px;
  border: 46px solid rgba(28, 28, 198, 0.09);
}

.ambient-two {
  width: 220px;
  height: 220px;
  right: -115px;
  bottom: 20px;
  border: 42px solid rgba(1, 255, 170, 0.17);
}

.hero-content,
.results-section {
  margin: 0 auto;
}

.hero-content {
  width: min(1180px, 100%);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: 10px;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(28, 28, 198, 0.2);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

h1 {
  max-width: none;
  margin: 22px auto 12px;
  color: var(--blue);
  font-size: 35px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

h1 span {
  color: var(--green);
}

.hero-copy {
  max-width: none;
  margin: 0 auto;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  white-space: nowrap;
}

.hero-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.search-card {
  position: relative;
  max-width: 970px;
  margin: 34px auto 0;
  padding: 16px;
  border: 1px solid rgba(28, 28, 198, 0.1);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.mode-switch {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 13px;
  padding: 4px;
  width: fit-content;
  max-width: calc(100% - 16px);
  border-radius: 12px;
  background: var(--lavender);
}

.mode-button {
  min-height: 36px;
  padding: 7px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #62627c;
  font-size: 13px;
  font-weight: 600;
  transition: 180ms ease;
  white-space: nowrap;
}

.mode-button:hover,
.mode-button:focus-visible {
  color: var(--blue);
  outline: none;
}

.mode-button.is-active {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 5px 13px rgba(28, 28, 198, 0.1);
}

.search-form {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px 8px 8px 23px;
  border: 2px solid var(--blue);
  border-radius: 18px;
  background: var(--white);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.search-form:focus-within {
  border-color: #00c985;
  box-shadow: 0 0 0 5px rgba(1, 255, 170, 0.13);
}

.search-icon {
  width: 22px;
  height: 22px;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 3px;
  margin: 17px 0 0 -2px;
  border-radius: 4px;
  background: var(--blue);
  transform: rotate(45deg);
  transform-origin: left center;
}

#searchInput {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

#searchInput::placeholder {
  color: #9292a5;
  opacity: 1;
}

#searchInput::-webkit-search-cancel-button {
  display: none;
}

.radius-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 5px 8px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--lavender);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.radius-picker[hidden] {
  display: none;
}

.radius-picker select {
  min-width: 72px;
  padding: 4px 24px 4px 7px;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: var(--white);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.clear-button {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--blue);
  font-size: 23px;
  line-height: 1;
}

.clear-button.is-visible {
  display: grid;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 52px;
  padding: 12px 20px;
  border: 2px solid var(--blue);
  border-radius: 13px;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  transition: 180ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: var(--white);
  color: var(--blue);
  outline: none;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 22px 50px rgba(6, 6, 36, 0.15);
  text-align: left;
}

.suggestion {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.suggestion:hover,
.suggestion.is-active {
  background: var(--lavender);
}

.suggestion-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #00b878);
  color: var(--white);
  font-size: 17px;
  font-weight: 700;
}

.suggestion-main {
  min-width: 0;
}

.suggestion-main strong,
.suggestion-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-main strong {
  color: var(--ink);
  font-size: 14px;
}

.suggestion-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.suggestion-type {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.results-section {
  position: relative;
  z-index: 1;
  width: min(1680px, 100%);
  padding: 20px 24px 48px;
  background: transparent;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.results-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.results-heading h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 35px);
  line-height: 1.2;
}

#resultsMeta {
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  gap: 14px;
  padding: 2px;
}

.location-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 178px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(20, 20, 105, 0.08);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.location-card::before {
  content: "";
  position: absolute;
  width: 115px;
  height: 115px;
  right: -62px;
  top: -57px;
  border: 22px solid rgba(1, 255, 170, 0.18);
  border-radius: 50%;
}

.location-card:hover {
  transform: translateY(-5px);
  border-color: rgba(28, 28, 198, 0.27);
  box-shadow: 0 22px 46px rgba(20, 20, 105, 0.14);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.location-card h3 {
  margin: 4px 0 7px;
  color: var(--blue);
  font-size: 17px;
  line-height: 1.2;
}

.location-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.location-line + .location-line {
  margin-top: 3px;
}

.location-type {
  margin: 9px 0 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.line-icon {
  flex: 0 0 auto;
  color: #00ad74;
  font-weight: 700;
}

.distance-value {
  color: var(--blue);
  font-weight: 700;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.location-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--blue);
  border-radius: 9px;
  background: var(--blue);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: 180ms ease;
}

.location-link:hover,
.location-link:focus-visible {
  background: var(--white);
  color: var(--blue);
  text-decoration: none;
  outline: none;
}

.empty-state {
  padding: 55px 24px;
  border: 1px dashed #c9c9f5;
  border-radius: 23px;
  background: var(--lavender);
  text-align: center;
}

.empty-state > span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 15px;
  border-radius: 16px;
  background: var(--blue);
  color: var(--green);
  font-size: 28px;
}

.empty-state h3 {
  margin: 0;
  color: var(--blue);
  font-size: 23px;
}

.empty-state p {
  margin: 8px 0 19px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state button {
  min-height: 44px;
  padding: 9px 16px;
  border: 2px solid var(--blue);
  border-radius: 11px;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
}

.radius-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.radius-note span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--blue);
  font-weight: 700;
}

.page-shell.has-results .results-section {
  padding: 8px 24px 0;
}

/* État intermédiaire fiable dans l'iframe Zama : les proportions du titre et
   du badge restent intactes, seuls les espaces verticaux sont resserrés. */
.page-shell:is(.has-results, .has-suggestions) .search-hero {
  padding: 16px 24px 8px;
}

.page-shell:is(.has-results, .has-suggestions) h1 {
  margin-top: 10px;
  margin-bottom: 5px;
  font-size: 35px;
}

.page-shell:is(.has-results, .has-suggestions) .hero-copy {
  font-size: 14px;
  line-height: 1.45;
}

.page-shell:is(.has-results, .has-suggestions) .search-card {
  margin-top: 13px;
  padding: 10px;
  border-radius: 21px;
  box-shadow: 0 13px 32px rgba(20, 20, 105, 0.1);
}

.page-shell:is(.has-results, .has-suggestions) .mode-switch {
  margin-bottom: 7px;
}

.page-shell:is(.has-results, .has-suggestions) .search-form {
  min-height: 54px;
  padding-block: 4px;
}

.page-shell:is(.has-results, .has-suggestions) .submit-button {
  min-height: 44px;
  padding-block: 8px;
}

.page-shell.has-results .results-heading {
  align-items: center;
  margin-bottom: 6px;
}

.page-shell.has-suggestions .suggestions {
  max-height: 128px;
}

.page-shell.has-results .results-kicker {
  font-size: 9px;
}

.page-shell.has-results .results-heading h2 {
  margin-top: 1px;
  font-size: 20px;
}

.page-shell.has-results #resultsMeta {
  font-size: 11px;
}

.page-shell.has-results .results-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.page-shell.has-results .results-grid::-webkit-scrollbar {
  display: none;
}

.page-shell.has-results .location-card {
  flex: 0 0 clamp(205px, 15.5vw, 250px);
  max-width: none;
  min-height: 132px;
  padding: 9px;
  border-radius: 14px;
  scroll-snap-align: start;
}

.results-carousel {
  position: relative;
}

.results-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(28, 28, 198, 0.22);
  color: var(--white);
  font-size: 27px;
  line-height: 1;
  transform: translateY(-50%);
}

.results-arrow-prev { left: -20px; }
.results-arrow-next { right: -20px; }
.results-arrow:disabled { opacity: 0.35; cursor: default; }
.results-arrow[hidden] { display: none; }

.page-shell.has-results .product-badge {
  min-height: 21px;
  padding: 3px 7px;
  font-size: 8px;
}

.page-shell.has-results .location-card h3 {
  margin: 2px 0 4px;
  font-size: 14px;
}

.page-shell.has-results .location-type {
  margin-top: 5px;
  font-size: 9px;
}

.page-shell.has-results .location-line {
  font-size: 10px;
}

.page-shell.has-results .card-footer {
  padding-top: 7px;
}

.page-shell.has-results .location-link {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 10px;
}

.page-shell.has-results .radius-note {
  display: none;
}

.page-shell.has-results .empty-state {
  padding: 12px 20px;
}

.page-shell.has-results .empty-state > span {
  display: none;
}

.page-shell.has-results .empty-state h3 {
  font-size: 18px;
}

.page-shell.has-results .empty-state p {
  margin: 3px 0 8px;
  font-size: 11px;
}

.page-shell.has-results .empty-state button {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 11px;
}

@media (max-width: 900px) {
  .hero-copy {
    font-size: 14px;
  }

  .mode-switch {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mode-switch::-webkit-scrollbar {
    display: none;
  }

  .results-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 270px);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .results-grid::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 660px) {
  .search-hero {
    padding-inline: 16px;
  }

  .search-card {
    padding: 10px;
    border-radius: 20px;
  }

  h1 {
    font-size: 28px;
    white-space: normal;
  }

  .hero-copy {
    font-size: 15px;
    line-height: 1.65;
    white-space: normal;
  }

  .mode-switch {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
  }

  .mode-button {
    flex: 0 0 auto;
    padding-inline: 12px;
    font-size: 11px;
  }

  .search-form {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 62px;
    padding: 7px 9px 7px 17px;
    gap: 9px;
  }

  #searchInput {
    font-size: 14px;
  }

  .submit-button {
    width: 47px;
    min-height: 46px;
    padding: 0;
  }

  .submit-button span:first-child {
    display: none;
  }

  .clear-button {
    position: absolute;
    right: 62px;
  }

  .radius-picker {
    gap: 4px;
    padding-inline: 7px;
  }

  .radius-picker > span {
    display: none;
  }

  .radius-picker select {
    min-width: 66px;
    padding-left: 5px;
  }

  .results-section {
    padding-inline: 16px;
  }

  .results-heading {
    display: block;
  }

  #resultsMeta {
    margin-top: 8px;
  }

  .results-grid {
    grid-template-columns: none;
    grid-auto-columns: minmax(220px, 82vw);
  }

  .location-card {
    min-height: 178px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
