/* Ajustes de la versión web sobre los estilos de la app de escritorio (src/renderer/styles.css) */

/* Fechas de actualización */
.upd-bar {
  display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 5px 18px; font-size: 12.5px;
  background: #eef1f6; color: #374151; border-bottom: 1px solid var(--line);
}
.upd-bar b { color: var(--navy); }
.upd-bar .busy { color: #c2410c; font-weight: 600; }
.upd-bar .busy::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-right: 6px; animation: pulse 1.2s infinite; }

.status.ok { color: #fff; font-weight: 400; margin-left: 0; }
.m-back { display: none; }

/* Barra de descarga (debajo de la barra azul; la página se puede usar mientras tanto) */
.load-bar { background: #fff7ed; border-bottom: 1px solid #fed7aa; padding: 7px 18px 8px; transition: opacity .35s; }
.load-bar.done { opacity: 0; }
.load-bar.err { background: var(--red-soft); border-color: #fca5a5; }
.lb-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #7c2d12; }
.load-bar.err .lb-text { color: var(--red); }
.lb-sub { color: var(--muted); font-size: 12px; }
.lb-text .btn { padding: 3px 10px; font-size: 12px; }
.lb-track { height: 6px; background: #fde4cc; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.lb-fill { height: 100%; width: 3%; background: var(--orange); border-radius: 999px; transition: width .25s ease; }
.lb-fill.wait { width: 100% !important; background: linear-gradient(90deg, #fde4cc 0%, var(--orange) 50%, #fde4cc 100%); background-size: 200% 100%; animation: lbwave 1.1s linear infinite; }
@keyframes lbwave { to { background-position: -200% 0; } }
.spin.sm { width: 14px; height: 14px; border-width: 2px; }
.empty .waiting { margin-top: 10px; color: #c2410c; font-weight: 600; }
@media (max-width: 760px) { .load-bar { padding: 6px 10px 7px; } }

/* Despiece: aviso mientras baja el dibujo */
.fig-wrap { position: relative; }
.fig-load {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: #fff; color: var(--muted); font-weight: 600; text-align: center; padding: 20px;
}
.spin {
  width: 34px; height: 34px; border-radius: 50%; border: 4px solid #e5e7eb; border-top-color: var(--orange);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.detail { position: relative; }

.info-list { display: grid; gap: 6px; margin: 8px 0; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid #f0f2f5; padding: 4px 0; }
.info-list span { color: var(--muted); }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand { order: 1; }
  .mark { font-size: 13px; padding: 5px 7px; }
  .status { order: 2; flex: 1; min-width: 0; max-width: none; font-size: 11.5px; padding: 5px 10px; }
  #btnSettings { order: 3; width: 36px; height: 36px; }
  .searchbox { order: 4; flex: 1 1 100%; height: 44px; }
  .searchbox input { font-size: 16px; } /* 16px: el iPhone no hace zoom al escribir */
  .searchbox kbd { display: none; }

  .upd-bar { padding: 4px 10px; font-size: 11.5px; gap: 2px 12px; }

  /* filtros en una sola fila que se desliza */
  .filters { flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding: 7px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chips { flex-wrap: nowrap; }
  .chip, .toggle { white-space: nowrap; flex: none; }
  .toggle input { width: 18px; height: 18px; }
  .count { flex: none; margin-left: 4px; }

  /* lista a pantalla completa; la ficha se abre encima */
  .layout { display: block; position: relative; overflow: hidden; }
  .results { height: 100%; border-right: 0; padding: 6px; }
  .detail {
    position: absolute; inset: 0; background: var(--bg); padding: 0 12px 30px; z-index: 5;
    transform: translateX(100%); transition: transform .2s ease; visibility: hidden;
  }
  body.show-detail .detail { transform: none; visibility: visible; }
  .m-back {
    display: block; position: sticky; top: 0; z-index: 3; width: calc(100% + 24px); margin: 0 -12px 10px;
    text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--navy);
    font-weight: 700; padding: 11px 14px; font-size: 15px;
  }

  .res { grid-template-columns: 56px 1fr auto; gap: 9px; padding: 8px 6px; }
  .thumb { width: 56px; height: 56px; }
  .thumb img { max-width: 54px; max-height: 54px; }
  .res-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
  .res-price b { font-size: 14px; }
  .tips { margin-top: 12px; }
  .empty { padding: 24px 12px; }

  .d-head h2 { font-size: 19px; }
  .d-grid { grid-template-columns: 1fr; gap: 12px; }
  .media-img { height: 240px; }
  .media-img img { max-height: 228px; }
  .price { font-size: 38px; }
  .fact { grid-template-columns: 110px 1fr; }
  .other { grid-template-columns: minmax(0, 1fr) 30px 64px 68px; gap: 6px; font-size: 12px; }
  .btn { padding: 9px 14px; }

  /* despiece a pantalla completa */
  .fig-dialog { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border-radius: 0; }
  .fig-dialog .dlg-head { flex-wrap: wrap; padding: 8px 10px; }
  .fig-titles { flex: 1 1 100%; min-width: 0; }
  .fig-titles strong { font-size: 14px; }
  .fig-dialog .dlg-actions { flex: 1 1 100%; justify-content: space-between; }
  .fig-wrap { padding: 0; }

  .set-dialog, .punto-dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .set-body { max-height: calc(92dvh - 60px); padding: 4px 14px 20px; }
  .punto-list { max-height: 55dvh; }
  .punto { flex-direction: column; gap: 2px; padding: 12px; }
  .punto input, .punto-body input { font-size: 16px; }
  .toast { bottom: max(20px, env(safe-area-inset-bottom)); max-width: 92vw; text-align: center; }
}
