/* ==========================================================
   Factor Partido — Optimización móvil global v1
   Capa responsive no invasiva para home, en vivo, partidos,
   noticias, blog, nota, análisis, contacto y admin.
   ========================================================== */

:root{
  --fp-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Base anti-scroll horizontal */
html, body{
  max-width:100%;
  overflow-x:hidden;
}

img, video, iframe{
  max-width:100%;
}

*{
  -webkit-tap-highlight-color: transparent;
}

.fp-mobile-only{
  display:none!important;
}

/* Mejora de navegación móvil genérica */
@media(max-width: 860px){
  body{
    overflow-x:hidden;
  }

  .container,
  .site-container,
  .main-container,
  .content-container,
  .page-container,
  .admin-content,
  .fp-cp-wrap,
  .analysis-index-wrap{
    width:100%!important;
    max-width:100%!important;
    padding-left:18px!important;
    padding-right:18px!important;
  }

  .site-header,
  header.site-header,
  .main-header,
  .topbar,
  .header{
    position:sticky;
    top:0;
    z-index:1000;
    backdrop-filter:blur(14px);
  }

  .admin-wrap,
  .alayout,
  .fp-contact-grid,
  .fp-privacy-layout,
  .analysis-index-grid,
  .news-grid,
  .blog-grid,
  .posts-grid,
  .matches-grid,
  .stat-grid,
  .footer-grid,
  .fp-footer-grid{
    grid-template-columns:1fr!important;
  }

  .admin-sidebar{
    position:relative!important;
    width:100%!important;
    min-height:auto!important;
    height:auto!important;
  }

  .admin-wrap{
    display:block!important;
  }

  .admin-menu{
    display:flex!important;
    overflow-x:auto!important;
    gap:8px!important;
    padding-bottom:8px!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }

  .admin-menu::-webkit-scrollbar{
    display:none;
  }

  .admin-menu a{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    border-radius:999px!important;
    padding:10px 12px!important;
  }

  .admin-topbar,
  .fp-admin-topbar,
  .fp-admin-hero,
  .fp-admin-layout,
  .fp-admin-stats{
    grid-template-columns:1fr!important;
    flex-direction:column!important;
    align-items:flex-start!important;
  }

  .fp-admin-stats,
  .stat-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .admin-card,
  .card,
  .news-card,
  .news-card-full,
  .fp-blog-card,
  .analysis-index-card,
  .match-card,
  .fp-contact-card,
  .fp-contact-info-card,
  .fp-privacy-section,
  .acard,
  .fp-panel{
    border-radius:18px!important;
  }

  h1,
  .hero-title,
  .page-title,
  .analysis-index-hero h1,
  .fp-cp-hero h1{
    font-size:clamp(32px, 10vw, 46px)!important;
    line-height:1.02!important;
    letter-spacing:-.7px!important;
  }

  h2,
  .section-title{
    font-size:clamp(24px, 7vw, 34px)!important;
    line-height:1.05!important;
  }

  p{
    overflow-wrap:anywhere;
  }

  table{
    width:100%;
  }

  .admin-table,
  .stand-table,
  .table,
  table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .btn,
  button,
  input,
  select,
  textarea,
  a{
    touch-action:manipulation;
  }

  input,
  select,
  textarea{
    font-size:16px!important; /* evita zoom raro en iOS */
  }
}

/* Home / héroes generales */
@media(max-width: 760px){
  .hero,
  .home-hero,
  .fp-home-hero,
  .page-hero,
  .analysis-index-hero,
  .fp-cp-hero{
    padding:82px 18px 30px!important;
  }

  .hero-actions,
  .actions,
  .cta-row,
  .btn-row{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
  }

  .hero-actions a,
  .actions a,
  .cta-row a,
  .btn-row a,
  .hero-actions button,
  .actions button{
    width:100%!important;
    justify-content:center!important;
  }

  .fp-home-v4,
  main{
    min-width:0!important;
  }
}

/* Cards editoriales */
@media(max-width: 760px){
  .news-card-full,
  .fp-blog-card,
  .analysis-index-card{
    display:block!important;
  }

  .news-card-full .thumb,
  .fp-blog-thumb,
  .post-thumb,
  .card-image{
    width:100%!important;
    min-height:190px!important;
    height:auto!important;
    aspect-ratio:16/10;
    overflow:hidden;
    border-radius:16px 16px 0 0!important;
  }

  .news-card-full img,
  .fp-blog-thumb img,
  .post-thumb img,
  .card-image img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }

  .note-content{
    font-size:16px!important;
    line-height:1.75!important;
  }

  .note-content h2{
    font-size:26px!important;
    margin-top:24px!important;
  }
}

