/* =========================================================================
   Panel de Search Console en 3D (hero de la home)

   Lo imprime el shortcode [psx_panel_gsc] (parts/panel-gsc.php) y lo mueve
   assets/js/panel-gsc.js. Todo va bajo .psx-gsc para no chocar con nada.
   El panel se dibuja a 760 x 600 y se escala al ancho de su columna (--s).
   Sin JS, o si el navegador frena las animaciones, queda todo dibujado.
   ========================================================================= */
.psx-gsc {
	--violeta: var( --psx-violeta, #7C3AED );
	--cuerpo: var( --psx-fuente-cuerpo, "DM Sans", sans-serif );
	--curva: cubic-bezier( .16, 1, .3, 1 );
	--g-azul: #1A73E8; --g-violeta: #5E35B1; --g-verde: #00897B; --g-naranja: #E8710A;
	--g-texto: #202124; --g-gris: #5F6368; --g-linea: #DADCE0; --g-fondo: #F8F9FA;
	width: 100%;
	text-align: left;
	line-height: normal;
	letter-spacing: normal;
}
.psx-gsc * { box-sizing: border-box; }
/* Escritorio: anclado al borde izquierdo de la columna, crece hacia la derecha. */
.psx-gsc.al-costado .lienzo { left: var( --ox, 0px ); transform: translate( 0, -50% ) scale( var( --s, 1 ) ); transform-origin: 0 50%; }

/* Terminada la entrada (.asentado) queda solo el flotar: la salida al hacer
   scroll la mueve panel-gsc.js tarjeta por tarjeta. */
.psx-gsc.en-vista.asentado .capa { animation: gsc-flotar 7s ease-in-out infinite; }
.psx-gsc.en-vista.asentado .gsc { animation: none; }

/* Sin parpadeo: mientras <html> tiene .psx-gsc-pre (lo pone el <head>) y la
   entrada no arranco, el panel no se ve. Asi aparece una sola vez, animado. */
html.psx-gsc-pre .psx-gsc:not( .en-vista ) .gsc,
html.psx-gsc-pre .psx-gsc:not( .en-vista ) .capa,
html.psx-gsc-pre .psx-gsc:not( .en-vista ) .halo { opacity: 0; }

/* El widget Shortcode de Elementor tiene que ocupar toda la columna (que centra con flex). */
.elementor-widget.psx-gsc-widget, .psx-gsc-widget > .elementor-widget-container { width: 100%; align-self: center; }

/* ---------- Escena 3D ----------
   El panel se dibuja a tamaño fijo (760 x 540) y se escala al ancho
   disponible con --s, asi se ve identico en cualquier pantalla. */
.psx-gsc { position: relative; height: calc(600px * var(--s, 1)); }
.psx-gsc .lienzo {
	position: absolute; left: 50%; top: 50%;
	width: 760px; height: 600px;
	transform: translate(-46%, -50%) scale(var(--s, 1));
	perspective: 1800px; perspective-origin: 50% 35%;
}
.psx-gsc .mundo {
	position: absolute; inset: 0; transform-style: preserve-3d;
	transform: rotateX(var(--rx, 9deg)) rotateY(var(--ry, -20deg)) rotateZ(1.5deg);
	will-change: transform;
}

/* Halo violeta detras */
.psx-gsc .halo { position: absolute; left: 10%; top: 12%; width: 80%; height: 70%; background: radial-gradient(closest-side, rgba(124,58,237,.55), transparent 75%); filter: blur(30px); transform: translateZ(-120px); }

/* Ventana de Search Console */
.psx-gsc .gsc {
	position: absolute; left: 40px; top: 50px; width: 680px; height: 470px;
	display: grid; grid-template-rows: 48px 1fr; overflow: hidden;
	border-radius: 14px; background: #fff; color: var(--g-texto);
	font-family: "Google Sans", "Product Sans", Roboto, Arial, sans-serif;
	box-shadow: 0 2px 0 rgba(255,255,255,.6) inset, 0 50px 90px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.15);
	transform: translateZ(0);
}
.psx-gsc .gsc::after { /* reflejo de luz que barre el panel */
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 48%, transparent 60%);
	transform: translateX(-120%); opacity: 0;
}
@keyframes gsc-brillo { from { transform: translateX(-120%); opacity: 1; } to { transform: translateX(120%); opacity: 1; } }

