/*
 * Suministro de Agua RJ – Landing
 * Se carga únicamente en la página "Inicio" (ver mu-plugins/agua-rj-landing.php).
 *
 * Reparto de responsabilidades:
 *  - Textos, colores, tipografías, fondos y espaciados de cada sección: ajustes nativos de Elementor.
 *  - Este archivo: lo que Elementor no resuelve por sí solo (encabezado fijo, curva del hero,
 *    rejillas de datos/sectores/tabla/pasos, botón flotante) y todo el formulario de pedido.
 */

:root { color-scheme: light; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body.rj-landing {
  --rj-bg: #F3F7FB;
  --rj-surface: #FFFFFF;
  --rj-ink: #0E2238;
  --rj-muted: #516277;
  --rj-line: #D6E1EC;
  --rj-brand: #1E63B0;
  --rj-brand-deep: #0F3D73;
  --rj-water: #5FB4E6;
  --rj-sun: #F2B42A;
  --rj-sun-ink: #2A1D00;
  --rj-ok: #1F9D57;
  --rj-err: #C42F2F;
  --rj-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --rj-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rj-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  margin: 0;
  background: var(--rj-bg);
  color: var(--rj-ink);
  overflow-x: clip;
}

.rj-landing *, .rj-landing *::before, .rj-landing *::after { box-sizing: border-box; }
.rj-landing :focus-visible { outline: 3px solid var(--rj-sun); outline-offset: 2px; }
.rj-landing .elementor-widget-text-editor p { margin: 0; }
.rj-landing .elementor-widget-text-editor p + p { margin-top: .6em; }
.rj-landing .elementor-heading-title { text-wrap: balance; }
.rj-landing .elementor-widget-text-editor a { color: inherit; }

/* ---------- Encabezado ---------- */
.rj-landing .rj-header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 20;
  background: rgba(243, 247, 251, .9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rj-line);
}
.rj-landing .rj-logo img { display: block; height: auto; }
.rj-landing .rj-header .elementor-nav-menu--main .elementor-item { transition: color .15s; }
.rj-landing .rj-header .elementor-menu-toggle { border-radius: 10px; padding: 9px; }
.rj-landing .rj-header .elementor-nav-menu--dropdown { border-bottom: 1px solid var(--rj-line); box-shadow: 0 18px 30px -22px #0008; }
.rj-landing .rj-header .elementor-nav-menu--dropdown .elementor-item { padding-block: 15px; }
@media (max-width: 1024px) {
  .rj-landing .rj-header .rj-logo { margin-right: auto; }
  .rj-landing .rj-header .rj-nav { order: 3; }
}
@media (max-width: 380px) {
  .rj-landing .rj-header .rj-header-cta .elementor-button { padding: 12px 15px; font-size: 14px; }
}

/* ---------- Botones ---------- */
.rj-landing .elementor-button { transition: transform .15s, box-shadow .15s, background-color .15s; }
.rj-landing .rj-btn-sun .elementor-button:hover { transform: translateY(-1px); }

/* ---------- Hero ---------- */
.rj-landing .rj-hero { position: relative; overflow: hidden; }
.rj-landing .rj-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 90px;
  background: radial-gradient(120% 90px at 50% 100%, var(--rj-bg) 60%, transparent 61%);
  pointer-events: none;
}
.rj-landing .rj-hero > .e-con-inner { position: relative; z-index: 1; }
.rj-landing .rj-hero h1 span { color: var(--rj-water); }
.rj-landing .rj-hero-top {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 40px;
  align-items: end;
}
.rj-landing .rj-hero-top > .e-con { width: auto; min-width: 0; }
.rj-landing .rj-phone .elementor-heading-title { user-select: all; }
.rj-landing .rj-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 18px;
  overflow: hidden;
}
.rj-landing .rj-facts > .e-con { width: auto; min-width: 0; }

/* ---------- Tarjeta del pedido ---------- */
.rj-landing .rj-order { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .67); scroll-margin-top: 92px; }
.rj-landing .rj-order-head { border-bottom: 1px solid var(--rj-line); }
.rj-landing .rj-order-head > .elementor-widget { width: auto; max-width: 100%; }

