/* Ferretería — estilos compartidos (cliente y panel) */
:root {
  --tinta: #16233b;      /* azul acero profundo: texto y encabezado */
  --acero: #44546e;      /* texto secundario */
  --fondo: #eef1f4;      /* gris galvanizado claro */
  --papel: #ffffff;
  --linea: #d3dae3;
  --cinta: #f5b800;      /* amarillo de flexómetro: acción principal */
  --cinta-fuerte: #dba300;
  --verde: #17824a;
  --rojo: #b3261e;
  --radio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "Barlow", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
}
h1, h2, h3, .precio, .cifra {
  font-family: "Barlow Condensed", "Barlow", "Arial Narrow", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 26px; line-height: 1.15; }
h3 { font-size: 21px; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #1d6fe0; outline-offset: 2px; }

.cabecera { background: var(--tinta); color: #fff; padding: 16px 18px 14px; }
.cabecera .sub { color: #c7d1e0; font-size: 16px; margin-top: 2px; }
.regla {
  height: 16px;
  background:
    linear-gradient(90deg, var(--tinta) 2px, transparent 2px) 0 0 / 50px 100% repeat-x,
    linear-gradient(90deg, var(--tinta) 1.5px, transparent 1.5px) 0 0 / 10px 45% repeat-x,
    var(--cinta);
}
.pagina { max-width: 620px; margin: 0 auto; padding: 16px 14px 130px; }
.sec { color: var(--acero); font-size: 16px; }
.centro { text-align: center; }
.espacio { height: 14px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 10px 20px;
  border-radius: var(--radio); border: 2px solid var(--tinta);
  background: var(--papel); color: var(--tinta);
  font-weight: 700; font-size: 19px; text-decoration: none; text-align: center;
}
.btn.principal { background: var(--cinta); border-color: var(--cinta-fuerte); }
.btn.principal:active { background: var(--cinta-fuerte); }
.btn.verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.peligro { border-color: var(--rojo); color: var(--rojo); }
.btn.liso { border-color: transparent; background: transparent; text-decoration: underline; }
.btn.ancho { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.fila-btn { display: flex; gap: 10px; flex-wrap: wrap; }
.fila-btn > * { flex: 1 1 140px; }

/* Campos */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-weight: 700; margin-bottom: 5px; }
.campo input, .campo textarea, .campo select, .buscar {
  width: 100%; min-height: 54px; padding: 12px 14px;
  border: 2px solid #8794a8; border-radius: 12px; background: #fff; font-size: 19px;
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo .ayuda { font-weight: 500; color: var(--acero); font-size: 15px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 54px; font-weight: 700; }
.check input { width: 28px; height: 28px; accent-color: var(--tinta); }
.error { background: #fde9e7; border: 2px solid var(--rojo); color: #7a1410; border-radius: 12px; padding: 12px 14px; font-weight: 600; margin-bottom: 14px; }

/* Filtros */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 46px; padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--linea); background: var(--papel); font-weight: 600; font-size: 17px;
}
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }

/* Listas */
.grupo { margin-top: 18px; }
.grupo > h3 { margin: 0 4px 8px; }
.lista { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.renglon {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 0; width: 100%; background: none; text-align: left;
}
.lista > * { border-top: 1px solid var(--linea); }
.lista > *:first-child { border-top: 0; }
.medidas .renglon { border-top: 1px dashed var(--linea); padding-left: 26px; background: #f6f8fa; }
.ver { flex: none; width: 30px; text-align: center; font-size: 26px; font-weight: 700; line-height: 1; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 76px; padding: 10px 14px; text-align: left;
  background: var(--papel); border: 2px solid var(--linea); border-left: 8px solid var(--cinta); border-radius: 12px; font-weight: 700; font-size: 19px;
}
.cat:active { background: #f3f5f8; }
.cat .sec { font-weight: 500; font-size: 15px; }
.solicitud { background: #fff6d6; border: 2px solid var(--cinta-fuerte); border-radius: 12px; padding: 12px 14px; margin-top: 12px; overflow-wrap: anywhere; }
.renglon .cuerpo { flex: 1; min-width: 0; }
.renglon .nombre { font-weight: 700; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.renglon .cuerpo .sec { font-size: 15px; }
.renglon .cuerpo .precio { font-size: 19px; }
.renglon .lado { text-align: right; flex: none; }
button.renglon:active { background: #f3f5f8; }
.precio { font-size: 22px; white-space: nowrap; }
.atenuado { opacity: 0.55; }
.etiqueta { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 15px; font-weight: 700; background: #e6eaf0; }
.etiqueta.debe { background: #fde9e7; color: #7a1410; }
.etiqueta.bien { background: #dff3e7; color: #0e5a32; }
.etiqueta.nuevo { background: var(--cinta); }

/* Contador de cantidad */
.contador { display: flex; align-items: center; gap: 6px; flex: none; }
.contador button {
  width: 50px; height: 50px; border-radius: 12px; border: 2px solid var(--tinta);
  background: var(--papel); font-size: 28px; font-weight: 700; line-height: 1; padding: 0;
}
.contador input {
  width: 58px; height: 50px; text-align: center; border: 2px solid #8794a8; border-radius: 12px;
  font-size: 21px; font-weight: 700; padding: 0; -moz-appearance: textfield; appearance: textfield;
}
.contador input::-webkit-outer-spin-button, .contador input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.agregar { min-height: 50px; padding: 8px 18px; font-size: 18px; }

/* Barra fija inferior */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--papel); border-top: 2px solid var(--tinta);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.barra .dentro { max-width: 620px; margin: 0 auto; }
.barra .btn { justify-content: space-between; }

.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; margin-top: 14px; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px 4px; }
.total .cifra { font-size: 36px; }
.cifra.grande { font-size: 44px; line-height: 1; }
.rojo { color: var(--rojo); }
.verde-t { color: #0e5a32; }
.volver { background: none; border: 0; padding: 10px 6px; font-weight: 700; font-size: 18px; text-decoration: underline; min-height: 48px; }

/* Aviso flotante */
#aviso {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 30;
  background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(22, 35, 59, 0.35);
}
#aviso[hidden] { display: none; }

/* Ventanas */
dialog {
  border: 0; border-radius: 18px; padding: 20px 18px; width: min(560px, 94vw); max-height: 90vh; overflow: auto;
  color: var(--tinta); box-shadow: 0 20px 60px rgba(22, 35, 59, 0.4);
}
dialog::backdrop { background: rgba(22, 35, 59, 0.55); }
dialog h2 { margin-bottom: 14px; }

/* Panel del dueño: navegación inferior */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  background: var(--tinta); padding-bottom: env(safe-area-inset-bottom);
}
.nav button {
  flex: 1; min-height: 66px; background: none; border: 0; color: #c7d1e0;
  font-weight: 700; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-top: 5px solid transparent; position: relative;
}
.nav button[aria-current="page"] { color: #fff; border-top-color: var(--cinta); }
.nav svg { width: 26px; height: 26px; }
.nav .globo {
  position: absolute; top: 6px; left: calc(50% + 8px); min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: var(--cinta); color: var(--tinta); font-size: 15px; line-height: 24px;
}
.resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.resumen .tarjeta { margin-top: 0; padding: 12px 14px; }
.resumen .cifra { font-size: 28px; }
.dato { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--linea); }
.dato:first-child { border-top: 0; }
.dato b { text-align: right; overflow-wrap: anywhere; }
.vacio { text-align: center; color: var(--acero); padding: 34px 16px; }

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: sube 0.18s ease-out; }
  @keyframes sube { from { transform: translateY(14px); opacity: 0; } }
}

/* Opciones grandes de elegir una */
.opcion { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; margin-bottom: 10px;
  border: 2px solid #8794a8; border-radius: 12px; font-weight: 700; font-size: 19px; background: var(--papel); }
.opcion input { width: 26px; height: 26px; accent-color: var(--tinta); flex: none; }
.opcion:has(input:checked) { border-color: var(--tinta); background: #fff6d6; }

/* Miniatura del producto (solo en el renglón principal) */
.mini {
  flex: none; width: 60px; height: 60px; object-fit: contain;
  background: #fff; border: 1px solid var(--linea); border-radius: 10px; padding: 2px;
}
.medidas .mini { display: none; }
.instalar { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; border: 2px solid var(--cinta); }
.instalar img { border-radius: 12px; flex: none; }
.instalar h3 { margin-bottom: 4px; }
.instalar { padding: 14px; gap: 12px; }
.instalar img { width: 48px; height: 48px; }
.instalar h3 { font-size: 19px; }
.instalar .sec { font-size: 15px; }
.instalar .fila-btn { display: flex; flex-wrap: nowrap; gap: 8px; }
.instalar .fila-btn .btn { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 6px 10px; font-size: 17px; }
.mis-datos { padding: 14px 16px; border: 2px solid var(--linea); border-radius: 12px; margin-bottom: 14px; }
.mis-datos p { margin: 2px 0; font-size: 18px; overflow-wrap: anywhere; }
.mis-datos .nombre { font-weight: 700; font-size: 20px; }
.recordar { display: flex; gap: 12px; align-items: center; min-height: 48px; margin: 0 0 14px; font-weight: 600; font-size: 17px; }
.recordar input { width: 24px; height: 24px; flex: none; accent-color: var(--tinta); }
.cabecera .sub.hola { color: #fff; font-size: 19px; }
.cabecera .sub.hola b { color: var(--cinta); font-weight: 700; }
/* Encabezado de clientes: lema y monito */
.cabecera.con-monito { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 8px; }
.cabecera .marca { min-width: 0; padding: 6px 0; }
.cabecera .monito { flex: none; width: 104px; height: auto; margin-bottom: -8px; align-self: flex-end; }
.gis { position: relative; display: inline-block; color: #fff; font-weight: 700; }
@media (max-width: 340px) { .cabecera .monito { width: 70px; } }
.cabecera .sub .pregunta { display: block; color: #fff; font-weight: 600; margin-top: 2px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cotizada { margin-top: 10px; padding: 10px 12px; background: #fff; border-radius: 10px; border: 1px solid #e5d28a; }
.cotizada p { margin: 2px 0; }
.ml { background: #f1f4f8; border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.ml .campo:last-child, .ml .dos .campo { margin-bottom: 4px; }
.cot-foto { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #fff; border: 2px solid var(--linea); border-radius: 10px; margin: 8px 0; }
.foto-cot .fila-btn { margin-bottom: 4px; }
.privado { margin-top: 10px; padding: 10px 12px; border: 2px dashed #b9c3d3; border-radius: 10px; background: #f6f8fb; }
.privado p { margin: 2px 0; }
.oculto { display: none; }
.cot-foto.grande { max-height: 380px; margin-top: 0; }
.precios-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.precios-cot div { border: 2px solid var(--linea); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.precios-cot span { font-weight: 600; color: var(--acero); }
.precios-cot b { font-family: 'Barlow Condensed', Barlow, sans-serif; font-size: 30px; line-height: 1.1; }
.nota-cot { margin-top: 12px; padding: 10px 12px; background: #fff6d6; border-radius: 10px; font-weight: 600; }
.bien-cot { margin-top: 14px; border: 2px solid #1a7f4b; }
