/* ==========================================================================
   Juanito — Menú tablet v2 (768–1024px) · WordPress puro, cero Elementor
   Arquitectura Onyx, piel de la casa: blanco pleno, entrada estilo Apple.

   Reglas del juego:
   - Hamburguesa (.jcmt-toggle) y panel (.jcmt-capa) son NUESTROS: viven
     colgados del body, no dentro de ningún widget. Elementor ni se toca —
     su toggle solo se OCULTA en la franja 768–1024 (la única regla que
     lo menciona). El día que Elementor se vaya, esto sigue andando.
   - Fuera de la franja, toggle y capa son display:none: el celular
     conserva su panel Apple y el PC su menú horizontal.
   - El color del toggle sigue al header real: blanco sobre la banda
     negra, tinta cuando el header se pone claro al scrollear (el JS marca
     body.jcmt-clara mirando .elementor-sticky--effects; si ese header ya
     no existe, se queda blanco y punto).
   ========================================================================== */

/* Fuera de la franja NO EXISTEN. El !important no es capricho: un bloque
   viejo del Customizer le pone `display:inline-flex !important` a TODO
   `button` en ≤767 (regla de toques del celular) y sin esto nuestra
   hamburguesa aparecía duplicada en el teléfono. */
.jcmt-toggle,
.jcmt-capa,
.jcmt-velo { display: none !important; }

