/* -----------------------------
   CONTENEDOR PRINCIPAL DE LA CARTA
------------------------------ */
.carta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin: 10px;
  align-items: center;
}

/* -----------------------------
   IMAGEN DE LA CARTA
------------------------------ */
.carta img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
  margin-left: 7rem;
}

/* -----------------------------
   SECCIÓN DEL BOTÓN Y TEXTO
------------------------------ */
.section-btn-carta {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 2rem;
  box-sizing: border-box;
  text-align: center;
  margin: 0 2rem;
}

.section-btn-carta p {
  text-align: center;
  color: #555;
  line-height: 1.6;
  font-size: 1.1rem;
  margin: 0;
}

.section-btn-carta p strong {
  color: #a50000;
  font-weight: 600;
}

/* -----------------------------
   BOTÓN CARTA 2024
------------------------------ */
.carta-2024 {
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff4d4d, #a50000);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.1),
    0 4px 15px rgba(165, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  min-width: 220px;
}

.carta-2024::before {
  content: "📄";
  font-size: 18px;
  transition: transform 0.3s ease;
}

.carta-2024::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #a50000, #ff4d4d);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carta-2024:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 8px 25px rgba(165, 0, 0, 0.3);
}

.carta-2024:hover::before {
  transform: scale(1.1);
}

.carta-2024:hover::after {
  opacity: 1;
}

.carta-2024:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 3px rgba(0, 0, 0, 0.1),
    0 4px 15px rgba(165, 0, 0, 0.2);
}

.carta-2024:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(255, 77, 77, 0.4),
    0 4px 15px rgba(165, 0, 0, 0.3);
}

/* -----------------------------
   MODAL (VENTANA EMERGENTE PDF) - CORREGIDO
------------------------------ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  width: 95%;
  max-width: 900px;
  height: 85%;
  border-radius: 12px;
  padding: 50px 20px 20px 20px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 4px;
}

/* -----------------------------
   BOTÓN DE CERRAR - MEJORADO
------------------------------ */
.cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-color: #a50000;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  transition: all 0.3s ease;
}

.cerrar:hover {
  background-color: #ff1a1a;
  transform: scale(1.1);
}

.cerrar:active {
  transform: scale(0.95);
}

/* -----------------------------
   MEDIA QUERIES (RESPONSIVE) - CORREGIDO
------------------------------ */
@media (max-width: 1024px) {
  .carta {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    text-align: center;
    justify-items: center;
    gap: 1.5rem;
  }

  .carta img {
    max-width: 300px;
    margin: 0 auto;
  }

  .section-btn-carta {
    margin: 0;
    padding: 1rem;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  .carta {
    padding: 1rem;
    margin: 0.5rem;
    gap: 1rem;
  }

  .carta img {
    max-width: 250px;
    width: 90%;
  }

  .section-btn-carta {
    padding: 0.5rem;
    gap: 1rem;
  }

  .section-btn-carta p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .carta-2024 {
    width: 100%;
    max-width: 280px;
    font-size: 0.95rem;
    padding: 12px 20px;
    min-width: unset;
  }

  /* MODAL EN MÓVILES */
  .modal-content {
    width: 98%;
    height: 80%;
    padding: 45px 10px 10px 10px;
    margin: 10px;
  }

  .cerrar {
    top: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .carta {
    padding: 0.8rem;
    margin: 0.3rem;
  }

  .carta img {
    max-width: 200px;
  }

  .section-btn-carta {
    gap: 0.8rem;
  }

  .section-btn-carta p {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  .carta-2024 {
    max-width: 250px;
    font-size: 0.9rem;
    padding: 10px 16px;
  }

  .modal-content {
    height: 75%;
    padding: 40px 8px 8px 8px;
  }

  .cerrar {
    top: 3px;
    right: 3px;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .section-btn-carta p {
    font-size: 0.85rem;
  }

  .carta-2024 {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  .carta img {
    max-width: 180px;
  }
  
  .modal-content {
    height: 70%;
  }
}