/* SRG Digitals ad slots — above-the-fold first, reserved sizes, non-blocking */
:root {
  --srg-top-ad-h: 68px;
  --srg-header-h: 68px;
  --srg-rail-gap: 168px;
}
@media (max-width: 519px) {
  :root { --srg-top-ad-h: 58px; }
}

.srg-ads-top,
.srg-ads-mid,
.srg-ads-native,
.srg-ads-skyscrapers {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 12px;
}
.srg-ads-top {
  min-height: 50px;
  position: relative;
  z-index: 1200;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.srg-ads-mid { min-height: 250px; padding: 8px 12px; }
.srg-ads-native { min-height: 120px; padding: 8px 12px 12px; }
.srg-ad-unit {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.srg-ad-unit iframe {
  border: 0;
  display: block;
  max-width: 100%;
  background: transparent;
}
.srg-ad-468x60 { min-width: min(100%, 468px); min-height: 60px; width: 468px; height: 60px; }
.srg-ad-320x50 { min-width: min(100%, 320px); min-height: 50px; width: 320px; height: 50px; }
.srg-ad-300x250 { min-width: min(100%, 300px); min-height: 250px; width: 300px; height: 250px; }
.srg-ad-160x600 { min-width: 160px; min-height: 600px; width: 160px; height: 600px; }
.srg-ad-160x300 { min-width: 160px; min-height: 300px; width: 160px; height: 300px; }
.srg-ad-native { width: 100%; max-width: 1000px; min-height: 120px; }

/* Mobile: 320x50 top banner. Desktop: 468x60 leaderboard. */
@media (max-width: 519px) {
  .srg-ad-468x60 { display: none; }
}
@media (min-width: 520px) {
  .srg-ad-320x50 { display: none; }
}

/* ---------- Main site: fixed header, so the top banner is also fixed ---------- */
body.srg-has-fixed-header .srg-ads-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #0a0a0a;
  border-bottom: 1px solid #222;
}
body.srg-has-fixed-header {
  padding-top: var(--srg-top-ad-h);
}
body.srg-has-fixed-header .main-header {
  top: var(--srg-top-ad-h) !important;
}
/* Shrink the 85vh video hero so mid stays in the first screen and native is one short scroll away */
body.srg-has-fixed-header.srg-ads-on .banner {
  height: calc(100vh - var(--srg-top-ad-h) - 120px);
  min-height: 420px;
}
body.srg-has-fixed-header .banner > .srg-ads-mid {
  position: absolute;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: 20px;
  z-index: 5;
  width: 300px;
  padding: 0;
  background: transparent;
}
@media (max-width: 1199px) {
  body.srg-has-fixed-header.srg-ads-on .banner {
    height: auto;
    min-height: 46vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 88px 16px 16px;
  }
  body.srg-has-fixed-header .banner > .srg-ads-mid {
    position: static;
    margin: 18px auto 8px;
    right: auto;
    bottom: auto;
    transform: none;
  }
}

/* ---------- get.srgdigitals.com: hero is the first screen — put the 300x250 in it ---------- */
body.srg-showroom-sales .hero-visual > .srg-ads-mid {
  padding: 0;
  width: 300px;
  max-width: 100%;
  position: relative;
  z-index: 3;
}
@media (min-width: 981px) {
  body.srg-showroom-sales.srg-ads-on .hero-grid {
    min-height: 0;
  }
  body.srg-showroom-sales.srg-ads-on .hero-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 0;
  }
  body.srg-showroom-sales.srg-ads-on .hero-colour-logo {
    width: min(220px, 70%);
  }
}
@media (min-width: 981px) {
  body.srg-showroom-sales.srg-ads-on .hero-grid {
    align-items: start;
  }
  body.srg-showroom-sales.srg-ads-on .hero-visual > .srg-ads-mid {
    order: -1;
    margin-top: 28px;
  }
}
@media (max-width: 980px) {
  /* Compact the GET hero so the 300x250 fits in the first mobile screen,
     above the sticky WhatsApp checkout bar. Headline, price and CTA stay. */
  body.srg-showroom-sales.srg-ads-on .hero-copy {
    padding: 12px 16px 8px !important;
  }
  body.srg-showroom-sales.srg-ads-on .hero-copy h1 {
    font-size: 30px !important;
    line-height: 1.05 !important;
    letter-spacing: -0.03em;
    margin: 8px 0 6px !important;
  }
  body.srg-showroom-sales.srg-ads-on .hero-lede,
  body.srg-showroom-sales.srg-ads-on .app-row,
  body.srg-showroom-sales.srg-ads-on .trust-pills {
    display: none !important;
  }
  body.srg-showroom-sales.srg-ads-on .hero-price {
    margin: 4px 0 !important;
  }
  body.srg-showroom-sales.srg-ads-on .hero-limited-offer {
    margin: 6px 0 8px !important;
    padding: 6px 10px !important;
  }
  body.srg-showroom-sales.srg-ads-on .hero-copy > .srg-ads-mid {
    padding: 4px 0 8px;
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
  }
  body.srg-showroom-sales.srg-ads-on .hero-actions {
    margin-top: 8px !important;
  }
  body.srg-showroom-sales.srg-ads-on .hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    margin: 0;
  }
  body.srg-showroom-sales.srg-ads-on .hero-colour-logo {
    display: none;
  }
}

/* ---------- Desktop rails: visible immediately, no content overlap ---------- */
@media (min-width: 1200px) {
  body.srg-ads-on:not(.srg-has-fixed-header) {
    padding-left: var(--srg-rail-gap);
    padding-right: var(--srg-rail-gap);
  }
  .srg-ads-skyscrapers {
    display: block;
    padding: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
  }
  .srg-ads-rail-left,
  .srg-ads-rail-right {
    position: fixed;
    top: 8px;
    z-index: 40;
    pointer-events: auto;
    display: block;
  }
  .srg-ads-rail-left { left: 6px; }
  .srg-ads-rail-right { right: 6px; }
  /* Main site header/top bar are full-bleed, so rails start just below them */
  body.srg-has-fixed-header .srg-ads-rail-left,
  body.srg-has-fixed-header .srg-ads-rail-right {
    top: calc(var(--srg-top-ad-h) + var(--srg-header-h) + 6px);
  }
  body.srg-has-fixed-header .banner > .srg-ads-mid {
    right: calc(var(--srg-rail-gap) + 8px);
  }
  body.srg-ads-on:not(.srg-has-fixed-header) header.top,
  body.srg-ads-on:not(.srg-has-fixed-header) .topbar {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Below the rail breakpoint: hide the tall 160x600; keep 160x300 compact in-flow */
@media (max-width: 1199px) {
  .srg-ads-skyscrapers {
    display: flex;
    justify-content: center;
    padding: 8px 12px;
  }
  .srg-ads-skyscrapers .srg-ad-160x600 { display: none; }
}

/* Leave room for the social bar; keep get.srgdigitals.com sticky checkout usable */
body.srg-ads-on { padding-bottom: 64px; }
@media (max-width: 900px) {
  .mobile-checkout { bottom: 62px !important; }
}
