/* =========================================================
   RBS SUPPORT SYSTEM v3.8 — FULL SCREEN & RESPONSIVE LAYOUT
   Loaded after style.css so it safely upgrades existing pages.
========================================================= */

:root {
  --container: 1600px;
  --page-gutter: clamp(16px, 3.2vw, 58px);
  --section-space: clamp(76px, 8vw, 132px);
  --hero-side-space: clamp(22px, 5vw, 84px);
}

html {
  width: 100%;
  min-width: 320px;
}

body {
  width: 100%;
  min-width: 320px;
  min-height: 100svh;
}

.container {
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--container));
  max-width: none;
}

.site-header {
  min-height: var(--header-height);
  height: auto;
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  min-height: var(--header-height);
}

main,
section,
footer {
  width: 100%;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
}

.hero-layout {
  width: min(calc(100% - (var(--hero-side-space) * 2)), 1540px);
  margin-inline: auto;
  min-height: min(760px, calc(100svh - var(--header-height)));
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: clamp(32px, 5vw, 84px);
  padding-block: clamp(58px, 7vh, 100px);
}

/* Slides use one shared grid track. The tallest slide defines the height,
   preventing copy and buttons from being clipped on narrow screens. */
.hero-slider {
  min-width: 0;
  padding-inline: clamp(2px, .6vw, 12px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
}

.hero-slide {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  height: max-content;
  align-self: center;
  pointer-events: none;
}

.hero-slide.active {
  pointer-events: auto;
}

.slider-controls {
  position: relative;
  left: auto;
  bottom: auto;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  margin-top: clamp(28px, 4vh, 46px);
}

.hero h1 {
  max-width: 850px;
  font-size: clamp(48px, 4.8vw, 82px);
  text-wrap: balance;
}

.hero-slide > p {
  max-width: 760px;
  font-size: clamp(15px, 1.1vw, 18px);
  text-wrap: pretty;
}

.hero-visual {
  min-width: 0;
  min-height: clamp(460px, 55vh, 620px);
}

.visual-main {
  width: min(100%, 560px);
  min-height: clamp(390px, 46vh, 480px);
}

.sponsor-affiliate-wrap {
  width: 100%;
}

.sponsor-affiliate-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.trust-strip {
  margin-top: auto;
}

.section {
  padding-block: var(--section-space);
}

.two-column,
.form-layout,
.register-layout,
.service-layout,
.cta-inner,
.footer-grid {
  min-width: 0;
  gap: clamp(34px, 6vw, 92px);
}

.section-heading {
  max-width: min(820px, 100%);
}

.section-heading h2,
.section-copy h2,
.form-intro h2,
.register-copy h2 {
  text-wrap: balance;
}

.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
  gap: clamp(16px, 1.8vw, 28px);
}

.product-card {
  min-width: 0;
  min-height: 100%;
}

.product-visual {
  height: clamp(170px, 15vw, 230px);
}

.product-content {
  flex: 1;
}

.pricing-grid,
.service-grid,
.testimonial-grid,
.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.form-layout {
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  align-items: start;
}

.form-card,
.register-card {
  width: 100%;
  min-width: 0;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  min-width: 0;
}

