:root {
  --bg-color: #f7f7f7;
  --btn-bg: #dcdbdb;
  --btn-bg-hover: #afacac;
  --btn-color: black;
  --shadow-color: rgba(0,0,0,0.2);
  --highlight-color: red;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  overflow: hidden;
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: var(--font-family);
}

/* Contenedor principal */
.magazine-viewport {
  position: relative;
  max-width: 1200px;
  margin: auto;
  overflow: hidden;
}

/* Contenedor de páginas */
.magazine-viewport .container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: auto;
  transition: all 0.3s ease;
  overflow: visible; /* clave para que los botones se vean */
}

/* Revista */
.magazine-viewport .magazine {
  width: 100%;
  height: auto;
  max-height: 780px;
  position: relative;
}

.magazine-viewport .page {
  width: 50%;
  height: auto;
  background-color: white;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 0 20px var(--shadow-color);
}

.magazine-viewport .page img {
  width: 100%;
  height: auto;
  object-fit: cover;
  user-select: none;
}

/* Botones navegación */
.previous-button,
.next-button {
  width: 40px;
  height: 100%;
  position: absolute;
  top: 0;
  cursor: pointer;
  z-index: 9999;
  background: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--btn-color);
  user-select: none;
  opacity: 0.6;
}

.previous-button {
  left: 0;
  border-radius: 0 10px 10px 0;
}

.next-button {
  right: 0;
  border-radius: 10px 0 0 10px;
}

.previous-button:hover,
.next-button:hover {
  background: rgba(0,0,0,0.5);
  color: #fff;
  opacity: 1;
}

/* Botón zoom */
.zoom-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 60px;
  height: 60px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 26px;
  font-weight: bold;
  border-radius: 50%;
  text-align: center;
  line-height: 60px;
  cursor: pointer;
  z-index: 1000;
  user-select: none;
  transition: background 0.3s;
}

.zoom-button:hover {
  background: var(--btn-bg-hover);
}

/* Thumbnails */
.thumbnails {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.thumbnails ul {
  display: flex;
  gap: 5px;
  padding: 0;
  margin: 0;
}

.thumbnails li {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 2px;
  box-shadow: 0 0 5px #ccc;
  padding: 2px;
  transition: transform 0.2s ease;
  user-select: none;
}

.thumbnails li:hover {
  transform: scale(1.05);
}

.thumbnails li img {
  width: 60px;
  height: auto;
  display: block;
}

.thumbnails .current {
  box-shadow: 0 0 10px var(--highlight-color);
}

/* Indicador de página */
.page-indicator {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.8);
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  z-index: 1000;
}

/* Responsive */
@media (max-width: 1300px) {
  .magazine-viewport .container {
    max-width: 90vw;
  }
  .magazine-viewport .page {
    width: 50vw;
  }
}

@media (max-width: 700px) {
  .magazine-viewport .container {
    max-width: 100vw;
  }
  .magazine-viewport .page {
    width: 90vw;
  }
  .magazine-viewport .next-button,
  .magazine-viewport .previous-button {
    display: none; /* usar swipe en móvil */
  }
}