/* Partidos / en vivo */
@media(max-width: 760px){
  .match-row,
  .live-match-row,
  .fp-live-row,
  .match-card{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  .match-teams,
  .score-row,
  .live-score-row{
    grid-template-columns:1fr!important;
    text-align:center!important;
  }

  .live-big-score,
  .score-big{
    font-size:42px!important;
  }

  .filters,
  .match-filters,
  .fp-live-filters{
    display:flex!important;
    overflow-x:auto!important;
    gap:8px!important;
    padding-bottom:8px!important;
    -webkit-overflow-scrolling:touch;
  }

  .filters button,
  .match-filters button,
  .fp-live-filters button,
  .filters a{
    flex:0 0 auto!important;
    white-space:nowrap!important;
  }
}

/* Análisis */
@media(max-width: 760px){
  .mhero{
    margin-top:0!important;
    padding-left:18px!important;
    padding-right:18px!important;
  }

  .alayout{
    padding-left:18px!important;
    padding-right:18px!important;
  }

  .tab-btn{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    padding:12px 14px!important;
  }

  .tc{
    min-width:0!important;
  }
}

/* Contacto / privacidad */
@media(max-width: 760px){
  .fp-contact-submit,
  .fp-contact-link{
    width:100%!important;
    justify-content:center!important;
  }

  .fp-privacy-index{
    position:relative!important;
    top:auto!important;
    display:flex!important;
    overflow-x:auto!important;
    gap:8px!important;
    padding:12px!important;
    scrollbar-width:none;
  }

  .fp-privacy-index::-webkit-scrollbar{
    display:none;
  }

  .fp-privacy-index strong{
    display:none!important;
  }

  .fp-privacy-index a{
    flex:0 0 auto!important;
    white-space:nowrap!important;
  }
}

/* Footer móvil */
@media(max-width: 760px){
  .fp-premium-footer,
  footer{
    padding-bottom:calc(92px + var(--fp-mobile-safe-bottom))!important;
  }

  .fp-footer-top,
  .fp-footer-bottom,
  .footer-bottom{
    display:block!important;
    text-align:left!important;
  }

  .fp-footer-brand,
  .footer-brand{
    max-width:100%!important;
  }
}

/* Botonera flotante móvil */
.fp-mobile-dock{
  position:fixed;
  left:12px;
  right:12px;
  bottom:calc(12px + var(--fp-mobile-safe-bottom));
  z-index:9998;
  display:none;
  gap:8px;
  padding:8px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(7,11,19,.88);
  backdrop-filter:blur(14px);
  border-radius:18px;
  box-shadow:0 18px 42px rgba(0,0,0,.28);
}

.fp-mobile-dock a,
.fp-mobile-dock button{
  flex:1;
  min-width:0;
  border:0;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-radius:13px;
  padding:11px 9px;
  font-size:11px;
  font-weight:950;
  color:#001018;
  background:var(--cyan, #00d4e8);
  line-height:1;
}

.fp-mobile-dock .secondary{
  color:var(--white, #fff);
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}

.fp-mobile-dock .live{
  background:#ef4444;
  color:#fff;
}

@media(max-width: 760px){
  body:not(.fp-admin-no-mobile-dock) .fp-mobile-dock{
    display:flex;
  }

  body{
    padding-bottom:calc(74px + var(--fp-mobile-safe-bottom));
  }
}

/* Botón subir */
.fp-mobile-top{
  position:fixed;
  right:14px;
  bottom:calc(88px + var(--fp-mobile-safe-bottom));
  z-index:9997;
  width:42px;
  height:42px;
  border-radius:15px;
  border:1px solid rgba(0,212,232,.24);
  background:rgba(7,11,19,.88);
  color:var(--cyan, #00d4e8);
  box-shadow:0 14px 30px rgba(0,0,0,.24);
  display:none;
  align-items:center;
  justify-content:center;
  font-weight:950;
  cursor:pointer;
}

.fp-mobile-top.show{
  display:flex;
}

/* Skeleton / carga amable para imágenes */
.fp-lazy-soft{
  background:linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,255,255,.08),rgba(255,255,255,.04));
  background-size:220% 100%;
  animation:fpLazyPulse 1.4s linear infinite;
}

@keyframes fpLazyPulse{
  0%{background-position:120% 0}
  100%{background-position:-120% 0}
}

/* Modo claro */
[data-theme="light"] .fp-mobile-dock,
[data-theme="light"] .fp-mobile-top{
  background:rgba(255,255,255,.92);
  border-color:rgba(15,23,42,.10);
  color:#0f172a;
}

[data-theme="light"] .fp-mobile-dock .secondary{
  background:#f1f5f9;
  color:#0f172a;
  border-color:rgba(15,23,42,.08);
}
