:root {
  --brand-blue: #0b2559;
  --brand-blue-2: #143b8f;
  --brand-gold: #f5b301;
  --bg-soft: #f4f6fb;
  --text-dark: #1a1f36;
  --card-radius: 14px;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg-soft);
  color: var(--text-dark);
}

/* ---------- Barra superior (USD/EUR, hora, clima) ---------- */
.top-info-bar {
  background: #061433;
  color: #b9c6e8;
  font-size: .78rem;
  padding: .35rem 0;
}
.top-info-item { margin-right: 1rem; white-space: nowrap; }
.top-info-item:last-child { margin-right: 0; }
.top-info-item strong { color: #fff; }
.top-info-right { text-align: right; }
@media (max-width: 575px) {
  .top-info-bar .container { flex-direction: column; gap: .15rem; align-items: center !important; }
  .top-info-right { text-align: center; }
}

/* ---------- Navbar ---------- */
.main-navbar {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-2));
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
}
.brand-accent { color: var(--brand-gold); }
.brand-icon { margin-right: 4px; }
.nav-search { gap: .35rem; }
.nav-search input { width: 130px; }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(rgba(11, 37, 89, .58), rgba(20, 59, 143, .5)),
    url('../img/hero-bg.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 3.5rem 0 2.5rem;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
.hero p.lead {
  color: #d7e0f5;
}
.hero-search {
  max-width: 480px;
  margin: 1.5rem auto 0;
}
.hero-search .form-control {
  border-radius: 50px 0 0 50px;
  border: none;
  padding: .75rem 1.25rem;
}
.hero-search .btn {
  border-radius: 0 50px 50px 0;
  background: var(--brand-gold);
  border: none;
  font-weight: 600;
  color: var(--brand-blue);
  padding: 0 1.5rem;
}

/* ---------- Section headings ---------- */
.section-title {
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}
.section-sub { color: #4b5563; margin-bottom: 1.5rem; }

/* ---------- Filter chips ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.filter-chip {
  border: 1px solid #d7deee;
  background: #fff;
  border-radius: 50px;
  padding: .35rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover { border-color: var(--brand-blue-2); }
.filter-chip.active {
  background: var(--brand-blue-2);
  border-color: var(--brand-blue-2);
  color: #fff;
}

/* ---------- Sorteo Cards ---------- */
.sorteo-card {
  background: #fff;
  border-radius: var(--card-radius);
  border-left: 5px solid var(--card-color, var(--brand-blue-2));
  box-shadow: 0 3px 12px rgba(20,30,60,.06);
  padding: 1.1rem 1.2rem;
  height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sorteo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(20,30,60,.12);
}
.sorteo-card .sorteo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .6rem;
}
.sorteo-nombre {
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0;
}
.sorteo-logo-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sorteo-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.empresa-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.sorteo-empresa {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--card-color, var(--brand-blue-2));
  font-weight: 600;
}
.sorteo-fecha {
  text-align: right;
  font-size: .78rem;
  color: #6b7280;
  white-space: nowrap;
}
.badge-hoy {
  background: #157a3f;
  color: #fff;
  font-size: .68rem;
  border-radius: 50px;
  padding: .15rem .55rem;
  font-weight: 600;
}
.badge-ayer {
  background: #6b7280;
  color: #fff;
  font-size: .68rem;
  border-radius: 50px;
  padding: .15rem .55rem;
  font-weight: 600;
}

.numeros-row {
  display: flex;
  gap: .6rem;
  margin: .7rem 0 .5rem;
  flex-wrap: wrap;
}
.numero-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card-color, var(--brand-blue-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15);
}
.numero-ball.small {
  width: 38px;
  height: 38px;
  font-size: .9rem;
}
.numero-label {
  font-size: .62rem;
  text-align: center;
  color: #4b5563;
  font-weight: 600;
  margin-top: 2px;
}
.numero-col { text-align: center; }

.sorteo-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.sorteo-actions a {
  font-size: .78rem;
  text-decoration: none;
  color: var(--brand-blue-2);
  font-weight: 600;
}
.sorteo-actions a:hover { text-decoration: underline; }

/* ---------- Loto cards ---------- */
.loto-card .numeros-row { row-gap: .4rem; }

/* ---------- Atrasados ---------- */
.atrasados-box {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: 0 3px 12px rgba(20,30,60,.06);
  padding: 1.2rem;
}
.atrasados-numeros { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Empresas footer ---------- */
.site-footer {
  background: #0e1730;
  color: #cbd5f5;
  margin-top: 3rem;
}
.footer-title { color: #fff; font-weight: 800; }
.footer-intro { color: #a9b6dd; max-width: 800px; }
.empresa-card {
  background: rgba(255,255,255,.04);
  border-top: 4px solid #fff;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  height: 100%;
}
.empresa-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.empresa-card p { font-size: .87rem; color: #b8c2e0; margin: 0 0 .6rem; }
.empresa-card-link { font-size: .82rem; font-weight: 600; color: #f5b301; text-decoration: none; }
.empresa-card-link:hover { text-decoration: underline; }
.footer-divider { border-color: rgba(255,255,255,.1); margin: 2rem 0 1rem; }

/* ---------- Historial page ---------- */
.historial-table th, .historial-table td { vertical-align: middle; }

/* ---------- Espacios publicitarios ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #eef1f8, #eef1f8 10px, #e3e7f2 10px, #e3e7f2 20px);
  border: 1px dashed #b9c2d9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5768;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 1.75rem auto;
  width: 100%;
}
.ad-slot-horizontal { max-width: 728px; height: 90px; }
.ad-slot-cuadrado { max-width: 300px; height: 250px; }
.ad-slot-movil { display: none; }
.ad-slot-tarjeta { height: 100%; min-height: 168px; margin: 0; width: 100%; border-radius: 14px; }
.ad-slot-real { text-align: center; margin: 1.5rem auto; overflow: hidden; }
@media (max-width: 767px) {
  .ad-slot-horizontal { height: 60px; }
  .ad-slot-movil { display: flex; max-width: 320px; height: 50px; }
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

@media (max-width: 991px) {
  .nav-search { margin-top: .75rem; width: 100%; }
  .nav-search input { width: 100%; }
}

/* ---------- Menú inferior estilo app (solo móvil) ---------- */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  background: #fff;
  border-top: 1px solid #e2e6f0;
  box-shadow: 0 -3px 12px rgba(20,30,60,.1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.app-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: .5rem 0 .45rem;
  font-size: .66rem;
  font-weight: 600;
  color: #5b6b8c;
  text-decoration: none;
}
.app-bottom-nav-item span { font-size: 1.3rem; line-height: 1; }
.app-bottom-nav-item:hover,
.app-bottom-nav-item:active { color: var(--brand-blue-2); }

@media (max-width: 767px) {
  body { padding-bottom: 62px; }
}
