/*
 * Shared bridge experiment presentation layer.
 *
 * Loaded after the active market theme. It deliberately owns only the sealed
 * visual treatment attributes applied by the Bridge runtime: CTA theme, hero
 * accent, panel theme, and desktop layout. It must not change copy, routing,
 * disclosures, consent, tracking, or provider behaviour.
 */

/* Some market themes add a custom rb-bridge-page body class while others use
 * the generated WordPress bridge-page class. Scope CTA treatments to the
 * actual CTA marker so every market receives the selected colour treatment. */
html[data-rb-exp-cta-theme="aqua"] [data-rb-bridge-cta="1"].rb-button {
  color: #042f2e !important;
  border-color: #5eead4 !important;
  background: #5eead4 !important;
}
html[data-rb-exp-cta-theme="aqua"] [data-rb-bridge-cta="1"].rb-button:hover,
html[data-rb-exp-cta-theme="aqua"] [data-rb-bridge-cta="1"].rb-button:focus-visible {
  color: #042f2e !important;
  border-color: #99f6e4 !important;
  background: #99f6e4 !important;
}
html[data-rb-exp-cta-theme="cobalt"] [data-rb-bridge-cta="1"].rb-button {
  color: #fff !important;
  border-color: #2563eb !important;
  background: #2563eb !important;
}
html[data-rb-exp-cta-theme="cobalt"] [data-rb-bridge-cta="1"].rb-button:hover,
html[data-rb-exp-cta-theme="cobalt"] [data-rb-bridge-cta="1"].rb-button:focus-visible {
  color: #fff !important;
  border-color: #1d4ed8 !important;
  background: #1d4ed8 !important;
}
html[data-rb-exp-cta-theme="coral"] [data-rb-bridge-cta="1"].rb-button {
  color: #fff !important;
  border-color: #b83b35 !important;
  background: #b83b35 !important;
}
html[data-rb-exp-cta-theme="coral"] [data-rb-bridge-cta="1"].rb-button:hover,
html[data-rb-exp-cta-theme="coral"] [data-rb-bridge-cta="1"].rb-button:focus-visible {
  color: #fff !important;
  border-color: #8f2c28 !important;
  background: #8f2c28 !important;
}
html[data-rb-exp-cta-theme] [data-rb-bridge-cta="1"].rb-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(4, 47, 46, .72);
}

