/*
 * Softem Cotizaciones: el botón «Cotizar», la confirmación, la lista, el formulario y WhatsApp.
 *
 * Los colores, el radio y la sombra salen de los tokens del tema de Softem (`--sf-*`) cuando están, y si no, de los
 * valores de abajo. Cada tienda los cambia redefiniendo las variables `--softem-cot-*` en su hoja.
 *
 * Desde la alta fidelidad de Dronescan (D14) los respaldos son su paleta y no el negro: la acción en el azul #465EBB
 * (blanco encima: 5,87:1), lo elegido en azul tenue con borde azul, y el foco azul. Así el complemento se ve con la
 * misma paleta aunque el tema no cargue sus tokens.
 */

:root {
  --softem-cot-accion: var(--sf-accion-primaria, #465ebb);
  --softem-cot-accion-hover: var(--sf-accion-primaria-hover, #384b9c);
  --softem-cot-inversa: var(--sf-accion-inversa, #fff);
  --softem-cot-texto: var(--sf-texto-principal, #1d1d1d);
  --softem-cot-suave: var(--sf-texto-secundario, #6b6b6b);
  --softem-cot-fondo: var(--sf-superficie-base, #fff);
  --softem-cot-gris: var(--sf-superficie-calida, #f0f1f2);
  --softem-cot-hundido: var(--sf-superficie-hundida, #ececec);
  --softem-cot-linea: var(--sf-borde-medio, #cdcdcd);
  --softem-cot-linea-sutil: var(--sf-borde-sutil, #dedede);
  --softem-cot-campo: var(--sf-borde-campo, #8a8a8a);
  --softem-cot-fuerte: var(--sf-borde-fuerte, #1d1d1d);
  --softem-cot-foco: var(--sf-foco, #465ebb);
  --softem-cot-azul: var(--sf-azul, #465ebb);
  --softem-cot-elegido-fondo: var(--sf-elegido-fondo, #eef1fb);
  --softem-cot-elegido-borde: var(--sf-elegido-borde, #465ebb);
  --softem-cot-elegido-texto: var(--sf-elegido-texto, #384b9c);
  --softem-cot-hover-fondo: var(--sf-hover-fondo, #eef1fb);
  --softem-cot-hover-texto: var(--sf-hover-texto, #384b9c);
  --softem-cot-exito: var(--sf-exito, #1b6b43);
  --softem-cot-exito-fondo: var(--sf-exito-fondo, #e7f3ec);
  --softem-cot-error: var(--sf-error, #b3121b);
  --softem-cot-error-fondo: var(--sf-error-fondo, #fbe9ea);
  --softem-cot-radio: var(--sf-radio, 5px);
  --softem-cot-velo: var(--sf-velo, rgba(0, 0, 0, .55));
  --softem-cot-sombra: var(--sf-sombra-2, 0 18px 30px rgba(0, 0, 0, .08));
  --softem-cot-boton-alto: var(--sf-boton-m, 50px);
  --softem-cot-boton-chico: var(--sf-boton-s, 40px);
  --softem-cot-boton-letra: var(--sf-boton-tam, 15px);
  --softem-cot-boton-chico-letra: var(--sf-boton-s-tam, 14px);
  --softem-cot-boton-relleno: var(--sf-boton-relleno, 22px);
  --softem-cot-boton-peso: var(--sf-peso-boton, 650);
}

/* --- El botón ------------------------------------------------------------------------------------------------- */

a.softem-cot-boton,
button.softem-cot-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--softem-cot-boton-alto);
  padding: 0 var(--softem-cot-boton-relleno);
  border: 2px solid transparent;
  border-radius: var(--softem-cot-radio);
  font-family: inherit;
  font-size: var(--softem-cot-boton-letra);
  font-weight: var(--softem-cot-boton-peso);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

a.softem-cot-boton:focus-visible,
button.softem-cot-boton:focus-visible {
  outline: 2px solid var(--softem-cot-foco);
  outline-offset: 2px;
}

a.softem-cot-boton--principal,
button.softem-cot-boton--principal {
  background: var(--softem-cot-accion);
  border-color: var(--softem-cot-accion);
  color: var(--softem-cot-inversa);
}

a.softem-cot-boton--principal:hover,
button.softem-cot-boton--principal:hover {
  background: var(--softem-cot-accion-hover);
  border-color: var(--softem-cot-accion-hover);
  color: var(--softem-cot-inversa);
  text-decoration: none;
}

a.softem-cot-boton--contorno,
button.softem-cot-boton--contorno {
  background: var(--softem-cot-fondo);
  border-color: var(--softem-cot-fuerte);
  color: var(--softem-cot-texto);
}

a.softem-cot-boton--contorno:hover,
button.softem-cot-boton--contorno:hover {
  background: var(--softem-cot-accion);
  border-color: var(--softem-cot-accion);
  color: var(--softem-cot-inversa);
  text-decoration: none;
}

a.softem-cot-boton--chico,
button.softem-cot-boton--chico {
  min-height: var(--softem-cot-boton-chico);
  padding: 0 16px;
  font-size: var(--softem-cot-boton-chico-letra);
}

a.softem-cot-boton--ancho,
button.softem-cot-boton--ancho {
  display: flex;
  width: 100%;
}

/* Mientras se agrega por AJAX: el anillo, para que no se vuelva a tocar. */
.softem-cot-boton.is-cargando {
  pointer-events: none;
  opacity: .8;
}

.softem-cot-boton.is-cargando::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: softem-cot-girar .6s linear infinite;
}

@keyframes softem-cot-girar {
  to { transform: rotate(360deg); }
}

.softem-cot-boton-error {
  display: block;
  margin-top: 6px;
  color: var(--softem-cot-error);
  font-size: 13px;
}

.softem-cot-carro {
  margin: 12px 0 0;
}

/* --- La confirmación al agregar ----------------------------------------------------------------------------------- */

.softem-cot-dialogo {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.softem-cot-dialogo[hidden] {
  display: none;
}

.softem-cot-dialogo__velo {
  position: absolute;
  inset: 0;
  background: var(--softem-cot-velo);
}

.softem-cot-dialogo__caja {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 20px;
  background: var(--softem-cot-fondo);
  border: 1px solid var(--softem-cot-linea);
  border-radius: var(--softem-cot-radio);
  box-shadow: var(--softem-cot-sombra);
  color: var(--softem-cot-texto);
  box-sizing: border-box;
}

.softem-cot-dialogo__caja:focus {
  outline: none;
}

.softem-cot-dialogo__cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.softem-cot-dialogo__titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}

.softem-cot-dialogo__titulo svg {
  flex: none;
  color: var(--softem-cot-exito);
}

button.softem-cot-dialogo__cerrar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--softem-cot-radio);
  color: var(--softem-cot-suave);
  cursor: pointer;
}

button.softem-cot-dialogo__cerrar:hover {
  background: var(--softem-cot-hover-fondo);
  color: var(--softem-cot-hover-texto);
}

.softem-cot-dialogo__item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--softem-cot-linea-sutil);
  border-bottom: 1px solid var(--softem-cot-linea-sutil);
}

.softem-cot-dialogo__foto img {
  display: block;
  width: 64px;
  height: 56px;
  object-fit: contain;
}

.softem-cot-dialogo__datos b {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}

.softem-cot-dialogo__datos small {
  font-size: 13.5px;
  color: var(--softem-cot-suave);
}

html.softem-cot-sin-scroll {
  overflow: hidden;
}

/* --- La página ---------------------------------------------------------------------------------------------------- */

.softem-cot {
  color: var(--softem-cot-texto);
}

.softem-cot *,
.softem-cot *::before,
.softem-cot *::after {
  box-sizing: border-box;
}

.softem-cot__columnas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: start;
}

.softem-cot__titulo {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.3;
}

.softem-cot-aviso {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 3px solid currentColor;
  border-radius: var(--softem-cot-radio);
  font-size: 15px;
  line-height: 1.45;
}

.softem-cot-aviso--exito {
  background: var(--softem-cot-exito-fondo);
  color: var(--softem-cot-exito);
}

.softem-cot-aviso--error {
  background: var(--softem-cot-error-fondo);
  color: var(--softem-cot-error);
}

.softem-cot-solo-lectores {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* La lista */

.softem-cot-lista__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.softem-cot-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--softem-cot-linea);
}

.softem-cot-item:last-child {
  border-bottom: 1px solid var(--softem-cot-linea);
}

.softem-cot-item__foto {
  display: block;
  background: var(--softem-cot-gris);
  border-radius: var(--softem-cot-radio);
}

.softem-cot-item__foto img {
  display: block;
  width: 100%;
  height: 88px;
  padding: 6px;
  object-fit: contain;
}

.softem-cot-item__info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.softem-cot-item__marca {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--softem-cot-suave);
}

a.softem-cot-item__nombre {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--softem-cot-texto);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.softem-cot-item__nombre:hover {
  color: var(--softem-cot-hover-texto);
  text-decoration: underline;
}

.softem-cot-item__sku {
  font-size: 12.5px;
  color: var(--softem-cot-suave);
}

.softem-cot-item__precio {
  font-weight: 700;
}

.softem-cot-item__precio del {
  color: var(--softem-cot-suave);
  font-weight: 400;
}

.softem-cot-item__precio ins {
  text-decoration: none;
}

.softem-cot-item__cantidad {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.softem-cot-cantidad {
  display: inline-flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--softem-cot-campo);
  border-radius: var(--softem-cot-radio);
  background: var(--softem-cot-fondo);
}

button.softem-cot-cantidad__boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--softem-cot-texto);
  cursor: pointer;
}

button.softem-cot-cantidad__boton:hover {
  background: var(--softem-cot-hover-fondo);
  color: var(--softem-cot-hover-texto);
}

input.softem-cot-cantidad__campo {
  width: 44px;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
  color: var(--softem-cot-texto);
  -moz-appearance: textfield;
  appearance: textfield;
}

input.softem-cot-cantidad__campo::-webkit-outer-spin-button,
input.softem-cot-cantidad__campo::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

a.softem-cot-item__quitar {
  font-size: 13px;
  color: var(--softem-cot-suave);
  text-decoration: underline;
}

.softem-cot-lista__enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 8px;
  font-size: 14px;
}

/* «Actualizar lista» va primero en el HTML para ser el botón que responde al Enter; se ve después de «Volver». */
.softem-cot-lista__enlaces a.softem-cot-enlace {
  order: -1;
}

a.softem-cot-enlace,
button.softem-cot-enlace {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: var(--softem-cot-texto);
  text-decoration: underline;
  cursor: pointer;
}

.softem-cot-vacia {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 24px;
  background: var(--softem-cot-gris);
  border-radius: var(--softem-cot-radio);
}

.softem-cot-vacia p {
  margin: 0;
}

/* El formulario */

.softem-cot-form__form {
  display: grid;
  gap: 18px;
}

.softem-cot-form__form .softem-cot__titulo {
  margin-bottom: -4px;
}

.softem-cot-campos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.softem-cot-campo--mensaje {
  grid-column: 1 / -1;
}

.softem-cot-campo label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.softem-cot-campo label em {
  font-style: normal;
  font-weight: 400;
  color: var(--softem-cot-suave);
}

.softem-cot-campo__marca {
  color: var(--softem-cot-texto);
}

.softem-cot-campo input,
.softem-cot-campo textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  background: var(--softem-cot-fondo);
  border: 1px solid var(--softem-cot-campo);
  border-radius: var(--softem-cot-radio);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--softem-cot-texto);
  box-shadow: none;
}

.softem-cot-campo textarea {
  min-height: 96px;
  resize: vertical;
}

.softem-cot-campo input::placeholder,
.softem-cot-campo textarea::placeholder {
  color: var(--softem-cot-suave);
  opacity: 1;
}

.softem-cot-campo input:focus-visible,
.softem-cot-campo textarea:focus-visible,
.softem-cot-opcion input:focus-visible,
input.softem-cot-cantidad__campo:focus-visible,
button.softem-cot-cantidad__boton:focus-visible,
.softem-cot-enlace:focus-visible {
  outline: 2px solid var(--softem-cot-foco);
  outline-offset: 2px;
}

.softem-cot-campo--error input,
.softem-cot-campo--error textarea,
.softem-cot-campo--error select,
.softem-cot-campo--error .select2-container .select2-selection--single {
  border-color: var(--softem-cot-error);
}

/* La comuna se elige de la lista del pago, por región (hallazgo 25 de la revisión del 13-11-2026): sin JS, la lista
   del navegador con el aspecto de los demás campos; con JS, el buscador del pago (selectWoo), del mismo alto. */
.softem-cot-campo select {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  background: var(--softem-cot-fondo);
  border: 1px solid var(--softem-cot-campo);
  border-radius: var(--softem-cot-radio);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--softem-cot-texto);
}

.softem-cot-campo select:focus-visible { outline: 2px solid var(--softem-cot-foco); outline-offset: 2px; }

.softem-cot-campo .select2-container .select2-selection--single {
  display: flex;
  align-items: center;
  height: 48px;
  background: var(--softem-cot-fondo);
  border: 1px solid var(--softem-cot-campo);
  border-radius: var(--softem-cot-radio);
}

.softem-cot-campo .select2-container .select2-selection--single .select2-selection__rendered {
  padding: 0 40px 0 14px;
  font-size: 16px;
  line-height: 46px;
  color: var(--softem-cot-texto);
}

.softem-cot-campo .select2-container .select2-selection--single .select2-selection__placeholder { color: var(--softem-cot-suave); }

.softem-cot-campo .select2-container .select2-selection--single .select2-selection__arrow {
  top: 0;
  right: 8px;
  height: 46px;
}

.softem-cot-campo .select2-container--focus .select2-selection--single,
.softem-cot-campo .select2-container--open .select2-selection--single {
  outline: 2px solid var(--softem-cot-foco);
  outline-offset: 2px;
}

.softem-cot-campo__error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--softem-cot-error);
}

.softem-cot-opcion {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--softem-cot-linea);
  border-radius: var(--softem-cot-radio);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.softem-cot-opcion:hover {
  border-color: var(--softem-cot-elegido-borde);
}

/* Marcada, como lo elegido en el tema: borde azul y fondo tenue (D14). */
.softem-cot-opcion:has(input:checked) {
  border-color: var(--softem-cot-elegido-borde);
  box-shadow: inset 0 0 0 1px var(--softem-cot-elegido-borde);
  background: var(--softem-cot-elegido-fondo);
}

.softem-cot-opcion input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--softem-cot-accion);
}

.softem-cot-opcion__texto {
  display: grid;
  line-height: 1.3;
}

.softem-cot-opcion__texto b {
  font-weight: 650;
}

.softem-cot-opcion__texto small {
  font-size: 12.5px;
  color: var(--softem-cot-suave);
}

.softem-cot-campo--rut[hidden],
.softem-cot-js .softem-cot-sin-js {
  display: none;
}

.softem-cot-trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.softem-cot-privacidad {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--softem-cot-suave);
}

.softem-cot-privacidad a {
  color: inherit;
}

/* WhatsApp con la lista */

.softem-cot-wa {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  background: var(--softem-cot-fondo);
  border: 1px solid var(--softem-cot-linea);
  border-radius: var(--softem-cot-radio);
}

.softem-cot-wa__cab {
  display: flex;
  align-items: center;
  gap: 12px;
}

.softem-cot-wa__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--softem-cot-accion);
  color: var(--softem-cot-inversa);
}

.softem-cot-wa__cab b {
  display: block;
  font-weight: 650;
  line-height: 1.3;
}

.softem-cot-wa__cab small {
  display: block;
  font-size: 13px;
  color: var(--softem-cot-suave);
}

.softem-cot-wa__mensaje {
  margin: 0;
  padding: 12px 14px;
  background: var(--softem-cot-gris);
  border-radius: var(--softem-cot-radio);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* La confirmación después de enviar */

.softem-cot-gracias {
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
  border: 1px solid var(--softem-cot-linea);
  border-radius: var(--softem-cot-radio);
  text-align: center;
}

.softem-cot-gracias p {
  margin: 0;
}

.softem-cot-gracias__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--softem-cot-exito-fondo);
  color: var(--softem-cot-exito);
}

