/* ===== Base general ===== */
html, body {
  margin: 0;
  padding: 0;
}

body {
  background: #222;
  font-family: "Comfortaa", sans-serif;
}

.main-content {
  text-align: center;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
}

.main-content h1 {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 1.5em;
}

.map-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
}

/* ===== MAPA base (desktop/tablet) ===== */
.map-base {
  width: 306px;
  height: 600px;

  /* Mapa CERRADO: usamos las mismas imágenes que side-5 y side-6 */
  background-image:
    url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/6.png"),
    url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/11.png");
  background-position: left center, right center;
  background-size: 50% 100%, 50% 100%;
  background-repeat: no-repeat;

  position: relative;
  display: inline-block;
  transform-origin: top center;
  cursor: pointer;
}

/* Cuando el mapa está ABIERTO, mostramos el interior */
.map-base.active {
  background-image: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/9.png");
  background-position: center center;
  background-size: cover;
}

.hint {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===== PANEL DEL MENÚ (desktop) ===== */
.menu-panel {
  position: absolute;
  top: 6%;
  bottom: 6%;
  left: -50%;
  width: 220%;

  background: rgba(248, 233, 200, 0.68);
  border-radius: 14px;
  border: 1px solid rgba(80, 52, 26, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  padding: 0.7rem 0.9rem;
  overflow-y: auto;
  color: #3b2414;
  backdrop-filter: blur(1.5px);

  opacity: 0;
  pointer-events: none;
  /* transform: scale(0.97); */
  transition: opacity 0.45s ease 0.3s, transform 0.45s ease 0.3s;
  z-index: 20;
}

/* Contenido interno desktop: 3 columnas lado a lado */
.menu-panel-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

/* Mostrar panel cuando el mapa está activo */
.map-base.active .menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Oscurecer apenas el mapa detrás cuando se abre */
.map-base::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent, rgba(0, 0, 0, 0.12));
  opacity: 0;
  transition: opacity 0.45s ease 0.2s;
  z-index: 15;
}

.map-base.active::after {
  opacity: 1;
}

/* ===== Estilo de columnas y listas ===== */
.menu-column h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(80, 52, 26, 0.5);
  margin: 0 0 0.25rem;
  padding-bottom: 0.15rem;
}

