/* Adaptación de presentación para pantallas angostas. Escritorio conserva sus estilos. */
@media (max-width: 1023px) {
  html:has(> body[data-showcase-layout="site"]) { display:block; height:auto; min-height:100%; overflow-x:hidden; overflow-y:auto; }
  body[data-showcase-layout="site"] { display:block; width:100%; height:auto; min-height:100svh; overflow-x:hidden; overflow-y:auto; }
  body[data-showcase-layout="site"] *, body[data-showcase-layout="site"] *::before, body[data-showcase-layout="site"] *::after { box-sizing:border-box; }
  body[data-showcase-layout="site"] > .containercowo { position:fixed; inset:0; width:100%; min-width:0; min-height:100svh; height:100%; aspect-ratio:auto; z-index:0; }
  body[data-showcase-layout="site"] > .containercowo > .background { min-width:0; min-height:100%; }
  body[data-showcase-page="admin"] > .containercowo > .background,
  body[data-showcase-page="expositor"] > .containercowo > .background { background-size:cover; }
  body[data-showcase-page="portada"] > .containercowo > .background,
  body[data-showcase-page="login-modal"] > .containercowo > .background,
  body[data-showcase-page="registro-modal"] > .containercowo > .background { background-size:cover; }
  body[data-showcase-layout="site"] .button-container { top:10px; right:12px; left:auto; max-width:calc(100% - 24px); flex-direction:row; gap:6px; flex-wrap:wrap; }
  body[data-showcase-layout="site"]:has(.toggle-menu-btn) .button-container { max-width:calc(100% - 80px); }
  body[data-showcase-layout="site"] .button-container button { min-width:44px; min-height:44px; padding:10px; font-size:1.25rem; }
  body[data-showcase-page="portada"] .letrero,
  body[data-showcase-page="login-modal"] .letrero,
  body[data-showcase-page="registro-modal"] .letrero { left:5%; top:17%; width:90%; height:auto; }
  body[data-showcase-page="portada"] .linea1,
  body[data-showcase-page="login-modal"] .linea1,
  body[data-showcase-page="registro-modal"] .linea1 { font-size:clamp(1.6rem,7vw,2.6rem); }
  body[data-showcase-page="portada"] .linea2,
  body[data-showcase-page="login-modal"] .linea2,
  body[data-showcase-page="registro-modal"] .linea2 { font-size:clamp(1.2rem,5.6vw,2rem); line-height:1.3; margin-top:16px; }
  body[data-showcase-layout="site"] .central-buttons { position:fixed; top:auto; bottom:15svh; left:16px; right:16px; width:auto; max-width:380px; margin:0 auto; transform:none; flex-direction:column; gap:16px; }
  body[data-showcase-layout="site"] .central-buttons .futuristic-button { width:100%; min-width:0; min-height:52px; font-size:1rem; padding:14px 16px; }
  body[data-showcase-layout="site"] .admin-panel,
  body[data-showcase-layout="site"] .admin-panel2 { position:relative; top:auto; left:auto; right:auto; transform:none; width:calc(100% - 24px); min-width:0; max-width:none; margin:calc(var(--showcase-nav-height,48px) + 32px) 12px 24px; padding:18px; max-height:calc(100dvh - var(--showcase-nav-height,48px) - 56px); overflow:auto; }
  /* El formulario ocupa el lugar de la lista; al cerrarlo vuelve el panel activo. */
  body[data-showcase-layout="site"]:has(> .admin-panel[id^="modal-"]:is([style*="display: block"],[style*="display:block"])) > .admin-panel[id^="panel-"] { display:none !important; }
  body[data-showcase-page="exhibiciones"] .admin-panel,
  body[data-showcase-page="stands"] .admin-panel2 { max-height:none; display:block; }
  body[data-showcase-page="exhibiciones"] #panel-exhibiciones,
  body[data-showcase-page="exhibiciones-pasadas"] #panel-exhibiciones,
  body[data-showcase-page="stands"] #panel-exhibiciones {
    display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));
    gap:24px; align-items:start;
  }
  .exhibiciones-container,.exhibiciones-container2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:18px; width:100%; padding:0; }
  .exhibicion-card,.stand-card { width:100%; height:auto; min-height:0; padding:14px; }
  .exhibicion-card img,.stand-card img { height:auto; aspect-ratio:1; object-fit:cover; }
  .exhibicion-card h3,.stand-card h3 { margin:14px 0 4px; overflow-wrap:anywhere; }
  .exhibicion-card::after,.stand-card::after { width:100%; }
  body[data-showcase-layout="site"] .sesion-modal { position:fixed; top:12px; left:12px; right:12px; transform:none; width:auto; max-width:none; height:calc(100dvh - 24px); max-height:none; overflow:hidden; z-index:3000; }
  body[data-showcase-layout="site"] .sesion-modal-content { width:100%; height:100%; padding:16px; display:flex; flex-direction:column; box-sizing:border-box; overflow:hidden; }
  body[data-showcase-layout="site"] .sesion-modal-content h2 { flex:none; width:100%; margin:4px 0 18px; padding:0 30px; font-size:1.4rem; }
  body[data-showcase-layout="site"] .frame-inicio { flex:1; width:100% !important; min-height:0; height:auto; max-height:none; }
  body[data-showcase-layout="site"] .sesion-modal > .close { position:absolute; top:5px; right:8px; width:44px; height:44px; display:grid; place-items:center; }
  body[data-showcase-layout="site"] .info-modal,
  body[data-showcase-layout="site"] .notes-modal,
  body[data-showcase-layout="site"] .notebook-modal { width:calc(100% - 24px); min-height:0; max-height:calc(100dvh - 24px); }
  body[data-showcase-layout="site"] .admin-menu { display:none; }
  body[data-showcase-layout="site"] .toggle-menu-btn { display:block; top:10px; left:12px; min-height:44px; min-width:44px; }
  body[data-showcase-layout="site"] .admin-menu { position:fixed; top:68px; left:12px; width:calc(100% - 24px); max-height:calc(100dvh - 90px); overflow:auto; padding:14px; border-radius:12px; background:rgba(0,35,15,.98); box-shadow:0 0 12px #00ff88; z-index:1100; }
  .form-tabla table,.form-tabla tbody,.form-tabla tr,.form-tabla td { display:block; width:100% !important; }
  .form-tabla [hidden] { display:none !important; }
  .form-tabla td { padding:0; margin-bottom:10px; }
  .form-tabla tr { margin:0 0 16px; }
  .form-tabla label { display:block; margin-bottom:6px; }
  .form-tabla input,.form-tabla textarea,.form-tabla select { max-width:100%; font-size:16px; min-height:44px; }
  .form-tabla input[type="checkbox"],.form-tabla input[type="radio"] { min-height:20px; width:20px; }
  .form-actions { flex-wrap:wrap; justify-content:stretch; gap:10px; }
  .form-actions button,.form-actions .futuristic-button { flex:1 1 140px; min-width:0; min-height:46px; padding:12px; }
  .card-exhibicion { flex-wrap:wrap; align-items:flex-start; }
  .card-exhibicion img { width:76px; height:76px; }
  .card-exhibicion h3 { font-size:1.15rem; overflow-wrap:anywhere; }
  .card-exhibicion button { min-height:44px; }
  .showcase-table-scroll { width:100%; max-width:100%; overflow-x:auto; }
  .enlace-invitacion-fila { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; padding:12px 0; border-bottom:1px solid rgba(0,255,136,.3); gap:10px; }
  .enlace-invitacion-fila input,.enlace-invitacion-estado { grid-column:1/-1; width:100%; min-height:46px; white-space:normal; overflow-wrap:anywhere; }
  #modal-links .enlace-invitacion-fila .btn-editar { min-height:44px; white-space:normal; }
  #modal-links { max-width:none; }
  .title-container,.stand-container,.perfil-container,.barra-compartir { position:relative; left:auto; transform:none; width:calc(100% - 24px); min-width:0; max-width:none; margin:12px; }
  .title-container { margin-top:calc(var(--showcase-nav-height,44px) + 32px); padding:10px 12px; }
  .stand-container { min-height:0; padding:8px 8px 18px; backdrop-filter:none; -webkit-backdrop-filter:none; }
  body[data-showcase-page="stand"] > .containercowo { position:fixed; inset:0 0 auto; min-height:0; height:0; overflow:visible; z-index:1001; pointer-events:none; }
  body[data-showcase-page="stand"] > .containercowo .nav-button { top:var(--showcase-stand-nav-top,50vh); width:44px; height:44px; padding:6px; background:transparent; color:#b2ffb2; -webkit-text-stroke:1px #00331f; paint-order:stroke fill; text-shadow:0 0 3px #00331f,0 0 10px rgba(0,255,136,.8); pointer-events:auto; }
  body[data-showcase-page="stand"] > .containercowo .nav-button.left { left:6px; }
  body[data-showcase-page="stand"] > .containercowo .nav-button.right { right:6px; }
  .stand-container > .background { width:100%; min-height:0; height:auto; aspect-ratio:16/9; left:auto; transform:none; }
  .stand-container .video-area { width:28.3%; max-width:none; aspect-ratio:16/9; }
  .stand-container .video-area iframe,.stand-container .video-area video { position:absolute; inset:0; width:100%; height:100%; display:block; }
  .stand-container .logo-area { width:8.5%; min-width:0; max-height:21%; }
  .stand-container .pendon-area { width:19.5%; height:62.5%; transform:perspective(600px) rotateY(20deg); }
  .stand-container .madera-superior,.stand-container .madera-inferior { max-width:100%; }
  .stand-buttons,.stand-icons,.stand-actions,.stand-links,.stand-container .buttons-container,.botones-area { max-width:100%; flex-wrap:wrap; justify-content:center; gap:10px; }
  .stand-container .stand-btn { flex:none; width:46px; height:46px; min-width:46px; }
  .voto-interfaz { flex-wrap:wrap; justify-content:center; max-width:calc(100% - 24px); gap:10px; }
  .voto-interfaz .stand-btn { width:46px; height:46px; flex:none; }
  .evaluacion-modal { z-index:6000; }
  .evaluacion-modal-content { width:calc(100% - 24px); max-width:720px; max-height:calc(100dvh - 24px); overflow:auto; margin:12px auto; padding:18px; box-sizing:border-box; }
  .evaluacion-modal h2 { padding-right:36px; font-size:1.3rem; }
  .evaluacion-modal .close { top:7px; right:7px; width:44px; height:44px; display:grid; place-items:center; }
  .evaluacion-modal input,.evaluacion-modal textarea,.evaluacion-modal select { box-sizing:border-box; max-width:100%; font-size:16px; }
  .evaluacion-modal .estrella-opcion { min-height:44px; padding:10px; display:flex; align-items:center; }
  #audio-controls { display:flex; flex-wrap:wrap; gap:10px; }
  #audio-controls button { min-height:44px; padding:10px; }
  #audio-controls audio { width:100%; }
  .audio-recording-indicator { white-space:normal; flex-wrap:wrap; }
  .onepager-modal { top:12px; width:calc(100% - 24px); height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); }
  .equipo-popup-modal { position:fixed; top:12px; left:12px; transform:none; width:calc(100% - 24px); max-width:none; max-height:calc(100dvh - 24px); padding:18px; background:#fff; z-index:6000; }
  .equipo-popup-content { padding:0; }
  .equipo-popup-content h2 { padding-right:40px; margin:0 0 18px; font-size:1.35rem; }
  .equipo-popup-modal > .close,.onepager-modal > .close { position:absolute; top:7px; right:7px; width:44px; height:44px; display:grid; place-items:center; }
  .onepager-content h1:first-child,.onepager-content h2:first-child { padding-right:40px; }
  .tabla-equipo-modal { min-width:480px; }
  .tabla-equipo-modal th,.tabla-equipo-modal td { overflow-wrap:normal; word-break:normal; }
  .onepager-content img { max-width:100%; height:auto; }
  .perfil-container { padding:8px; }
  .background.perfil-background { width:100%; min-height:0; padding:12px; left:auto; transform:none; }
  .perfil-hero { padding:18px; flex-direction:column; text-align:center; }
  .perfil-headline { min-width:0; }
  .perfil-headline h1 { overflow-wrap:anywhere; }
  .perfil-secciones { grid-template-columns:1fr; }
  .perfil-card.full { grid-column:auto; }
  .stats-modal { width:calc(100% - 24px); max-height:calc(100dvh - 24px); padding:16px; }
  body[data-showcase-page="terminos"] { padding:20px 16px; box-sizing:border-box; width:auto; margin:0; }
  body[data-showcase-page="terminos"] p,body[data-showcase-page="terminos"] a,body[data-showcase-page="terminos"] li { overflow-wrap:anywhere; }
}
body[data-showcase-page="stand"] .video-area > video { object-fit:contain !important; background:#000; }
.showcase-video-open { display:none; }
.showcase-video-dialog { width:min(960px,calc(100vw - 24px),calc((100dvh - 96px) * 1.777778 + 24px)); max-width:none; max-height:calc(100dvh - 24px); box-sizing:border-box; margin:auto; padding:48px 12px 12px; border:0; border-radius:12px; background:#fff; color:#222; overflow:auto; }
.showcase-video-dialog::backdrop { background:rgba(0,0,0,.8); }
.showcase-video-close { position:absolute; top:4px; right:4px; display:grid; place-items:center; width:44px; height:44px; margin:0; padding:0; border:0; background:transparent; color:#222; font:30px/1 Arial,sans-serif; cursor:pointer; }
.showcase-video-player { position:relative; width:100%; height:auto; aspect-ratio:16/9; max-height:calc(100dvh - 96px); background:#000; border-radius:8px; overflow:hidden; }
.showcase-video-player iframe { display:block; position:absolute; inset:0; width:100%; height:100%; border:0; transform-origin:top left; }
.showcase-video-player:has(> video) { aspect-ratio:auto; min-height:0; max-height:none; }
.showcase-video-player video { display:block; position:static; width:auto !important; height:auto !important; max-width:100%; max-height:calc(100dvh - 96px); margin:auto; border:0; border-radius:8px; object-fit:contain !important; }
@media (max-width:767px), (max-width:1023px) and (max-height:500px) and (orientation:landscape) {
  .showcase-video-open { position:absolute; inset:0; z-index:2; display:grid; place-items:center; width:100%; height:100%; margin:0; padding:0; border:0; border-radius:6px; background:transparent; cursor:pointer; }
  .showcase-video-open span { display:grid; place-items:center; width:48px; height:32px; border-radius:8px; background:#ff0033; color:#fff; font:20px/1 Arial,sans-serif; }
}
@media (max-width:1023px) and (max-height:500px) {
  body[data-showcase-layout="site"] .central-buttons { flex-direction:row; bottom:18px; max-width:680px; }
  body[data-showcase-page="portada"] .letrero { top:15%; }
  body[data-showcase-page="portada"] .linea1 { font-size:1.7rem; }
  body[data-showcase-page="portada"] .linea2 { font-size:1.3rem; margin-top:8px; }
}
/* El iframe recibe el tamaño de la vista exterior; escritorio conserva sus estilos. */
body[data-showcase-layout="auth"][data-showcase-compact="1"] { padding:0 0 82px; overflow-x:hidden; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] #sp-main-body { padding:8px 0 16px; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] .body-wrapper { padding:0; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] .container,
body[data-showcase-layout="auth"][data-showcase-compact="1"] .row,
body[data-showcase-layout="auth"][data-showcase-compact="1"] #sp-component { width:100%; max-width:none; padding:0; margin:0; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] > .body-wrapper { padding:12px; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] input,
body[data-showcase-layout="auth"][data-showcase-compact="1"] select,
body[data-showcase-layout="auth"][data-showcase-compact="1"] textarea { font-size:16px; min-height:44px; max-width:100%; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] input[type="checkbox"],
body[data-showcase-layout="auth"][data-showcase-compact="1"] input[type="radio"] { min-height:18px; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] .col-lg-10,
body[data-showcase-layout="auth"][data-showcase-compact="1"] .col-xl-7 { width:100%; max-width:none; padding:0; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] .social-login-form button { min-height:46px; }
body[data-showcase-layout="auth"][data-showcase-compact="1"] fieldset { min-width:0; }
@media (max-width:600px) {
  body[data-showcase-layout="administrator"] .admin-header { height:auto; min-height:64px; flex-wrap:wrap; gap:10px; padding:12px; }
  body[data-showcase-layout="administrator"] .admin-header nav { flex-wrap:wrap; gap:8px; }
  body[data-showcase-layout="administrator"] .toolbar button { min-height:44px; }
  body[data-showcase-layout="administrator"] .filters { flex-wrap:wrap; }
  body[data-showcase-layout="administrator"] .search-label { width:100%; }
  body[data-showcase-layout="administrator"] .form-grid { grid-template-columns:1fr; }
}
