.ig-reels-section {
  background: linear-gradient(to bottom, #090A20, #090A20);
  padding: 5rem 1rem;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

body.dark .ig-reels-section {
  background: linear-gradient(to bottom, #000000, #000000);
}

.ig-reels-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(207, 98, 27, 0.15) 0%, transparent 40%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

body.dark .ig-reels-section::before {
  background: radial-gradient(circle at 20% 30%, rgba(207, 98, 27, 0.25) 0%, transparent 40%);
}

.ig-header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
  z-index: 2;
}

.ig-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

body.dark .ig-title {
  color: #CF621B;
}

.ig-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: #CF621B;
  border-radius: 2px;
}

.ig-subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  transition: color 0.3s ease;
}

body.dark .ig-subtitle {
  color: rgba(207, 98, 27, 0.9);
}

.ig-container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.ig-card {
  background: linear-gradient(145deg, rgba(25, 26, 58, 0.7), rgba(15, 16, 38, 0.7));
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(207, 98, 27, 0.2);
  position: relative;
  height: 480px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

body.dark .ig-card {
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.9), rgba(10, 10, 10, 0.9));
  border: 1px solid rgba(207, 98, 27, 0.3);
  box-shadow: 0 8px 25px rgba(207, 98, 27, 0.1);
}

.ig-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 35px rgba(207, 98, 27, 0.25);
  border-color: rgba(207, 98, 27, 0.4);
}

body.dark .ig-card:hover {
  box-shadow: 0 15px 35px rgba(207, 98, 27, 0.3);
  border-color: rgba(207, 98, 27, 0.5);
}

.ig-embed {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
}

.ig-embed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.8) 100%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ig-card:hover .ig-embed::before {
  opacity: 1;
}

.ig-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(207, 98, 27, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
}

.ig-play-overlay i {
  color: white;
  font-size: 1.5rem;
  margin-left: 4px;
}

.ig-card:hover .ig-play-overlay {
  opacity: 1;
}

.ig-card-content {
  padding: 1.2rem;
  background: rgba(15, 16, 38, 0.9);
  border-top: 1px solid rgba(207, 98, 27, 0.2);
  transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark .ig-card-content {
  background: rgba(10, 10, 10, 0.9);
  border-top: 1px solid rgba(207, 98, 27, 0.3);
}

.ig-card-title {
  color: #FFFFFF;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

body.dark .ig-card-title {
  color: #CF621B;
}

.ig-card-date {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

body.dark .ig-card-date {
  color: rgba(207, 98, 27, 0.8);
}

.ig-card-date i {
  margin-right: 0.5rem;
  color: #CF621B;
}

.ig-actions {
  text-align: center;
  margin-top: 2rem;
}

.ig-toggle {
  background: linear-gradient(135deg, #CF621B 0%, #E9722C 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(207, 98, 27, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ig-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(207, 98, 27, 0.4);
}

body.dark .ig-toggle:hover {
  box-shadow: 0 8px 20px rgba(207, 98, 27, 0.5);
}

.ig-toggle:active {
  transform: translateY(1px);
}

.instagram-media {
  width: 100% !important;
  min-width: 100% !important;
  border: none !important;
  overflow: hidden !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .ig-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 992px) {
  .ig-title {
    font-size: 2.4rem;
  }
  
  .ig-subtitle {
    font-size: 1.1rem;
  }
  
  .ig-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .ig-reels-section {
    padding: 4rem 1rem;
  }
  
  .ig-title {
    font-size: 2rem;
  }
  
  .ig-header {
    margin-bottom: 2.5rem;
  }
  
  .ig-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto 3rem;
  }
  
  .ig-card {
    height: 450px;
  }
}

@media (max-width: 480px) {
  .ig-title {
    font-size: 1.8rem;
  }
  
  .ig-subtitle {
    font-size: 1rem;
  }
  
  .ig-card {
    height: 400px;
  }
  
  .ig-toggle {
    padding: 0.9rem 2rem;
    font-size: 1rem;
  }
}

/* Estados para mostrar/ocultar */
.ig-card.hidden {
  display: none;
}

/* Animación de aparición */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ig-card {
  animation: fadeIn 0.6s ease forwards;
}

/* Estilos para el popup/modal */
.ig-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ig-popup.active {
  opacity: 1;
  visibility: visible;
}

.ig-popup-content {
  background: linear-gradient(145deg, rgba(25, 26, 58, 0.95), rgba(15, 16, 38, 0.95));
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(207, 98, 27, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

body.dark .ig-popup-content {
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.95), rgba(10, 10, 10, 0.95));
  border: 1px solid rgba(207, 98, 27, 0.4);
  box-shadow: 0 20px 40px rgba(207, 98, 27, 0.2);
}

.ig-popup.active .ig-popup-content {
  transform: scale(1);
}

.ig-popup-embed {
  width: 100%;
  height: 0;
  padding-bottom: 125%; /* Relación de aspecto para Instagram Reels */
  position: relative;
  background: #000;
}

.ig-popup-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.ig-popup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(15, 16, 38, 0.9);
  position: relative;
  transition: background 0.3s ease;
}

body.dark .ig-popup-actions {
  background: rgba(10, 10, 10, 0.9);
}

.ig-popup-btn {
  background: linear-gradient(135deg, #CF621B 0%, #E9722C 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.ig-popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(207, 98, 27, 0.3);
}

body.dark .ig-popup-btn:hover {
  box-shadow: 0 5px 15px rgba(207, 98, 27, 0.4);
}

.ig-popup-close {
  background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.ig-popup-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* Spinner de carga */
.ig-popup-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 5px solid rgba(207, 98, 27, 0.3);
  border-radius: 50%;
  border-top-color: #CF621B;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}