:root {
  --primario: #F4721E;
  --secundario: #1D3557;
  --fondo: #F8F9FA;
  --tarjeta: #FFFFFF;
  --texto: #212529;
  --texto-secundario: #6C757D;
  --borde: #dee2e6;
  --texto-filtro: #495057;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--tarjeta);
  border-bottom: 1px solid #F1F1F1;
  padding: 12px 16px 0;
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-brand {
  flex: 1;
  min-width: 0;
}

.brand {
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-main {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  color: #1D3557;
  line-height: 1;
}

.brand-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #F4721E;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1;
}

.header-meta {
  max-width: 1200px;
  margin: 1px auto 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tagline {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: #9CA3AF;
}

.weather {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: #6C757D;
  white-space: nowrap;
}

.weather:empty {
  display: none;
}

.header-calendar-wrap {
  position: relative;
  flex-shrink: 0;
}

.header-calendar {
  background: #F5F5F5;
  border: none;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  color: #1D3557;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-calendar:hover {
  background: #ECECEC;
}

.header-calendar.active {
  background: #F4721E;
  color: #fff;
}

.cal-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 60;
  overflow: hidden;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.cal-dropdown[hidden] {
  display: none;
}

.cal-option {
  background: transparent;
  border: none;
  padding: 12px 16px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--texto);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.cal-option:hover {
  background: #f4f4f4;
}

.cal-option.active {
  background: #F4721E;
  color: #fff;
}

.tabs-principales {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding-bottom: 6px;
}

.tab {
  padding: 8px 22px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #1D3557;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.activo {
  background: #F4721E;
  color: #fff;
  font-weight: 700;
}

.header-filters {
  max-width: 1200px;
  margin: 14px auto 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 10px;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.header-filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--borde);
  color: var(--texto-filtro);
  padding: 5px 16px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--primario);
  color: var(--primario);
}

.filter-btn.active {
  background: var(--primario);
  color: #fff;
  border-color: var(--primario);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1D3557;
}

.section-title[hidden] {
  display: none;
}

.featured-section {
  margin: 0 0 24px;
}

.featured-section[hidden] {
  display: none;
}