@media (max-width: 920px) {
  .rj-landing .rj-hero-top { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Secciones ---------- */
.rj-landing .rj-sec-head > .elementor-widget { width: auto; max-width: 100%; }

.rj-landing .rj-sectors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 2px solid var(--rj-ink);
}
.rj-landing .rj-sectors > .e-con { width: auto; min-width: 0; border-right: 1px solid var(--rj-line); }
.rj-landing .rj-sectors > .e-con:last-child { border-right: 0; }
@media (max-width: 820px) {
  .rj-landing .rj-sectors { grid-template-columns: 1fr 1fr; }
  .rj-landing .rj-sectors > .e-con { border-bottom: 1px solid var(--rj-line); }
  .rj-landing .rj-sectors > .e-con:nth-child(2n) { border-right: 0; }
}
@media (max-width: 480px) {
  .rj-landing .rj-sectors { grid-template-columns: 1fr; }
  .rj-landing .rj-sectors > .e-con { border-right: 0; }
}

/* Tabla de capacidades (filas = contenedores de Elementor) */
.rj-landing .rj-scale-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.7fr 30%;
  gap: 0 24px;
  align-items: center;
}
.rj-landing .rj-scale-row > * { width: auto; min-width: 0; }
.rj-landing .rj-scale-row + .rj-scale-row { border-top: 1px solid var(--rj-line); }
.rj-landing .rj-scale-row .elementor-heading-title,
.rj-landing .rj-scale-row .elementor-widget-text-editor { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .rj-landing .rj-scale-head { display: none; }
  .rj-landing .rj-scale-head + .rj-scale-row { border-top: 0; }
  .rj-landing .rj-scale-row { grid-template-columns: auto 1fr; gap: 6px 16px; }
  .rj-landing .rj-scale-row > :nth-child(2) { text-align: right; }
  .rj-landing .rj-scale-row > :nth-child(3),
  .rj-landing .rj-scale-row > :nth-child(4) { grid-column: 1 / -1; }
}

.rj-landing .rj-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.rj-landing .rj-steps > .e-con { width: auto; min-width: 0; }
@media (max-width: 760px) { .rj-landing .rj-steps { grid-template-columns: 1fr; } }

/* Preguntas frecuentes (acordeón anidado de Elementor) */
.rj-landing .rj-faq { max-width: 820px; }
.rj-landing .rj-faq .e-n-accordion { display: grid; gap: 10px; }
.rj-landing .rj-faq .e-n-accordion-item {
  background: var(--rj-surface);
  border: 1px solid var(--rj-line);
  border-radius: 14px;
  overflow: hidden;
}
.rj-landing .rj-faq .e-n-accordion-item-title {
  padding: 16px 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  justify-content: space-between;
}
.rj-landing .rj-faq .e-n-accordion-item-title-text { font: 700 16px/1.4 var(--rj-body); color: var(--rj-ink); margin: 0; }
.rj-landing .rj-faq .e-n-accordion-item-title-icon svg { fill: var(--rj-brand); width: 14px; height: 14px; }
.rj-landing .rj-faq .e-n-accordion-item > .e-con { border: 0; }

.rj-landing .rj-cta > .elementor-widget { width: auto; max-width: 100%; }

/* ---------- Pie y botón flotante ---------- */
.rj-landing .rj-footer > .e-con-inner > .elementor-widget { width: auto; max-width: 100%; }
.rj-landing .rj-footer a { text-decoration: underline; }

.rj-landing .rj-float {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: auto;
  transition: opacity .2s, transform .2s, visibility .2s;
}
.rj-landing .rj-float.is-away { opacity: 0; visibility: hidden; transform: translateY(12px); pointer-events: none; }
.rj-landing .rj-float .elementor-button {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .55);
}
.rj-landing .rj-float .elementor-button-content-wrapper { display: grid; place-items: center; gap: 0; }
.rj-landing .rj-float .elementor-button-icon svg { width: 30px; height: 30px; display: block; }
.rj-landing .rj-float .elementor-button-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ============================================================
   Formulario de pedido  ([agua_rj_pedido])
   ============================================================ */
.rj-form { color: var(--rj-ink); font: 16px/1.55 var(--rj-body); margin: 0; }
.rj-form [hidden] { display: none !important; }
.rj-form .rj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.rj-form .rj-cols > div { min-width: 0; }
.rj-form .rj-step {
  display: flex; align-items: center; gap: 10px;
  font: 700 13px/1.3 var(--rj-body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--rj-muted); margin: 20px 0 10px;
}
.rj-form .rj-cols > div > .rj-step:first-child { margin-top: 6px; }
.rj-form .rj-step i {
  font-style: normal; display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rj-brand); color: #fff; font-size: 12px; letter-spacing: 0;
}

