/* TuFísico · megamenú (17-nov-2026). Solo escritorio (>921px). */
@media (min-width:922px){
  /* la barra de cabecera es la referencia para los paneles a todo lo ancho */
  body.tf-d .ast-primary-header-bar, body.tf-d .main-header-bar{position:relative}
  body.tf-d .site-primary-header-wrap, body.tf-d .ast-builder-grid-row, body.tf-d .site-header-primary-section-right,
  body.tf-d .ast-builder-menu-1, body.tf-d #primary-site-navigation-desktop, body.tf-d .main-navigation, body.tf-d #ast-hf-menu-1{position:static}
  body.tf-d #ast-hf-menu-1 > .menu-item{position:relative}
  body.tf-d #ast-hf-menu-1 > .menu-item.tf-con-mega{position:static}

  /* elementos de primer nivel: trazo de pincel rojo bajo el activo o al pasar */
  body.tf-d #ast-hf-menu-1 > .menu-item > .menu-link{position:relative;padding-left:16px!important;padding-right:16px!important}
  body.tf-d #ast-hf-menu-1 > .menu-item > .menu-link::after{content:"";position:absolute;left:16px;right:16px;bottom:18px;height:6px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='none'%3E%3Cpath fill='%23c8211a' d='M2 7C40 3 120 2 210 3S360 5 398 6L392 9C300 11 180 11 90 11S20 11 3 10Z'/%3E%3C/svg%3E") left/100% 100% no-repeat;transform:scaleX(0);transform-origin:left;transition:transform .3s ease}
  body.tf-d #ast-hf-menu-1 > .menu-item:hover > .menu-link::after, body.tf-d #ast-hf-menu-1 > .menu-item:focus-within > .menu-link::after,
  body.tf-d #ast-hf-menu-1 > .current-menu-item > .menu-link::after{transform:scaleX(1)}
  body.tf-d #ast-hf-menu-1 > .menu-item .dropdown-menu-toggle .ast-icon{transition:transform .3s ease}
  body.tf-d #ast-hf-menu-1 > .tf-con-mega:hover .dropdown-menu-toggle .ast-icon, body.tf-d #ast-hf-menu-1 > .tf-con-mega:focus-within .dropdown-menu-toggle .ast-icon{transform:rotate(180deg)}
  /* los desplegables normales de esos tres elementos no se usan */
  body.tf-d #ast-hf-menu-1 > .tf-con-mega > .sub-menu{display:none!important}

  /* el panel */
  body.tf-d .tf-mega{position:absolute;left:0;right:0;top:100%;z-index:9999;padding-top:0;visibility:hidden;opacity:0;transform:translateY(-8px);transition:opacity .25s ease,transform .25s ease,visibility 0s .25s;pointer-events:none}
  body.tf-d .tf-mega::before{content:"";position:absolute;left:0;right:0;top:-24px;height:24px}
  body.tf-d #ast-hf-menu-1 > .tf-con-mega:hover > .tf-mega, body.tf-d #ast-hf-menu-1 > .tf-con-mega:focus-within > .tf-mega{visibility:visible;opacity:1;transform:none;transition-delay:.08s,.08s,0s;pointer-events:auto}
  body.tf-d .tf-mega-in{max-width:1180px;margin:0 auto;display:grid;grid-template-columns:300px 1fr;background:#fbf8f2;border-top:3px solid var(--tf-rojo);box-shadow:0 30px 60px rgba(0,0,0,.35);border-radius:0 0 4px 4px;overflow:hidden;text-align:left}

  /* columna destacada, negra con dragón en línea */
  body.tf-d .tf-mega-destacado{position:relative;overflow:hidden;background:var(--tf-negro);color:#c9cacd;padding:30px 28px;isolation:isolate}
  body.tf-d .tf-mega-destacado::after{content:"";position:absolute;right:-90px;bottom:-60px;width:330px;height:230px;background:url("img/dragon-serpiente-rojo.svg?2") no-repeat center/contain;opacity:.35;z-index:-1;transform:scaleX(-1)}
  body.tf-d .tf-mega-kanji{position:absolute;right:18px;top:16px;writing-mode:vertical-rl;font:700 64px/1 var(--tf-kanji,'Noto Serif JP',serif);color:#fff;opacity:.08;letter-spacing:.08em;z-index:-1}
  body.tf-d .tf-mega-eti{font:600 11px/1 var(--tf-cuerpo);letter-spacing:.14em;text-transform:uppercase;color:var(--tf-rojo);margin:0 0 12px}
  body.tf-d .tf-mega-titulo{font:800 30px/1.02 var(--tf-titular);color:#fff;margin:0 0 12px}
  body.tf-d .tf-mega-titulo b{color:#fff}
  body.tf-d .tf-mega-texto{font-size:14px;line-height:1.55;margin:0 0 20px;color:#b9bbbf}
  body.tf-d .tf-mega-boton{display:inline-flex;align-items:center;gap:8px;background:var(--tf-rojo);color:#fff!important;padding:10px 16px;border-radius:3px;font:600 14px/1 var(--tf-cuerpo);text-decoration:none!important}
  body.tf-d .tf-mega-boton:hover{background:var(--tf-rojo-osc)}
  body.tf-d .tf-mega-boton .tf-mi{width:18px;height:18px}

  body.tf-d .tf-mega-cuerpo{padding:24px 28px 20px;position:relative}
  /* el menú de Astra impone su altura de línea y su display a todo lo que hay dentro: se anula en el panel */
  body.tf-d .tf-mega a, body.tf-d .tf-mega span, body.tf-d .tf-mega small, body.tf-d .tf-mega strong, body.tf-d .tf-mega em, body.tf-d .tf-mega p, body.tf-d .tf-mega label{line-height:1.3!important;height:auto!important;min-height:0!important}
  body.tf-d .tf-mega a{padding-top:0;padding-bottom:0}
  body.tf-d .tf-mega em, body.tf-d .tf-mega small{white-space:nowrap}
  body.tf-d .tf-mi-disc{padding:9px 8px!important}
  body.tf-d .tf-mega-grupo a{padding:6px 2px!important}
  body.tf-d .tf-mega-acc{padding:14px!important}
  body.tf-d .tf-mega-boton{padding:10px 16px!important}
  body.tf-d .tf-mega-titulo{line-height:1.02!important}
  body.tf-d .tf-mi-sello{line-height:1.02!important}
  body.tf-d .tf-mega .tf-mi-sello{height:40px!important;width:36px;flex:0 0 36px}
  body.tf-d .tf-mega .tf-mega-acc-i{height:42px!important;width:42px;flex:0 0 42px}
  body.tf-d .tf-mega-buscar{max-width:100%;box-sizing:border-box}
  body.tf-d .tf-mega-buscar label{min-width:0}
  body.tf-d .tf-mega-buscar select{min-width:0;max-width:240px}
  body.tf-d .tf-mi{flex:0 0 auto}

  /* disciplinas: rejilla con sello de kanji */
  body.tf-d .tf-mega-rejilla{display:grid;grid-template-columns:repeat(4,1fr);gap:4px 14px}
  body.tf-d .tf-mi-disc{display:flex;align-items:center;gap:11px;padding:8px 8px;border-radius:3px;color:var(--tf-texto)!important;text-decoration:none!important;transition:background .2s ease}
  body.tf-d .tf-mi-disc:hover{background:#fff;box-shadow:0 0 0 1px #e8dfd0}
  body.tf-d .tf-mi-sello{flex:0 0 36px;height:38px;display:grid;place-items:center;background:var(--tf-negro);color:#fff;border-radius:3px;font:700 13px/1.02 var(--tf-kanji,'Noto Serif JP',serif);writing-mode:vertical-rl;letter-spacing:0;transform:rotate(-2deg);transition:background .2s ease,transform .25s ease}
  body.tf-d .tf-mi-disc:hover .tf-mi-sello{background:var(--tf-rojo);transform:rotate(0) scale(1.06)}
  body.tf-d .tf-mi-txt strong{display:block;font:700 18px/1.05 var(--tf-titular);color:var(--tf-negro)}
  body.tf-d .tf-mi-txt small{font-size:12px;color:var(--tf-gris)}
  body.tf-d .tf-mega-pie{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;margin-top:16px;padding-top:14px;border-top:1px solid #e6dccb;font-size:13px}
  body.tf-d .tf-mega-pie span{font:600 11px/1 var(--tf-cuerpo);letter-spacing:.12em;text-transform:uppercase;color:var(--tf-rojo)}
  body.tf-d .tf-mega-pie a{color:var(--tf-texto)!important;text-decoration:none!important}
  body.tf-d .tf-mega-pie a:hover{color:var(--tf-rojo)!important}
  body.tf-d .tf-mega-pie em{font-style:normal;color:var(--tf-gris);font-size:12px}

  /* provincias por comunidad */
  body.tf-d .tf-mega-grupos{display:grid;grid-template-columns:repeat(4,1fr);gap:18px 22px}
  body.tf-d .tf-mega-grupo-t{font:700 17px/1.1 var(--tf-titular);color:var(--tf-negro);margin:0 0 8px;padding-bottom:7px;border-bottom:2px solid var(--tf-negro);display:flex;justify-content:space-between;align-items:baseline}
  body.tf-d .tf-mega-grupo-t small{font:600 11px/1 var(--tf-cuerpo);color:var(--tf-rojo)}
  body.tf-d .tf-mega-grupo a{display:flex;align-items:center;gap:7px;padding:5px 2px;font-size:14px;color:var(--tf-texto)!important;text-decoration:none!important;border-radius:3px}
  body.tf-d .tf-mega-grupo a .tf-mi{width:15px;height:15px;color:#c4b9a6;transition:color .2s ease}
  body.tf-d .tf-mega-grupo a em{margin-left:auto;font-style:normal;font-size:12px;color:var(--tf-gris);font-variant-numeric:tabular-nums}
  body.tf-d .tf-mega-grupo a:hover{color:var(--tf-rojo)!important}
  body.tf-d .tf-mega-grupo a:hover .tf-mi{color:var(--tf-rojo)}
  body.tf-d .tf-mega-mas{margin-top:6px;font-weight:600;color:var(--tf-rojo)!important}
  body.tf-d .tf-mega-form{display:flex;background:#fff;border-radius:3px;overflow:hidden}
  body.tf-d .tf-mega-form select{flex:1;border:0!important;background:#fff!important;padding:10px 12px!important;font:500 14px var(--tf-cuerpo);color:var(--tf-negro);height:auto}
  body.tf-d .tf-mega-form button{background:var(--tf-rojo);border:0;color:#fff;padding:0 14px;cursor:pointer;display:grid;place-items:center}

  /* clubes: buscador y accesos con iconos de pincel */
  body.tf-d .tf-mega-buscar{display:flex;gap:0;border:1px solid #e0d6c4;border-radius:3px;background:#fff;overflow:hidden;margin-bottom:18px}
  body.tf-d .tf-mega-buscar label{flex:1.4;display:flex;align-items:center;gap:8px;padding:0 12px;margin:0;color:var(--tf-gris)}
  body.tf-d .tf-mega-buscar input, body.tf-d .tf-mega-buscar select{border:0!important;box-shadow:none!important;background:transparent!important;font:500 15px var(--tf-cuerpo);color:var(--tf-negro);padding:13px 6px!important;height:auto;width:100%;outline:0}
  body.tf-d .tf-mega-buscar select{flex:1;border-left:1px solid #eee3d2!important;padding-left:12px!important}
  body.tf-d .tf-mega-buscar button{background:var(--tf-rojo);color:#fff;border:0;padding:0 22px;font:600 15px var(--tf-cuerpo);cursor:pointer}
  body.tf-d .tf-mega-buscar button:hover{background:var(--tf-rojo-osc)}
  body.tf-d .tf-mega-accesos{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  body.tf-d .tf-mega-acc{display:flex;gap:14px;align-items:flex-start;padding:14px 14px;border:1px solid #ebe2d3;border-radius:3px;background:#fff;color:var(--tf-texto)!important;text-decoration:none!important;transition:border-color .2s ease,transform .2s ease}
  body.tf-d .tf-mega-acc:hover{border-color:var(--tf-rojo);transform:translateY(-1px)}
  body.tf-d .tf-mega-acc-i{flex:0 0 42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#f6efe3;color:var(--tf-rojo);transition:background .2s ease,color .2s ease}
  body.tf-d .tf-mega-acc:hover .tf-mega-acc-i{background:var(--tf-rojo);color:#fff}
  body.tf-d .tf-mega-acc strong{display:block;font:700 18px/1.1 var(--tf-titular);color:var(--tf-negro);margin-bottom:3px}
  body.tf-d .tf-mega-acc small{font-size:13px;color:var(--tf-gris);line-height:1.4}
}
/* en móvil el panel no existe: se usan los desplegables de Astra */
@media (max-width:921px){ body.tf-d .tf-mega{display:none!important} }
@media (prefers-reduced-motion: reduce){ body.tf-d .tf-mega{transition:none!important} }