/* Móvil: carrusel horizontal con snap */
.featured-list {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.featured-list::-webkit-scrollbar {
  display: none;
}

.featured-card {
  min-width: 85%;
  scroll-snap-align: start;
}

/* Imagen featured: aspect-ratio 16/9 (override del height fijo del .card-media) */
.featured-card .card-media {
  aspect-ratio: 16 / 9;
  height: auto;
}

.featured-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.grid-separator {
  grid-column: 1 / -1;
  margin: 16px 0 0;
  padding-top: 8px;
  border-top: 1px solid #F1F1F1;
  font-size: 11px;
  font-weight: 500;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grid-separator:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.grid-separator[hidden] {
  display: none;
}

/* Toast (feedback de "Link copiado") */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(29, 53, 87, 0.95);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 16px;
}

.empty-state[hidden] {
  display: none;
}

.empty-gif {
  max-width: 280px;
  width: 100%;
  border-radius: 12px;
  display: block;
}

.empty-gif[hidden] {
  display: none;
}

.empty-text {
  margin: 0;
  font-size: 14px;
  color: #6C757D;
  text-align: center;
  font-style: italic;
}

/* Card */
.card {
  background: var(--tarjeta);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  opacity: 1;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.card-media {
  position: relative;
  width: 100%;
  height: 120px;
  background: #eee;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primario);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.badge[data-cat="Música"] { background: #F4721E; }
.badge[data-cat="Gastronomía"] { background: #B45309; }
.badge[data-cat="Arte"] { background: #6D597A; }
.badge[data-cat="Deporte"] { background: #2A9D8F; }
.badge[data-cat="Otro"] { background: #1D3557; }
.badge[data-cat="enCurso"] { background: #2D9C6A; }

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  margin: 0;
  font-size: 13px;
  color: var(--texto-secundario);
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--texto-secundario);
}

.ver-mas {
  margin-top: 6px;
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primario);
  color: #fff;
  padding: 8px;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.ver-mas:hover {
  background: #d85e10;
}

/* Footer */
.footer {
  background: var(--secundario);
  color: #fff;
  text-align: center;
  padding: 36px 16px 24px;
}

.cta-btn {
  display: inline-block;
  background: #F4721E;
  color: #fff;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.cta-btn:hover {
  background: #d85e10;
  transform: translateY(-1px);
}

.footer-copy {
  margin: 20px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Switching de vistas — el body controla qué vista se ve */
.promos-section {
  display: none;
}

body.vista-promos .promos-section {
  display: block;
}

body.vista-promos .header-filters,
body.vista-promos .featured-section,
body.vista-promos #grid,
body.vista-promos .empty-state {
  display: none;
}

/* Promos */
.promos-section {
  max-width: 1200px;
  margin: 0 auto;
}

.promos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

@media (min-width: 480px) {
  .promos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .promos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.promo-card {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.promo-card.destacada {
  border-left: 3px solid #F4721E;
}

.promo-img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.promo-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.promo-local {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1D3557;
}

.promo-desc {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #F4721E;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-meta {
  margin: 0;
  font-size: 11px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  gap: 4px;
}

.promo-meta svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.promo-redes {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.promo-red {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  border: 1.5px solid;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease;
}

.promo-red.instagram {
  border-color: #E1306C;
  color: #E1306C;
}
.promo-red.whatsapp {
  border-color: #25D366;
  color: #25D366;
}
.promo-red.facebook {
  border-color: #1877F2;
  color: #1877F2;
}

.promo-red.instagram:hover { background: rgba(225, 48, 108, 0.08); }
.promo-red.whatsapp:hover { background: rgba(37, 211, 102, 0.08); }
.promo-red.facebook:hover { background: rgba(24, 119, 242, 0.08); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay.visible {
  opacity: 1;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.2s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.modal-actions button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}

.modal-actions button:hover {
  background: rgba(0, 0, 0, 0.7);
}

.modal-close {
  font-size: 22px;
  line-height: 1;
}

.modal-share svg {
  width: 18px;
  height: 18px;
}

.modal-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background-color: #111111;
  display: block;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.modal-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--texto);
}

.modal-desc {
  margin: 0;
  font-size: 14px;
  color: var(--texto-secundario);
  line-height: 1.5;
}

.modal-meta {
  margin: 0;
  font-size: 14px;
  color: var(--texto);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-redes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.red-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid;
  transition: background 0.18s ease, color 0.18s ease;
}

.red-btn.instagram {
  border-color: #E1306C;
  color: #E1306C;
}
.red-btn.facebook {
  border-color: #1877F2;
  color: #1877F2;
}
.red-btn.whatsapp {
  border-color: #25D366;
  color: #25D366;
}

.red-btn.instagram:hover {
  background: rgba(225, 48, 108, 0.08);
}
.red-btn.facebook:hover {
  background: rgba(24, 119, 242, 0.08);
}
.red-btn.whatsapp:hover {
  background: rgba(37, 211, 102, 0.08);
}

@media (min-width: 600px) {
  .container {
    padding: 24px 24px 48px;
  }
}

@media (min-width: 768px) {
  /* En desktop el calendario, brand, clima y filtros alinean su borde
     derecho/izquierdo con las tarjetas. Como .header-top y .container
     ya comparten max-width: 1200px + margin: 0 auto, sus paredes
     externas coinciden; lo que faltaba era replicar el padding interno
     (24px) dentro de los contenedores centrados del header. */
  .header {
    padding-left: 0;
    padding-right: 0;
  }
  .header-top,
  .header-meta,
  .tabs-principales,
  .header-filters {
    padding-left: 24px;
    padding-right: 24px;
  }
  /* En desktop el filtro se sube un punto para no quedar diminuto, pero
     manteniendo su rol secundario respecto a los tabs. */
  .filter-btn {
    font-size: 12px;
  }
}

@media (min-width: 900px) {
  /* Header — más presencia en pantalla grande */
  .header {
    padding: 18px 16px 0;
  }
  .brand-main {
    font-size: 30px;
  }
  .brand-sub {
    font-size: 18px;
  }
  .header-meta {
    margin-top: 4px;
    margin-bottom: 14px;
  }
  .tagline {
    font-size: 13px;
  }
  .weather {
    font-size: 13px;
  }

  /* Filtros con un poco más de aire vertical en desktop */
  .header-filters {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 16px;
  }

  /* Tarjetas con más jerarquía */
  .grid {
    gap: 20px;
  }
  .card-media {
    height: 180px;
  }
  .card-body {
    padding: 16px;
    gap: 8px;
  }
  .card-title {
    font-size: 16px;
  }
  .card-meta {
    font-size: 14px;
  }
  .ver-mas {
    padding: 11px;
    font-size: 14px;
  }

}

/* Featured — desde 768px pasa a grid de 2 columnas (si hay 1 solo, queda en
   la primera columna sin estirarse). */
@media (min-width: 768px) {
  .featured-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .featured-card {
    min-width: 0;
    scroll-snap-align: none;
  }
}
