@charset "utf-8";
/* ==========================================================================
   Adaptación a móviles y tabletas – Montes del Guadalhorce
   Se carga DESPUÉS de style.css. En escritorio (> 1060px) no cambia nada.
   ========================================================================== */

img, iframe { max-width: 100%; }

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

	*, *::before, *::after { box-sizing: border-box; }

	html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

	body {
		background-image: none;
		overflow-x: hidden;
	}

	/* --- Estructura --- */
	div.content, div.header, div.page {
		width: 100%;
		max-width: 100%;
	}

	div.fondo { height: 200px; }

	div.header {
		height: 200px;
		max-height: none;
		background-size: cover;
		background-position: center center;
	}
	/* Botella decorativa: en pantallas estrechas tapa el contenido */
	div.header img { display: none; }

	div.page {
		padding: 0 15px;
		min-height: 0;
	}

	/* --- Menú: de columna lateral a botones horizontales --- */
	ul#menu_principal {
		float: none;
		width: 100%;
		min-height: 0;
		margin: 12px 0 0;
		padding: 0;
		background-image: none;
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
	}
	ul#menu_principal li {
		float: none;
		width: auto;
		padding: 0;
		flex: 1 1 auto;
	}
	ul#menu_principal li a {
		float: none;
		width: auto;
		text-align: center;
		padding: 12px 10px;
		border: 1px solid #e0d7a0;
		border-radius: 4px;
		background: #faf7e6;
		letter-spacing: 0.03em;
	}

	/* --- Contenido --- */
	div#contenidos {
		float: none;
		clear: both;
		width: 100%;
		min-height: 0;
		padding: 20px 0 0;
		margin: 0 0 30px;
		display: flow-root; /* contiene los elementos flotantes (formulario, recetas...) */
	}
	div.content::after, div.page::after { content: ""; display: table; clear: both; }
	form#frm_contactar { float: none; }
	div#contenidos p,
	div.contenido_receta,
	div.productos,
	div.producto,
	form#frm_contactar,
	.banner_galery {
		width: 100%;
	}
	div#contenidos p { text-align: left; }
	div#contenidos h1, h2.comollegar { font-size: 28px; }
	div#contenidos img { height: auto; }

	/* Galería de "Nuestra cooperativa" */
	.banner_galery { height: auto; background-size: 100% 20px; }
	#slideshow { height: auto; }
	#slideshow a, #slideshow A { position: static; width: 100%; height: auto; }
	div#jquery-image-zoom a img { width: 100% !important; height: auto !important; }

	/* Mapa de "Cómo llegar" */
	div#contenidos iframe { width: 100%; height: 300px; }

	/* --- Productos --- */
	div.productos div.imagen_producto { margin: 15px 15px 15px 0; }
	div.productos div.datos_producto {
		width: calc(100% - 230px);
		margin-left: 0;
	}

	/* --- Recetas --- */
	div.contenidos_recetas h2 { width: 100%; padding: 10px 10px 12px 70px !important; }
	div.contenido_receta ul.ingredientes { width: auto; padding-left: 20px; }

	/* --- Formulario de contacto --- */
	form#frm_contactar label,
	form#frm_contactar input,
	form#frm_contactar textarea {
		float: none;
		display: block;
		width: 100%;
		margin: 4px 0;
	}
	form#frm_contactar label {
		text-align: left;
		padding: 8px 12px;
		margin-top: 12px;
	}
	form#frm_contactar input,
	form#frm_contactar textarea {
		padding: 12px;
		font-size: 16px; /* evita el zoom automático en iOS */
	}
	form#frm_contactar textarea { min-height: 140px; resize: vertical; }
	form#frm_contactar input[name="enviar"] {
		float: none;
		width: 100%;
		margin-top: 12px;
	}
	form#frm_contactar .g-recaptcha { margin: 12px 0; }

	/* --- Pie: deja de ser fijo para no tapar contenido --- */
	div.footer {
		position: static;
		padding: 12px 10px;
		line-height: 2.4;
	}
	div.footer a span { padding: 6px 10px; }
	a.social { margin: 0 4px; }

	/* --- Portada --- */
	div#selector_idioma {
		width: 220px;
		margin-left: -110px;
	}
	div#selector_idioma span { width: 100%; }
}

/* Teléfonos */
@media screen and (max-width: 600px) {
	div.fondo { height: 150px; }
	div.header { height: 150px; }
	div#contenidos h1, h2.comollegar { font-size: 24px; }

	ul#menu_principal li { flex: 1 1 45%; }

	/* Productos: imagen arriba, datos debajo */
	div.productos div.imagen_producto,
	div.productos div.datos_producto {
		float: none;
		width: 100%;
		margin: 10px 0;
	}
	div.productos div.imagen_producto { height: 240px; background-size: contain; }
	div.producto { padding-bottom: 15px; border-bottom: 1px dashed #e0d7a0; overflow: hidden; }

	/* Recetas: foto a ancho completo */
	div.contenido_receta div.imagen {
		float: none;
		width: 100%;
		height: 220px;
		margin-bottom: 10px;
	}
	div.contenido_receta h3.ingredientes { width: 100%; }

	div#contenidos iframe { height: 250px; }

	/* reCAPTCHA mide 304px: se reduce en pantallas de 320px */
	form#frm_contactar .g-recaptcha { transform: scale(0.9); transform-origin: 0 0; }
}
