/* ============================================================
   Container New Banner Section
   Figma: 92:9000 (mobile) + 93:9035 (desktop)
   ============================================================ */

/* ── Gap-closing: flush banner against fixed header ────────── */
/* nl-banner-outer: the full-width wrapper that provides the positioning
   context for the custom pagination overlay. */
.nl-banner-outer {
  position: relative;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.nl-new-banner {
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  /* Overflow is provided by Swiper's own .swiper { overflow:hidden } rule. */
}

.mt_required .site-content .wp-block-cgb-container-new-banner-section,
.wp-block-cgb-container-new-banner-section {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

.entry-content > .wp-block-cgb-container-new-banner-section:first-child {
  margin-top: 0 !important;
}

.mt_required .site-content:has(> .wp-block-cgb-container-new-banner-section:first-child),
.mt_required .site-content:has(> .entry-content > .wp-block-cgb-container-new-banner-section:first-child) {
  padding-top: 0 !important;
  /* Trust bar lives inside .fixed-top; --header-height already includes it. */
  margin-top: var(--header-height, 72px) !important;
}

.entry-content:has(> .wp-block-cgb-container-new-banner-section:first-child) {
  padding-top: 0 !important;
  overflow: visible !important;
}

.entry-content > .wp-block-cgb-container-new-banner-section:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Never let Swiper stretch the banner to viewport height (causes white gap). */
.nl-banner-swiper,
.nl-banner-swiper.swiper,
.nl-banner-swiper .swiper-wrapper,
.nl-banner-swiper .swiper-slide {
  height: auto !important;
  min-height: 0 !important;
}

.nl-banner-swiper {
  width: 100%;
  position: relative;
  /* No padding-bottom — pagination sits inside the swiper container
     (Swiper's default structure) after the wrapper. */
}

.nl-banner-swiper .swiper-wrapper {
  align-items: stretch;
}

/* Pagination — inside .nl-banner-swiper after .swiper-wrapper (Swiper default).
   Desktop: absolute at bottom of swiper.
   Mobile:  static in flow with negative margin (see mobile media query).
   NOTE: Swiper adds .swiper-pagination-* classes; global theme rules target those
   and must be reset here with equal/higher specificity. */
.nl-banner-pagination,
.nl-banner-swiper > .nl-banner-pagination.swiper-pagination-bullets.swiper-pagination-horizontal {
  position: absolute !important;
  bottom: 12px !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  text-align: center !important;
  height: auto !important;
  line-height: 1;
  z-index: 10 !important;
  transform: none !important;
  display: block !important;
  justify-content: center !important;
  /* Container itself must NOT intercept clicks — only the bullet spans should */
  pointer-events: none !important;
}

.nl-banner-pagination .swiper-pagination-bullet {
  background: rgba(0, 0, 0, 0.3) !important;
  background-color: rgba(0, 0, 0, 0.3) !important;
  opacity: 1 !important;
  width: 8px !important;
  height: 8px !important;
  display: inline-block !important;
  border-radius: 50% !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  margin: 0 4px !important;
  transition: background 0.2s;
}

.nl-banner-pagination .swiper-pagination-bullet-active {
  background: #000 !important;
  background-color: #000 !important;
}

/* ── Shared CTA pill (orange, both breakpoints) ────────────── */
.nl-new-banner__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ff9900 !important;
  color: #000 !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  text-decoration: none;
  min-width: 122px;
  margin-top: 4px;
}

.nl-new-banner__cta:hover,
.nl-new-banner__cta:focus {
  background-color: #e68a00 !important;
  color: #000 !important;
  opacity: 1;
}

/* ── "How do trade-ins work?" — full reset + visual style ─── */
.nl-new-banner__how-it-works,
.nl-new-banner__how-it-works:link,
.nl-new-banner__how-it-works:visited,
.nl-new-banner__how-it-works:hover,
.nl-new-banner__how-it-works:focus,
.nl-new-banner__how-it-works:active {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px;
  width: auto !important;
  max-width: 100%;
  align-self: flex-start;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 20px !important;
  color: var(--nl-dark-purple, #111) !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  text-align: left !important;
  text-decoration: none !important;
}

.nl-new-banner__how-it-works svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--nl-dark-purple, #111);
}

.nl-new-banner__how-it-works span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nl-new-banner__how-it-works:hover {
  opacity: 0.75 !important;
}

/* ============================================================
   Desktop (≥601px) – Figma 93:9035
   Gradient applied per-slide via inline style (PHP template)
   Use only these rules (not Bootstrap d-sm-*) — theme sm = 600px
   conflicts with the 601px design breakpoint.
   ============================================================ */
/* ── Breakpoint visibility — override inline style with !important ─ */
.nl-new-banner__desktop {
  display: none; /* default: mobile-first */
}

.nl-new-banner__mobile {
  display: block; /* default: mobile-first */
}

@media (max-width: 600px) {
  .nl-new-banner__desktop {
    display: none !important;
  }
  .nl-new-banner__mobile {
    display: block !important;
  }
}

@media (min-width: 601px) {
  .nl-new-banner__mobile {
    display: none !important;
  }
  /* !important overrides the inline style="display:none" on the desktop div */
  .nl-new-banner__desktop {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    /* Use 320px min-height to match the product image height so it is never
       clipped by the container. overflow:visible lets it breathe;
       Swiper's own overflow:hidden on .swiper handles carousel clipping. */
    min-height: 320px;
    overflow: visible;
  }

  /* Left: text content */
  .nl-new-banner__desktop .nl-new-banner__content {
    flex: 1;
    padding: 48px 32px 48px 64px;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Heading – 48px/56px SemiBold (Figma 93:9041) */
  .nl-new-banner__desktop .nl-new-banner__title {
    font-size: 48px;
    font-weight: 600;
    line-height: 56px;
    color: var(--nl-dark-purple, #111);
    margin: 0;
    white-space: pre-line;
  }

  /* Sub-title (optional) */
  .nl-new-banner__desktop .nl-new-banner__subtitle {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--nl-dark-purple, #111);
    margin: 0;
  }

  .nl-new-banner__desktop .nl-new-banner__how-it-works {
    margin: 0;
  }

  .nl-new-banner__desktop .nl-new-banner__cta {
    margin-top: 0;
    align-self: flex-start;
  }

  /* Right: product image – 320×320px, matching Figma 93:9047 */
  .nl-new-banner__desktop-img {
    width: 320px;
    height: 320px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 64px;
    display: block;
  }
}

/* ============================================================
   Mobile (≤600px) – Figma 92:9000
   Gradient applied per-slide via inline style (PHP template)
   ============================================================ */
@media (max-width: 600px) {
  .nl-new-banner__mobile {
    position: relative;
    min-height: 260px;
    padding-bottom: 28px;
    /* No overflow:hidden — the product image is right-aligned and must not
       be clipped by this container. The Swiper (.swiper) already provides
       overflow:hidden at the outer level. */
  }

  /* Product image – absolute, top-right (168×168) */
  .nl-new-banner__product-img {
    position: absolute;
    top: 16px;
    right: 0;
    width: 168px;
    height: 168px;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
  }

  /* Content block – left column */
  .nl-new-banner__mobile .nl-new-banner__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 24px 16px 0 16px;
    max-width: calc(100% - 150px);
  }

  /* Heading – 30px Bold */
  .nl-new-banner__mobile .nl-new-banner__title {
    font-size: 30px;
    font-weight: 700;
    line-height: 36px;
    color: var(--nl-dark-purple, #111);
    margin-bottom: 12px;
    white-space: pre-line;
  }

  .nl-new-banner__mobile .nl-new-banner__subtitle {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--nl-dark-purple, #111);
    margin-bottom: 12px;
  }

  .nl-new-banner__mobile .nl-new-banner__cta {
    margin-top: 4px;
    margin-bottom: 0;
  }

  .nl-new-banner__mobile .nl-new-banner__how-it-works {
    margin-top: 16px !important;
  }

  .nl-banner-outer > .nl-banner-pagination,
  .nl-banner-pagination,
  .nl-banner-swiper > .nl-banner-pagination.swiper-pagination-bullets.swiper-pagination-horizontal {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-shrink: 0;
    width: 100% !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    padding-bottom: 12px !important;
  }

  .nl-banner-pagination .swiper-pagination-bullet,
  .nl-banner-pagination.swiper-pagination-horizontal .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    display: inline-block !important;
    margin: 0 4px !important;
  }
}

/* ============================================================
   Trade-in overlay — appended to <body> by JS (direct child of body).
   Desktop (≥601px): centered white card over dimmed page.
   Mobile  (≤600px): white bottomsheet sliding up from the bottom.
   Show/hide is controlled entirely by JS inline style (display:none/flex)
   so no theme CSS can override visibility.
   ============================================================ */

.nl-tradein-overlay {
  /* JS sets display:flex when opening, display:none when closed */
  display: none;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 100000 !important;
  align-items: flex-end;
  justify-content: center;
}

.nl-tradein-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nl-tradein-overlay.is-open .nl-tradein-backdrop {
  opacity: 1;
}

.nl-tradein-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  background-color: #ffffff !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 16px 16px 0 0 !important;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.nl-tradein-overlay.is-open .nl-tradein-panel {
  transform: translateY(0);
}

.nl-tradein-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 0;
}

