/* =========================================
   PRICENOW — ADS.CSS
   Ad zones, ad units, consistent spacing
   ========================================= */

/* ── Ad Zone Container ───────────────────────────────── */
/*
  Each zone wraps one or more ad units for a placement location.
  Consistent margin above and below separates ads from page content.
*/
.pn-ad-zone {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);           /* gap between consecutive ad units */
  margin-top: var(--space-xl);    /* space above zone (from content above) */
  margin-bottom: var(--space-xl); /* space below zone (to content below) */
  width: 100%;
}

/* Square zone — for Related Products placement */
.pn-ad-zone--square .pn-ad-unit {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.pn-ad-zone--square .pn-ad-unit__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Individual Ad Unit ──────────────────────────────── */
.pn-ad-unit {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  /* Subtle label so users understand it's an ad */
}

/* "Ad" label — tiny, unobtrusive top-right badge */
.pn-ad-unit::before {
  content: 'Ad';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  line-height: 1.6;
  pointer-events: none;
  z-index: 2;
}

/* ── Image Ad ────────────────────────────────────────── */
.pn-ad-unit__link {
  display: block;
  width: 100%;
}

.pn-ad-unit__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: opacity var(--transition-fast);
}

.pn-ad-unit__link:hover .pn-ad-unit__img {
  opacity: 0.92;
}

/* ── Video Ad ────────────────────────────────────────── */
.pn-ad-unit__video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.pn-ad-unit__video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
}

/* ── Code Ad ─────────────────────────────────────────── */
/*
  Code ads (script/HTML injected) fill the full unit width.
  Add a min-height so injected content has space to render.
*/
.pn-ad-unit > ins,
.pn-ad-unit > div:not([class]),
.pn-ad-unit > script + ins {
  display: block;
  width: 100%;
  min-height: 60px;
}

/* ── Location-Specific Sizing ────────────────────────── */

/* Single — Top of Description & Below Description */
/* Inherits full width of .pn-single-content — no extra rule needed */

/* Single — Top of Related Products (square) */
/* Handled by .pn-ad-zone--square above */

/* Category / Brand archive — full grid width */
.pn-ad-zone--category-before-grid,
.pn-ad-zone--brand-before-grid {
  /* Takes 100% of .pn-archive-main */
  margin-bottom: var(--space-lg);
}

/* ── Multiple ad units in a row ──────────────────────── */
/* When 2+ units share one zone, space them consistently  */
.pn-ad-zone > .pn-ad-unit + .pn-ad-unit {
  margin-top: 0; /* gap: var(--space-md) on parent handles this */
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .pn-ad-zone {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
    gap: var(--space-sm);
  }

  .pn-ad-zone--square .pn-ad-unit {
    aspect-ratio: 4 / 3; /* relax square on mobile */
  }
}
