@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

.container .compra {
  background: #000;
  color: #fff;
  font-family: "Be Vietnam Pro", sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* === CONTENEDOR === */
.container .compra {
  display: flex;
  justify-content: center;
  align-items: stretch;
  width: 70vw;
  height: 60vh;
  gap: 6px;
  overflow: hidden;
}

/* === TARJETA === */
.compra {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.6s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #111;
  border: 2px solid transparent;
}

/* Enlace invisible pero interactivo */
.compra a {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Efecto RGB del borde */
.compra::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  padding: 2px;
  background: linear-gradient(
    120deg,
    #ff0000,
    #00ffea,
    #0040ff,
    #ff00c8,
    #ff0000
  );
  background-size: 300% 300%;
  z-index: 1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  animation: rgbBorder 6s linear infinite;
}

@keyframes rgbBorder {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Imagen de fondo */
.compra img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  top: 0;
  left: 0;
  opacity: 0.85;
  transition: transform 1s ease, opacity 0.6s ease;
}

/* Capa oscura */
.compra::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.1));
  z-index: 1;
  transition: opacity 0.5s ease;
}

/* Texto RGB */
.compra h2 {
  position: relative;
  z-index: 2;
  font-size: 10px;
  font-family: "Be Vietnam Pro", sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    90deg,
    #ff0000,
    #00ffea,
    #0040ff,
    #ff00c8,
    #ff0000
  );
  background-size: 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rgbText 6s linear infinite;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

@keyframes rgbText {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Hover */
.compra:hover {
  flex: 1.25;
  transform: scale(1.02);
  z-index: 5;
}

.compra:hover img {
  transform: scale(1.12);
  opacity: 1;
}

.compra:hover::after {
  opacity: 0.35;
}

.compra:hover h2 {
  transform: translateY(-10px);
  opacity: 1;
}

/* Animación inicial */
.compra {
  opacity: 0;
  transform: translateY(30px);
}

.compra.loaded {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s ease;
}

@media (max-width: 200px) {
  .container {
    flex-direction: column;
    height: 50vh;
  }

  .compra {
    flex: unset;
    height: 16%;
  }
}
