* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f2f4f7;
  color: #1c2430;
  padding: 16px;
}

.wrap { max-width: 900px; margin: 0 auto; }

header { text-align: center; margin: 18px 0 22px; }
header .logo {
  max-width: 340px; width: 92%;
  margin-bottom: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
  box-sizing: border-box;
}
header h1 { font-size: 1.5rem; color: #2b2b2b; }
header .version {
  font-size: .75rem; color: #9aa5b1; margin: 2px 0 4px;
  letter-spacing: .4px;
}
header .sub { color: #6b7280; margin-top: 4px; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border-top: 4px solid #f39204;
}
.card h2 { font-size: 1.1rem; margin-bottom: 12px; color: #2b2b2b; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
label { display: block; font-size: .85rem; color: #3d4c5e; }
input[type=text], input[type=date], input[type=number] {
  width: 100%; padding: 10px; margin-top: 4px;
  border: 1px solid #c9d3dd; border-radius: 8px; font-size: 1rem;
}
.chk { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 1rem; }
.chk input { width: 18px; height: 18px; }

.nota-fecha {
  font-size: .72rem; color: #8a97a5; margin-top: 6px; line-height: 1.3;
}

/* Líneas de prenda */
.linea {
  border: 1px solid #dfe6ee; border-radius: 10px;
  padding: 12px; margin-bottom: 10px; position: relative;
  background: #fafcfe;
}
.linea .linea-num {
  display: flex; justify-content: flex-end; margin-bottom: 8px;
}
.linea .quitar {
  background: #fdecec; color: #b3261e; border: none; border-radius: 8px;
  padding: 4px 10px; cursor: pointer; font-size: .85rem;
}

/* Pestañas de categoría (verano, invierno, EPIs, reclamo). */
.tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.tabs .tab {
  flex: 1 1 0; min-width: 110px;
  padding: 8px 10px; font-size: .9rem; cursor: pointer;
  border: 1.5px solid #c9d3dd; border-radius: 999px;
  background: #fff; color: #3d4c5e;
}
.tabs .tab.sel {
  border-color: #f39204; background: #f39204; color: #fff; font-weight: 600;
}

/* Selector de prenda: pictogramas o desplegable (EPIs / reclamo). */
.selector-prenda { margin-bottom: 8px; }
.desplegable {
  width: 100%; padding: 10px; font-size: .95rem;
  border: 1.5px solid #c9d3dd; border-radius: 10px; background: #fff;
  display: none;
}

/* Nota de la hoja original (requisitos por prenda). */
.nota-prenda {
  min-height: 18px; margin-bottom: 10px;
  font-size: .78rem; color: #8a5a00; background: #fdf6e8;
  border-left: 3px solid #f39204; border-radius: 6px;
  padding: 5px 9px;
}
.nota-prenda:empty { display: none; }

/* Campos de cantidad, talla, color y modelo. */
.fila-campos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 10px;
}
.fila-campos label { font-size: .78rem; color: #5a6b7d; }
.fila-campos input {
  width: 100%; padding: 8px; margin-top: 4px;
  border: 1px solid #c9d3dd; border-radius: 8px; font-size: .9rem;
}

/* Casillas de posición del logo (con el asterisco de Proves). */
.casillas {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.casillas .casilla {
  border: 1.5px solid #c9d3dd; border-radius: 10px;
  padding: 8px 4px; text-align: center; cursor: pointer;
  background: #fff; user-select: none;
}
.casillas .casilla .caja {
  font-size: 1.3rem; color: transparent; line-height: 1.4;
}
.casillas .casilla .nombre { font-size: .72rem; color: #5a6b7d; }
.casillas .casilla.sel {
  border-color: #f39204; background: #fdf0de;
}
.casillas .casilla.sel .caja { color: #f39204; }
.casillas .casilla.sel .nombre { color: #8a5a00; font-weight: 600; }

/* Iconos de prenda: dibujo al doble de tamaño; si no caben, bajan de fila. */
.fila-iconos { margin-bottom: 10px; }
.prendas {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px;
  border: 1.5px solid #e2e8ef; border-radius: 10px;
  background: #fff; padding: 8px;
}
.prendas .op {
  flex: 1 1 0; min-width: 56px; max-width: 64px;
  border: 2px solid #dfe6ee; border-radius: 10px; padding: 6px 4px;
  cursor: pointer; text-align: center; background: #fff;
}
.prendas .op img {
  display: block; margin: 0 auto; width: 50px; max-width: 100%;
  height: 42px; object-fit: contain;
}
.prendas .op .nombre {
  font-size: .68rem; margin-top: 3px;
  height: 2.4em; text-align: center;
  display: flex; align-items: center; justify-content: center;
  word-break: break-word;
}
.prendas .op.sel { border-color: #f39204; background: #fdf0de; }

/* Preguntas en horizontal debajo de los iconos (4 bloques recuadrados). */
.fila-preguntas {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px;
}
.fila-preguntas .grupo {
  flex: 1 1 160px; min-width: 150px;
  border: 1.5px solid #e2e8ef; border-radius: 10px;
  background: #fff; padding: 10px;
}
.grupo .etiqueta {
  font-size: .78rem; color: #5a6b7d; margin-bottom: 8px;
  text-align: center;
}

/* Opciones: una debajo de la otra, a lo ancho del grupo. */
.opciones { display: flex; flex-direction: column; gap: 6px; }
.opciones .pill {
  border: 1.5px solid #c9d3dd; border-radius: 999px; padding: 6px 12px;
  font-size: .85rem; cursor: pointer; background: #fff; user-select: none;
  text-align: center; width: 100%;
}
.opciones .pill.sel { border-color: #f39204; background: #fdf0de; color: #8a5a00; font-weight: 600; }

/* Observaciones por prenda y del pedido. */
.fila-obs { margin-bottom: 10px; }
.fila-obs .etiqueta { font-size: .78rem; color: #5a6b7d; margin-bottom: 6px; }
.fila-obs input {
  width: 100%; padding: 8px; border: 1px solid #c9d3dd;
  border-radius: 8px; font-size: .9rem;
}
textarea {
  width: 100%; padding: 10px; border: 1px solid #c9d3dd;
  border-radius: 8px; font-size: .95rem; resize: vertical;
}

/* Adjunto: botón y nombre del archivo debajo, centrados. */
.adjunto { text-align: center; }
.adjunto .file-btn {
  display: inline-block; border: 1.5px solid #c9d3dd; border-radius: 999px;
  padding: 6px 14px; font-size: .85rem; cursor: pointer; background: #fff;
}
.adjunto .file-btn input { display: none; }
.adjunto .archivo-nombre {
  display: block; margin-top: 6px; font-size: .75rem; color: #6b7280;
  word-break: break-all; max-width: 100%;
}

.add-mensaje {
  text-align: center; margin: 6px 0; min-height: 20px;
  font-size: .9rem; font-weight: 600; color: #b3261e;
}

/* Líneas bloqueadas tras añadir la siguiente. */
.linea.bloqueada { opacity: .7; }
.linea.bloqueada .op,
.linea.bloqueada .pill,
.linea.bloqueada .casilla,
.linea.bloqueada .tab { cursor: default; }

/* Botones */
.add {
  width: 100%; padding: 10px; border: 1.5px dashed #f39204; background: #fdf0de;
  color: #8a5a00; border-radius: 10px; cursor: pointer; font-size: .95rem;
}
.add:hover { background: #fbe3c4; }

.submit {
  width: 100%; padding: 14px; background: #f39204; color: #fff; border: none;
  border-radius: 12px; font-size: 1.05rem; cursor: pointer; margin-top: 4px;
}
.submit:hover { background: #d97e00; }

#mensaje { text-align: center; margin-top: 12px; font-weight: 600; min-height: 22px; }
#mensaje.ok { color: #1d7a35; }
#mensaje.err { color: #b3261e; }

#resumen ul { list-style: none; }
#resumen li { padding: 6px 0; border-bottom: 1px solid #eef2f6; font-size: .9rem; }
#resumen .vacío { color: #8a97a5; font-size: .9rem; }

/* Modal de pedido enviado (bloquea la web hasta aceptar). */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.modal-oculto { display: none; }
.modal-caja {
  background: #fff; border-radius: 14px; padding: 24px;
  text-align: center; max-width: 340px; width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.modal-caja h2 { color: #1d7a35; margin-bottom: 8px; }
.modal-caja p { margin-bottom: 18px; font-size: 1rem; color: #3d4c5e; }
.modal-caja .submit { margin-top: 0; }
