/* Shared by lean and legacy pages. Never style the contents of Google frames. */
.mley-ad-shell {
  margin: 1rem 0 1.25rem;
}

.mley-ad-shell__label {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-color);
}

.mley-ad-shell__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  background: var(--bg-surface);
}

.mley-ad-shell__frame::before {
  content: none;
  display: block;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.mley-ad-shell__frame[data-ad-slot-state="requested"]::before,
.mley-ad-shell__frame[data-ad-slot-state="rendered"]::before,
.mley-ad-shell__frame[data-ad-slot-state="filled"]::before,
.mley-ad-shell__frame[data-ad-slot-state="unfilled"]::before {
  display: none;
}

.mley-ad-shell--unfilled .mley-ad-shell__label {
  display: none;
}

.mley-ad-shell--unfilled .mley-ad-shell__frame {
  border: none;
  background: transparent;
  box-shadow: none;
}

.mley-ad-shell--unfilled .mley-ad-shell__frame::before {
  display: none;
}

/* Runtime diagnostics distinguish a network failure from Google's no-fill.
   Retain the reserved space so a delayed response does not shift reading. */
.mley-ad-shell__frame[data-ad-slot-state="loading"]::before,
.mley-ad-shell__frame[data-ad-slot-state="timeout"]::before,
.mley-ad-shell__frame[data-ad-slot-state="sdk-timeout"]::before,
.mley-ad-shell__frame[data-ad-slot-state="sdk-error"]::before,
.mley-ad-shell__frame[data-ad-slot-state="error"]::before,
.mley-ad-shell__frame[data-ad-slot-state="hidden"]::before,
.mley-ad-shell__frame[data-ad-slot-state="disabled"]::before,
.mley-ad-shell__frame[data-ad-slot-state="unfill-optimized"]::before {
  display: none;
}

.mley-ad-shell:is([data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="timeout"], [data-ad-state="hidden"],
  [data-ad-state="disabled"]) .mley-ad-shell__label {
  visibility: hidden;
}

.mley-ad-shell:is([data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="timeout"], [data-ad-state="hidden"],
  [data-ad-state="disabled"]) .mley-ad-shell__frame {
  background: transparent;
  border-color: transparent;
}

.mley-ad-shell--banner .mley-ad-shell__frame {
  min-height: 124px;
}

.mley-ad-shell--rectangle .mley-ad-shell__frame {
  min-height: 304px;
}

.mley-ad-slot {
  display: block;
  width: 100%;
  min-width: 100%;
}

/* Preview is local-only; visitors never see technical placeholders. */
.mley-ad-shell[data-ad-preview="1"] .mley-ad-shell__frame::before {
  content: "Vista previa de publicidad";
}

/* Reserve a common responsive mobile height before requesting the slot. */
@media (max-width: 600px) {
  .mley-ad-shell--banner .mley-ad-shell__frame { min-height: 250px; }
}

@media (min-width: 992px) {
  .mley-ad-shell--banner .mley-ad-shell__frame {
    min-height: 138px;
  }

  .mley-ad-shell--rectangle .mley-ad-shell__frame {
    min-height: 328px;
  }
}

/* Only definitive no-fill/failure collapses. A pending timeout may still fill. */
.mley-ad-shell:is([data-ad-state="unfilled"], [data-ad-state="unfill-optimized"],
  [data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="disabled"]) {
  display: none;
  margin-block: 0;
}
.mley-ad-shell:is([data-ad-state="unfilled"], [data-ad-state="unfill-optimized"],
  [data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="disabled"]) .mley-ad-shell__label {
  display: none;
}
.mley-ad-shell:is([data-ad-state="unfilled"], [data-ad-state="unfill-optimized"],
  [data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="disabled"]) .mley-ad-shell__frame {
  min-height: 0;
  border: 0;
  background: transparent;
}