.psx-gsc .g-barra { display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--g-linea); font-size: 13px; }
.psx-gsc .g-barra .ham { display: grid; gap: 3px; } .psx-gsc .g-barra .ham i { display: block; width: 14px; height: 2px; background: var(--g-gris); border-radius: 2px; }
.psx-gsc .g-logo { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--g-gris); white-space: nowrap; }
.psx-gsc .g-logo b { font-weight: 500; color: var(--g-gris); }
.psx-gsc .g-prop { display: flex; align-items: center; gap: 6px; margin-left: 8px; padding: 6px 10px; border: 1px solid var(--g-linea); border-radius: 6px; font-size: 12px; color: var(--g-texto); white-space: nowrap; }
.psx-gsc .g-prop::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(135deg, #7C3AED, #E8342A); }
.psx-gsc .g-busca { flex: 1; margin-left: 6px; padding: 7px 12px; border-radius: 6px; background: #F1F3F4; color: var(--g-gris); font-size: 12px; white-space: nowrap; overflow: hidden; }
.psx-gsc .g-av { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #7C3AED, #A78BFA); flex: none; }

.psx-gsc .g-cuerpo { display: grid; grid-template-columns: 150px 1fr; min-height: 0; }
.psx-gsc .g-menu { padding: 10px 0; border-right: 1px solid #F1F3F4; font-size: 12px; color: var(--g-texto); }
.psx-gsc .g-menu div { padding: 7px 14px; border-radius: 0 16px 16px 0; margin-right: 10px; white-space: nowrap; }
.psx-gsc .g-menu .on { background: #E8F0FE; color: #1967D2; font-weight: 500; }
.psx-gsc .g-menu small { display: block; padding: 10px 14px 4px; color: var(--g-gris); font-size: 10px; letter-spacing: .04em; }

.psx-gsc .g-main { padding: 14px 18px; background: var(--g-fondo); min-width: 0; }
.psx-gsc .g-titulo { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.psx-gsc .g-titulo span { font-size: 11px; color: #1967D2; font-weight: 500; }
.psx-gsc .g-chips { display: flex; gap: 6px; margin: 10px 0 12px; }
.psx-gsc .g-chips span { padding: 4px 10px; border: 1px solid var(--g-linea); border-radius: 14px; background: #fff; font-size: 11px; color: var(--g-texto); white-space: nowrap; }
.psx-gsc .g-chips span.on { background: #E8F0FE; border-color: #E8F0FE; color: #1967D2; }

.psx-gsc .g-card { border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.15), 0 1px 3px 1px rgba(60,64,67,.08); overflow: hidden; }
.psx-gsc .g-tiles { display: grid; grid-template-columns: repeat(4, 1fr); transform-style: preserve-3d; }
.psx-gsc .g-tile { padding: 10px 12px 12px; color: #fff; font-size: 11px; }
.psx-gsc .g-tile .chk { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border: 1.5px solid currentColor; border-radius: 2px; vertical-align: -1px; background: currentColor; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.0); }
.psx-gsc .g-tile strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 400; letter-spacing: -.01em; }
.psx-gsc .g-tile.clics { background: var(--g-azul); }
.psx-gsc .g-tile.impr { background: var(--g-violeta); }
.psx-gsc .g-tile.ctr, .psx-gsc .g-tile.pos { color: var(--g-gris); background: #fff; border-left: 1px solid #F1F3F4; }
.psx-gsc .g-tile.ctr .chk { color: var(--g-verde); background: transparent; }
.psx-gsc .g-tile.pos .chk { color: var(--g-naranja); background: transparent; }
.psx-gsc .g-tile.ctr strong, .psx-gsc .g-tile.pos strong { color: var(--g-texto); }

.psx-gsc .g-graf { position: relative; padding: 10px 14px 4px; }
.psx-gsc .g-graf svg { display: block; width: 100%; height: 132px; overflow: visible; }
.psx-gsc .g-graf .rej { stroke: #F1F3F4; }
.psx-gsc .g-graf .eje { fill: var(--g-gris); font-size: 9px; font-family: Roboto, Arial, sans-serif; }
.psx-gsc .g-graf .l { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 0; }
.psx-gsc .g-graf .l.az { stroke: var(--g-azul); }
.psx-gsc .g-graf .l.vi { stroke: var(--g-violeta); }
.psx-gsc .g-graf .punto { fill: #fff; stroke: var(--g-azul); stroke-width: 2.5; }
.psx-gsc .g-graf .guia { stroke: #9AA0A6; stroke-width: 1; stroke-dasharray: 3 3; }
@keyframes gsc-trazar { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
@keyframes gsc-mostrar { from { opacity: 0; } }

.psx-gsc .g-tabla { margin-top: 10px; font-size: 11px; }
.psx-gsc .g-tabs { display: flex; gap: 18px; padding: 0 12px; border-bottom: 1px solid var(--g-linea); color: var(--g-gris); font-size: 10px; font-weight: 500; letter-spacing: .06em; }
.psx-gsc .g-tabs span { padding: 8px 0; }
.psx-gsc .g-tabs .on { color: #1967D2; box-shadow: inset 0 -2px 0 #1967D2; }
.psx-gsc .g-fila { display: grid; grid-template-columns: 1fr 64px 80px; padding: 7px 12px; border-bottom: 1px solid #F1F3F4; color: var(--g-texto); }
.psx-gsc .g-fila span:not(:first-child) { text-align: right; }
.psx-gsc .g-fila.cab { color: var(--g-gris); font-size: 10px; }

/* ---------- Capas flotantes: cada una a otra profundidad ---------- */
.psx-gsc .capa { --z: 0px; transform: translateZ(var(--z)); position: absolute; border-radius: 12px; background: #fff; color: var(--g-texto); font-family: "Google Sans", Roboto, Arial, sans-serif; box-shadow: 0 30px 50px -18px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.04); }
@keyframes gsc-flotar { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* Tooltip del grafico: la capa mas cercana */
.psx-gsc .c-tip { left: 560px; top: 262px; padding: 8px 12px; font-size: 11px; --z: 150px; }
.psx-gsc .c-tip b { display: block; margin-bottom: 4px; font-weight: 500; }
.psx-gsc .c-tip::after { content: ""; position: absolute; right: 18px; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); box-shadow: 3px 3px 6px -3px rgba(0,0,0,.2); }
.psx-gsc .c-tip i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }

/* Resultado de Google: primera posicion */
.psx-gsc .c-serp { left: -54px; top: -6px; width: 330px; padding: 14px 16px; --z: 110px; }
.psx-gsc .c-serp .fuente { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--g-texto); }
.psx-gsc .c-serp .fuente i { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #7C3AED, #E8342A); flex: none; }
.psx-gsc .c-serp .fuente small { display: block; color: var(--g-gris); font-size: 10px; }
.psx-gsc .c-serp .tit { margin: 6px 0 2px; color: #1A0DAB; font-size: 15px; line-height: 1.3; }
.psx-gsc .c-serp p { margin: 0; color: #4D5156; font-size: 11px; line-height: 1.45; }
.psx-gsc .c-serp .pos1 { position: absolute; top: -10px; right: -10px; padding: 4px 9px; border-radius: 999px; background: var(--violeta); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--cuerpo); box-shadow: 0 8px 18px -6px rgba(124,58,237,.8); }

/* Core Web Vitals */
.psx-gsc .c-cwv { left: -70px; bottom: 70px; width: 200px; padding: 14px; --z: 90px; }
.psx-gsc .c-cwv .tt { font-size: 12px; font-weight: 500; }
.psx-gsc .c-cwv .sub { color: var(--g-gris); font-size: 10px; margin-top: 2px; }
.psx-gsc .c-cwv .barra { display: flex; height: 8px; margin: 10px 0 8px; border-radius: 4px; overflow: hidden; background: #F1F3F4; }
.psx-gsc .c-cwv .barra span { width: 100%; background: #188038; }
@keyframes gsc-llenar { from { width: 0; } to { width: 100%; } }
.psx-gsc .c-cwv .ley { display: flex; justify-content: space-between; font-size: 10px; color: var(--g-gris); }
.psx-gsc .c-cwv .ley b { color: #188038; font-weight: 500; }

/* Inspeccion de URL */
.psx-gsc .c-url { left: 330px; bottom: -34px; width: 300px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; --z: 130px; }
.psx-gsc .c-url .ok { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #E6F4EA; color: #188038; font-weight: 700; flex: none; }
.psx-gsc .c-url b { display: block; font-size: 12px; font-weight: 500; }
.psx-gsc .c-url small { color: var(--g-gris); font-size: 10px; }



/* Google Analytics: usuarios por dia (barras) */
.psx-gsc .c-ga { right: -46px; top: -34px; width: 236px; padding: 12px 14px 10px; --z: 120px; }
.psx-gsc .ga-cab { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--g-gris); }
.psx-gsc .ga-cab svg { width: 14px; height: 14px; }
.psx-gsc .ga-num { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.psx-gsc .ga-num strong { font-size: 22px; font-weight: 400; color: var(--g-texto); }
.psx-gsc .ga-num span { color: #188038; font-size: 11px; font-weight: 500; }
.psx-gsc .ga-num small { display: block; color: var(--g-gris); font-size: 10px; }
.psx-gsc .ga-barras { display: flex; align-items: flex-end; gap: 4px; height: 58px; margin-top: 8px; padding-bottom: 2px; border-bottom: 1px solid #F1F3F4; }
.psx-gsc .ga-barras i { flex: 1; border-radius: 2px 2px 0 0; background: #1A73E8; opacity: .85; transform-origin: bottom; }
.psx-gsc .ga-barras i:nth-last-child(-n+3) { background: #7C3AED; opacity: 1; }
@keyframes gsc-crecer { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.psx-gsc .ga-pie { display: flex; justify-content: space-between; margin-top: 4px; font-size: 9px; color: var(--g-gris); }

/* Visitas por canal (anillo) */
.psx-gsc .c-canal { left: -96px; top: 150px; width: 210px; padding: 12px 14px; --z: 70px; }
.psx-gsc .c-canal .tt { font-size: 11px; color: var(--g-gris); }
.psx-gsc .canal-cuerpo { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.psx-gsc .anillo2 { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.psx-gsc .anillo2 circle { fill: none; stroke-width: 7; }
.psx-gsc .anillo2 .seg { stroke-dasharray: var(--d) 100; }
@keyframes gsc-segmento { from { stroke-dasharray: 0 100; } to { stroke-dasharray: var(--d) 100; } }
.psx-gsc .canal-ley { display: grid; gap: 3px; font-size: 10px; color: var(--g-texto); }
.psx-gsc .canal-ley i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.psx-gsc .canal-ley b { font-weight: 500; }


/* Entrada: se dispara cuando la escena aparece en pantalla (JS agrega .en-vista).
   Sin JS, o si el navegador frena las animaciones, todo queda dibujado igual. */
.psx-gsc.en-vista .g-graf .l { animation: gsc-trazar 1s cubic-bezier(.45,0,.2,1) .6s both; }
.psx-gsc.en-vista .g-graf .l.vi { animation-delay: .7s; }
.psx-gsc.en-vista .g-graf .punto, .psx-gsc.en-vista .g-graf .guia { animation: gsc-mostrar .25s cubic-bezier(.2,.8,.2,1) 1.5s both; }
.psx-gsc.en-vista .ga-barras i { animation: gsc-crecer .9s var(--curva) var(--b) both; }
.psx-gsc.en-vista .anillo2 .seg { animation: gsc-segmento 1.3s var(--curva) 1.8s both; }
.psx-gsc.en-vista .c-cwv .barra span { animation: gsc-llenar 1.4s var(--curva) 2s both; }
/* ---- Entrada en 3D ----
   1. El panel llega desde lejos y se apoya (0 a 1,3 s).
   2. Con el panel apoyado, cada tarjeta entra desde SU lado y desde adelante
      (mas cerca de la camara que su lugar final), girando, desenfocada como un
      objeto demasiado cerca del lente, y se apoya en su profundidad con un
      leve rebote. Nunca atraviesa el panel.
   3. El aviso del grafico nace del punto del grafico cuando la linea termina. */
.psx-gsc.en-vista .halo { animation: gsc-halo 1.6s ease both; }
.psx-gsc.en-vista .gsc { animation: gsc-panel 1.3s cubic-bezier(.22,1,.36,1) both; }
.psx-gsc.en-vista .capa {
	animation: gsc-capa 1s cubic-bezier(.2,1.1,.3,1) var(--d) both, gsc-flotar var(--fl, 7s) cubic-bezier(.45,0,.55,1) calc(var(--d) + 1s) infinite;
}
.psx-gsc .c-serp { --d: .75s; --dx: -140px; --dy: -70px; --giy: 28deg;  --gix: -12deg; }
.psx-gsc .c-ga { --d: .9s;  --dx: 150px;  --dy: -80px; --giy: -28deg; --gix: -12deg; }
.psx-gsc .c-canal { --d: 1.05s; --dx: -170px; --dy: 0px;  --giy: 32deg;  --gix: 0deg; }
.psx-gsc .c-cwv { --d: 1.2s; --dx: -140px; --dy: 90px;  --giy: 26deg;  --gix: 14deg; }
.psx-gsc .c-url { --d: 1.35s; --dx: 30px;  --dy: 140px; --giy: -6deg;  --gix: 22deg; }
.psx-gsc .c-tip { --d: 1.5s; --dx: 160px; --dy: 20px; --giy: -30deg; --gix: 0deg; }

@keyframes gsc-panel {
	0%   { opacity: 0; filter: blur(8px); transform: translate3d(60px, 80px, -520px) rotateY(-14deg) rotateX(18deg); }
	55%  { opacity: 1; filter: blur(0); }
	100% { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes gsc-capa {
	0%   { opacity: 0; filter: blur(8px);
	       transform: translate3d(var(--dx), var(--dy), calc(var(--z) + 340px)) rotateY(var(--giy)) rotateX(var(--gix)); }
	35%  { opacity: 1; }
	70%  { filter: blur(0); }
	100% { opacity: 1; filter: blur(0); transform: translateZ(var(--z)); }
}
@keyframes gsc-halo { from { opacity: 0; } to { opacity: 1; } }


/* ---------- Celular: panel mas angosto, sin menu lateral ---------- */
@media ( max-width: 600px ) {
	.psx-gsc .mundo { --rx: 6deg; --ry: -8deg; }
	.psx-gsc .lienzo { width: 560px; }
	.psx-gsc .gsc { left: 10px; width: 540px; }
	.psx-gsc .g-cuerpo { grid-template-columns: 1fr; }
	.psx-gsc .g-menu, .psx-gsc .g-busca, .psx-gsc .c-cwv, .psx-gsc .c-canal { display: none; }
	.psx-gsc .c-ga { right: -10px; top: -40px; }
	.psx-gsc .c-serp { left: -6px; top: -34px; width: 290px; }
	.psx-gsc .c-tip { left: 360px; top: 230px; }
	.psx-gsc .c-url { left: 150px; bottom: -30px; }
}
@media ( min-width: 601px ) and ( max-width: 1023px ) {
	.psx-gsc .mundo { --rx: 8deg; --ry: -12deg; }
}
@media ( prefers-reduced-motion: reduce ) {
	.psx-gsc *, .psx-gsc .gsc::after { animation: none !important; }
}

/* ---- Ajustes de motion (design-motion-principles) ---- */
/* Reflejo: una pasada cuando el panel se apoya. */
.psx-gsc.en-vista .gsc::after { animation: gsc-brillo 1.1s cubic-bezier(.4,0,.2,1) 1.25s both; }
/* Ritmo de flotar distinto por tarjeta, para que no se muevan al unisono. */
.psx-gsc .c-serp { --fl: 7.4s; } .psx-gsc .c-ga { --fl: 6.6s; } .psx-gsc .c-canal { --fl: 8.2s; }
.psx-gsc .c-cwv { --fl: 7.8s; } .psx-gsc .c-url { --fl: 6.9s; } .psx-gsc .c-tip { --fl: 7.1s; }
.psx-gsc.en-vista.asentado .capa { animation: gsc-flotar var(--fl, 7s) cubic-bezier(.45,0,.55,1) calc(var(--d, 0s) + 1s) infinite; }
/* Mismo retraso que en la entrada: Chrome sigue la misma animacion y, si el
   retraso cambia, cambia la fase y la tarjeta da un saltito. */
.psx-gsc.en-vista.asentado .c-tip { animation-delay: 2.4s; }
/* El aviso nace del punto que senala (esquina inferior derecha), cuando la linea llega. */
.psx-gsc .c-tip { transform-origin: 92% 110%; }
.psx-gsc.en-vista .c-tip { animation: gsc-tip .45s cubic-bezier(.2,1.2,.3,1) 1.6s both, gsc-flotar var(--fl, 7s) cubic-bezier(.45,0,.55,1) 2.4s infinite; }
@keyframes gsc-tip {
	from { opacity: 0; filter: blur(3px); transform: translateZ(var(--z)) scale(.9); }
	to   { opacity: 1; filter: blur(0); transform: translateZ(var(--z)) scale(1); }
}