@media (min-width: 768px) and (max-width: 1024px) {

	/* --- el toggle de Elementor se guarda; el nuestro toma su lugar ---
	   OJO con la aritmética de especificidad: el bloque viejo del Customizer
	   lo posiciona con `body .678c9fa0 .8b3a646×4 {display:block!important}`
	   (5 clases). Para ganarle de verdad hacen falta MÁS de 5 — acá van 6. */
	body .elementor-element-678c9fa0 .elementor-element-8b3a646.elementor-element-8b3a646.elementor-element-8b3a646.elementor-element-8b3a646.elementor-element-8b3a646 {
		display: none !important;
	}

	/* --- el botón "+ CONTACT US" también se guarda en la franja ---
	   Vive encima de la hamburguesa (rect 24,20 vs toggle 6,22): se comía
	   los taps y las 3 líneas quedaban escondidas detrás del texto. En
	   tablet el contacto vive DENTRO del panel (fila .jcmt-contacto). */
	body .elementor-element-678c9fa0 .elementor-element-06c69b4.elementor-element-06c69b4.elementor-element-06c69b4.elementor-element-06c69b4.elementor-element-06c69b4 {
		display: none !important;
	}

	/* --- el logo, centrado DE VERDAD en la franja ---
	   Al esconder CONTACT US el lado izquierdo del flex perdió peso y el
	   logo quedaba 15px corrido a la izquierda (medido, igual en todas las
	   páginas). Absoluto al centro de la banda: clavado en el eje, idéntico
	   en home, login y secciones. Los iconos conservan su derecha. */
	body .elementor-element-678c9fa0 .elementor-element-572cd30.elementor-element-572cd30.elementor-element-572cd30 {
		position: absolute !important;
		left: 50% !important;
		top: 50% !important;
		transform: translate(-50%, -50%) !important;
		margin: 0 !important;
	}
	body .elementor-element-678c9fa0 .elementor-element-6fe9869.elementor-element-6fe9869.elementor-element-6fe9869 {
		margin-left: auto !important;
	}

	/* --- nuestra hamburguesa: mismo lugar (6,22), mismo trazo fino ---
	   (doblada .jcmt-toggle.jcmt-toggle para ganarle al none!important base) */
	.jcmt-toggle.jcmt-toggle {
		display: grid !important;
		place-items: center;
		position: fixed;
		left: 6px;
		top: 18px; /* eje 40: el mismo del logo y los iconos del header */
		width: 44px;
		height: 44px;
		/* Por ENCIMA del header de Elementor (fixed): con menos, el fondo #111
		   de las internas tapaba las 3 líneas y el header se comía los taps. */
		z-index: 2147483600;
		border: 0 !important;
		padding: 0 !important;
		background: transparent !important; /* el kit pinta fondo a todo button */
		box-shadow: none !important;
		cursor: pointer;
		color: #fff;
		-webkit-tap-highlight-color: transparent;
	}
	/* !important: en la home un bloque viejo del Customizer pinta el header con
	   important y el toggle quedaba blanco sobre el sticky blanco al scrollear */
	body.jcmt-clara .jcmt-toggle.jcmt-toggle { color: #161513 !important; }
	.jcmt-toggle svg { width: 22px; height: 22px; display: block; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
	.jcmt-toggle .jcmt-ico-x { display: none; }
	/* La X NO pisa el color: el toggle vive SOBRE el header (el panel arranca
	   en 80px), así que sigue la misma lógica que la hamburguesa — blanca en
	   header oscuro, tinta cuando body.jcmt-clara. (El override tinta fijo
	   la dejaba invisible sobre la banda negra de las internas.) */
	.jcmt-toggle.on .jcmt-ico-x { display: block; }
	.jcmt-toggle.on .jcmt-ico-m { display: none; }

	/* --- la capa: panel GRANDE que baja del header, estilo Onyx/Apple —
	   no es pantalla completa: la página queda visible detrás, tras un velo
	   (pedido de ella 2026-08-01: «grandes pero no de toda la pantalla») --- */
	.jcmt-capa {
		position: fixed;
		top: 80px;
		left: 0;
		right: 0;
		height: min(620px, calc(100vh - 148px));
		height: min(620px, calc(100dvh - 148px));
		z-index: 2147483500; /* sobre el header; bajo el toggle (la X manda) */
		background: #fff;
		color: #161513;
		font-family: Poppins, sans-serif;
		text-align: left;
		overflow: hidden;
		flex-direction: column;
		border-radius: 0 0 18px 18px;
		box-shadow: 0 30px 70px rgba(22, 21, 19, .22);
	}
	.jcmt-capa.jcmt-abierta { display: flex !important; }
	.jcmt-capa.jcmt-anim { animation: jcmtBaja .38s cubic-bezier(.2, .7, .2, 1); }
	/* el velo: atenúa la página de atrás; tocarlo cierra el panel */
	.jcmt-velo.on { display: block !important; position: fixed; inset: 0; top: 80px; z-index: 2147483400; background: rgba(22, 21, 19, .38); animation: jcmtVelo .3s ease; }
	@keyframes jcmtBaja { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
	@keyframes jcmtVelo { from { opacity: 0; } to { opacity: 1; } }
	.jcmt-capa a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

	/* mientras el panel está abierto, la página de atrás no se pasea.
	   .jcmt-consb la pone el JS SOLO si había scrollbar clásica (>0px):
	   conserva su espacio y el logo centrado no da el saltito al abrir
	   (reporte de ella). En táctiles la barra es overlay (0px) y no se
	   reserva nada — con gutter fijo el saltito aparecía al revés. */
	html.jcmt-quieta, html.jcmt-quieta body { overflow: hidden !important; }
	html.jcmt-consb { scrollbar-gutter: stable !important; }

	.jcmt-inner { flex: 1; display: flex; min-height: 0; padding: 26px 34px 0; }

	/* riel izquierdo = el .groups de Onyx (260px, filas quietas de 32) —
	   acá 236px y filas de 48: la tablet es dedo, no mouse */
	.jcmt-riel { width: 236px; flex: none; display: flex; flex-direction: column; overflow: auto; padding-right: 10px; }
	/* Blindados con !important: el kit del tema (post-362) pinta TODO <button>
	   con terracota/Oswald/uppercase y el riel salía como ladrillos naranjas
	   (se vio en pixel el 2026-08-01; el QA por DOM nunca lo detectó). */
	.jcmt-sec.jcmt-sec {
		display: flex !important; align-items: center; gap: 10px;
		min-height: 48px; padding: 0 10px !important;
		border: 0 !important; background: transparent !important;
		box-shadow: none !important; cursor: pointer;
		text-align: left !important; border-radius: 9px !important;
		font: 400 16px/1.2 Poppins, sans-serif !important; color: #161513 !important;
		letter-spacing: 0 !important; text-transform: none !important;
	}
	.jcmt-sec svg { width: 14px; height: 14px; stroke: #9c5b3b; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: translateX(-5px); transition: .16s; margin-left: auto; flex: none; }
	.jcmt-sec.on.on { font-weight: 500 !important; color: #9c5b3b !important; }
	.jcmt-sec.on svg { opacity: 1; transform: none; }
	.jcmt-sec.jcmt-sec:hover { background: #f5f4f2 !important; }
	.jcmt-cuenta { margin-top: auto; border-top: 1px solid #dad4d3; padding-top: 10px; }
	/* con la fila de contacto arriba, la de cuenta va pegada a ella sin duplicar borde */
	.jcmt-contacto + .jcmt-cuenta { margin-top: 0; border-top: 0; padding-top: 0; }
	.jcmt-cuenta a { display: flex; align-items: center; min-height: 48px; padding: 0 10px; font: 400 15px/1.2 Poppins, sans-serif; border-radius: 9px; }
	.jcmt-cuenta a:hover { background: #f5f4f2; }

	/* zona derecha = el .panels de Onyx */
	.jcmt-paneles { flex: 1; min-width: 0; border-left: 1px solid #dad4d3; padding: 6px 0 0 30px; position: relative; }
	.jcmt-pan { display: none; height: 100%; }
	.jcmt-pan.on { display: flex; gap: 26px; }

	.jcmt-subs { width: 212px; flex: none; display: flex; flex-direction: column; }
	.jcmt-k { font: 500 11px/1 Oswald, sans-serif; letter-spacing: 1.4px; text-transform: uppercase; color: #9c5b3b; margin: 8px 0 4px; }
	.jcmt-subs a { display: flex; align-items: center; min-height: 46px; font: 500 15px/1.3 Poppins, sans-serif; border-radius: 9px; padding: 0 8px; margin: 0 -8px; }
	.jcmt-subs a:hover { background: #f5f4f2; color: #9c5b3b; }
	.jcmt-subs a.jcmt-peque { font-weight: 300; color: #6f6a64; }

	/* la tarjeta con foto y llamado */
	.jcmt-card { flex: 1; min-width: 0; align-self: stretch; margin-bottom: 22px; position: relative; border-radius: 16px; overflow: hidden; display: block; }
	.jcmt-ph { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .4s ease; }
	.jcmt-card:hover .jcmt-ph { transform: scale(1.03); }
	.jcmt-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,4,2,0) 40%, rgba(8,4,2,.68)); }
	.jcmt-tx { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 22px; z-index: 2; display: block; }
	.jcmt-k2 { display: block; font: 500 10.5px/1 Oswald, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.82); }
	.jcmt-h3 { display: block; font: 600 30px/1 'Yanone Kaffeesatz', Oswald, sans-serif; text-transform: uppercase; color: #fff; margin: 6px 0 12px; }
	.jcmt-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; background: #f3ece0; color: #161513; font: 500 13px/1 Poppins, sans-serif; border-radius: 11px; }

	/* barra inferior: la marca y la píldora ES|EN de la casa */
	.jcmt-pie { flex: none; border-top: 1px solid #dad4d3; padding: 10px 34px; display: flex; align-items: center; justify-content: space-between; background: #fff; }
	.jcmt-marca { font: 500 11px/1 Oswald, sans-serif; letter-spacing: 1.6px; text-transform: uppercase; color: #6f6a64; }
	.jcmt-lang { display: flex; align-items: center; gap: 9px; }
	.jcmt-lang > span { font: 500 11px/1 Oswald, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: #6b4a3f; }
	.jcmt-lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #dad4d3; font: 500 12.5px/1 Oswald, sans-serif; letter-spacing: 1.2px; color: #161513 !important; }
	/* Con (0,5,1) + !important: las vistas del plugin herramientas llevan
	   body.woocommerce-page (contexto de la página shop) y la regla vieja
	   `body.woocommerce-page a:not(...)` (0,4,1)!important pintaba el chip
	   activo tinta sobre tinta. */
	.jcmt-capa .jcmt-lang a.on.on.on { background: #161513 !important; color: #f3ece0 !important; border-color: #161513 !important; }

	/* la entrada mantequillosa (se re-dispara con .jcmt-anim en cada apertura) */
	.jcmt-anim .jcmt-sec, .jcmt-anim .jcmt-cuenta, .jcmt-anim .jcmt-pie { animation: jcmtIn .44s cubic-bezier(.2,.7,.2,1) backwards; }
	.jcmt-anim .jcmt-sec:nth-child(1) { animation-delay: .03s; }
	.jcmt-anim .jcmt-sec:nth-child(2) { animation-delay: .06s; }
	.jcmt-anim .jcmt-sec:nth-child(3) { animation-delay: .09s; }
	.jcmt-anim .jcmt-sec:nth-child(4) { animation-delay: .12s; }
	.jcmt-anim .jcmt-sec:nth-child(5) { animation-delay: .15s; }
	.jcmt-anim .jcmt-sec:nth-child(6) { animation-delay: .18s; }
	.jcmt-anim .jcmt-cuenta { animation-delay: .21s; }
	.jcmt-anim .jcmt-pie { animation-delay: .24s; }
	.jcmt-pan.on .jcmt-subs { animation: jcmtIn .4s cubic-bezier(.2,.7,.2,1) .05s backwards; }
	.jcmt-pan.on .jcmt-card { animation: jcmtIn .44s cubic-bezier(.2,.7,.2,1) .1s backwards; }

	/* tablet chica: columnas un pelo más angostas */
	@media (max-width: 800px) {
		.jcmt-riel { width: 212px; }
		.jcmt-subs { width: 190px; }
	}
}

@keyframes jcmtIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.jcmt-anim .jcmt-sec, .jcmt-anim .jcmt-cuenta, .jcmt-anim .jcmt-pie,
	.jcmt-capa.jcmt-anim, .jcmt-velo.on,
	.jcmt-pan.on .jcmt-subs, .jcmt-pan.on .jcmt-card, .jcmt-ph { animation: none !important; transition: none !important; }
}
