/* ===== Maizul — Menú Digital =====
   Tokens tomados de Maizul_Identidad_Visual.html
   Azul #3C55AF · Azul oscuro #536086 · Dorado #FFEC76 · Dorado profundo #C38036
   Crema #FDFBEC · Crema alterna #EFECD2
*/

:root{
  --azul: #3C55AF;
  --azul-deep: #536086;
  --dorado: #FFEC76;
  --dorado-deep: #C38036;
  --crema: #FDFBEC;
  --crema-alt: #EFECD2;
  --white: #FFFFFF;

  --font-script: 'Sacramento', cursive;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;

  --page-max-width: 480px;
  /* letter-ratio (8.5 x 11) frame on larger screens */
  --page-aspect: 0.773;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--crema-alt);
  color: var(--azul);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body{
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-frame{
  position: relative;
  width: 100%;
  max-width: var(--page-max-width);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--crema);
  overflow: hidden;
  box-shadow: none;
}

/* On wider viewports, present as a letter-portrait card instead of full-bleed */
@media (min-width: 560px){
  html, body{ background: var(--crema-alt); }
  body{ padding: 32px 16px; }
  .page-frame{
    min-height: unset;
    aspect-ratio: var(--page-aspect);
    border-radius: 18px;
    box-shadow: 0 24px 60px -20px rgba(60, 85, 175, 0.35);
    border: 1px solid var(--crema-alt);
  }
}

.screen{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9% 8% 8%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease;
}
.screen.is-active{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce){
  .screen{ transition: none; }
}

/* ---- Brandmark ---- */
.brandmark{
  margin-top: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.swash{
  width: 62%;
  max-width: 230px;
  margin-bottom: -2.4rem;
}
.swash svg{ width: 100%; height: auto; display: block; }

.wordmark{
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  color: var(--azul);
  margin: 0;
  line-height: 1;
  position: relative;
}
.location{
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  color: var(--azul-deep);
  margin: 0.6rem 0 0;
  text-transform: uppercase;
}

.brandmark--small{ margin-top: 2%; }
.brandmark--small .swash--small{ width: 44%; max-width: 150px; margin-bottom: -1.5rem; }
.wordmark--small{ font-size: clamp(1.7rem, 8vw, 2.1rem); }

/* ---- Titles ---- */
.menu-title{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.9rem, 9vw, 2.4rem);
  letter-spacing: 0.04em;
  color: var(--azul);
  margin: 10% 0 8%;
  text-align: center;
}
.menu-title--sub{
  font-weight: 500;
  font-size: clamp(1.1rem, 5vw, 1.3rem);
  color: var(--azul-deep);
  margin-top: 14%;
}

/* ---- Buttons ---- */
.btn-group{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  margin-bottom: 12%;
}
.btn{
  width: 100%;
  padding: 16px 20px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active{ transform: scale(0.97); }
.btn:focus-visible{ outline: 3px solid var(--dorado-deep); outline-offset: 2px; }

.btn-primary{
  background: var(--azul);
  color: var(--white);
  box-shadow: 0 10px 24px -10px rgba(60, 85, 175, 0.55);
}
.btn-primary:hover{ background: #33499a; }

.btn-secondary{
  background: var(--dorado);
  color: var(--azul);
  box-shadow: 0 10px 24px -12px rgba(195, 128, 54, 0.45);
}
.btn-secondary:hover{ background: #ffe454; }

/* ---- Disclaimer / nota legal ---- */
.disclaimer{
  font-family: var(--font-sans);
  font-weight: 300;
  font-style: italic;
  font-size: 0.66rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--azul-deep);
  text-align: center;
  max-width: 92%;
  margin: 0 auto;
  opacity: 0.8;
}

/* ---- Back button ---- */
.btn-back{
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--azul-deep);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 6px 4px;
  cursor: pointer;
  margin-bottom: 4px;
}
.btn-back .arrow{ font-size: 1rem; }
.btn-back:focus-visible{ outline: 2px solid var(--dorado-deep); outline-offset: 2px; }

/* ---- Viewer screen ---- */
#screen-viewer{ padding: 4% 0 0; }
.viewer-top{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6% 3%;
  border-bottom: 1px solid var(--crema-alt);
}
.viewer-label{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--azul);
  letter-spacing: 0.03em;
}
.btn-back--viewer{ margin-bottom: 0; }

.pdf-container{
  width: 100%;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--crema-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 30px;
}
.pdf-container canvas{
  max-width: calc(100% - 24px);
  height: auto;
  box-shadow: 0 6px 18px -8px rgba(60, 85, 175, 0.35);
  background: var(--white);
  border-radius: 2px;
}

.pdf-loading{
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--azul-deep);
  font-size: 0.85rem;
  font-weight: 500;
}
.spinner{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--crema-alt);
  border-top-color: var(--azul);
  animation: spin 0.85s linear infinite;
}
@media (prefers-reduced-motion: reduce){
  .spinner{ animation: none; border-top-color: var(--azul-deep); }
}
@keyframes spin{ to{ transform: rotate(360deg); } }