.nl-tradein-handle-bar {
  width: 40px;
  height: 5px;
  background: #ebebeb;
  border-radius: 3px;
}

/* × close button — top-right corner of the panel */
.nl-tradein-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 4px 8px !important;
  font-size: 22px !important;
  line-height: 1 !important;
  color: #666 !important;
  cursor: pointer !important;
  z-index: 2;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.nl-tradein-close:hover {
  color: #000 !important;
}

.nl-tradein-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px;
  padding: 16px 16px 32px !important;
  overflow-y: auto;
  background: #ffffff !important;
}

.nl-tradein-title {
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 28px !important;
  color: #000000 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nl-tradein-desc {
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 21px !important;
  color: #737373 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nl-tradein-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px;
}

.nl-tradein-item {
  display: flex !important;
  gap: 12px;
  align-items: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nl-tradein-check {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  background: #e8f6f0 !important;
  border-radius: 11px !important;
  flex-shrink: 0;
  margin-top: 1px;
}

.nl-tradein-check svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
}

.nl-tradein-item > div {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nl-tradein-item-title {
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 24px !important;
  color: #000000 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nl-tradein-item-desc {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
  color: #737373 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* CTA button */
.nl-tradein-cta,
.nl-tradein-cta:link,
.nl-tradein-cta:visited {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--bs-primary, #ff9900) !important;
  color: #000 !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  margin-top: 8px !important;
  box-sizing: border-box !important;
}

.nl-tradein-cta:hover,
.nl-tradein-cta:focus,
.nl-tradein-cta:active {
  opacity: 0.9 !important;
  color: #000 !important;
  text-decoration: none !important;
}

body.nl-tradein-open {
  overflow: hidden !important;
}

@media (min-width: 601px) {
  /* Desktop: centered modal card */
  .nl-tradein-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .nl-tradein-panel {
    width: 480px;
    max-width: calc(100% - 48px);
    border-radius: 16px !important;
    /* Replace mobile slide-up with a subtle scale-in */
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  }

  .nl-tradein-overlay.is-open .nl-tradein-panel {
    transform: scale(1);
  }

  .nl-tradein-handle {
    display: none !important;
  }

  .nl-tradein-content {
    padding: 24px !important;
  }
}
