/* bottle-viewer.css — Mobile First */

/* ── Overlay ── */
.bottle-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;

  /* iOS Safari: visibility + opacity para que la transición funcione */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
  overflow: hidden;
}

.bottle-viewer.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s ease, visibility 0s linear 0s;
}

/* ── Fondo con imagen ── */
.bottle-viewer__bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  animation: none;
}

/* ── Logo familia — esquina inferior derecha ── */
.bottle-viewer__familia {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 10;
  width: 110px;
  height: auto;
  pointer-events: none;
}

@keyframes bgPulse {
  0%   { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ── Contenido centrado ── */
.bottle-viewer__content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;  /* evita scroll interno */
  background: radial-gradient(circle at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
}

/* ── Imagen de la botella ── */
/* Base móvil: 375px */
.bottle-viewer__img {
  max-width: 75vw;
  max-height: 78svh;
  width: auto;
  height: auto;
  object-fit: contain;

  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
              opacity   0.8s cubic-bezier(0.25, 1, 0.5, 1);

  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.8));
}

.bottle-viewer.is-open .bottle-viewer__img {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Tablet */
@media (min-width: 768px) {
  .bottle-viewer__img {
    max-width: 42vw;
    max-height: 82svh;
  }
}

/* Desktop — la imagen portrait con contain ocupa ~44.8vh de ancho (ratio 1376:3070)
   El logo se alinea al borde derecho real de la imagen: (100vw - 44.8vh) / 2 desde la derecha */
@media (min-width: 1024px) {
  .bottle-viewer__img {
    max-width: 340px;
    max-height: 84vh;
  }

  .bottle-viewer__familia {
    right: calc((100vw - 44.8vh) / 2);
    bottom: 0;
    width: 110px;
  }
}

/* Desktop grande */
@media (min-width: 1440px) {
  .bottle-viewer__img {
    max-width: 400px;
    max-height: 85vh;
  }

  .bottle-viewer__familia {
    right: calc((100vw - 44.8vh) / 2);
    bottom: 0;
    width: 120px;
  }
}

/* ── Botón cerrar ── */
.bottle-viewer__close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease, transform 0.3s ease;
  /* Área táctil mínima para móvil */
  min-width: 44px;
  min-height: 44px;
}

.bottle-viewer__close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}
