body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f0f0f0;
}

header {
  background-color: #010d52;
  color: white;
  padding: 1rem;
  text-align: center;
}

main {
  padding: 0.3rem 1rem 1rem 1rem; 
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* =========================================
   ESTILOS DE SECCIONES (VOCES)
   ========================================= */
section.voz {
  background: white;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  padding: 0.3rem 1rem 1rem 1rem;
  width: 100%;
  max-width: 400px;
  
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s ease;
  will-change: opacity, transform;
  
  position: absolute; 
  top: 0; 
  left: 0;
  visibility: hidden; 
}

section.voz.mostrando {
  display: block;
}

section.voz.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  position: static; 
}

section.voz h2 {
  color: #010d52;
  border-bottom: 2px solid #010d52;
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  section.voz {
    width: 45%;
  }
}

@media (min-width: 1024px) {
  section.voz {
    width: 30%;
  }
}

/* =========================================
   HEADER STICKY Y TABS (PESTAÑAS)
   ========================================= */
.sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: white;
}

.sticky-wrapper::after {
  content: '';
  display: block;
  height: 1px;
  background: #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-header {
  width: 100%;
  overflow: hidden;
  max-height: 250px;
}

.hero-header img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Tabs Mobile (Grid 3x2) */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 0.4rem; 
  padding: 0.8rem 0.5rem;
  background-color: white;
  border-bottom: 1px solid #ccc;
}

.tab {
  background-color: #f0f0f0;
  border: 2px solid transparent;
  color: #333;
  padding: 0.6rem 0.2rem;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.85rem; 
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab:hover {
  background-color: #e0e0e0;
}

.tab.active {
  background-color: #010d52;
  color: white;
  border-color: #010d52;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transform: scale(1.03);
}

/* Tabs Desktop (Línea simple) */
@media (min-width: 768px) {
  .tabs {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
  }
  .tab {
    min-width: 100px;
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
    border-radius: 20px;
  }
}

/* =========================================
   ELEMENTOS DE AUDIO Y PDF
   ========================================= */
.lista audio {
  width: 100%;
  margin-bottom: 0.5rem;
}

.item-audio {
  margin-bottom: 1.5rem;
  padding: 0.8rem;
  background-color: #fdfdfd;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  transition: background-color 0.5s ease, transform 0.5s ease;
}

.item-audio:hover {
  transform: scale(1.01);
}

.item-audio.activo {
  background-color: #d0ebff; 
  box-shadow: 0 0 10px #85c1ff;
  transform: scale(1.03); 
  z-index: 10;
}

.titulo-con-switch {
  margin-bottom: 10px; 
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.titulo-audio {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: #010d52 !important;
  flex: 1;
}

.audio-con-pdf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px; 
}

.audio-con-pdf audio {
  flex-grow: 1;
  min-width: 180px; 
  margin-top: 0;
  margin-bottom: 0;
}

.pdf-link {
  display: flex; 
  align-items: center; 
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.pdf-icon-img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain;  
  display: block;
  margin: 0;
}

.pdf-link:hover .pdf-icon-img {
  opacity: 0.9;
  transform: scale(1.05);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* =========================================
   SWITCH DE REPETICIÓN
   ========================================= */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin-left: 12px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #010d52 !important;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* =========================================
   OTROS
   ========================================= */
hr {
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
}

.footer {
  text-align: center;
  background-color: #010d52;
  color: white;
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 2rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}