/* ============================================================
   GlobalSoftServer — cotizador.css
   Estilos propios del Cotizador de Desarrollo de Software.
   Reutiliza variables y clases de styles.css.
   ============================================================ */

/* Nota aclaratoria bajo el subtítulo */
.cot-nota {
  max-width: 720px;
  margin: -1.6rem auto 2.4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .86rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
}

/* Aviso si falla la carga de tarifas */
.cot-aviso {
  max-width: 720px;
  margin: 0 auto 2rem;
}

/* ---------- Disposición general ---------- */
.cot-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

/* ---------- Catálogo (columna izquierda) ---------- */
.cot-grupo { margin-bottom: 2.6rem; }
.cot-grupo:last-child { margin-bottom: 0; }

.cot-grupo-cabecera {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: .7rem;
  margin-bottom: 1.4rem;
}

.cot-grupo-cabecera h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.cot-grupo-cabecera h3 svg { color: var(--accent-2); flex-shrink: 0; }

.cot-grupo-cabecera .cot-grupo-desc {
  color: var(--text-muted);
  font-size: .85rem;
}

.cot-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

/* Tarjeta de ítem */
.cot-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: border-color .25s, transform .25s, background .25s;
}

.cot-item.activo {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.cot-item:hover { border-color: var(--accent-2); transform: translateY(-3px); }

.cot-item-nombre { font-size: 1.02rem; font-weight: 700; }

.cot-item-desc {
  color: var(--text-muted);
  font-size: .85rem;
  flex-grow: 1;
}

.cot-item-precio {
  font-weight: 700;
  color: var(--accent-2);
  font-size: .95rem;
}

.cot-item-precio .cot-unidad { color: var(--text-muted); font-weight: 500; font-size: .82rem; }

/* Control de cantidad */
.cot-cantidad-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  border-top: 1px solid var(--border);
  padding-top: .8rem;
}

.cot-cantidad-etq { font-size: .82rem; color: var(--text-muted); }

.cot-stepper {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem;
}

.cot-stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s;
}

.cot-stepper button:hover { background: var(--accent); color: #fff; }

.cot-stepper input {
  width: 52px;
  text-align: center;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  -moz-appearance: textfield;
}

.cot-stepper input::-webkit-outer-spin-button,
.cot-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cot-stepper input:focus { outline: none; }

/* Subtotal por ítem */
.cot-item-subtotal {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: right;
  min-height: 1.1em;
}
.cot-item-subtotal strong { color: var(--success); }

/* ---------- Resumen (columna derecha, fijo) ---------- */
.cot-resumen {
  position: sticky;
  top: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  display: grid;
  gap: 1.1rem;
}

.cot-resumen h3 { font-size: 1.15rem; }

.cot-seleccion {
  list-style: none;
  display: grid;
  gap: .6rem;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.cot-seleccion li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem .8rem;
  font-size: .85rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
}

.cot-seleccion li:last-child { border-bottom: 0; }

.cot-sel-nombre { color: var(--text); font-weight: 600; }
.cot-sel-detalle { color: var(--text-muted); font-size: .78rem; grid-column: 1; }
.cot-sel-sub { color: var(--accent-2); font-weight: 700; white-space: nowrap; }

.cot-vacio { color: var(--text-muted); font-size: .86rem; text-align: center; padding: .8rem 0; }

/* Total grande */
.cot-total-caja {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: grid;
  gap: .2rem;
}

.cot-total-etq {
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .72rem;
  color: var(--text-muted);
}

.cot-total-valor {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.cot-total-nota { color: var(--text-muted); font-size: .75rem; }

/* Formulario dentro del resumen */
.cot-form { display: grid; gap: .9rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* Mensaje de éxito con referencia */
.cot-exito-detalle {
  display: grid;
  gap: .3rem;
  margin-top: .6rem;
  font-size: .82rem;
}
.cot-ref {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--text);
  word-break: break-all;
  font-weight: 700;
}

/* ---------- Panel de éxito ampliado ---------- */
.cot-exito-panel {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.cot-exito-cab {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.05rem;
}

.cot-exito-check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient, linear-gradient(135deg, #2f7bff, #22d3ee));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .9rem;
  font-weight: 700;
}

/* Aviso de horario hábil */
.cot-exito-horario {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0;
  padding: .7rem .85rem;
  font-size: .84rem;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface-hover, rgba(47, 123, 255, .08));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
}

.cot-exito-reloj { flex-shrink: 0; font-size: 1rem; line-height: 1.4; }

/* Bloques de descarga / envío */
.cot-exito-bloque {
  border-top: 1px solid var(--border);
  padding-top: .9rem;
  display: grid;
  gap: .7rem;
}

.cot-exito-bloque h4 {
  font-size: .92rem;
  margin: 0;
  color: var(--text);
}

.cot-exito-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.cot-exito-acciones .boton {
  flex: 1 1 auto;
  min-width: 120px;
  text-align: center;
  padding: .55rem .8rem;
  font-size: .85rem;
}

/* Envío por correo */
.cot-envio-fila {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.cot-envio-campo {
  display: grid;
  gap: .25rem;
  font-size: .74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.cot-envio-campo-email { flex: 1 1 180px; }

.cot-envio-campo select,
.cot-envio-campo input {
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .55rem .7rem;
  text-transform: none;
  letter-spacing: normal;
}

.cot-envio-campo input { width: 100%; }
.cot-envio-campo select:focus,
.cot-envio-campo input:focus {
  outline: none;
  border-color: var(--accent);
}

.cot-envio-boton { width: 100%; padding: .6rem 1rem; font-size: .9rem; }
.cot-envio-boton:disabled { opacity: .6; cursor: default; }

.cot-envio-estado { font-size: .82rem; min-height: 1.1em; }
.cot-envio-estado.exito { color: var(--success); }
.cot-envio-estado.error { color: var(--danger, #ff6b6b); }

/* Barra inferior fija (solo móvil) */
.cot-barra {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  background: rgba(15, 23, 48, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: .7rem 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cot-barra-info { display: grid; }
.cot-barra-etq { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.cot-barra-valor { font-size: 1.25rem; font-weight: 800; color: var(--accent-2); }
.cot-barra .boton { padding: .6rem 1.2rem; font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .cot-layout { grid-template-columns: 1fr; }
  .cot-resumen { position: static; top: auto; }
  .cot-seleccion { max-height: none; }
  .cot-barra { display: flex; }
  /* Espacio para que la barra fija no tape el contenido */
  main { padding-bottom: 5rem; }
}

@media (max-width: 420px) {
  .cot-items { grid-template-columns: 1fr; }
}
