/*==============================================================
   NOVEDADES.CSS — TodoGlobos Silvia
   Diseño estilo "Stories" de Instagram / WhatsApp
   Mobile-first | Consistent with inicio.css & productos.css
================================================================*/

/* ===== VARIABLES DE LA PÁGINA ===== */
:root {
  --stories-ring: linear-gradient(135deg, #7b4fff 0%, #ff4ecd 100%);
  --stories-dark: #0a0010;
  --stories-overlay: linear-gradient(to top,
      rgba(10, 0, 16, 0.95) 0%,
      rgba(10, 0, 16, 0.6) 45%,
      transparent 100%);
  --stories-progress: #ff4ecd;
  --viewer-z: 10000;
}

/* ===== BODY / FONDO ===== */
body {
  background-color: #f5f0ff;
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(123, 79, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(255, 78, 205, 0.05) 0%, transparent 50%);
  min-height: 100dvh;
}

/* ===== HEADER OVERRIDE ===== */
.header {
  box-shadow: 0 2px 20px rgba(123, 79, 255, 0.12);
}

/* ===== FAB WHATSAPP FLOTANTE ===== */
.fab__whatsapp {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fab__whatsapp:hover {
  transform: scale(1.12);
  box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
  color: #fff;
}

.fab__icon {
  font-size: 1.75rem;
  position: relative;
  z-index: 2;
  color: #fff;
}

.fab__pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.45);
  animation: fabPulse 2s ease-out infinite;
}

.fab__pulse--delay {
  animation-delay: 0.8s;
}

@keyframes fabPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.fab__tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fab__whatsapp:hover .fab__tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

@media screen and (min-width: 768px) {
  .fab__whatsapp {
    bottom: 2rem;
    right: 1.75rem;
    width: 62px;
    height: 62px;
  }
}


/* ===== HERO / ENCABEZADO DE PÁGINA ===== */
.novedades__hero {
  padding: 4rem 1.25rem 1rem;
  text-align: center;
}

.novedades__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--first-color);
  background: rgba(123, 79, 255, 0.08);
  border: 1px solid rgba(123, 79, 255, 0.15);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: .5rem;
}

.novedades__eyebrow i {
  font-size: 0.9rem;
  color: #ff4ecd;
}

.novedades__title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #7b4fff 0%, #ff4ecd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.novedades__subtitle {
  font-size: 0.92rem;
  color: #666;
  max-width: 480px;
  margin: 0 auto .5rem;
  line-height: 1.65;
}

.novedades__count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--boton-gradiente);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  margin-top: 0.5rem;
}

/* ===================================================================
   STORIES STRIP — La franja horizontal con thumbnails circulares
=================================================================== */
.stories__section {
  padding: .5rem 0 .5rem;
}

.stories__strip-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.75rem 1.25rem 1.75rem;
  user-select: none;
  -webkit-user-select: none;
}

.stories__strip-wrapper::-webkit-scrollbar {
  display: none;
}

.stories__strip {
  display: flex;
  gap: 1.1rem;
  width: max-content;
  padding-bottom: 0.25rem;
}

/* === Cada ítem de story === */
.story__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.story__item:hover {
  transform: translateY(-4px);
}

.story__item:active {
  transform: scale(0.93);
}

/* El anillo gradiente */
.story__ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b4fff 0%, #ff4ecd 50%, #ffd166 100%);
  padding: 3px;
  box-shadow: 0 4px 18px rgba(123, 79, 255, 0.4);
  animation: storyRingGlow 2.8s ease-in-out infinite alternate;
  position: relative;
}

@keyframes storyRingGlow {
  from {
    box-shadow: 0 4px 18px rgba(123, 79, 255, 0.35);
  }

  to {
    box-shadow: 0 4px 28px rgba(255, 78, 205, 0.6);
  }
}

/* "Visto": anillo gris */
.story__item.seen .story__ring {
  background: linear-gradient(135deg, #bbb, #888);
  animation: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* La imagen circular */
.story__ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2.5px solid #fff;
}

.story__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
  border-radius: 50%;
  -webkit-user-drag: none;
}

