/*
 * Reklamy wewnętrzne na listach ogłoszeń (search.php, motyw zeta).
 * Odstępy, linie i zaokrąglenia skopiowane z .simple-prod w themes/zeta/css/style.css,
 * żeby slot wyglądał jak kolejny element listy / siatki.
 */

.products .fr-ad-slot {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.fr-ad-slot a {
  display: block;
}

/* Bez przycinania: proporcje z atrybutów width/height (realne wymiary pliku). */
.fr-ad-slot img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Jak etykieta „Reklama” banerów bocznych motywu (.lab): mały szary tekst. */
.fr-ad-label {
  display: block;
  width: 100%;
  margin: 0 0 2px 0;
  font-size: 12px;
  line-height: 14px;
  color: var(--mb-color7, #7c7c7c);
}

/* Widok listy: jak wiersz ogłoszenia (.products.list .simple-prod). */
.products.list .fr-ad-slot {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid #ddd;
}

.products.list .fr-ad-slot img {
  border-radius: 6px;
}

/* Widok siatki: jak karta siatki (.simple-prod + .simple-wrap). */
.products.grid .fr-ad-slot {
  width: calc(100% - 4px);
  margin: 0 2px 8px 2px;
  padding: 8px;
}

.products.grid.with-border .fr-ad-slot {
  width: 100%;
  margin: 0 -1px -1px 0;
  border: 1px solid #eee;
}

.products.grid .fr-ad-slot img {
  border-radius: 5px;
}

/* 4 kolumny po 25% zachodzą na siebie o 1 px — prawa krawędź slotu równo z kartami. */
@media screen and (min-width: 1151px) {
  .products.grid.with-border .fr-ad-slot {
    width: calc(100% - 3px);
  }
}

html[mode="dark"] .products.list .fr-ad-slot {
  border-bottom-color: var(--mb-color13);
}

html[mode="dark"] .products.grid.with-border .fr-ad-slot {
  border-color: var(--mb-color13);
}

@media screen and (max-width: 767px) {
  .products.grid .fr-ad-slot img {
    border-radius: 3px;
  }

  /* Siatka mobilna motywu: pełna szerokość ekranu, linie #e4e4e4 między kartami. */
  .products.grid.with-border .fr-ad-slot {
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #e4e4e4;
  }

  /*
   * Motyw rysuje linie kolumn przez :nth-child(odd/even). Slot jest dodatkowym
   * dzieckiem .products, więc liczymy parzystość tylko wśród ogłoszeń.
   */
  .products.grid.with-border .fr-ad-slot ~ .simple-prod:nth-child(odd of .simple-prod) {
    padding-left: 4px;
    padding-right: 0;
    border-right: 1px solid #e4e4e4;
  }

  .products.grid.with-border .fr-ad-slot ~ .simple-prod:nth-child(even of .simple-prod) {
    padding-left: 0;
    padding-right: 4px;
    border-right: none;
  }

  html[mode="dark"] .products.grid.with-border .fr-ad-slot,
  html[mode="dark"] .products.grid.with-border .fr-ad-slot ~ .simple-prod:nth-child(odd of .simple-prod) {
    border-color: var(--mb-color13);
  }
}
