/* =====================================================================
   v5 order bottom sheet + hero CTA block + sticky price bar.

   Loaded only when rv_order_ui = 'sheet', so a site on the 4.x inline form
   downloads none of this. Everything here is additive: no rule in main.css is
   overridden, and no selector here matches markup the inline form renders.
   ===================================================================== */

/* ---------- Hero CTA block (replaces the inline form card) ---------- */
.rv-ctablock {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 20px 18px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.rv-ctablock__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-leaf-tint, rgba(var(--color-primary-rgb), 0.08));
  color: var(--color-primary-text);
  font-size: 13px;
  font-weight: 700;
}
.rv-ctablock__chip-icon { width: 15px; height: 15px; flex-shrink: 0; }

.rv-ctablock__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.rv-ctablock__now {
  font: 800 clamp(38px, 10vw, 52px)/1 var(--font-body);
  letter-spacing: -0.02em;
  color: var(--color-heading);
}
.rv-ctablock__was {
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 600;
  color: var(--color-text-muted);
}
.rv-ctablock__pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.rv-ctablock .rv-single-trust { margin-bottom: 16px; }

.rv-ctablock__consult {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 4px;
  background: none;
  border: 0;
  color: var(--color-primary-text);
  font: 600 15px/1.4 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.rv-ctablock__consult svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Sticky bar: price + CTA ---------- */
.rv-sticky-cta--v5 {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rv-sticky-cta--v5 .rv-btn-primary {
  width: auto;
  flex: 0 0 auto;
  margin-left: auto;
  padding-inline: 22px;
}
.rv-sticky-cta__price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}
.rv-sticky-cta__now {
  font: 800 19px/1 var(--font-body);
  color: var(--color-heading);
  white-space: nowrap;
}
.rv-sticky-cta__pill {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary-text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
/* Suppressed, not hidden: `display:none` would fight initStickyCTA's own
   is-visible toggle and leave the bar stuck off after the sheet closes. */
.rv-sticky-cta.is-suppressed {
  transform: translateY(110%);
  pointer-events: none;
}

/* ---------- Bottom sheet ---------- */
.rv-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.rv-sheet[hidden] { display: none; }

.rv-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 20, 0.45);
  opacity: 0;
  transition: opacity 200ms ease;
}
.rv-sheet.is-open .rv-sheet__backdrop { opacity: 1; }

.rv-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  /* dvh, not vh: on iOS Safari 100vh is the address-bar-collapsed height, so a vh
     sheet is taller than the screen and its CTA sits below the fold. */
  max-height: 92dvh;
  background: var(--color-bg, #ffffff);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.rv-sheet.is-open .rv-sheet__panel { transform: translateY(0); }

.rv-sheet__grip {
  width: 44px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  flex-shrink: 0;
}

.rv-sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.rv-sheet__close:hover { background: var(--color-bg-soft); }
.rv-sheet__close svg { width: 22px; height: 22px; }

.rv-sheet__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  /* Room for the keyboard to push the focused field into view. */
  scroll-padding-bottom: 80px;
}

.rv-sheet__head { margin-bottom: 16px; }
.rv-sheet__title {
  margin: 0;
  font: 800 clamp(22px, 6vw, 26px)/1.2 var(--font-body);
  letter-spacing: -0.02em;
  color: var(--color-heading);
}
.rv-sheet__title:focus-visible { outline: none; }
.rv-sheet__sub {
  margin: 6px 0 0;
  color: var(--color-primary-text);
  font-size: 15px;
  font-weight: 600;
}

/* The sheet supplies the card chrome, so the form inside must not add its own. */
.rv-sheet .rv-order-form { padding: 0; background: none; border: 0; box-shadow: none; }

body.rv-sheet-open { overflow: hidden; }

@media (min-width: 768px) {
  /* Desktop keeps the same component, centred — never a second implementation. */
  .rv-sheet__panel {
    left: 50%;
    bottom: auto;
    top: 50%;
    width: min(480px, calc(100vw - 48px));
    max-height: min(88dvh, 780px);
    border-radius: 20px;
    transform: translate(-50%, -46%) scale(0.98);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease;
  }
  .rv-sheet.is-open .rv-sheet__panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  .rv-sheet__grip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rv-sheet__panel,
  .rv-sheet__backdrop { transition: none; }
}