/* Opciones tipo tarjeta (radios) */
.rj-form .rj-opt { position: relative; display: flex; min-width: 0; }
.rj-form .rj-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.rj-form .rj-opt label {
  flex: 1; min-width: 0; cursor: pointer; margin: 0;
  border: 1.5px solid var(--rj-line); border-radius: 12px; background: var(--rj-surface);
  transition: border-color .15s, background-color .15s;
}
.rj-form .rj-opt label:hover { border-color: #9FBBD8; }
.rj-form .rj-opt input:checked + label { border-color: var(--rj-brand); background: #E9F0F8; }
.rj-form .rj-opt input:focus-visible + label { outline: 3px solid var(--rj-sun); outline-offset: 2px; }

.rj-form .rj-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rj-form .rj-seg label,
.rj-form .rj-urg label {
  padding: 10px 6px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.25;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.rj-form .rj-seg label svg { width: 22px; height: 22px; stroke: var(--rj-brand); fill: none; }
.rj-form .rj-urg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rj-form .rj-urg label { min-height: 46px; }

/* Ilustración del volumen */
.rj-form .rj-vol-wrap { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: stretch; }
.rj-form .rj-vol-wrap > div { min-width: 0; }
.rj-form .rj-tank-col { display: flex; flex-direction: column; gap: 6px; }
.rj-form .rj-tank {
  position: relative; flex: 1; min-height: 170px; overflow: hidden;
  border: 2px solid var(--rj-brand); border-radius: 14px 14px 18px 18px; background: #F4F9FD;
}
.rj-form .rj-tank-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, var(--rj-water), var(--rj-brand));
  transition: height .5s cubic-bezier(.3, .7, .2, 1);
}
.rj-form .rj-tank-fill::before {
  content: ""; position: absolute; top: -6px; left: -10%; width: 120%; height: 12px;
  border-radius: 50%; background: var(--rj-water); opacity: .7;
}
.rj-form .rj-tank-label {
  position: absolute; left: 0; right: 0; top: 10px; z-index: 1; text-align: center;
  font: 700 20px/1 var(--rj-display); color: var(--rj-brand-deep);
}
.rj-form .rj-tank-label small { display: block; margin-top: 3px; font: 500 10px/1 var(--rj-mono); color: var(--rj-muted); }
.rj-form .rj-tank-note { margin: 0; text-align: center; font: 500 10px/1.3 var(--rj-mono); color: var(--rj-muted); }
.rj-form .rj-vol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rj-form .rj-vol label { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.rj-form .rj-vol label b { font: 700 22px/1 var(--rj-display); }
.rj-form .rj-vol label small { font: 500 11px/1.3 var(--rj-mono); color: var(--rj-muted); }
.rj-form .rj-vol-readout { margin: 10px 0 0; font-size: 13px; color: var(--rj-muted); font-variant-numeric: tabular-nums; }
.rj-form .rj-vol-readout b { color: var(--rj-ink); }

/* Campos */
.rj-form .rj-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rj-form .rj-fecha-row { margin-top: 10px; }
.rj-form .rj-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rj-form .rj-field.rj-full { grid-column: 1 / -1; }
.rj-form .rj-field label { font-size: 13px; font-weight: 600; margin: 0; }
.rj-form .rj-field label span { font-weight: 400; color: var(--rj-muted); }
.rj-form .rj-field input,
.rj-form .rj-field select,
.rj-form .rj-field textarea {
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--rj-ink);
  background: var(--rj-bg); border: 1.5px solid var(--rj-line); border-radius: 10px;
  padding: 10px 12px; width: 100%; min-height: 46px; margin: 0; box-shadow: none;
}
.rj-form .rj-field textarea { min-height: 0; resize: vertical; }
.rj-form .rj-field input:focus,
.rj-form .rj-field select:focus,
.rj-form .rj-field textarea:focus { border-color: var(--rj-brand); outline: none; box-shadow: 0 0 0 3px rgba(30, 99, 176, .2); }
.rj-form .rj-err { color: var(--rj-err); font-size: 12.5px; line-height: 1.35; font-weight: 500; }
.rj-form .rj-err:empty { display: none; }
.rj-form .rj-field.is-invalid input,
.rj-form .rj-field.is-invalid select { border-color: var(--rj-err); background: #FDF4F4; }

/* Botones del formulario */
.rj-form .rj-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; font: 700 15px/1.15 var(--rj-body); padding: 14px 22px;
  cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.rj-form .rj-btn-sun { background: var(--rj-sun); color: var(--rj-sun-ink); box-shadow: 0 6px 0 -2px #856317; }
.rj-form .rj-btn-sun:hover { transform: translateY(-1px); background: var(--rj-sun); color: var(--rj-sun-ink); }
.rj-form .rj-btn-ghost { background: transparent; color: var(--rj-ink); border: 1.5px solid var(--rj-line); }
.rj-form .rj-btn-ghost:hover { background: var(--rj-bg); color: var(--rj-ink); }
.rj-form .rj-btn-wa { background: #25D366; color: #06301A; }
.rj-form .rj-btn-wa:hover { background: #25D366; color: #06301A; transform: translateY(-1px); }
.rj-form .rj-submit { width: 100%; margin-top: 20px; font-size: 16px; padding: 17px; }
.rj-form .rj-fine { font-size: 12px; color: var(--rj-muted); margin: 12px 0 0; text-align: center; }
.rj-form .rj-form-alert { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--rj-err); text-align: center; }
.rj-form .rj-form-alert:empty { display: none; }

/* Resumen del pedido preparado */
.rj-form .rj-done { border: 2px solid var(--rj-ok); border-radius: 16px; padding: 18px; margin-top: 18px; background: #F1F9F4; }
.rj-form .rj-done h3 { font: 700 24px/1.05 var(--rj-display); text-transform: uppercase; color: #17794A; margin: 0; }
.rj-form .rj-done h3:focus { outline: none; }
.rj-form .rj-done-text { margin: 6px 0 12px; font-size: 14.5px; }
.rj-form .rj-done pre {
  white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 var(--rj-mono); color: var(--rj-ink);
  background: var(--rj-bg); border: 1px solid var(--rj-line); border-radius: 10px;
  padding: 12px; margin: 0 0 12px; max-height: 240px; overflow: auto;
}
.rj-form .rj-done-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rj-form .rj-copy-status { font-size: 12.5px; color: var(--rj-muted); }

@media (max-width: 920px) {
  .rj-form .rj-cols { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 480px) {
  .rj-form .rj-seg { grid-template-columns: repeat(2, 1fr); }
  .rj-form .rj-grid2 { grid-template-columns: 1fr; }
  .rj-form .rj-vol { grid-template-columns: repeat(2, 1fr); }
  .rj-form .rj-vol-wrap { grid-template-columns: 70px 1fr; }
  .rj-form .rj-urg label { font-size: 12.5px; padding-inline: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rj-landing *, .rj-form * { transition: none !important; }
}

/* ---------- Anchos máximos de lectura ---------- */
.rj-landing .rj-lead { max-width: 34em; }
.rj-landing .rj-order-sub { max-width: 32em; }
.rj-landing .rj-sec-head .elementor-heading-title { max-width: 14em; }
.rj-landing .rj-sec-head .elementor-widget-text-editor { max-width: 30em; }
.rj-landing .rj-cta .elementor-heading-title { max-width: 13em; }
.rj-landing .rj-footer strong { color: var(--rj-ink); }
.rj-landing .rj-float .elementor-button-icon svg { fill: #06301A; }

/* ---------- Ajustes de una sola columna ---------- */
@media (max-width: 920px) {
  .rj-form .rj-cols > div + div > .rj-step:first-child { margin-top: 22px; }
}
@media (max-width: 480px) {
  .rj-form .rj-tank-label { font-size: 16px; }
  .rj-form .rj-tank-label small { font-size: 9px; }
}

/* ---------- Ajustes de UX (botones del hero y textos del formulario) ---------- */
.rj-landing .rj-hero-ctas .elementor-button { white-space: nowrap; }
.rj-landing .rj-btn-call .elementor-button-icon svg { width: 15px; height: 15px; fill: currentColor; }
.rj-form .rj-submit { line-height: 1.2; }
.rj-form .rj-ico-wa { width: 22px; height: 22px; flex: none; fill: currentColor; }
.rj-form .rj-fine { font-size: 13px; color: var(--rj-ink); }
.rj-form .rj-fine.rj-fine-2 { font-size: 12px; color: var(--rj-muted); margin-top: 6px; }
@media (max-width: 380px) {
  .rj-form .rj-submit { font-size: 15px; padding-inline: 12px; }
}

/* ---------- Vista previa del mensaje de WhatsApp ---------- */
.rj-form .rj-done pre { font-family: var(--rj-mono), "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji"; }
.rj-form .rj-done pre b { font-weight: 700; }

/* ---------- Campo de ubicación en Google Maps ---------- */
.rj-form .rj-help { font-size: 12px; line-height: 1.4; color: var(--rj-muted); }
.rj-form .rj-field input[type="url"] { text-overflow: ellipsis; }
