/* ==========================================================================
   Sorteito.com — Hoja de estilos global
   Variables de diseño, cabecera, menú móvil responsive, footer uniforme
   y contenedores publicitarios Anti-CLS (.ad-slot)
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eef6f5;
  --text: #0f172a;
  --muted: #475569;
  --primary: #0ea5a4;
  --primary-hover: #0b8a89;
  --primary-soft: #ccfbf1;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --gold: #f4c95d;
  --dark: #0f172a;
  --header-height: 72px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #eef6f5 100%);
  min-height: 100vh;
  color: var(--text);
  overflow-x: clip;
}

/* ==========================================================================
   Cabecera fija y navegación principal
   ========================================================================== */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Outfit', system-ui, sans-serif;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.logo-mark {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
}

.logo-dot {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.25s ease, background-color 0.25s ease;
  padding: 8px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background-color: var(--surface-soft);
}

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-soft);
}

.nav-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(14, 165, 164, 0.2);
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 164, 0.3);
}

/* Botón hamburguesa (móvil) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  box-shadow: none;
  border-radius: 6px;
  z-index: 1001;
}

.menu-toggle:hover {
  transform: none;
  box-shadow: none;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text);
  border-radius: 4px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 820px) {
  .header-container {
    padding: 0 16px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 20px 24px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    display: none;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link {
    text-align: center;
    padding: 12px 16px;
  }
}

/* ==========================================================================
   Footer corporativo y legal uniforme
   ========================================================================== */

.site-footer {
  width: 100%;
  max-width: 1100px;
  margin: 56px auto 0;
  border-top: 1px solid var(--border);
  padding: 36px 20px 24px;
  text-align: center;
}

.site-footer__heading {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 16px;
}

.site-footer__tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.site-footer__tools a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.site-footer__tools a:hover {
  text-decoration: underline;
}

.site-footer__legal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.site-footer__legal a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.site-footer__legal a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.site-footer__legal a.site-footer__cookie-link {
  color: var(--primary);
}

.site-footer__sep {
  color: var(--border);
  user-select: none;
}

.site-footer__copy {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   Bloques publicitarios Anti-CLS (Google AdSense)
   Separados >= 32px de botones de acción para evitar clics accidentales
   ========================================================================== */

.ad-slot {
  width: 100%;
  margin: 36px auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  contain: layout style;
  overflow: hidden;
}

/* Etiqueta clara exigida por buenas prácticas de UX y políticas de anuncios */
.ad-slot__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  user-select: none;
}

/* Contenedor interno reservado para evitar Cumulative Layout Shift (CLS) */
.ad-slot__body {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slot Display Horizontal (Post-herramienta / Pre-footer) */
.ad-slot--display .ad-slot__body {
  min-height: 250px; /* Móvil: 300x250 / responsive */
}

@media (min-width: 768px) {
  .ad-slot--display {
    max-width: 970px;
  }

  .ad-slot--display .ad-slot__body {
    min-height: 100px; /* Escritorio: 728x90 / 970x90 */
  }
}

/* Slot In-Article (En medio de la sección editorial o guías) */
.ad-slot--in-article {
  max-width: 728px;
}

.ad-slot--in-article .ad-slot__body {
  min-height: 280px;
}

@media (min-width: 768px) {
  .ad-slot--in-article .ad-slot__body {
    min-height: 250px;
  }
}

/* Oculto mientras no haya una unidad AdSense activa (evita cajas vacías durante revisión).
   Al activar AdSense, quitar la clase .ad-slot--standby y descomentar <ins class="adsbygoogle">. */
.ad-slot--standby {
  display: none;
}

/* ==========================================================================
   Utilidades de seguridad visual
   ========================================================================== */

.confetti {
  position: fixed !important;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.history-time {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}
