/* =====================================================================
   Consultation button + call-back sheet for the site styles (runviet-wp 4.51.0,
   inc/consult.php, styles/_shared/consult-sheet.php, assets/js/consult.js).

   One look for every style, coloured by the site's own tokens (--st-brand / --st-font,
   which shop, brand, hybrid, shrine and the EU builds all derive from). It is the calm
   second choice next to the order button: outlined, brand colour, never the CTA colour,
   so the order button stays the loudest thing on the page.
   ===================================================================== */

.rv-cx, .rv-cx-root {
  --cx-brand: var(--sh-brand, var(--sp-brand, var(--st-brand, #0f5c4d)));
  --cx-ink: var(--st-heading, #1d2327);
  --cx-text: var(--st-text, #3c434a);
  --cx-font: var(--sh-font, var(--st-font, system-ui, sans-serif));
  --cx-tint: color-mix(in srgb, var(--cx-brand) 8%, #fff);
  --cx-line: color-mix(in srgb, var(--cx-brand) 32%, #fff);
  --cx-r: 12px;
}
body.rv-style-brand .rv-cx { --cx-r: 999px; }
/* shop / hybrid: the row sits after the key facts on phones and after the buy button on desktop */
.rv-cx-cta--shop { margin-top: 14px; }

.rv-cx-svg { width: 100%; height: 100%; display: block; }
.rv-cx-ic {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 9px; box-sizing: border-box;
  border-radius: 50%; background: var(--cx-tint); color: var(--cx-brand);
}
.rv-cx-ic--lg { width: 48px; height: 48px; padding: 11px; }

/* ---------- 1. The row under the buy button ---------- */
.rv-cx-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; box-sizing: border-box;
  margin: 10px 0 0; padding: 8px 16px 8px 9px;
  border: 1.5px solid var(--cx-line); border-radius: var(--cx-r); background: #fff;
  color: var(--cx-ink); font-family: var(--cx-font); text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.rv-cx-cta:hover, .rv-cx-cta:focus-visible { border-color: var(--cx-brand); background: var(--cx-tint); color: var(--cx-ink); text-decoration: none; }
.rv-cx-cta:focus-visible { outline: 3px solid color-mix(in srgb, var(--cx-brand) 35%, transparent); outline-offset: 2px; }
.rv-cx-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rv-cx-t b { font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--cx-ink); }
.rv-cx-t small { font-size: 14.5px; line-height: 1.3; color: var(--cx-brand); font-weight: 600; }
.rv-cx-cta > .rv-cx-svg { flex: none; width: 20px; height: 20px; color: var(--cx-brand); }

/* ---------- 2. The call-back card closing the FAQ ---------- */
.rv-cx-card {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 14px;
  margin: 22px 0 0; padding: 18px; border-radius: 16px; box-sizing: border-box;
  border: 1px solid var(--cx-line); background: var(--cx-tint); font-family: var(--cx-font); text-align: left;
}
.rv-cx-card .rv-cx-ic { background: #fff; }
.rv-cx-card-h { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--cx-ink); }
.rv-cx-card-x { margin: 3px 0 0; font-size: 15px; line-height: 1.45; color: var(--cx-text); }
.rv-cx .rv-cx-card-btn {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; box-sizing: border-box;
  border: 2px solid var(--cx-brand); border-radius: var(--cx-r); background: #fff;
  color: var(--cx-brand); font: 700 17px/1.2 var(--cx-font); text-decoration: none; cursor: pointer;
}
.rv-cx .rv-cx-card-btn:hover, .rv-cx .rv-cx-card-btn:focus-visible { background: var(--cx-brand); color: #fff; text-decoration: none; }
.rv-cx .rv-cx-card-btn .rv-cx-svg { width: 19px; height: 19px; }
@media (min-width: 720px) {
  .rv-cx-card { grid-template-columns: auto 1fr auto; padding: 20px 22px; }
  .rv-cx .rv-cx-card-btn { grid-column: auto; }
}

/* ---------- 3. The sheet (bottom sheet on phones, centred dialog on desktop) ---------- */
.rv-cx-root { position: fixed; inset: 0; z-index: 1000; }
.rv-cx-root[hidden] { display: none; }
.rv-cx-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .25s; cursor: pointer; }
.rv-cx-root.is-open .rv-cx-backdrop { opacity: 1; }
.rv-cx-sheet {
  position: absolute; left: 50%; bottom: 0; width: min(100%, 520px); max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; box-sizing: border-box;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
  transform: translate(-50%, 100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  font-family: var(--cx-font); color: var(--cx-text); font-size: 16px; line-height: 1.5;
}
.rv-cx-root.is-open .rv-cx-sheet { transform: translate(-50%, 0); }
.rv-cx-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #d5d8db; }
.rv-cx-close {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 44px; height: 44px; padding: 11px; box-sizing: border-box;
  border: 0; border-radius: 50%; background: none; color: #6b7280; cursor: pointer;
}
.rv-cx-close:hover { background: #f1f3f5; }
.rv-cx-close svg { width: 100%; height: 100%; display: block; }
.rv-cx-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 30px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) {
  .rv-cx-sheet { top: 50%; bottom: auto; max-height: 88vh; border-radius: 18px; opacity: 0; transform: translate(-50%, -46%); transition: transform .22s ease, opacity .22s ease; }
  .rv-cx-root.is-open .rv-cx-sheet { opacity: 1; transform: translate(-50%, -50%); }
  .rv-cx-grip { display: none; }
  .rv-cx-scroll { padding: 28px 26px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv-cx-sheet, .rv-cx-backdrop { transition: none; }
}

.rv-cx-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding-right: 34px; }
.rv-cx-root .rv-cx-h { margin: 0; font: 700 21px/1.25 var(--cx-font); letter-spacing: normal; text-transform: none; color: var(--cx-ink); }
.rv-cx-root .rv-cx-h:focus { outline: none; }
.rv-cx-sub { margin: 4px 0 0; font-size: 15.5px; line-height: 1.45; color: var(--cx-text); }

.rv-cx-form { position: relative; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.rv-cx-field { margin: 0 0 13px; }
.rv-cx-field label { display: block; margin: 0 0 6px; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--cx-ink); }
.rv-cx-field input,
.rv-cx-field textarea {
  display: block; width: 100%; min-height: 52px; box-sizing: border-box; margin: 0; padding: 12px 14px;
  border: 1.5px solid #cfd4d9; border-radius: 10px; background: #fff; box-shadow: none;
  color: var(--cx-ink); font: 400 17px/1.4 var(--cx-font); /* >= 16px: no iOS zoom on focus */
}
.rv-cx-field textarea { min-height: 78px; resize: vertical; }
.rv-cx-field input::placeholder, .rv-cx-field textarea::placeholder { color: #8c9297; opacity: 1; }
.rv-cx-field input:focus, .rv-cx-field textarea:focus { outline: none; border-color: var(--cx-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-brand) 18%, transparent); }
.rv-cx-field.is-err input, .rv-cx-field.is-err textarea { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.rv-cx-form .rv-honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.rv-cx-root .rv-cx-submit {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; margin: 6px 0 0;
  padding: 0 20px; box-sizing: border-box; border: 0; border-radius: 12px; background: var(--cx-brand); color: #fff;
  font: 700 18px/1.2 var(--cx-font); text-transform: none; letter-spacing: normal; cursor: pointer;
}
.rv-cx-root .rv-cx-submit:hover { background: color-mix(in srgb, var(--cx-brand) 88%, #000); }
.rv-cx-root .rv-cx-submit:active { transform: translateY(1px); }
.rv-cx-root .rv-cx-submit .rv-cx-svg { width: 20px; height: 20px; }
.rv-cx-root .rv-cx-submit.is-loading { opacity: .7; cursor: progress; }
.rv-cx-note { margin: 10px 0 0; font-size: 14px; line-height: 1.45; text-align: center; color: var(--cx-text); }
.rv-cx-consent { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; text-align: center; color: #6b7280; }
.rv-cx-root .rv-cx-alt {
  display: block; width: 100%; box-sizing: border-box; margin: 12px 0 0; padding: 10px; border: 0; background: none; cursor: pointer;
  font-family: var(--cx-font); text-align: center;
  font-size: 15.5px; font-weight: 600; color: var(--cx-brand); text-decoration: underline; text-underline-offset: 3px;
}
.rv-cx-root .rv-cx-alt:hover { color: var(--cx-ink); }

.rv-cx-done { text-align: center; }
.rv-cx-check { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%; background: var(--cx-brand); color: #fff; }
.rv-cx-check svg { width: 32px; height: 32px; }
.rv-cx-done .rv-cx-sub { margin-bottom: 16px; }
.rv-cx-steps { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; }
.rv-cx-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid #eceef0; }
.rv-cx-steps li:first-child { border-top: 0; }
.rv-cx-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--cx-tint); color: var(--cx-brand); font-weight: 700; font-size: 15px; }
.rv-cx-steps b { display: block; font-size: 15.5px; line-height: 1.3; color: var(--cx-ink); }
.rv-cx-steps small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--cx-text); }
.rv-cx-info { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--cx-tint); font-size: 14px; color: var(--cx-text); }
