/**
 * DZD Sooq Advertising Engine — NATIVE / STANDARD / PREMIUM / SELLER_PROFILE (RO-AD-2).
 * Uses DZD tokens; NATIVE reuses homepage listing card classes.
 */

.dzd-ad-slot {
  display: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.dzd-ad-slot.is-filled {
  display: block;
  margin-top: 12px;
}

/* Empty promo reserve must not reserve visual space when unused. */
.dzd-homepage-engine .dzd-home-promo-reserve:not(.is-filled),
.dzd-homepage-engine .dzd-ad-slot:not(.is-filled) {
  display: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* -------- Horizontal banner -------- */
.dzd-ad-banner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.dzd-ad-banner__link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(45, 30, 113, 0.08);
  background:
    linear-gradient(135deg, rgba(94, 67, 214, 0.06), rgba(255, 255, 255, 0.95) 45%, #fff);
  box-shadow: 0 6px 18px rgba(45, 30, 113, 0.06);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-sizing: border-box;
}

.dzd-ad-banner__link:hover {
  border-color: rgba(94, 67, 214, 0.22);
}

.dzd-ad-banner__badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.dzd-ad-banner__media {
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(94, 67, 214, 0.04);
  aspect-ratio: 16 / 7;
}

.dzd-ad-banner__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dzd-ad-banner__body {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.dzd-ad-banner__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
}

.dzd-ad-banner__text {
  min-width: 0;
}

.dzd-ad-banner__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2340;
  line-height: 1.25;
}

.dzd-ad-banner__by,
.dzd-ad-banner__desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.35;
}

.dzd-ad-banner__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dzd-ad-banner__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: #5e43d6;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* NATIVE card extras (base = .dzd-home-card) */
.dzd-ad-card__desc,
.dzd-ad-card__cta {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dzd-ad-card__cta {
  color: #5e43d6;
  font-weight: 600;
  -webkit-line-clamp: 1;
}

.dzd-ad-card__logo {
  position: absolute;
  bottom: 8px;
  inset-inline-end: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #fff;
  z-index: 2;
}

.dzd-ad-badge {
  background: rgba(17, 24, 39, 0.78) !important;
}

/* Premium banner — larger visual priority */
.dzd-ad-banner--premium .dzd-ad-banner__link {
  padding: 18px 20px;
  border-color: rgba(94, 67, 214, 0.18);
  background:
    linear-gradient(135deg, rgba(94, 67, 214, 0.12), rgba(255, 255, 255, 0.96) 40%, #fff);
  box-shadow: 0 10px 28px rgba(45, 30, 113, 0.1);
}

.dzd-ad-banner--premium .dzd-ad-banner__media {
  aspect-ratio: 21 / 7;
}

.dzd-ad-banner--premium .dzd-ad-banner__title {
  font-size: 18px;
}

/* Seller profile banner — compact, non-disruptive */
.dzd-profile .dzd-ad-slot.is-filled {
  margin: 12px var(--dzd-space-4, 16px) 0;
  max-width: 100%;
  box-sizing: border-box;
}

.dzd-ad-banner--seller-profile .dzd-ad-banner__link {
  padding: 12px 14px;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .dzd-ad-banner__link {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 12px;
    padding: 12px;
  }

  .dzd-ad-banner__title {
    font-size: 15px;
  }
}

@media (max-width: 767px) {
  .dzd-ad-slot.is-filled {
    margin-top: 10px;
  }

  .dzd-ad-banner__link {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .dzd-ad-banner__media {
    aspect-ratio: 16 / 9;
  }

  .dzd-ad-banner__cta {
    width: 100%;
  }

  .dzd-ad-banner__badge {
    top: 8px;
    inset-inline-start: 8px;
  }
}