html[data-rb-exp-hero-accent="aqua"] .rb-bridge-hero--offer {
  background: radial-gradient(circle at 78% 16%, rgba(94, 234, 212, .30) 0 13%, transparent 13.4%), linear-gradient(124deg, #063e46 0%, #087168 55%, #176d98 100%);
}
html[data-rb-exp-hero-accent="violet"] .rb-bridge-hero--offer {
  background: radial-gradient(circle at 78% 16%, rgba(196, 181, 253, .31) 0 13%, transparent 13.4%), linear-gradient(124deg, #1e3a5f 0%, #315687 55%, #514a87 100%);
}
html[data-rb-exp-hero-accent="sun"] .rb-bridge-hero--offer {
  background: radial-gradient(circle at 78% 16%, rgba(253, 224, 71, .26) 0 13%, transparent 13.4%), linear-gradient(124deg, #5d3a14 0%, #97551b 55%, #176d7b 100%);
}

html[data-rb-exp-panel-theme="ocean"] .rb-value-panel {
  background: radial-gradient(circle at 100% 0, rgba(125, 211, 252, .20) 0 18%, transparent 18.4%), linear-gradient(150deg, #0f3e58 0%, #176b86 100%);
}
html[data-rb-exp-panel-theme="ocean"] .rb-value-panel::before {
  background: linear-gradient(90deg, #7dd3fc 0%, #dbeafe 48%, #60a5fa 100%);
}
html[data-rb-exp-panel-theme="ocean"] .rb-value-panel__eyebrow { color: #dbeafe; }
html[data-rb-exp-panel-theme="ocean"] .rb-value-panel__highlights li::before { border-color: #a5e3ff; }

html[data-rb-exp-panel-theme="ink"] .rb-value-panel {
  background: radial-gradient(circle at 100% 0, rgba(196, 181, 253, .18) 0 18%, transparent 18.4%), linear-gradient(150deg, #19233e 0%, #3d3566 100%);
}
html[data-rb-exp-panel-theme="ink"] .rb-value-panel::before {
  background: linear-gradient(90deg, #c4b5fd 0%, #ede9fe 48%, #818cf8 100%);
}
html[data-rb-exp-panel-theme="ink"] .rb-value-panel__eyebrow { color: #ede9fe; }
html[data-rb-exp-panel-theme="ink"] .rb-value-panel__highlights li::before { border-color: #ddd6fe; }

html[data-rb-exp-panel-theme="mint"] .rb-value-panel {
  background: radial-gradient(circle at 100% 0, rgba(253, 224, 71, .17) 0 18%, transparent 18.4%), linear-gradient(150deg, #0e5648 0%, #2c7962 100%);
}
html[data-rb-exp-panel-theme="mint"] .rb-value-panel::before {
  background: linear-gradient(90deg, #99f6e4 0%, #ecfdf5 48%, #6ee7b7 100%);
}
html[data-rb-exp-panel-theme="mint"] .rb-value-panel__eyebrow { color: #ecfdf5; }
html[data-rb-exp-panel-theme="mint"] .rb-value-panel__highlights li::before { border-color: #a7f3d0; }

/* The legacy layout catalog begins at 761px, while localized themes reserve
 * two-column bridge geometry for 1024px and above. Make that middle range an
 * explicit one-column reset rather than depending on theme order or a partial
 * historical reset. */
@media (min-width: 761px) and (max-width: 1023px) {
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-grid {
    grid-template-areas: none;
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy {
    display: block;
    min-width: 0;
  }
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__copy,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__action,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__points,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__credit,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__support,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-grid > aside {
    grid-area: auto;
    min-width: 0;
  }
}

/*
 * The original layout catalog flattened the copy wrapper into the outer grid,
 * assigning named tracks to each fragment. Later layout rules restored the
 * wrapper but could leave those named tracks in place. This explicit final
 * cascade resets every outer and inner placement before the safe treatment-
 * specific ordering below, so no treatment can create an unused hero row.
 */
/* Localized themes deliberately retain one-column bridge geometry through
 * 1023px. Keep this canonical desktop reset above that breakpoint so a late
 * shared asset can never reintroduce a cramped tablet two-column treatment. */
@media (min-width: 1024px) {
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-grid {
    grid-template-areas: none;
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1.16fr) minmax(21rem, .84fr);
    gap: clamp(1.75rem, 4vw, 3.75rem);
    align-items: center;
  }
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy {
    display: grid;
    grid-template-rows: none;
    align-content: center;
    min-width: 0;
  }
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__copy,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__action,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__points,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__credit,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__support,
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-grid > aside {
    grid-area: auto;
    min-width: 0;
  }
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-offer-hero-copy__support:empty {
    display: none;
  }
  html[data-rb-exp-layout] .rb-bridge-hero--offer .rb-value-panel {
    justify-self: end;
    align-self: center;
  }

  /* Split hero: copy and CTA are introduced before the decision panel. */
  html[data-rb-exp-layout="split-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__copy { order: 1; }
  html[data-rb-exp-layout="split-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__action { order: 2; margin-top: .2rem; }
  html[data-rb-exp-layout="split-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__points { order: 3; }
  html[data-rb-exp-layout="split-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__credit { order: 4; }

  /* Stacked hero: proof points precede the action, with the panel aligned to
   * the headline rather than vertically centred in a long copy column. */
  html[data-rb-exp-layout="stacked-hero"] .rb-bridge-hero--offer .rb-offer-hero-grid { align-items: start; }
  html[data-rb-exp-layout="stacked-hero"] .rb-bridge-hero--offer .rb-value-panel { align-self: start; }
  html[data-rb-exp-layout="stacked-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__copy { order: 1; }
  html[data-rb-exp-layout="stacked-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__points { order: 2; }
  html[data-rb-exp-layout="stacked-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__action { order: 3; margin-top: .2rem; }
  html[data-rb-exp-layout="stacked-hero"] .rb-bridge-hero--offer .rb-offer-hero-copy__credit { order: 4; }

  /* Offer-card-first: the same sealed panel becomes the first visual anchor. */
  html[data-rb-exp-layout="offer-card-first"] .rb-bridge-hero--offer .rb-offer-hero-grid {
    grid-template-columns: minmax(21rem, .84fr) minmax(0, 1.16fr);
  }
  html[data-rb-exp-layout="offer-card-first"] .rb-bridge-hero--offer .rb-value-panel {
    order: -1;
    justify-self: start;
  }
  html[data-rb-exp-layout="offer-card-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__copy { order: 1; }
  html[data-rb-exp-layout="offer-card-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__action { order: 2; margin-top: .2rem; }
  html[data-rb-exp-layout="offer-card-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__points { order: 3; }
  html[data-rb-exp-layout="offer-card-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__credit { order: 4; }

  /* Comparison-first: contrast the proof cards before the action. */
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__copy { order: 1; }
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__points { order: 2; }
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__action { order: 3; margin-top: .2rem; }
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-hero-copy__credit { order: 4; }
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .85rem;
  }
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-points li {
    min-height: 100%;
    padding: .55rem;
    border: 1px solid rgba(218, 244, 233, .25);
    border-radius: .65rem;
    background: rgba(3, 54, 57, .17);
    font-size: .8rem;
    line-height: 1.32;
  }
  html[data-rb-exp-layout="comparison-first"] .rb-bridge-hero--offer .rb-offer-points li::before { margin-top: .04rem; }

  /* Action-row: give the selected CTA a stronger, full-row presentation while
   * retaining the shared copy and panel hierarchy. */
  html[data-rb-exp-layout="action-row"] .rb-bridge-hero--offer .rb-offer-hero-copy__copy { order: 1; }
  html[data-rb-exp-layout="action-row"] .rb-bridge-hero--offer .rb-offer-hero-copy__action { order: 2; margin-top: .35rem; }
  html[data-rb-exp-layout="action-row"] .rb-bridge-hero--offer .rb-offer-hero-copy__points { order: 3; margin-top: .5rem; }
  html[data-rb-exp-layout="action-row"] .rb-bridge-hero--offer .rb-offer-hero-copy__credit { order: 4; }
  html[data-rb-exp-layout="action-row"] .rb-bridge-hero--offer .rb-offer-cta--hero {
    align-items: stretch;
    width: min(100%, 30rem);
  }
  html[data-rb-exp-layout="action-row"] .rb-bridge-hero--offer .rb-button--hero-offer { width: 100%; }
}
