/* ==========================================================================
   Calculadora de presupuesto orientativo (includes/calculator.php + assets/calc.js)
   ========================================================================== */
.rxc {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 32px);
  align-items: start;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1c1c17;
}
.rxc-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(18px, 2.4vw, 32px);
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e6e0d4;
  box-shadow: 0 22px 44px -34px rgba(20, 20, 22, .4);
}
.rxc-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.rxc-legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #020304;
}

/* tipos de trabajo: tarjetas seleccionables */
.rxc-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rxc-type { position: relative; cursor: pointer; }
.rxc-type input, .rxc-q input { position: absolute; opacity: 0; pointer-events: none; }
.rxc-type-in {
  height: 100%;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ddd8ce;
  background: #f7f5f0;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.rxc-type-in .material-symbols-outlined { font-size: 22px; color: #7b5827; }
.rxc-type-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.rxc-type:hover .rxc-type-in { border-color: #7b5827; transform: translateY(-1px); }
.rxc-type input:checked + .rxc-type-in { background: #141416; border-color: #141416; color: #fdf9f1; box-shadow: 0 12px 24px -16px rgba(20, 20, 22, .8); }
.rxc-type input:checked + .rxc-type-in .material-symbols-outlined { color: #e5a93c; }
.rxc-type input:focus-visible + .rxc-type-in, .rxc-q input:focus-visible + span { outline: 2px solid #e5a93c; outline-offset: 2px; }

/* cantidad */
.rxc-slider-row { display: flex; align-items: center; gap: 16px; }
.rxc-range { flex: 1; accent-color: #7b5827; height: 28px; cursor: pointer; }
.rxc-num { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid #ddd8ce; background: #fff; }
.rxc-num input { width: 64px; border: 0; outline: 0; font: 700 18px/1.2 "Plus Jakarta Sans", system-ui, sans-serif; text-align: right; color: #141416; background: transparent; -moz-appearance: textfield; }
.rxc-num input::-webkit-outer-spin-button, .rxc-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rxc-num:focus-within { border-color: #7b5827; box-shadow: 0 0 0 3px rgba(123, 88, 39, .12); }
.rxc-num span { font-weight: 600; color: #45474a; }
.rxc-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid #ddd8ce; background: #fff; }
.rxc-stepper button { width: 40px; height: 40px; border: 0; border-radius: 9px; background: #f3efe7; font-size: 20px; font-weight: 600; cursor: pointer; color: #141416; }
.rxc-stepper button:hover { background: #e9e3d6; }
.rxc-stepper button:focus-visible { outline: 2px solid #e5a93c; outline-offset: 1px; }
.rxc-stepper output { min-width: 44px; text-align: center; font-size: 20px; font-weight: 700; }
.rxc-qty-fixed { margin: 0; padding: 12px 14px; border-radius: 10px; background: #f7f5f0; font-size: 13.5px; color: #45474a; }
.rxc [hidden] { display: none !important; }

/* calidad */
.rxc-quality { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rxc-q { position: relative; cursor: pointer; }
.rxc-q > span {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #ddd8ce;
  background: #fff;
  transition: border-color .2s ease, background .2s ease;
}
.rxc-q strong { font-size: 14px; }
.rxc-q small { font-size: 11.5px; line-height: 1.35; color: #6b6b66; }
.rxc-q:hover > span { border-color: #7b5827; }
.rxc-q input:checked + span { border-color: #7b5827; background: #fff8ea; box-shadow: inset 0 0 0 1px #7b5827; }

/* resultado */
.rxc-result {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(20px, 2.4vw, 30px);
  border-radius: 20px;
  color: #fdf9f1;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(229, 169, 60, .2), transparent 55%),
    linear-gradient(rgba(229, 169, 60, .06) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(229, 169, 60, .06) 1px, transparent 1px) 0 0 / 22px 22px,
    #1c1d1f;
  box-shadow: 0 30px 60px -30px rgba(20, 20, 22, .8);
}
.rxc-res-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #e5a93c; }
.rxc-total { font: 500 clamp(30px, 3.4vw, 42px)/1.1 "Noto Serif", Georgia, serif; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.rxc-formula { font: 500 13px/1.4 ui-monospace, Consolas, monospace; color: rgba(253, 249, 241, .72); }
.rxc-bar { position: relative; height: 8px; margin-top: 6px; border-radius: 999px; background: rgba(253, 249, 241, .14); overflow: hidden; }
.rxc-bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #7b5827, #e5a93c); transition: left .4s ease, width .4s ease; }
.rxc-bar-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: rgba(253, 249, 241, .6); }
.rxc-facts { margin: 6px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(253, 249, 241, .12); }
.rxc-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.rxc-facts dt { color: rgba(253, 249, 241, .65); }
.rxc-facts dd { margin: 0; font-weight: 600; text-align: right; }
.rxc-incl { display: flex; gap: 8px; margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: rgba(253, 249, 241, .8); }
.rxc-incl .material-symbols-outlined { font-size: 18px; color: #e5a93c; }
.rxc-ctas { display: grid; gap: 8px; margin-top: 6px; }
.rxc-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.rxc-cta:hover { transform: translateY(-1px); }
.rxc-cta:focus-visible { outline: 2px solid #e5a93c; outline-offset: 2px; }
.rxc-cta-dark { background: #fdf9f1; color: #141416; }
.rxc-cta-dark:hover { background: #fff; }
.rxc-cta-wa { background: #25d366; color: #0b3d20; }
.rxc-cta-wa:hover { background: #1fbf5b; }
.rxc-note { margin: 2px 0 0; font-size: 11px; line-height: 1.4; color: rgba(253, 249, 241, .5); }

@media (max-width: 1023px) {
  .rxc { grid-template-columns: 1fr; }
  .rxc-result { position: static; }
}
@media (max-width: 639px) {
  .rxc-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rxc-quality { grid-template-columns: 1fr; }
  .rxc-type-in { min-height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .rxc-bar-fill, .rxc-type-in, .rxc-cta { transition: none; }
}
