/* portada_a_movil.css - Adaptacion a moviles de la portada A (index.html)
   Solo actua en pantallas de menos de 860 px. En ordenador la pagina se ve exactamente igual que antes.
   FrontPage 2003 ignora este archivo (no lo muestra en la vista Diseno), asi que no altera la edicion.
   Orden en movil: cabecera, foto, banners (inmobiliaria y COOVIHAL), Noticias y Novedades, menus (izquierda), servicios (derecha). */

/* Menu de saltos: oculto en ordenador */
.menu-movil, .subir-movil { display: none; }

@media screen and (max-width: 860px) {

	html { scroll-behavior: smooth; }
	#cuerpoA td[id^="sec-"], #tdNotT, #tdNovT, #tdIzq1, #menuMovil { scroll-margin-top: 8px; }

	/* ---- Menu de saltos (botones de colores) ---- */
	.menu-movil { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 4px 0; padding: 0 4px; }
	.menu-movil a {
		flex: 1 1 42%; box-sizing: border-box; text-align: center; padding: 10px 6px;
		font: bold 15px Arial, Helvetica, sans-serif; color: #FFFFFF; text-decoration: none;
		border-radius: 8px; border: 1px solid rgba(0,0,0,0.35); box-shadow: 0 2px 3px rgba(0,0,0,0.25);
	}
	.menu-movil a:active { transform: translateY(1px); box-shadow: none; }
	.menu-movil .mm1 { background: #C62828; }
	.menu-movil .mm2 { background: #1565C0; }
	.menu-movil .mm3 { background: #2E7D32; }
	.menu-movil .mm4 { background: #6A1B9A; }
	.menu-movil .mm5 { background: #00838F; }
	.menu-movil .mm6 { background: #AD1457; }
	.menu-movil .mm7 { background: #EF6C00; }
	.menu-movil .mm8 { background: #5D4037; }
	.menu-movil .mm9 { background: #37474F; }
	.menu-movil .mm10 { background: #212121; }
	/* boton flotante para volver al menu */
	.subir-movil {
		display: block; position: fixed; right: 10px; bottom: 10px; z-index: 50;
		background: #808000; color: #FFFFFF; font: bold 14px Arial, Helvetica, sans-serif;
		padding: 9px 14px; border-radius: 20px; text-decoration: none; box-shadow: 0 2px 5px rgba(0,0,0,0.4);
	}
	/* quita el hueco vacio bajo el buscador */
	#tdHero table[width="372"] > tbody > tr:last-child { display: none; }
	#tdHero form br:last-of-type { display: none; }
	#cuerpoA #tdBan br { display: none; }
	#cuerpoA #tdBan p { margin: 2px 0; }


	body { margin: 0; padding: 6px; }
	img { max-width: 100%; height: auto; }
	table { max-width: 100%; }
	td { overflow-wrap: anywhere; }

	/* ---- Cabecera: logo y fecha, centrados y sin columnas vacias ---- */
	#tCab, #tCab > tbody, #tCab > tbody > tr, #tCab > tbody > tr > td,
	#AutoNumber2, #AutoNumber2 > tbody, #AutoNumber2 > tbody > tr, #AutoNumber2 > tbody > tr > td { display: block; width: auto !important; height: auto !important; }
	#tCab > tbody > tr:first-child > td:nth-child(n+2) { display: none; }
	#tCab p { text-align: center !important; }
	#AutoNumber2 > tbody > tr:first-child, #AutoNumber2 > tbody > tr:last-child { display: none; }
	#AutoNumber2 > tbody > tr > td[width="10%"] { display: none; }
	#AutoNumber2 td { font-size: 15px; }

	/* ---- Cuerpo: todas las celdas pasan a una sola columna y se ordenan ---- */
	#cuerpoA { display: flex; flex-direction: column; }
	#cuerpoA > div, #AutoNumber1, #AutoNumber1 > tbody, #AutoNumber1 > tbody > tr,
	#AutoNumber3, #AutoNumber3 > tbody, #AutoNumber3 > tbody > tr { display: contents; }
	#AutoNumber1 > tbody > tr > td, #AutoNumber3 > tbody > tr > td {
		display: block; box-sizing: border-box; width: 100% !important; height: auto !important;
		min-width: 0; order: 20; padding: 6px 0; text-align: center;
	}
	#cuerpoA #tdHero { order: 1; }
	#cuerpoA #tdCen3 { order: 3; }
	#cuerpoA #tdIzq1 { order: 4; }
	#cuerpoA #tdIzq3 { order: 5; }
	#cuerpoA #tdDer1 { order: 6; }
	#cuerpoA #tdDer3 { order: 7; }
	#cuerpoA #tdBan  { order: 2; }
	#cuerpoA #tdVac1, #cuerpoA #tdVac2 { display: none !important; }

	/* tablas internas: ancho completo en lugar de 205, 210 o 372 px */
	#cuerpoA table { width: 100% !important; height: auto !important; }
	#cuerpoA td { height: auto !important; font-size: 15px; }
	#cuerpoA td[width="372"], #cuerpoA td[width="205"], #cuerpoA td[width="210"] { width: auto !important; }

	/* ---- Noticias y Novedades: una debajo de otra, cada titulo con su lista ---- */
	#tNews { display: flex; flex-direction: column; }
	#tNews > tbody, #tNews > tbody > tr { display: contents; }
	#tNews > tbody > tr > td { display: block; box-sizing: border-box; width: 100% !important; height: auto !important; text-align: left; }
	#tNews > tbody > tr > #tdNotT { order: 1; } #tNews > tbody > tr > #tdNot { order: 2; } #tNews > tbody > tr > #tdNovT { order: 3; margin-top: 12px; } #tNews > tbody > tr > #tdNov { order: 4; }

	/* ---- Banners y videos ---- */
	#cuerpoA #tdBan img { display: block; margin: 8px auto; }
	/* primero el banner de la inmobiliaria (marbella.com), despues COOVIHAL */
	#cuerpoA #tdBan p, #cuerpoA #tdBan i, #cuerpoA #tdBan font { display: flex; flex-direction: column; }
	#cuerpoA #tdBan a[href*="marbella"] { order: 1; }
	#cuerpoA #tdBan a[href*="alharilla"] { order: 2; }
}
