:root {
  --primary: #1a365d;       /* Azul marino Manta */
  --accent: #c59b27;        /* Dorado patrimonial */
  --bg: #f8f6f0;            /* Crema cálido museo */
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  padding-bottom: 100px; /* Espacio para el reproductor inferior */
}

/* Header & Logo */
.app-header {
  background: var(--primary);
  color: #ffffff;
  text-align: center;
  padding: 24px 20px 20px;
  border-bottom: 4px solid var(--accent);
}

.logo {
  max-width: 190px;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}

.intro-text {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #e2e8f0;
  max-width: 500px;
  margin: 0 auto;
}

/* Controles Fijos Superiores */
.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 12px 14px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  white-space: nowrap;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-main);
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.sub-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Interruptor Adulto / Niño */
.mode-toggle {
  display: flex;
  align-items: center;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 20px;
}

.mode-label {
  display: none;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 18px;
  color: var(--text-muted);
  cursor: pointer;
}

.mode-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mode-toggle.disabled {
  opacity: 0.45;
  pointer-events: none;
}

#search-input {
  flex: 1;
  min-width: 110px;
  padding: 7px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  font-size: 0.85rem;
  background: #ffffff;
}

/* Cuadrícula de Tarjetas (2 columnas en móvil) */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.2s;
}

.card.playing {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.25);
}

/* Contenedor Cuadrado 1:1 Estricto */
.card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e2e8f0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(26, 54, 93, 0.88);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.card-play-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.card-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

/* Reproductor Inferior Fijo */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
}

.player-bar.hidden {
  display: none;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.player-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #334155;
  flex-shrink: 0;
}

.player-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-subtitle {
  font-size: 0.75rem;
  color: #cbd5e1;
}

.play-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.progress-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* =========================================
   DISEÑO DESTACADO PARA "PLAZA E HITOS"
   ========================================= */
.items-grid.featured-layout {
  grid-template-columns: 1fr; /* 1 sola columna de ancho completo */
  gap: 16px;
}

.items-grid.featured-layout .card-img-wrapper {
  aspect-ratio: 3 / 2; /* Proporción horizontal exacta (600x400 px) */
}

.items-grid.featured-layout .card-title {
  font-size: 1.05rem; /* Título un poco más grande y destacado */
}

.items-grid.featured-layout .card-play-overlay {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
}

/* =========================================
   SECCIÓN DE STICKER WHATSAPP
   ========================================= */
.sticker-section {
  padding: 10px 14px 30px;
  max-width: 800px;
  margin: 10px auto 0;
}

.sticker-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  border: 2px dashed var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.sticker-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.sticker-card h2 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.sticker-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sticker-preview-box {
  width: 190px;
  height: 190px;
  margin: 0 auto 18px;
  padding: 12px;
  border-radius: 16px;
  /* Fondo sutil tipo damero para que resalte el borde blanco del sticker */
  background-color: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
}

.sticker-download-btn {
  display: inline-block;
  width: 100%;
  max-width: 280px;
  background: #25D366; /* Verde oficial WhatsApp */
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transition: transform 0.15s, background 0.2s;
  margin-bottom: 20px;
}

.sticker-download-btn:active {
  transform: scale(0.97);
}

.sticker-steps {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid #e2e8f0;
}

.sticker-steps h3 {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.sticker-steps ol {
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.5;
}

.sticker-steps li {
  margin-bottom: 4px;
}

/* =========================================
   SECCIÓN DE VIDEOS EDUCATIVOS
   ========================================= */
.videos-section {
  padding: 10px 14px 30px;
  max-width: 800px;
  margin: 0 auto;
}

.videos-header {
  text-align: center;
  margin-bottom: 18px;
}

.videos-header h2 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.video-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
}

/* Contenedor responsivo 16:9 para YouTube */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-info {
  padding: 14px 16px;
}

.video-info h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.video-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}