/* ORIGINAL: D:/Programacion/_branding/camara/camara-escania.css. Se COPIA a cada producto. No editar la copia. */
/*
 * Cámara Escania web — estilos aislados. Todo cuelga de .ce-capa con prefijo .ce-
 * y no depende del CSS de la app. Probado a 390 px de ancho. Sin modo oscuro
 * propio: el visor siempre es negro y la revisión siempre es clara.
 */
html.ce-abierta, html.ce-abierta body { overflow: hidden !important; overscroll-behavior: none; }

.ce-capa {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483000;
  width: 100vw; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: #000; color: #fff;
  font: 400 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-align: left; letter-spacing: normal; text-transform: none;
}
.ce-capa *, .ce-capa *::before, .ce-capa *::after { box-sizing: border-box; }
.ce-capa h2, .ce-capa p, .ce-capa ol, .ce-capa li, .ce-capa fieldset, .ce-capa legend { margin: 0; padding: 0; border: 0; }
.ce-capa ol { list-style: none; }
.ce-capa img, .ce-capa video, .ce-capa canvas { max-width: none; border: 0; }
.ce-capa [hidden] { display: none !important; }
.ce-capa :focus { outline: none; }
.ce-capa :focus-visible { outline: 3px solid #FFD54F; outline-offset: 2px; }
.ce-capa .ce-solo-lector {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ce-principal { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* ---------- Botones ---------- */
.ce-capa button, .ce-capa input, .ce-capa select, .ce-capa textarea {
  font: inherit; color: inherit; text-transform: none; letter-spacing: normal; text-shadow: none; text-indent: 0;
}
.ce-capa .ce-btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 10px 16px; margin: 0;
  border: 2px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.2; text-decoration: none;
  cursor: pointer; background: #ECEFF1; color: #102027; box-shadow: none;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.ce-capa .ce-btn:disabled { opacity: .45; cursor: default; }
.ce-capa .ce-primario { background: #0D47A1; color: #fff; }
.ce-capa .ce-primario:not(:disabled):hover { background: #0B3C88; }
.ce-capa .ce-secundario { background: #fff; color: #0D47A1; border-color: #0D47A1; }
.ce-capa .ce-peligro { background: #B71C1C; color: #fff; }
.ce-capa .ce-opcion { background: #fff; color: #102027; border-color: #90A4AE; text-align: left; justify-content: flex-start; width: 100%; }
.ce-capa .ce-texto-boton { background: transparent; color: #fff; padding: 10px 8px; }
.ce-capa .ce-texto-boton.ce-oscuro { color: #0D47A1; }
.ce-capa .ce-fuerte { font-weight: 700; }
.ce-capa .ce-enlace { background: transparent; color: #fff; text-decoration: underline; padding: 6px 8px; min-height: 40px; font-weight: 700; }
.ce-capa .ce-claro { color: #fff; border-color: #fff; background: transparent; }

/* ---------- Visor ---------- */
.ce-visor { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #000; touch-action: none; }
.ce-arriba { position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding: env(safe-area-inset-top, 0) 0 0; pointer-events: none; }
.ce-letrero {
  margin: 0; padding: 10px 16px; min-height: 44px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 15px; line-height: 1.35; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ce-letrero.ce-cargando { position: relative; padding-bottom: 14px; }
.ce-letrero.ce-cargando::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(41,182,246,.25) 0%, #29B6F6 50%, rgba(41,182,246,.25) 100%);
  background-size: 200% 100%; animation: ce-barra 1.2s linear infinite;
}
@keyframes ce-barra { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.ce-escenario { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #000; touch-action: none; }
.ce-video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ce-contorno { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.ce-destello { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #fff; opacity: 0; pointer-events: none; }
.ce-destello.ce-destellando { animation: ce-destello 220ms ease-out; }
@keyframes ce-destello { from { opacity: .7; } to { opacity: 0; } }
.ce-capa .ce-reanudar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.ce-abajo { position: relative; z-index: 3; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0)); background: #000; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ce-pildora {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 10px;
  max-width: calc(100% - 24px); padding: 4px 6px 4px 16px; border-radius: 22px;
  background: rgba(27,94,32,.8); color: #fff; font-size: 15px; display: flex; align-items: center; flex-wrap: nowrap; justify-content: center;
  white-space: nowrap; gap: 2px;
}
.ce-pildora > span { overflow: hidden; text-overflow: ellipsis; }
.ce-contador { font-size: 16px; font-weight: 600; color: #fff; text-align: center; min-height: 22px; }
.ce-contador.ce-salto { animation: ce-salto 250ms ease-out; }
@keyframes ce-salto { from { transform: scale(1.25); } to { transform: scale(1); } }
.ce-pastillas { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ce-capa .ce-pastilla {
  min-height: 44px; padding: 8px 14px; border-radius: 22px; font-size: 15px; font-weight: 600;
  background: rgba(255,255,255,.08); color: #fff; border: 1.5px solid rgba(255,255,255,.55);
}
.ce-capa .ce-pastilla.ce-activa { background: rgba(41,182,246,.33); border-color: #29B6F6; }
.ce-fila-abajo { width: 100%; max-width: 520px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.ce-fila-abajo > :first-child { justify-self: start; }
.ce-fila-abajo > :last-child { justify-self: end; }
.ce-disparo-caja { position: relative; width: 86px; height: 86px; }
.ce-anillo { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 86px; height: 86px; pointer-events: none; }
.ce-capa .ce-disparador {
  position: absolute; left: 4px; top: 4px; width: 78px; height: 78px; padding: 0; margin: 0;
  border-radius: 50%; border: 4px solid #000; background: #fff; box-shadow: 0 0 0 2px #fff;
  cursor: pointer; appearance: none; -webkit-appearance: none; touch-action: manipulation;
}
.ce-capa .ce-disparador.ce-gris, .ce-capa .ce-disparador:disabled { background: #9E9E9E; box-shadow: 0 0 0 2px #9E9E9E; cursor: default; }
.ce-capa .ce-disparador:active:not(:disabled) { transform: scale(.94); }

/* ---------- Revisión ---------- */
.ce-revision { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #F5F7F8; color: #102027; }
.ce-rev-cuerpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(16px + env(safe-area-inset-top, 0)) 16px 16px; }
@media (min-width: 1040px) {
  .ce-rev-cuerpo { padding-left: calc((100% - 1000px) / 2); padding-right: calc((100% - 1000px) / 2); }
}
.ce-rev-sub { font-size: 14px; color: #455A64; margin-bottom: 2px; }
.ce-rev-titulo { font-size: 22px; font-weight: 700; line-height: 1.25; color: #102027; }
.ce-rev-ayuda { font-size: 15px; color: #37474F; margin-top: 4px; }
.ce-rev-avisos { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ce-capa .ce-aviso { padding: 8px 12px; border-radius: 8px; background: #FFF8E1; color: #4E3B00; border-left: 4px solid #F9A825; font-size: 15px; }
.ce-capa .ce-aviso-fuerte { background: #FFEBEE; color: #7F0000; border-left-color: #C62828; }
.ce-vacio { margin-top: 12px; }
.ce-capa .ce-mensaje-fijo { padding: 12px 14px; border-radius: 10px; background: #E3F2FD; color: #0D2A4D; border-left: 4px solid #1565C0; font-size: 15px; }
.ce-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.ce-tarjeta { background: #fff; border: 1px solid #CFD8DC; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ce-capa .ce-mini { display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; margin: 0; border: 1px solid #B0BEC5; border-radius: 8px; background: #ECEFF1; overflow: hidden; cursor: pointer; }
.ce-mini-img { display: block; width: 100%; height: 100%; object-fit: contain; background: #ECEFF1; }
.ce-mini-espera { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: #455A64; padding: 8px; text-align: center; }
.ce-tarjeta-nombre { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; padding: 0 2px; }
.ce-marca-aviso { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: #F9A825; color: #2B1E00; font-weight: 800; font-size: 14px; }
.ce-tarjeta-acciones { display: grid; grid-template-columns: 44px 1fr 44px; gap: 4px; }
.ce-capa .ce-flecha { padding: 0; font-size: 26px; line-height: 1; background: #ECEFF1; color: #102027; }
.ce-capa .ce-flecha.ce-claro { background: transparent; color: #fff; border: 0; }
.ce-capa .ce-quitar { color: #B71C1C; background: #fff; border-color: #EF9A9A; padding: 8px; }
.ce-rev-opciones { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.ce-capa .ce-grupo { background: #fff; border: 1px solid #CFD8DC; border-radius: 12px; padding: 10px 12px; }
.ce-capa .ce-grupo legend { font-size: 16px; font-weight: 700; padding: 0 4px; color: #102027; }
.ce-opcion-radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; min-height: 44px; cursor: pointer; border-top: 1px solid #ECEFF1; }
.ce-opcion-radio:first-of-type { border-top: 0; }
.ce-capa .ce-opcion-radio input { appearance: auto; -webkit-appearance: radio; width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: #0D47A1; }
.ce-opcion-textos { display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: #37474F; }
.ce-opcion-textos strong { color: #102027; font-weight: 700; }
.ce-rev-barra {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0)); background: #fff; border-top: 1px solid #CFD8DC;
}
.ce-rev-barra > :first-child { margin-right: auto; }
.ce-toast {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 4;
  max-width: calc(100% - 32px); padding: 6px 8px 6px 16px; border-radius: 22px;
  background: rgba(16,32,39,.92); color: #fff; font-size: 15px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center;
}
@media (max-width: 420px) {
  .ce-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ce-rev-barra .ce-btn { flex: 1 1 auto; }
  .ce-rev-barra > :first-child { flex: 0 0 auto; }
}

/* ---------- Capas encima: vista grande, esquinas, diálogos, espera ---------- */
.ce-sobre { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; }
.ce-vista, .ce-esquinas {
  display: flex; flex-direction: column; gap: 8px; background: #101418; color: #fff;
  padding: calc(8px + env(safe-area-inset-top, 0)) 12px calc(12px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
}
.ce-vista-arriba { display: grid; grid-template-columns: 44px 1fr 44px auto; align-items: center; gap: 4px; }
.ce-vista-titulo { font-size: 17px; font-weight: 700; text-align: center; color: #fff; }
.ce-esquinas .ce-vista-titulo { text-align: left; }
.ce-vista-marco { position: relative; flex: 1 1 auto; min-height: 200px; overflow: auto; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 8px; touch-action: pan-x pan-y; }
/* min-width/min-height 0: como hijo flex, min-width:auto le ganaba a max-width y la hoja se salía del marco. */
.ce-vista-img { display: block; min-width: 0; min-height: 0; max-width: 100%; max-height: 62vh; object-fit: contain; background: #fff; }
.ce-vista-marco.ce-acercada { align-items: flex-start; justify-content: flex-start; }
.ce-vista-marco.ce-acercada .ce-vista-img { max-width: none; max-height: none; width: 200%; }
.ce-vista-ayuda { font-size: 14px; color: #CFD8DC; text-align: center; }
.ce-vista-avisos { display: flex; flex-direction: column; gap: 6px; }
.ce-vista-acciones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ce-capa .ce-accion { background: #263238; color: #fff; border-color: #455A64; padding: 8px 6px; font-size: 15px; }
.ce-capa .ce-accion.ce-quitar { background: #3E1515; color: #FFCDD2; border-color: #8E2C2C; }
.ce-esq-instruccion { font-size: 15px; color: #E0E0E0; }
.ce-esq-botones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ce-esq-escenario { position: relative; width: 100%; min-height: 200px; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: contain; }
.ce-esq-lienzo { position: absolute; top: 0; display: block; touch-action: none; }
.ce-lupa { position: absolute; width: 128px; height: 128px; z-index: 2; pointer-events: none; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.6); }
.ce-capa .ce-manija { position: absolute; width: 44px; height: 44px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: none; z-index: 1; }
.ce-capa .ce-manija:focus-visible { outline: 3px solid #FFD54F; outline-offset: 0; }
.ce-fondo-dialogo { display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.ce-dialogo { width: 100%; max-width: 420px; background: #fff; color: #102027; border-radius: 14px; padding: 18px 16px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-height: 100%; overflow-y: auto; }
.ce-dialogo-titulo { font-size: 19px; font-weight: 700; line-height: 1.3; color: #102027; }
.ce-dialogo-texto { margin-top: 8px; font-size: 16px; color: #37474F; }
.ce-dialogo-botones { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.ce-dialogo-botones.ce-columna { flex-direction: column; align-items: stretch; }
.ce-dialogo-botones .ce-btn { flex: 1 1 auto; }
.ce-espera { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.8); padding: 16px; }
.ce-espera-caja { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; max-width: 360px; }
.ce-espera-texto { font-size: 18px; font-weight: 600; color: #fff; }
.ce-espera-sub { font-size: 15px; color: #E0E0E0; }
.ce-rueda { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #29B6F6; animation: ce-gira 0.9s linear infinite; }
.ce-revision .ce-rueda, .ce-rueda.ce-chica { border-color: #CFD8DC; border-top-color: #0D47A1; }
.ce-rueda.ce-chica { width: 26px; height: 26px; border-width: 3px; }
.ce-vista-marco .ce-rueda { position: absolute; }
@keyframes ce-gira { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ce-destello.ce-destellando, .ce-contador.ce-salto { animation: none; }
  .ce-rueda { animation-duration: 2.5s; }
}
