.stories-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #cec3a7e5;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.stories-container {
  position: relative;
  width: 100%;
  max-width: 40rem;
  height: 90vh;
  max-height: 90rem;
  background: #2a2a2a;
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 0.8rem 3.2rem rgba(0, 0, 0, 0.4);
}

/* Progress bars */
.stories-progress {
  position: absolute;
  top: 2dvh;
  left: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.4rem;
  z-index: 10;
}

.progress-bar-container {
  flex: 1;
  height: 0.3rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0.2rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: white;
  transition: width 0.1s linear;
}

.progress-bar.active {
  animation: progressAnimation 5s linear forwards;
}

.progress-bar.completed {
  width: 100%;
}

@keyframes progressAnimation {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* Header */
.stories-header {
  position: absolute;
  top: 6dvh;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.stories-logo {
  filter: drop-shadow(0 0.2rem 0.4rem rgba(0, 0, 0, 0.5));
}

.stories-controls {
  display: flex;
}

.control-btn {
  border: none;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

.control-btn svg {
  width: 2.4rem;
  height: 2.4rem;
}

/* Share menu */
.share-button-container {
  position: relative;
}

.share-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.8rem;
  background: white;
  border-radius: 1rem;
  padding: 0.8rem;
  box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 100;
  min-width: 16rem;
  animation: fadeIn 0.2s ease;
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 1.4rem;
  color: #333;
}

.share-menu-item:hover {
  background: #f5f5f5;
}

.share-menu-item span {
  font-weight: 500;
}

.bluesky-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1185fe;
  border-radius: 50%;
}

.bluesky-icon svg {
  width: 20px;
  height: 20px;
}

/* Story content */
.stories-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.story-video,
.story-image {
  width: auto;
  height: 100%;
  object-fit: cover;
}

.story-image {
  height: 100%;
}

.story-text-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 3rem;
  text-align: center;
}

