.browseitem-highlighted-immobilien {
  background-color: rgb(255 247 237);
}

.page-grid {
  width: 100%;
  overflow-x: clip;
}

.site-base--left-banner,
.site-base--right-banner {
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 1280px) {
  .site-base--left-banner,
  .site-base--right-banner {
    min-height: 600px;
  }
}

@media (max-width: 1279px) {
  .site-base--left-banner,
  .site-base--right-banner {
    width: 0;
    min-height: 0;
    padding: 0 !important;
    visibility: hidden;
  }

  .page-grid {
    grid-template-columns: 0 minmax(0, 1fr) 0 !important;
  }
}

@media (max-width: 969px) {
  .page-grid {
    display: block !important;
  }

  .site-base--left-banner,
  .site-base--right-banner {
    display: none;
  }

  #main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  header[data-testid="header"] .header-top-inner,
  [data-testid="header-bottom"] > .header-bottom-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 970px) {
  #homepage-main {
    width: 700px;
    max-width: 100%;
  }
}

.side-ad-sticky {
  position: sticky;
  top: 1rem;
  width: 200px;
}

[data-testid="search-form"] svg {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0;
}

[data-testid="keywords-section"] svg,
[data-testid="location-section"] svg {
  width: 16px !important;
  height: 16px !important;
}

details summary {
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

.auth-area {
  position: relative;
}

.auth-buttons {
  position: relative;
}

#login-overlay.login-popup {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 3000;
  width: 400px;
}

#login-overlay.login-popup::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 44px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid #d8d8d8;
  border-top: 1px solid #d8d8d8;
  transform: rotate(45deg);
}

#login-overlay.hidden {
  display: none;
}

.login-popup-close {
  border: none;
  background: transparent;
  color: #555;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
}

header[data-testid="header"] {
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

#footer {
  margin-left: auto;
  margin-right: auto;
}

.gallery-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow: hidden;
}

.gallery-row .gallery-item {
  flex: 0 0 160px;
}

.idealo-top {
  display: flex;
  gap: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  min-height: 210px;
  overflow: hidden;
}

.idealo-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111;
  padding: 10px 12px;
  text-decoration: none;
}

.idealo-card--top {
  flex: 1;
  min-width: 0;
  border-right: 1px solid #efefef;
}

.idealo-card--top:last-child {
  border-right: none;
}

.idealo-card--side {
  border: 1px solid #e8e8e8;
  margin-bottom: 14px;
}

.idealo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 18px;
}

.idealo-ad-badge {
  font-size: 11px;
  color: #9a9a9a;
  white-space: nowrap;
}

.idealo-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  border: 1px solid #c8c8c8;
  border-radius: 50%;
  font-size: 8px;
  font-style: italic;
  margin-left: 2px;
  color: #888;
}

.idealo-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.idealo-card--top .idealo-card-image {
  height: 95px;
}

.idealo-card--side .idealo-card-image {
  height: 150px;
}

.idealo-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.idealo-card-text {
  min-width: 0;
}

.idealo-title {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.35;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idealo-price {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.idealo-shipping {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgb(50 105 22);
}

.idealo-neu {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 5px;
  border-radius: 2px;
  background: #fff3e0;
  color: #e65100;
  font-size: 10px;
  font-weight: 700;
}

/* Responsive layout — mirrors kleinanzeigen breakpoints (640 / 768 / 970 / 1280) */

body {
  overflow-x: clip;
}

header[data-testid="header"],
#footer {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 970px) {
  header[data-testid="header"],
  #footer {
    width: 100%;
  }
}

#homepage-main {
  flex-direction: column;
}

.homepage-sidebar {
  width: 100%;
  min-width: 0;
}

@media (min-width: 1024px) {
  #homepage-main {
    flex-direction: row;
  }

  .homepage-sidebar {
    min-width: 255px;
    width: auto;
  }
}

@media (max-width: 767px) {
  .gallery-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 0.25rem;
  }

  .gallery-row .gallery-item {
    scroll-snap-align: start;
  }

  .idealo-top {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .idealo-card--top {
    flex: 0 0 168px;
    min-width: 168px;
  }

  .gallery-section-header .text-secondary {
    display: none;
  }

  .ads-grid > li {
    width: calc(50% - 0.25rem) !important;
  }

  .ads-grid > li > a {
    width: 100% !important;
  }

  #footer nav > ul > li {
    flex: 1 1 50%;
    min-width: 9rem;
  }
}

@media (max-width: 639px) {
  .auth-divider,
  [data-testid="register-button"] {
    display: none !important;
  }

  header[data-testid="header"] .py-large {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  [data-testid="search-bar-container"] {
    flex-basis: 100% !important;
    flex-grow: 1 !important;
  }

  [data-testid="header-bottom"] > .header-bottom-inner {
    flex-direction: column;
    align-items: stretch;
  }

  [data-testid="header-bottom"] nav {
    width: 100%;
    justify-content: center;
    padding-bottom: 0.75rem;
  }

  [data-testid="search-form"] {
    grid-template-columns: 1fr auto !important;
    height: auto;
    min-height: 3rem;
  }

  [data-testid="search-form"] .search-form-divider,
  [data-testid="category-section"],
  [data-testid="location-section"],
  [data-testid="radius-section"] {
    display: none !important;
  }

  [data-testid="keywords-section"] {
    border-radius: 9999px 0 0 9999px;
  }

  #login-overlay.login-popup {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    border-radius: 0.75rem 0.75rem 0 0;
  }

  #login-overlay.login-popup::before {
    display: none;
  }

  .ads-grid > li {
    width: calc(50% - 0.25rem) !important;
  }

  #footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #footer nav > ul {
    flex-direction: column;
  }

  #footer nav > ul > li {
    flex: 1 1 100%;
  }
}

@media (max-width: 479px) {
  .ads-grid > li {
    width: 100% !important;
    max-width: 20rem;
  }
}

.promo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.promo-overlay img {
  max-width: min(96vw, 52rem);
  max-height: 94vh;
  width: auto;
  height: auto;
  border-radius: 0.25rem;
  box-shadow:
    0 28px 56px -14px rgba(0, 0, 0, 0.4),
    0 16px 32px -10px rgba(0, 0, 0, 0.28),
    0 6px 16px rgba(0, 0, 0, 0.18);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

@media (max-width: 767px) {
  .promo-overlay img {
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow:
      0 20px 40px -12px rgba(0, 0, 0, 0.35),
      0 8px 20px -6px rgba(0, 0, 0, 0.22);
  }
}
