.ayn-elem-search,
.ayn-elem-listings {
  --ayn-elem-accent: var(--ayn-primary);
}

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

.ayn-elem-search__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.ayn-elem-search__field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--ayn-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--ayn-shadow-md);
}

.ayn-elem-search__icon {
  width: 22px;
  height: 22px;
  color: var(--ayn-slate-600);
  flex-shrink: 0;
}

.ayn-elem-search__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ayn-elem-search__field input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--ayn-text);
  outline: none;
}
.ayn-elem-search__field input:focus-visible {
  outline: 2px solid var(--ayn-primary);
  outline-offset: 2px;
}

.ayn-elem-search__field input::placeholder {
  color: var(--ayn-text-muted);
}

.ayn-elem-search__submit {
  border: none;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ayn-elem-accent);
  box-shadow: var(--ayn-shadow-lg);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ayn-elem-search__submit-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.ayn-elem-search__submit-icon svg {
  width: 100%;
  height: 100%;
}

.ayn-elem-search__submit-text {
  display: inline-flex;
}

.ayn-elem-search__submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--ayn-shadow-xl);
}

.ayn-elem-search__submit:focus-visible,
.ayn-elem-search__field:focus-within {
  outline: 2px solid var(--ayn-focus);
  outline-offset: 2px;
}

.ayn-elem-search--horizontal .ayn-elem-search__form {
  display: flex;
  gap: 0;
  align-items: center;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid var(--ayn-border);
  background: #ffffff;
  box-shadow: var(--ayn-shadow-lg);
}

.ayn-elem-search--horizontal .ayn-elem-search__field {
  flex: 1;
  min-width: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 12px 18px;
  background: transparent;
}

.ayn-elem-search--horizontal .ayn-elem-search__field + .ayn-elem-search__field {
  border-left: 1px solid var(--ayn-border);
}

.ayn-elem-search--horizontal .ayn-elem-search__submit {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 0;
  margin-left: 8px;
}

.ayn-elem-search--horizontal .ayn-elem-search__submit-text {
  display: none;
}

.ayn-elem-search--vertical .ayn-elem-search__form {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--ayn-border);
  background: #ffffff;
  box-shadow: var(--ayn-shadow-xl);
}

.ayn-elem-search--vertical .ayn-elem-search__submit {
  align-self: flex-start;
  padding: 12px 26px;
  border-radius: 12px;
}

.ayn-elem-search--vertical .ayn-elem-search__submit-icon {
  display: none;
}

.ayn-elem-listings {
  display: block;
}

.ayn-elem-grid {
  display: grid;
  grid-template-columns: repeat(var(--ayn-elem-columns, 3), minmax(0, 1fr));
  gap: 24px;
}

.ayn-elem-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8f9 100%);
  box-shadow: var(--ayn-shadow-lg);
  animation: aynElemFadeUp 0.35s ease both;
}

.ayn-elem-card__media {
  position: relative;
  display: block;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e6ebee;
}

.ayn-elem-card__media::before {
  content: "";
  display: block;
  padding-top: 75%;
}

@supports (aspect-ratio: 4 / 3) {
  .ayn-elem-card__media::before {
    display: none;
  }
}

.ayn-elem-card__image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: inherit;
  display: block;
  position: absolute;
  inset: 0;
}

.ayn-elem-card__image--placeholder {
  background: #e6ebee;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
  position: absolute;
  inset: 0;
}

.ayn-elem-card__fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--ayn-shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ayn-slate-600);
}

.ayn-elem-card__fav svg {
  width: 18px;
  height: 18px;
}


.ayn-elem-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ayn-elem-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ayn-elem-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ayn-text);
  line-height: 1.35;
}

.ayn-elem-card__title-text {
  display: inline-block;
  max-width: 100%;
}

.ayn-elem-card__title-text a {
  color: inherit;
  text-decoration: none;
}

.ayn-elem-card__price {
  font-size: 20px;
  font-weight: 700;
  color: var(--ayn-text);
  white-space: nowrap;
}

.ayn-elem-card__price-unit {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ayn-text-muted);
}

.ayn-elem-card__location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ayn-text-muted);
}

.ayn-elem-card__location-icon {
  width: 16px;
  height: 16px;
  color: var(--ayn-elem-accent);
  display: inline-flex;
}

.ayn-elem-card__location-icon svg {
  width: 100%;
  height: 100%;
}

.ayn-elem-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ayn-elem-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f3f5;
  border: 1px solid var(--ayn-border);
  font-size: 12px;
  color: #1e2a2d;
}

.ayn-elem-chip svg {
  width: 16px;
  height: 16px;
}

.ayn-elem-card__actions {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ayn-elem-card__cta {
  flex: 1;
  text-align: center;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ayn-elem-accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--ayn-shadow-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ayn-elem-card__cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--ayn-shadow-xl);
}

.ayn-elem-empty {
  padding: 24px;
  border-radius: 16px;
  background: #f4f6f7;
  color: var(--ayn-text-subtle);
  font-size: 14px;
}

.ayn-elem-empty__reset {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--ayn-primary-soft);
  background: #fff;
  color: var(--ayn-primary);
  font-weight: 600;
  cursor: pointer;
}

.ayn-elem-similar--carousel .ayn-elem-grid {
  grid-template-columns: unset;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  overflow-x: auto;
  padding-bottom: 6px;
}

.ayn-elem-similar--carousel .ayn-elem-grid::-webkit-scrollbar {
  height: 6px;
}