.affiliate-notice {
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 10px);
  bottom: auto;
  max-width: min(760px, calc(100% - 24px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-drawer {
  width: min(430px, 100%);
  max-width: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 1700px) {
  :root {
    --container: 1760px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr);
  }
}

@media (max-width: 1180px) {
  :root {
    --page-gutter: clamp(18px, 3vw, 34px);
  }

  .desktop-nav {
    gap: 20px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, .82fr);
    gap: 30px;
  }

  .hero h1 {
    font-size: clamp(46px, 5.5vw, 68px);
  }

  .sponsor-affiliate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 72px;
  }

  .desktop-nav,
  .desktop-only {
    display: none !important;
  }

  .menu-toggle {
    display: grid;
  }

  .hero {
    min-height: auto;
  }

  .hero-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding-block: 70px 54px;
  }

  .hero-slider {
    align-content: start;
  }

  .hero-slide {
    align-self: start;
  }

  .hero-visual {
    width: min(680px, 100%);
    min-height: 470px;
    margin-inline: auto;
  }

  .visual-main {
    width: min(100%, 520px);
  }

  .sponsor-affiliate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sponsor-info-item:last-child {
    grid-column: auto;
  }

  .two-column,
  .form-layout,
  .register-layout,
  .service-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-intro {
    position: static;
  }

  .about-showcase,
  .service-visual {
    width: min(720px, 100%);
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  :root {
    --page-gutter: 16px;
    --section-space: 76px;
    --header-height: 66px;
  }

  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 8px;
  }

  .header-actions {
    gap: 7px;
  }

  .icon-button,
  .menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .mobile-menu {
    max-height: calc(100dvh - var(--header-height) - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .hero-layout {
    padding-block: 58px 40px;
  }

  .hero h1 {
    font-size: clamp(38px, 11.5vw, 56px);
    line-height: 1.06;
  }

  .hero-slide > p {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.72;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 28px;
  }

  .hero-actions .button {
    width: 100%;
    min-height: 50px;
    justify-content: center;
  }

  .slider-controls {
    width: 100%;
    justify-content: space-between;
    margin-top: 26px;
  }

  .hero-visual {
    min-height: 390px;
  }

  .visual-main {
    min-height: 350px;
    padding: 20px;
    border-radius: 26px;
    transform: none;
  }

  .floating-chip {
    min-width: 142px;
    padding: 10px 12px;
  }

  .chip-one {
    right: 0;
  }

  .chip-two {
    left: 0;
    bottom: 118px;
  }

  .chip-three {
    right: 4px;
    bottom: 28px;
  }

  .sponsor-affiliate-wrap {
    margin-top: 0;
  }

  .sponsor-affiliate-card {
    padding: 18px;
  }

  .sponsor-affiliate-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sponsor-affiliate-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sponsor-affiliate-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sponsor-affiliate-actions .button {
    width: 100%;
    justify-content: center;
  }

  .trust-grid {
    min-height: 66px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-block: 13px;
  }

  .trust-grid span:last-child {
    grid-column: 1 / -1;
  }

  .section-heading {
    margin-bottom: 34px;
  }

  .section-heading h2,
  .section-copy h2,
  .form-intro h2,
  .register-copy h2 {
    font-size: clamp(34px, 9.6vw, 48px);
  }

  .check-grid,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid label.full {
    grid-column: auto;
  }

  .product-grid,
  .pricing-grid,
  .service-grid,
  .testimonial-grid,
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-card {
    min-height: 0;
  }

  .product-visual {
    height: clamp(210px, 64vw, 300px);
  }

  .filter-tabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs button {
    flex: 0 0 auto;
  }

  .affiliate-notice {
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 8px);
    width: calc(100% - 20px);
    max-width: none;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 11px;
  }

  .footer-bottom {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  .brand-copy small {
    display: none;
  }

  .hero h1 {
    font-size: clamp(36px, 11.7vw, 48px);
  }

  .hero-visual {
    min-height: 350px;
  }

  .floating-chip {
    min-width: 128px;
    font-size: 11px;
  }

  .chart-bars {
    gap: 7px;
  }

  .dashboard-title strong {
    font-size: 28px;
  }

  .dashboard-stats {
    gap: 5px;
  }

  .dashboard-stats b {
    font-size: 14px;
  }

  .sponsor-avatar {
    width: 50px;
    height: 50px;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    font-size: 9px;
  }
}


@media (max-width: 420px) {
  :root { --hero-side-space: 20px; }
}

@media (orientation: landscape) and (max-height: 560px) and (min-width: 700px) {
  .hero {
    min-height: auto;
  }

  .hero-layout {
    min-height: 620px;
    padding-block: 55px;
  }
}
