/*!
 * PsDevs Solicitar Cotización — estilos del diálogo.
 * Usa las variables del tema si existen y, si no, sus propios valores.
 */

.psdevs-cotizacion {
  --psdevs-ink: var(--nv-ink, #0a1831);
  --psdevs-red: var(--nv-red, #c91f3a);
  --psdevs-red-dark: var(--nv-red-dark, #a9142d);
  --psdevs-muted: var(--nv-muted, #697386);
  --psdevs-line: var(--nv-line, #d9d8d3);

  width: calc(100% - 32px);
  max-width: 660px;
  max-height: min(92svh, 900px);
  padding: 0;
  border: 1px solid var(--psdevs-line);
  border-radius: 10px;
  color: var(--psdevs-ink);
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  overflow: auto;
}

/* Apertura y cierre animados. `allow-discrete` permite animar `display` y
   `overlay`, que es lo que hace que la salida también se vea; `@starting-style`
   da el estado inicial de la entrada. Donde no se soporta, se abre y cierra sin
   animación, sin romper nada. */
.psdevs-cotizacion {
  opacity: 0;
  transform: translateY(14px) scale(.985);
  transition:
    opacity .26s ease,
    transform .26s cubic-bezier(.22, .61, .36, 1),
    overlay .26s ease allow-discrete,
    display .26s ease allow-discrete;
}

.psdevs-cotizacion[open] {
  opacity: 1;
  transform: none;
}

@starting-style {
  .psdevs-cotizacion[open] {
    opacity: 0;
    transform: translateY(14px) scale(.985);
  }
}

.psdevs-cotizacion::backdrop {
  background: rgba(5, 15, 32, .7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition:
    opacity .26s ease,
    overlay .26s ease allow-discrete,
    display .26s ease allow-discrete;
}

.psdevs-cotizacion[open]::backdrop { opacity: 1; }

@starting-style {
  .psdevs-cotizacion[open]::backdrop { opacity: 0; }
}

.psdevs-cotizacion__form {
  position: relative;
  margin: 0;
  padding: 30px 34px 0;
}

.psdevs-cotizacion__cerrar {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 2px;
  border: 1px solid var(--psdevs-line);
  border-radius: 50%;
  background: #fff;
  color: var(--psdevs-ink);
  font-size: 20px;
  line-height: 0;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.psdevs-cotizacion__cerrar:hover {
  border-color: var(--psdevs-red);
  background: var(--psdevs-red);
  color: #fff;
}

.psdevs-cotizacion__antetitulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--psdevs-red);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.psdevs-cotizacion__antetitulo::before {
  content: "";
  width: 28px;
  height: 2px;
  flex: 0 0 28px;
  background: currentColor;
}

.psdevs-cotizacion__titulo {
  margin: 0 40px 8px 0;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.psdevs-cotizacion__descripcion {
  margin: 0 0 20px;
  color: var(--psdevs-muted);
  font-size: .88rem;
}

.psdevs-cotizacion__campos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 18px;
}

.psdevs-cotizacion__campo { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.psdevs-cotizacion__campo--ancho { grid-column: 1 / -1; }

.psdevs-cotizacion__campo label {
  color: #4b5568;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.psdevs-cotizacion__campo label span { color: var(--psdevs-red); }

.psdevs-cotizacion__campo input,
.psdevs-cotizacion__campo textarea {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #d7dbe3;
  border-radius: 6px;
  background: #fff;
  color: var(--psdevs-ink);
  font: inherit;
  font-size: .9rem;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.psdevs-cotizacion__campo textarea {
  height: auto;
  min-height: 76px;
  padding: 9px 12px;
  resize: vertical;
}

/* El foco no usa el rojo de marca para no confundirse con un error. */
.psdevs-cotizacion__campo input:focus,
.psdevs-cotizacion__campo textarea:focus {
  border-color: var(--psdevs-ink);
  box-shadow: 0 0 0 3px rgba(10, 24, 49, .08);
  outline: none;
}

.psdevs-cotizacion__campo input:focus-visible,
.psdevs-cotizacion__campo textarea:focus-visible,
.psdevs-cotizacion__boton:focus-visible,
.psdevs-cotizacion__cerrar:focus-visible {
  outline: 3px solid #efb02d;
  outline-offset: 2px;
}

.psdevs-cotizacion__campo input[readonly] {
  border-color: #e6e8ee;
  background: #f5f6f9;
  color: #5c667a;
}

.psdevs-cotizacion__campo input[aria-invalid="true"],
.psdevs-cotizacion__campo textarea[aria-invalid="true"] {
  border-color: var(--psdevs-red);
  box-shadow: 0 0 0 3px rgba(201, 31, 58, .1);
}

.psdevs-cotizacion__campo .psdevs-cotizacion__error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--psdevs-red);
  font-size: .72rem;
  font-weight: 600;
}

.psdevs-cotizacion__campo .psdevs-cotizacion__error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--psdevs-red);
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  line-height: 1;
}

/* señuelo antispam: fuera de la vista, pero no con display:none */
.psdevs-cotizacion__senuelo {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: 0;
}

.psdevs-cotizacion__nota {
  margin: 12px 0 14px;
  color: var(--psdevs-muted);
  font-size: .78rem;
}

/* Los botones quedan siempre a la vista aunque el formulario sea más alto que
   la pantalla. */
.psdevs-cotizacion__acciones {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 -34px;
  padding: 14px 34px 20px;
  background: #fff;
  box-shadow: 0 -14px 18px rgba(255, 255, 255, .92);
}

.psdevs-cotizacion__boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: inherit;
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.psdevs-cotizacion__boton--enviar { background: var(--psdevs-red); color: #fff; }
.psdevs-cotizacion__boton--enviar:hover { background: var(--psdevs-red-dark); }
.psdevs-cotizacion__boton--enviar[disabled] { opacity: .6; cursor: default; }

.psdevs-cotizacion__boton--cancelar {
  background: #f7f7f7;
  border-color: transparent;
  color: var(--psdevs-ink);
}
.psdevs-cotizacion__boton--cancelar:hover { background: #eee; }

.psdevs-cotizacion__aviso,
.psdevs-cotizacion__mensaje {
  margin: 18px 0 0;
  padding: 14px;
  border-left: 4px solid var(--psdevs-red);
  background: #fdf0f2;
  color: #7a1123;
  font-size: .85rem;
}

.psdevs-cotizacion__aviso--ok,
.psdevs-cotizacion__mensaje--ok {
  border-left-color: #338149;
  background: #eef5ef;
  color: #174d26;
}

.psdevs-cotizacion__mensaje:empty { display: none; }

body.psdevs-cotizacion-abierto { overflow: hidden; }

@media (max-width: 640px) {
  .psdevs-cotizacion__form { padding: 24px 20px 0; }
  .psdevs-cotizacion__acciones { margin: 0 -20px; padding: 13px 20px 16px; }
  .psdevs-cotizacion__campos { grid-template-columns: 1fr; }
  .psdevs-cotizacion__campo--ancho { grid-column: auto; }
  .psdevs-cotizacion__acciones .psdevs-cotizacion__boton { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .psdevs-cotizacion,
  .psdevs-cotizacion::backdrop { transition: none; }
}
