/* ============================
   main.css – Estilos globales
   Tótem Alimentaria 2026
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&display=swap');

/* Variables de marca P.A.N. */
:root {
  --pan-yellow:    #FFD100;
  --pan-yellow-dk: #E8BC00;
  --pan-blue:      #003087;
  --pan-blue-lt:   #0057B8;
  --pan-white:     #FFFFFF;
  --pan-gray:      #F5F5F5;
  --pan-shadow:    rgba(0,0,0,0.35);

  --ui-radius:     16px;
  --ui-btn-min:    130px;   /* Mínimo para uso táctil */
  --ui-font:       'Montserrat', sans-serif;
  --ui-transition: 0.3s ease;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--pan-blue);
  font-family: var(--ui-font);
  cursor: none; /* Modo kiosk – sin cursor */
  user-select: none;
  -webkit-user-select: none;
}

/* ─── PANTALLA DE BIENVENIDA ─────────────────────────── */

#welcome-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--pan-blue) 0%, #001a4f 100%);
  z-index: 100;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#welcome-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(255,209,0,0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 50%, rgba(255,209,0,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.welcome-corner {
  position: absolute;
  width: 300px;
  height: 300px;
  background: var(--pan-yellow);
  border-radius: 50%;
  opacity: 0.07;
}
.welcome-corner.tl { top: -100px; left: -100px; }
.welcome-corner.br { bottom: -100px; right: -100px; }

.welcome-logo {
  width: 300px;
  height: auto;
  margin-bottom: 40px;
  animation: logoIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}

.welcome-title {
  font-size: clamp(36px, 4vw, 64px);
  font-weight: 900;
  color: var(--pan-white);
  text-align: center;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 16px;
  animation: fadeUp 0.7s 0.2s ease both;
}

.welcome-title span {
  color: var(--pan-yellow);
}

.welcome-subtitle {
  font-size: clamp(18px, 2vw, 28px);
  color: rgba(255,255,255,0.75);
  text-align: center;
  font-weight: 400;
  margin-bottom: 72px;
  max-width: 700px;
  animation: fadeUp 0.7s 0.35s ease both;
}

.welcome-lang-label {
  font-size: 18px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: fadeUp 0.7s 0.45s ease both;
}

.welcome-buttons {
  display: flex;
  gap: 32px;
  animation: fadeUp 0.7s 0.55s ease both;
}

.lang-btn {
  min-width: var(--ui-btn-min);
  min-height: var(--ui-btn-min);
  padding: 24px 48px;
  border: none;
  border-radius: var(--ui-radius);
  font-family: var(--ui-font);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.lang-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.lang-btn:active::after {
  background: rgba(255,255,255,0.2);
}

.lang-btn-es {
  background: var(--pan-yellow);
  color: var(--pan-blue);
  box-shadow: 0 8px 32px rgba(255,209,0,0.4);
}

.lang-btn-es:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 48px rgba(255,209,0,0.5);
}

.lang-btn-en {
  background: transparent;
  color: var(--pan-white);
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.lang-btn-en:hover {
  transform: translateY(-4px) scale(1.03);
  background: rgba(255,255,255,0.1);
  border-color: var(--pan-white);
}

.welcome-footer {
  position: absolute;
  bottom: 32px;
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
}

/* ─── VISOR DE REVISTA ───────────────────────────────── */

#viewer-screen {
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  z-index: 50;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#viewer-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Header flotante */
.viewer-topbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0, 20, 70, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 209, 0, 0.25);
  border-radius: 48px;
  z-index: 20;
  white-space: nowrap;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-title {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.topbar-page-info {
  color: var(--pan-yellow);
  font-size: 15px;
  font-weight: 700;
  min-width: 52px;
  text-align: center;
}

.ui-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  color: var(--pan-white);
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ui-btn:hover, .ui-btn:active {
  background: var(--pan-yellow);
  color: var(--pan-blue);
  border-color: var(--pan-yellow);
  transform: scale(1.08);
}

.ui-btn.back-btn {
  background: rgba(255,209,0,0.12);
  border-color: rgba(255,209,0,0.4);
  color: var(--pan-yellow);
  font-size: 13px;
  padding: 6px 14px;
}

/* Área central del visor (ocupa toda la pantalla) */
.viewer-main {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 90px;
}

/* Botones laterales de navegación */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 160px;
  border: none;
  background: rgba(0,0,0,0.35);
  color: var(--pan-white);
  font-size: 48px;
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s ease, transform 0.2s ease;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-arrow:hover, .nav-arrow:active {
  background: var(--pan-yellow);
  color: var(--pan-blue);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow.prev { left: 12px; }
.nav-arrow.next { right: 12px; }

/* Miniaturas ocultas */
.viewer-thumbnails { display: none; }

/* ─── SCREENSAVER/TIMEOUT ────────────────────────────── */
.timeout-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--pan-yellow);
  transition: width 1s linear;
  z-index: 9999;
  opacity: 0;
}

.timeout-bar.active {
  opacity: 0.7;
}

/* ─── ANIMACIONES ────────────────────────────────────── */
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1200px) {
  .viewer-main { padding: 16px 90px; }
  .nav-arrow { width: 70px; height: 130px; font-size: 40px; }
}