.ayn-elem-similar--carousel .ayn-elem-grid::-webkit-scrollbar-thumb {
  background: var(--ayn-slate-300);
  border-radius: 999px;
}

.ayn-elem-kpi {
  display: grid;
  gap: 14px;
}

.ayn-elem-kpi--grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ayn-elem-kpi--inline {
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
}

.ayn-elem-kpi__item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--ayn-border);
  background: #ffffff;
  box-shadow: var(--ayn-shadow-md);
}

.ayn-elem-kpi__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ayn-text);
}

.ayn-elem-kpi__label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ayn-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ayn-elem-contact {
  display: flex;
}

.ayn-elem-contact__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--ayn-elem-accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--ayn-shadow-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ayn-elem-contact__btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--ayn-shadow-xl);
}

.ayn-elem-pagination {
  margin-top: 24px;
}

.ayn-elem-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ayn-elem-pagination a,
.ayn-elem-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--ayn-border);
  text-decoration: none;
  color: var(--ayn-text-subtle);
  font-size: 13px;
}

.ayn-elem-pagination .current {
  background: var(--ayn-elem-accent);
  color: #ffffff;
  border-color: transparent;
}

@media (max-width: 1024px) {
  .ayn-elem-search__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ayn-elem-search--horizontal .ayn-elem-search__form {
    flex-direction: column;
    align-items: stretch;
    border-radius: 24px;
    padding: 12px;
  }

  .ayn-elem-search--horizontal .ayn-elem-search__field + .ayn-elem-search__field {
    border-left: none;
    border-top: 1px solid var(--ayn-border);
  }

  .ayn-elem-search--horizontal .ayn-elem-search__submit {
    width: 100%;
    height: auto;
    border-radius: 16px;
    margin-left: 0;
    padding: 12px 18px;
  }

  .ayn-elem-search--horizontal .ayn-elem-search__submit-text {
    display: inline-flex;
  }

  .ayn-elem-search--horizontal .ayn-elem-search__submit-icon {
    display: none;
  }

  .ayn-elem-grid {
    grid-template-columns: repeat(var(--ayn-elem-columns-md, 2), minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ayn-elem-search__form {
    grid-template-columns: 1fr;
  }

  .ayn-elem-search__submit {
    width: 100%;
  }

  .ayn-elem-search--horizontal .ayn-elem-search__form {
    padding: 12px;
  }

  .ayn-elem-grid {
    grid-template-columns: repeat(var(--ayn-elem-columns-sm, 1), minmax(0, 1fr));
  }

  .ayn-elem-card {
    border-radius: 22px;
    padding: 16px;
  }
}

@keyframes aynElemFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ayn-elem-card,
  .ayn-elem-search__submit,
  .ayn-elem-card__cta {
    animation: none;
    transition: none;
  }
}

.ayn-elem-description {
  color: var(--ayn-text);
}

.ayn-elem-description__content {
  font-size: 15px;
  line-height: 1.7;
  color: inherit;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ayn-elem-description__content > *:first-child {
  margin-top: 0;
}

.ayn-elem-description__content > *:last-child {
  margin-bottom: 0;
}

.ayn-elem-description.is-expanded .ayn-elem-description__content {
  -webkit-line-clamp: initial;
  max-height: none;
}

.ayn-elem-description__toggle {
  margin-top: 10px;
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ayn-elem-accent);
  cursor: pointer;
}

.ayn-elem-description__toggle:focus-visible {
  outline: 2px solid var(--ayn-focus);
  outline-offset: 3px;
}

.ayn-elem-search.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.ayn-elem-context-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ayn-primary-soft);
  background: var(--ayn-primary-softer);
  color: var(--ayn-text);
  font-size: 13px;
}

.ayn-elem-map {
  width: 100%;
}

.ayn-listings-map {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--ayn-border);
  overflow: hidden;
  background: #f4f6f7;
}

.ayn-elem-map-placeholder {
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  border: 1px dashed var(--ayn-border);
  background: #f4f6f7;
  color: var(--ayn-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 16px;
  text-align: center;
}

.ayn-elem-map-popup {
  display: flex;
  flex-direction: column;
  max-width: 260px;
  min-width: 240px;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--ayn-shadow-lg);
}

.ayn-elem-map-popup__image {
  width: 100%;
  overflow: hidden;
}

.ayn-elem-map-popup__image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.ayn-elem-map-popup__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}

.ayn-elem-map-popup__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ayn-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ayn-elem-accent);
}

.ayn-elem-map-popup__location {
  font-size: 13px;
  color: var(--ayn-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ayn-elem-map-popup__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ayn-elem-map-popup__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ayn-text);
}

.ayn-elem-map-popup__cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--ayn-elem-accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.ayn-elem-map .leaflet-popup-content {
  margin: 0;
  width: 260px;
}

.ayn-elem-map .leaflet-popup-content-wrapper {
  border-radius: 16px;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
}

.ayn-elem-map .mapboxgl-popup-content {
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}

.ayn-elem-map .mapboxgl-popup-tip,
.ayn-elem-map .leaflet-popup-tip {
  box-shadow: none;
}

.ayn-elem-map .mapboxgl-popup-close-button,
.ayn-elem-map .leaflet-popup-close-button {
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ayn-text);
  font-size: 16px;
  right: 8px;
  top: 8px;
}

/* ======================================
   Listings Map Page (Nos logements)
====================================== */