.softem-cot-gracias__titulo {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.softem-cot-gracias__numero {
  font-size: 17px;
}

.softem-cot-gracias__lista {
  width: 100%;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  border-top: 1px solid var(--softem-cot-linea-sutil);
}

.softem-cot-gracias__lista li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--softem-cot-linea-sutil);
}

.softem-cot-gracias__lista small {
  flex: none;
  color: var(--softem-cot-suave);
}

.softem-cot-gracias__acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* --- Celular ------------------------------------------------------------------------------------------------------ */

@media (max-width: 900px) {
  .softem-cot__columnas {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 700px) {
  .softem-cot-item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px 14px;
  }

  .softem-cot-item__foto img {
    height: 76px;
  }

  .softem-cot-item__marca {
    display: none;
  }

  .softem-cot-item__cantidad {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .softem-cot-campos {
    grid-template-columns: minmax(0, 1fr);
  }

  .softem-cot-wa {
    padding: 16px;
  }

  .softem-cot-gracias {
    padding: 24px 16px;
  }

  .softem-cot-gracias__acciones {
    flex-direction: column;
    align-self: stretch;
  }

  .softem-cot-gracias__acciones .softem-cot-boton {
    width: 100%;
  }

  .softem-cot-dialogo {
    align-items: flex-end;
    padding: 0;
  }

  .softem-cot-dialogo__caja {
    width: 100%;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--softem-cot-radio) var(--softem-cot-radio) 0 0;
  }
}