.menu-subtitle {
  font-size: 0.78rem;
  margin: 0.4rem 0 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.menu-list {
  list-style: none;
  margin: 0.2rem 0 0.4rem;
  padding: 0;
}

.menu-list li {
  display: flex;
  align-items: baseline;
  font-size: 0.78rem;
  margin: 0.04rem 0;
}

.menu-list.small li {
  font-size: 0.74rem;
}

.item-name {
  flex: 0 1 auto;
  max-width: 72%;
}

.dots {
  flex: 1 1 auto;
  border-bottom: 1px dotted rgba(80, 52, 26, 0.55);
  margin: 0 0.25rem;
}

.price {
  flex: 0 0 auto;
  font-weight: 600;
  white-space: nowrap;
}

.menu-note {
  margin-top: 0.4rem;
  font-size: 0.7rem;
}

/* =================== */
/* MAPA ORIGINAL: flaps, lados, huellas (solo desktop) */
/* =================== */

.map-flap {
  transform-style: preserve-3d;
  position: absolute;
  width: 100%;
  height: 25%;
  margin: auto;
  left: 0;
  right: 0;
  transition: 0.5s ease;
  top: 25%;
}

.map-flap__front,
.map-flap__back {
  backface-visibility: hidden;
  width: 100%;
  height: 100%;
  position: absolute;
}

.map-flap__back {
  transform: scale(-1) rotateY(180deg);
}

.flap--1 {
  box-shadow: 0 -1px 6px rgba(97, 83, 73, 0.5);
}

.flap--1 .map-flap__front {
  background: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/mini-1.png")
    center left / cover;
}

.flap--1 .map-flap__back {
  background: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/mini-3.png")
    -3px 0 / cover;
}

.flap--2 {
  box-shadow: 0 1px 6px rgba(97, 83, 73, 0.5);
  top: 50%;
}

.flap--2 .map-flap__front {
  background: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/mini-2.png")
    center left / cover;
}

.flap--2 .map-flap__back {
  background: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/mini-4.png")
    -3px 0 / cover;
}

.map-side {
  height: 600px;
  width: 152px;
  position: absolute;
  transform-style: preserve-3d;
  transition: 0.3s ease;
  top: 0;
}

.map-side .front,
.map-side .back {
  width: 100%;
  height: 100%;
  position: absolute;
  background-repeat: no-repeat;
  background-position: left top;
  background-size: cover;
  background-image: var(--image);
  backface-visibility: hidden;
}

.map-side .back {
  background-image: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/back.png");
}

.map-side.side-1 {
  left: 0;
  margin-left: 1.5px;
}

.map-side.side-2 {
  left: 50%;
  margin-left: -2px;
}

.map-side.side-3 {
  left: 0;
  margin-left: 3px;
}

.map-side.side-3 .back {
  transform: rotateY(180deg);
}

.map-side.side-4 {
  left: 50%;
  margin-left: -1px;
}

.map-side.side-4 .back {
  transform: rotateY(180deg);
}

.map-side.side-5 {
  left: 0;
}

.map-side.side-5 .back {
  background-image: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/1.png");
}

.map-side.side-6 {
  left: 50%;
}

.map-side.side-6 .front {
  background-size: 99.5%;
}

.map-side.side-6 .back {
  background-image: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/17.png");
}

/* Scroll con nombre */
.scroll-name {
  position: absolute;
  bottom: 105px;
  left: -60px;
  width: 150px;
  height: 30px;
  font: 15px "Satisfy", cursive;
  text-align: center;
  background: url("https://meowlivia.s3.us-east-2.amazonaws.com/codepen/map/scroll.svg")
    center center / cover;
  z-index: 10;
  color: #615349;
  cursor: default;
  opacity: 0;
}

.scroll-name p {
  display: inline-block;
  margin: 4px 0 0 15px;
}

/* Huellitas */
.footstep {
  position: absolute;
  background: #615349;
  width: 6px;
  height: 12px;
  border-radius: 80% 80% 70% 70% / 130% 130% 25% 25%;
  z-index: 10;
  opacity: 0;
}

.footstep::before {
  content: "";
  position: absolute;
  border-radius: 6px;
  width: 5px;
  height: 5px;
  top: 110%;
  left: 0;
  background: #615349;
  border-radius: 0 0 100% 100%;
}

.footstep.left {
  transform: rotate(5deg);
}

.footstep.right {
  transform: rotate(-3deg) translateY(15px) translateX(10px);
}

.footsteps-1 .footstep.left {
  bottom: 150px;
  left: 18px;
  transform: rotate(35deg);
}

.footsteps-1 .footstep.right {
  bottom: 150px;
  left: 28px;
  transform: rotate(30deg);
}

.footsteps-2 .footstep.left {
  bottom: 285px;
  left: 280px;
  transform: rotate(-90deg);
}

.footsteps-2 .footstep.right {
  bottom: 275px;
  left: 285px;
  transform: rotate(-85deg);
}

.footsteps-2 .scroll-name {
  bottom: 300px;
  left: 220px;
}

/* Estado activo del mapa */
.map-base.active .flap--1 {
  transform: rotateX(180deg);
  transform-origin: top center;
  transition: 0.6s transform 1.5s;
}

.map-base.active .flap--2 {
  transform: rotateX(180deg);
  transform-origin: bottom center;
  transition: 0.6s transform 1.8s;
}

.map-base.active .side-1 {
  transform-origin: center left;
  transform: rotateY(180deg) skewY(2deg);
  transition: 0.5s all ease-in-out 0.6s;
}

.map-base.active .side-1 .front {
  transform: rotateY(180deg);
}

.map-base.active .side-2 {
  transform: rotateY(180deg) skewY(-2deg);
  transform-origin: center right;
  transition: 0.5s all ease-in-out 0.6s;
}

.map-base.active .side-2 .front {
  transform: rotateY(180deg);
}

.map-base.active .side-3 {
  left: -50%;
  transform: skewY(2deg) translateX(-100%);
  top: 8px;
  transition: 0.5s transform ease 0.8s, 0.3s left ease 0.8s, 0.5s top ease 0.8s;
}

.map-base.active .side-4 {
  left: 100%;
  transform: skewY(-2deg) translateX(100%);
  top: 8px;
  margin-left: -7px;
  transition: 0.5s transform ease 0.8s, 0.3s left ease 0.8s, 0.5s top ease 0.8s, 0.5s margin ease 0.8s;
}

.map-base.active .side-5 {
  left: -100%;
  transform-origin: center left;
  transform: rotateY(180deg);
  transition: 0.5s transform, 0.7s left 0.8s, 0.2s margin 0.8s;
  top: 0;
  margin-left: 4px;
}

.map-base.active .side-5 .front {
  transform: rotateY(180deg);
  transition: 0.1s transform;
}

.map-base.active .side-6 {
  left: 150%;
  transform: rotateY(180deg);
  transform-origin: center right;
  margin-left: -8px;
  transition: 0.5s transform 0.3s, 0.7s left 0.8s, 0.5s top 0.8s, 0.5s margin 0.8s;
}

.map-base.active .side-6 .front {
  transform: rotateY(180deg);
  transition: 0.1s transform;
}

.map-base.active .footstep,
.map-base.active .scroll-name {
  opacity: 1;
  transition: 0.5s opacity 2.5s;
}

/* Animaciones huellas + scrolls */
@keyframes footsteps-1 {
  10% { transform: translate(8px, -15px) rotate(30deg); }
  20% { transform: translate(30px, -45px) rotate(30deg); }
  30% { transform: translate(40px, -75px) rotate(20deg); }
  40% { transform: translate(45px, -100px) rotate(10deg); }
  50% { transform: translate(50px, -125px) rotate(10deg); }
  60% { transform: translate(50px, -135px) rotate(10deg); }
  100% { transform: translate(50px, -135px) rotate(20deg); }
}

@keyframes footsteps-2 {
  0% {}
  80% { transform: translate(-170px, -25px) rotate(-90deg); }
  100% { transform: translate(-180px, -25px) rotate(-90deg); }
}

@keyframes scroll-1 {
  10% { transform: translate(8px, -15px); }
  20% { transform: translate(30px, -45px); }
  30% { transform: translate(40px, -75px); }
  40% { transform: translate(45px, -100px); }
  50% { transform: translate(50px, -125px); }
  60% { transform: translate(50px, -135px); }
  100% { transform: translate(50px, -135px); }
}

@keyframes scroll-2 {
  0% {}
  80% { transform: translate(-170px, -25px); }
  100% { transform: translate(-180px, -25px); }
}

/* ===== AJUSTE SOLO PARA MOBILE ===== */
/* ===== AJUSTE SOLO PARA MOBILE ===== */
@media (max-width: 600px) {

  /* El body puede scrollear si hace falta */
  html,
  body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
  }

  /* Contenedor del mapa en mobile */
  .map-wrapper {
    width: 100%;
    height: 100vh;
    align-items: flex-start;   /* pegado arriba */
    justify-content: flex-start;
    padding-top: 8px;
    padding-bottom: 8px;
    overflow-x: auto;          /* para ver las hojas al abrirse */
    overflow-y: auto;          /* para que NO se corte al agrandarlo */
  }

  /* Mapa CERRADO: más grande */
  .map-base {
    transform: scale(1.25);    /* probá 1.25 / 1.3 / 1.35 si querés más grande */
    transform-origin: top center;
    margin-left: 24px;         /* lo deja más “centrado visualmente” */
  }

  /* Mapa ABIERTO: mismo scale + corrimiento a la derecha
     para que entren las hojas del lado izquierdo */
  .map-base.active {
    transform: scale(1.25) translateX(400px);
  }
}