.story__item:hover .story__thumb {
  transform: scale(1.06);
}

/* Ícono play en hover */
.story__play-hint {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(123, 79, 255, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.story__item:hover .story__play-hint {
  opacity: 1;
}

.story__play-hint i {
  font-size: 1.5rem;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* Nombre debajo del thumbnail */
.story__name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dark-color);
  text-align: center;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.story__item.seen .story__name {
  color: #aaa;
  font-weight: 500;
}

/* ===================================================================
   STORY VIEWER — Overlay fullscreen
=================================================================== */
.story__viewer {
  position: fixed;
  inset: 0;
  z-index: var(--viewer-z);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.story__viewer.is-active {
  opacity: 1;
  pointer-events: all;
}

/* En desktop, el viewer va en una "ventana" estilo smartphone */
.viewer__stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0a0010;
}

/* === Barras de progreso === */
.viewer__progress-bars {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  right: 0.9rem;
  display: flex;
  gap: 4px;
  z-index: 20;
}

.viewer__prog-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  overflow: hidden;
}

.viewer__prog-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 9999px;
}

.viewer__prog-segment.done .viewer__prog-fill {
  width: 100%;
  transition: none !important;
}

.viewer__prog-segment.is-active .viewer__prog-fill {
  /* La duración se establece por JS */
}

/* === Cabecera viewer: branding + botón cerrar === */
.viewer__header {
  position: absolute;
  top: 2rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.viewer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.viewer__brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  object-fit: cover;
}

.viewer__brand-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.viewer__close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  color: #111;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.viewer__close:hover {
  background: #fff;
  transform: scale(1.08);
}

/* === Imagen de la story === */
.viewer__img-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Overlay de info (parte inferior) === */
.viewer__info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top,
      rgba(10, 0, 16, 0.97) 0%,
      rgba(10, 0, 16, 0.65) 50%,
      transparent 100%);
  padding: 4rem 1.5rem 2.5rem;
  z-index: 15;
}

.viewer__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #7b4fff, #ff4ecd);
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  margin-bottom: 0.65rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.viewer__title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.22;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  margin-bottom: 0.5rem;
}

.viewer__desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.viewer__wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  font-family: var(--body-font, inherit);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.viewer__wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.6);
  color: #fff;
}

.viewer__wa-btn i {
  font-size: 1.1rem;
}

/* === Zonas de tap para navegar (izq / der) === */
.viewer__tap-zone {
  position: absolute;
  top: 4rem;
  /* debajo del header */
  bottom: 38%;
  /* arriba de la info */
  z-index: 18;
  cursor: pointer;
}

.viewer__tap-left {
  left: 0;
  width: 38%;
}

.viewer__tap-right {
  right: 0;
  width: 38%;
}

/* ===================================================================
   EMPTY STATE
=================================================================== */
.stories__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem 5rem;
  gap: 0.85rem;
}

.stories__empty i {
  font-size: 4rem;
  background: linear-gradient(135deg, #7b4fff, #ff4ecd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.stories__empty h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark-color);
}

.stories__empty p {
  font-size: 0.9rem;
  color: #888;
  max-width: 300px;
}



/* ===================================================================
   RESPONSIVE — DESKTOP
=================================================================== */
@media screen and (min-width: 640px) {
  .novedades__title {
    font-size: 2.6rem;
  }

  .story__ring {
    width: 90px;
    height: 90px;
  }

  .stories__strip {
    gap: 1.35rem;
  }

  .story__name {
    max-width: 94px;
    font-size: 0.72rem;
  }

  .viewer__title {
    font-size: 1.65rem;
  }

  /* En tablet/desktop: viewer centrado estilo smartphone */
  .story__viewer {
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .viewer__stage {
    width: min(420px, 100%);
    height: min(750px, 100dvh);
    border-radius: 1.75rem;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
}

@media screen and (min-width: 768px) {
  .novedades__hero {
    padding: 6.5rem 2rem 1rem;
  }

  .novedades__title {
    font-size: 3rem;
  }
}