/*
Theme Name: PropFirm Futuros
Theme URI: https://tudominio.com
Author: PropFirm Futuros
Description: Ranking de prop firms de futuros. Desktop-first con mobile responsive.
Version: 4.0.0
License: GNU General Public License v2 or later
Text Domain: propfirm-futuros
*/

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

:root {
  --bg-primary:    #0f0f0b;
  --bg-secondary:  #1a1a12;
  --bg-card:       #1e1e16;
  --bg-card-hover: #252519;
  --bg-header:     #141410;
  --border:        #2a2a1e;
  --border-light:  #333328;
  --text-primary:  #f0ede0;
  --text-secondary:#999980;
  --text-muted:    #666655;
  --accent-purple: #9333ea;
  --accent-pink:   #db2777;
  --accent-gold:   #f59e0b;
  --accent-green:  #22c55e;
  --accent-red:    #ef4444;
  --font-main: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --shadow: 0 2px 16px rgba(0,0,0,0.5);
  --cols: 2.4fr 1.4fr 0.7fr 0.5fr 0.8fr 1.3fr 1.1fr 1.2fr 0.8fr;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-main); font-size: 15px; line-height: 1.6; min-height: 100vh; }
a { color: var(--text-primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(1.4rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.2rem, 4vw, 2rem); }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; }

/* ═══ HEADER ══════════════════════════════════════════════════════ */
.site-header { background: var(--bg-header); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.site-logo { font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
.logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink)); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; text-decoration: none; display: block; }
.main-nav a:hover, .main-nav .current-menu-item a { color: var(--text-primary); background: var(--bg-card); }

/* Dropdown */
.main-nav ul li { position: relative; list-style: none; }
.main-nav ul li:hover > ul,
.main-nav ul li:focus-within > ul { display: flex !important; }
.main-nav ul ul {
  display: none !important;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 210px;
  padding: 6px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  gap: 2px;
}
.main-nav ul ul li { width: 100%; }
.main-nav ul ul a { display: block; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); white-space: nowrap; background: transparent; }
.main-nav ul ul a:hover { background: var(--bg-secondary); color: var(--text-primary); }
/* Flecha en items con hijos */
.main-nav ul li.menu-item-has-children > a::after { content: ' ▾'; font-size: 10px; opacity: 0.6; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--text-primary); flex-direction: column; gap: 5px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