.story-text-bg {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.story-text-bg--bg1 {
  left: 0;
  top: 0;
  height: 100%;
  width: auto;
  object-fit: cover;
}

.story-text-bg--bg2 {
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.story-text-title {
  color: white;
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 2rem;
  line-height: 1.2;
  text-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.story-text-body {
  color: rgba(255, 255, 255, 0.9);
  font-size: 2.8rem;
  font-weight: 300;
  line-height: 1.5;
  font-family: "Noto Serif", serif;
  width: 34rem;
  text-shadow: 0 0.1rem 0.4rem rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  text-align: right;
}

.story-text-body .name-highlight {
  color: #ebdb48;
  font-family: "Boldonse";
  font-size: 3.2rem;
  font-weight: 400;
  display: block;
}

.story-text-body .price-highlight {
  color: #ebdb48;
  font-family: "Boldonse";
  font-size: 5rem;
  font-weight: 400;
  display: block;
}

.story-text-body .price-highlight-color {
  color: #e0773b;
  font-family: "Boldonse";
  font-size: 5.3rem;
  font-weight: 400;
  display: block;
}

.story-text-body .price-highlight-big {
  color: #e0773b;
  font-family: "Boldonse";
  font-size: 9.6rem;
  font-weight: 400;
  display: block;
}

.story-text-body .data-highlight {
  color: #fff;
  font-family: "Boldonse";
  font-size: 2rem;
  font-weight: 400;
  border-radius: 1.3rem;
  background: #e0773b;
  display: block;
  padding: 0.5rem;
  margin: 0.5rem 0;
  text-align: center;
}

.story-text-body .data-highlight-big {
  color: #fff;
  font-family: "Boldonse";
  font-size: 6rem;
  font-weight: 400;
  border-radius: 2.5rem;
  background: #e0773b;
  display: block;
  padding: 1rem;
  margin: 0.5rem 0;
  text-align: center;
}

/* Story Grid */
.story-grid {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8rem 3rem 3rem;
}

.story-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 42rem;
  width: 100%;
}

.story-grid-item {
  background: transparent;
  border: 1px solid #fff;
  border-radius: 1.2rem;
  padding: 2rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.story-grid-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-0.5rem);
}

.story-grid-item--link {
  text-decoration: none;
}

.story-grid-item--link .story-grid-text {
  color: white;
}

.story-grid-icon {
  width: 10rem;
  height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.story-grid-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-grid-text {
  color: white;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.4);
}

/* Social CTA Box */
.story-social-box {
  margin-top: 2rem;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 1.2rem;
  padding: 1.8rem 2rem;
  text-align: center;
  width: 100%;
  max-width: 42rem;
}

.story-social-text {
  color: white;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.story-social-hashtag {
  color: #ebdb48;
  font-family: "Boldonse";
}

.story-social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.story-social-icon {
  display: flex;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.story-social-icon:hover {
  transform: scale(1.12);
  opacity: 0.9;
}
.story-caption {
  position: absolute;
  bottom: 8rem;
  left: 0;
  right: 0;
  color: white;
  font-size: 2.5rem;
  font-weight: 300;
  text-align: center;
  text-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.8);
  /*background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem 2rem;
  border-radius: 0.8rem;
  backdrop-filter: blur(0.5rem);*/
  line-height: 1.4;
  margin: 0 auto;
  max-width: 24rem;
}

.story-tap-zone {
  display: none;
}

/* Navigation arrows */
.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(59, 59, 59, 0.6);
  border: none;
  border-radius: 7px;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(0.5rem);
  z-index: 2001;
}

.story-nav:hover {
  background: rgba(59, 59, 59, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.story-nav-prev {
  left: calc(50% - 28rem);
  background: transparent;
  border: 1.6px solid #3b3b3b;
}

.story-nav-next {
  right: calc(50% - 28rem);
}

/* Close button */
.stories-close {
  position: absolute;
  top: calc(50% - min(42vh, 42rem));
  right: calc(50% - 27rem);
  border: none;
  border-radius: 50%;
  width: 3.3rem;
  height: 3.3rem;
  color: #3b3b3b;
  font-size: 6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(0.5rem);
  z-index: 2001;
  background: transparent;
}

/* Story Message (cuando no hay video) */
.story-message-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.story-message-content {
  text-align: center;
  padding: 4rem 3rem;
  position: relative;
  z-index: 1;
}

.story-message-title {
  color: white;
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  line-height: 1.3;
  text-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.4);
}

.story-message-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.5;
  text-shadow: 0 0.1rem 0.4rem rgba(0, 0, 0, 0.3);
  max-width: 36rem;
  margin: 0 auto;
}

@media (max-width: 1600px) {
  .stories-close {
    top: 5rem;
  }
}

.stories-close--inline {
  display: none;
}

.stories-close:hover {
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Play/Pause Overlay Icon */
.play-pause-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
  animation: fadeInOut 1s ease-in-out forwards;
}

.play-pause-icon {
  width: 8rem;
  height: 8rem;
  object-fit: contain;
  filter: drop-shadow(0 0.4rem 0.8rem rgba(0, 0, 0, 0.6));
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 575.98px) {
  .stories-container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .story-grid {
    padding: 8rem 15% 3rem;
  }

  .story-grid-container {
    gap: .5rem;
    grid-template-columns: repeat(1, 1fr);
    max-width: 25rem;
  }

  .story-grid-item {
    padding: 1rem;
  }

  .story-grid-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
  }

  .story-grid-text {
    font-size: 1.5rem;
  }

  .story-nav {
    display: none;
  }

  .story-tap-zone {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22%;
    z-index: 5;
  }

  .story-tap-zone--left {
    left: 0;
  }

  .story-tap-zone--right {
    right: 0;
  }

  .story-nav-prev {
    left: 1rem;
  }

  .story-nav-next {
    right: 1rem;
  }

  .control-btn {
    width: 3.5rem;
    height: 3.5rem;
  }

  .control-btn svg {
    width: 2rem;
    height: 2rem;
  }

  .stories-close {
    display: none;
  }

  .stories-close--inline {
    display: flex;
    position: static;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 3rem;
    color: white;
    background: transparent;
    border: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .story-social-box {
    max-width: 25rem;
    margin-top: .5rem;
  }
}

@media (min-width: 1024px) and (max-height: 690px) and (hover: hover) and (pointer: fine) {
  .stories-container {
      aspect-ratio: 9 / 16;
      width: auto;
  }
  .stories-content {
      aspect-ratio: 9 / 16;
  }
  .story-text-body {
    font-size: 2.6rem;
    width: 27rem;
  }
  .story-text-body .name-highlight {
    font-size: 2.9rem;
  }

  .story-text-body .price-highlight {
    font-size: 3.5rem;
  }

  .story-text-body .price-highlight-color {
    font-size: 4.3rem;
  }

  .story-text-body .price-highlight-big {
    font-size: 8rem;
  }

  .story-text-body .data-highlight {
    font-size: 1.8rem;
  }

  .story-text-body .data-highlight-big {
    font-size: 4.9rem;
  }
  .story-grid-icon {
    width: 6rem;
    height: 6rem;
    margin-bottom: 1rem;
  }
  .story-grid-container {
    grid-gap: 1rem;
    gap: 1rem;
  }
  .story-social-box {
    margin-top: 1rem;
  }
  .stories-close {
    right: calc(50% - 23rem);
  }
  .story-nav-prev {
    left: calc(50% - 23rem);
  }
  .story-nav-next {
    right: calc(50% - 23rem);
  }
}