/* ═══ MOBILE NAV ══════════════════════════════════════════════════ */
.mobile-nav { display: none; position: fixed; inset: 0; background: var(--bg-primary); z-index: 200; padding: 20px 16px; flex-direction: column; overflow-y: auto; }
.mobile-nav.abierto { display: flex; }
.mobile-nav-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mobile-nav-cerrar { background: var(--bg-card); border: none; color: var(--text-primary); font-size: 20px; cursor: pointer; width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.mobile-nav a { display: block; padding: 14px 16px; border-radius: var(--radius-md); font-size: 16px; font-weight: 500; color: var(--text-secondary); border-bottom: 1px solid var(--border); }

/* ═══ HERO ════════════════════════════════════════════════════════ */
.page-hero { padding: 48px 0 32px; border-bottom: 1px solid var(--border); }
.page-hero h1 { margin-bottom: 10px; }
.page-hero p { color: var(--text-secondary); font-size: 15px; max-width: 640px; }
.hero-meta { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hero-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; background: rgba(147,51,234,0.15); color: #c084fc; border: 1px solid rgba(147,51,234,0.3); }

/* ═══ STATS ═══════════════════════════════════════════════════════ */
.stats-bar { display: flex; gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.stat-number { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ═══ FILTROS ═════════════════════════════════════════════════════ */
.filter-bar { padding: 20px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.filter-btn { padding: 7px 14px; border: 1px solid var(--border-light); border-radius: 100px; font-size: 12px; font-weight: 500; color: var(--text-secondary); background: transparent; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.filter-btn:hover, .filter-btn.active { border-color: var(--accent-purple); color: var(--accent-purple); background: rgba(147,51,234,0.1); }
.filter-search { margin-left: auto; position: relative; }
.filter-search input { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px 7px 34px; font-size: 13px; color: var(--text-primary); width: 220px; }
.filter-search input:focus { outline: none; border-color: var(--accent-purple); }
.filter-search input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* ═══ CABECERA TABLA ══════════════════════════════════════════════ */
.ranking-header {
  display: grid;
  grid-template-columns: var(--cols);
  padding: 8px 17px;
  margin: 16px 0 4px;
  align-items: center;
}
.ranking-header span { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Alinear cada columna del header igual que sus celdas */
.ranking-header span:nth-child(1) { text-align: left; }    /* FIRMA */
.ranking-header span:nth-child(2) { text-align: left; }    /* POSICIÓN */
.ranking-header span:nth-child(3) { text-align: left; }    /* PAÍS */
.ranking-header span:nth-child(4) { text-align: center; }  /* AÑOS */
.ranking-header span:nth-child(5) { text-align: left; }    /* MERCADO */
.ranking-header span:nth-child(6) { text-align: left; }    /* PLATAFORMAS */
.ranking-header span:nth-child(7) { text-align: left; }    /* ASIGNACIÓN */
.ranking-header span:nth-child(8) { text-align: left; }    /* PROMO */
.ranking-header span:nth-child(9) { text-align: left; }    /* ACCIÓN */

/* ═══ FILA FIRMA — DESKTOP ════════════════════════════════════════ */
.firm-row {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 6px;
  transition: all 0.2s;
  cursor: pointer;
}
.firm-row:hover { background: var(--bg-card-hover); border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.firm-row.destacado { border-color: rgba(147,51,234,0.4); background: rgba(147,51,234,0.05); }

/* ── Celda: Firma ── */
.cell-firma { display: flex; align-items: center; gap: 10px; min-width: 0; }
.firma-rank-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
.firma-rank-badge.oro    { background: rgba(245,158,11,0.2); color: var(--accent-gold); }
.firma-rank-badge.plata  { background: rgba(148,163,184,0.2); color: #94a3b8; }
.firma-rank-badge.bronce { background: rgba(180,120,80,0.2);  color: #b47850; }
.firma-logo-wrap { position: relative; flex-shrink: 0; }
.firma-logo { width: 46px; height: 46px; border-radius: var(--radius-sm); border: 2px solid var(--border-light); background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; }
.firma-logo img { width: 100%; height: 100%; object-fit: cover; }
.badge-nuevo { position: absolute; top: -6px; left: -2px; background: var(--accent-green); color: #052e16; font-size: 8px; font-weight: 800; padding: 1px 5px; border-radius: 4px; }
.badge-hot   { position: absolute; top: -6px; left: -2px; background: var(--accent-red);   color: #fff;    font-size: 8px; font-weight: 800; padding: 1px 5px; border-radius: 4px; }
.firma-engranaje { position: absolute; bottom: -4px; right: -4px; width: 16px; height: 16px; background: var(--accent-gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; }
.firma-nombre { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.firma-likes  { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.corazon { color: #f43f5e; }

/* ── Celda: Puntuación ── */
.cell-puntuacion { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.circulo-puntuacion { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent-purple); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #e9d5ff; margin-bottom: 2px; }
.estrellas    { font-size: 11px; color: var(--accent-gold); letter-spacing: -1px; }
.cant-resenas { font-size: 10px; color: var(--accent-purple); font-weight: 500; }

/* ── Celda: País ── */
.cell-pais { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.bandera { font-size: 18px; }

/* ── Celda: Años ── */
.cell-anos { display: flex; justify-content: center; }
.anillo-anos { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border-light); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* ── Celda: Mercado ── */
.cell-mercado {}
.tag-mercado { display: inline-block; padding: 4px 10px; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); border-radius: 100px; font-size: 11px; font-weight: 600; color: #93c5fd; }

/* ── Celda: Plataformas ── */
.cell-plats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.icono-plat { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-secondary); border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.plat-mas { padding: 2px 7px; background: var(--bg-secondary); border-radius: 100px; font-size: 10px; color: var(--text-muted); }

/* ── Celda: Asignación ── */
.cell-asig { display: flex; flex-direction: column; }
.monto-asignacion { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.barra-asig-wrap { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; width: 90%; }
.barra-asig { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink)); }

/* ── Celda: Promo ── */
.cell-promo {}
.caja-promo { display: inline-flex; flex-direction: column; align-items: center; background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink)); border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer; transition: opacity 0.2s; min-width: 80px; text-align: center; }
.caja-promo:hover { opacity: 0.85; }
.promo-descuento { font-size: 13px; font-weight: 800; color: #fff; line-height: 1; }
.promo-etiqueta  { font-size: 9px; color: rgba(255,255,255,0.7); margin-top: 2px; font-weight: 500; }

/* ── Celda: Acción ── */
.cell-accion {}
.btn-firma { padding: 7px 18px; border: 1.5px solid var(--border-light); border-radius: 100px; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: transparent; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-firma:hover { border-color: var(--accent-purple); color: var(--accent-purple); background: rgba(147,51,234,0.08); }

/* ═══ SINGLE FIRMA ════════════════════════════════════════════════ */
.link-volver { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); padding: 16px 0 4px; }
.firma-hero { padding: 40px 0; border-bottom: 1px solid var(--border); }
.firma-hero-inner { display: flex; gap: 20px; align-items: flex-start; }
.firma-hero-logo { width: 80px; height: 80px; border-radius: var(--radius-md); border: 2px solid var(--border-light); background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 36px; flex-shrink: 0; overflow: hidden; }
.firma-hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.puntuacion-grande { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.numero-puntuacion { font-size: 2rem; font-weight: 800; color: var(--accent-gold); }
.estrellas-grandes { font-size: 18px; color: var(--accent-gold); }
.tags-firma { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag-firma { padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 500; background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-secondary); }
.botones-firma { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-visitar { padding: 10px 24px; background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink)); border-radius: 100px; font-size: 14px; font-weight: 700; color: #fff; display: inline-block; }
.grilla-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 24px 0; }
.tarjeta-info { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.tarjeta-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.tarjeta-valor { font-size: 1.1rem; font-weight: 700; }
.seccion { padding: 24px 0; border-top: 1px solid var(--border); }
.seccion h2 { margin-bottom: 16px; }
.plataformas-lista { display: flex; gap: 8px; flex-wrap: wrap; }
.plat-chip { padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.tarjeta-resena { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; margin-bottom: 12px; }
.resena-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.resena-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-purple); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.resena-nombre { font-size: 14px; font-weight: 600; }
.resena-fecha { font-size: 11px; color: var(--text-muted); }
.resena-texto { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.trustpilot-seccion h3 { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ═══ FOOTER ══════════════════════════════════════════════════════ */
.site-footer { background: var(--bg-header); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 64px; }
.aviso-legal { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 11px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-secondary); font-size: 13px; margin-top: 12px; max-width: 280px; line-height: 1.7; }
.footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--text-secondary); transition: color 0.2s; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE  ≤ 960px
   Transforma el grid en tarjetas apiladas
═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {

  /* Header */
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-inner { height: 56px; }
  .container { padding: 0 16px; }

  /* Hero */
  .page-hero { padding: 24px 0 20px; }
  .page-hero p { font-size: 14px; }

  /* Stats: 2x2 grid con tarjetas */
  .stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 0;
  }
  .stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
  }
  .stat-number { font-size: 1.3rem; }

  /* Filtros */
  .filter-bar { padding: 12px 0; gap: 6px; }
  .filter-search { margin-left: 0; width: 100%; }
  .filter-search input { width: 100%; }

  /* Ocultar cabecera de tabla */
  .ranking-header { display: none; }

  /* ── FIRM ROW: de grid horizontal a tarjeta vertical ── */
  .firm-row {
    display: block;          /* ← anula el grid */
    padding: 14px;
    margin-bottom: 10px;
    transform: none !important;
  }
  .firm-row:hover { transform: none; box-shadow: none; }

  /* Ocultar TODAS las celdas del grid desktop */
  .cell-firma,
  .cell-puntuacion,
  .cell-pais,
  .cell-anos,
  .cell-mercado,
  .cell-plats,
  .cell-asig,
  .cell-promo,
  .cell-accion { display: none !important; }

  /* Mostrar secciones mobile */
  .mob-top,
  .mob-chips,
  .mob-plats,
  .mob-bottom { display: flex !important; }

  /* ── MOB-TOP: logo + nombre + score ── */
  .mob-top {
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .mob-info { flex: 1; min-width: 0; }
  .mob-info .firma-nombre { font-size: 15px; font-weight: 700; }
  .mob-info .firma-likes  { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
  .mob-score { flex-shrink: 0; text-align: center; }
  .mob-score .circulo-puntuacion { width: 36px; height: 36px; font-size: 12px; margin: 0 auto 2px; }
  .mob-score .estrellas    { font-size: 10px; display: block; }
  .mob-score .cant-resenas { font-size: 9px;  display: block; }

  /* ── MOB-CHIPS: país, años, mercado ── */
  .mob-chips {
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 500; background: var(--bg-secondary); border: 1px solid var(--border-light); color: var(--text-secondary); }
  .chip.mercado { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.25); color: #93c5fd; }

  /* ── MOB-PLATS: plataformas ── */
  .mob-plats {
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .plat-label { font-size: 10px; color: var(--text-muted); margin-right: 2px; }

  /* ── MOB-BOTTOM: asignación + promo + botón ── */
  .mob-bottom {
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    flex-wrap: wrap;
  }
  .mob-asig { flex: 1; min-width: 80px; }
  .mob-asig-label { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
  .mob-asig .monto-asignacion { font-size: 15px; }
  .mob-asig .barra-asig-wrap  { height: 3px; margin-top: 4px; }

  /* Single firma mobile */
  .firma-hero-inner { flex-wrap: wrap; }
  .firma-hero-logo { width: 60px; height: 60px; font-size: 26px; }
  .grilla-info { grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; }
  .tarjeta-info { padding: 12px; }
  .tarjeta-valor { font-size: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 6px; }
}
