/*
Theme Name: Aquapura
Theme URI: https://aquapura.com.sv
Description: Tema de bloques a medida para Aquapura S.A. de C.V. Sin page builder, sin dependencias externas.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aquapura
*/

/* La mayoría de estilos vive en theme.json. Aquí solo lo que theme.json no cubre. */

/* Marca de año en el hero: número grande con etiqueta pequeña arriba */
.aq-est {
	line-height: 1;
	letter-spacing: 0.35em;
}

/* En pantallas angostas la grilla de productos baja a 2 columnas: con el
   mínimo de 11rem del layout quedaría una sola y la página se hace eterna */
@media (max-width: 599px) {
	.aq-grid-productos {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* Grid de presentaciones: la imagen manda, el texto es etiqueta */
.aq-producto img {
	aspect-ratio: 3 / 4;
	object-fit: contain;
}

/* Etiquetas de producto en azul y negrita, como el sitio original */
.aq-producto figcaption {
	margin-top: 0.75rem;
	color: var(--wp--preset--color--azul);
	font-weight: 600;
}

/* Marca de agua decorativa (onda) en secciones blancas, como el original */
.aq-onda {
	background-image: url(assets/img/fondo-onda.png);
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

/* Sección "Únete a nuestra comunidad": la foto de la izquierda llena su columna */
.aq-unete-foto figure {
	margin: 0;
	height: 100%;
}

.aq-unete-foto img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Separador decorativo de onda */
.aq-separador img {
	width: 100%;
	height: auto;
	display: block;
}

/* Enlaces dentro de párrafos sobre fondos azules: heredan el blanco del texto
   (el azul global de enlaces no contrasta). Solo párrafos: no toca botones. */
.has-azul-background-color p a,
.has-azul-profundo-background-color p a {
	color: inherit;
}

/* Enlaces del footer: heredan el blanco del pie (el azul global no contrasta
   sobre azul profundo) y sin subrayado hasta el hover */
.aq-footer a {
	color: inherit;
	text-decoration: none;
}

.aq-footer a:hover,
.aq-footer a:focus {
	text-decoration: underline;
}

/* ===== Efectos (paridad con el sitio original en Elementor) ===== */

/* Video de fondo del hero: efectos.js lo inyecta sobre la imagen en pantallas
   grandes y aparece con un fundido cuando ya puede reproducirse */
.aq-hero-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
	opacity: 0;
	transition: opacity 0.8s ease;
}

.aq-hero-video--lista {
	opacity: 1;
}


/* Aparición al hacer scroll: efectos.js marca .aq-reveal y agrega .aq-visible.
   Sin JS nada se oculta, porque la clase la pone el propio script. */
.aq-reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.6s ease, transform 0.6s ease;
	transition-delay: var(--aq-delay, 0s);
}

.aq-reveal.aq-visible {
	opacity: 1;
	transform: none;
}

/* Productos: sombra al pie de la botella y elevación al pasar el cursor,
   como en el carrusel del sitio original */
.aq-producto img {
	transition: transform 0.3s ease;
	filter: drop-shadow(0 16px 9px rgba(2, 26, 48, 0.14));
}

.aq-producto:hover img,
.aq-producto:focus-within img {
	transform: translateY(-10px);
}

/* ===== Carrusel de presentaciones (paridad con el slick del original:
   5/4/3/2/1 visibles según ancho, flechas ‹ › que agrega efectos.js) ===== */
.aq-carrusel-caja {
	position: relative;
}

.aq-carrusel {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.aq-carrusel::-webkit-scrollbar {
	display: none;
}

.aq-carrusel > .wp-block-image {
	flex: 0 0 20%;
	margin: 0;
	padding: 0 0.75rem;
	box-sizing: border-box;
	scroll-snap-align: start;
}

@media (max-width: 1199px) {
	.aq-carrusel > .wp-block-image {
		flex-basis: 25%;
	}
}

@media (max-width: 1023px) {
	.aq-carrusel > .wp-block-image {
		flex-basis: 33.333%;
	}
}

@media (max-width: 767px) {
	.aq-carrusel > .wp-block-image {
		flex-basis: 50%;
	}
}

@media (max-width: 479px) {
	.aq-carrusel > .wp-block-image {
		flex-basis: 100%;
	}
}

.aq-carrusel-flecha {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	z-index: 5;
	border: 0;
	background: none;
	color: var(--wp--preset--color--tinta);
	font-size: 2.75rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.25rem;
}

.aq-carrusel-flecha--prev {
	left: -20px;
}

.aq-carrusel-flecha--next {
	right: -20px;
}

@media (max-width: 767px) {
	.aq-carrusel-flecha--prev {
		left: -6px;
	}

	.aq-carrusel-flecha--next {
		right: -6px;
	}
}

/* ===== Tarjetas de Instagram en "Únete a nuestra comunidad": imagen con
   overlay y pastilla "aquapura.sv" al hover, como el original ===== */
.aq-insta {
	margin: 0;
	border-radius: 12px;
	overflow: hidden;
}

.aq-insta a {
	display: block;
	position: relative;
}

.aq-insta img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.aq-insta:hover img,
.aq-insta a:focus-visible img {
	transform: scale(1.06);
}

.aq-insta a::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(6, 46, 96, 0);
	transition: background 0.3s ease;
}

.aq-insta:hover a::before,
.aq-insta a:focus-visible::before {
	background: rgba(6, 46, 96, 0.35);
}

.aq-insta a::after {
	content: "aquapura.sv";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) translateY(8px);
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--azul-profundo);
	font-weight: 600;
	font-size: 0.9rem;
	padding: 0.5rem 1.1rem;
	border-radius: 999px;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.aq-insta:hover a::after,
.aq-insta a:focus-visible::after {
	opacity: 1;
	transform: translate(-50%, -50%);
}

@media (max-width: 599px) {
	.aq-insta-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* Botones: encogimiento sutil (efecto "shrink" del original) */
.wp-block-button__link {
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	transform: scale(0.96);
}

/* Estadísticas: fondo que entra desde la izquierda (hover-from-left del original) */
.aq-stat {
	position: relative;
	overflow: hidden;
}

.aq-stat::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.1);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.35s ease;
	z-index: 2;
	pointer-events: none;
}

.aq-stat:hover::before {
	transform: scaleX(1);
}

/* ===== Formulario "Escríbenos" (shortcode [aquapura_form]) ===== */
.aq-form p {
	margin: 0 0 0.75rem;
}

.aq-form input[type="email"],
.aq-form textarea {
	box-sizing: border-box;
	width: 100%;
	border: 1px solid #c6ccd2;
	border-radius: 2px;
	padding: 0.6rem 0.75rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--tinta);
}

.aq-form-fila {
	display: flex;
	align-items: stretch;
}

.aq-form-fila textarea {
	flex: 1;
	border-right: 0;
	border-radius: 2px 0 0 2px;
	resize: vertical;
	min-height: 2.9rem;
}

.aq-form-fila button {
	background: var(--wp--preset--color--tinta);
	color: var(--wp--preset--color--blanco);
	border: 0;
	border-radius: 0 2px 2px 0;
	padding: 0 1.25rem;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.aq-form-fila button:hover,
.aq-form-fila button:focus-visible {
	background: var(--wp--preset--color--azul);
}

/* Versión completa (página Contáctenos): etiquetas visibles, campos con solo
   línea inferior y botón azul a lo ancho, como el original */
.aq-form--completa .aq-campo {
	margin-bottom: 1.25rem;
}

.aq-form--completa label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 0.25rem;
}

.aq-form--completa input[type="text"],
.aq-form--completa input[type="tel"],
.aq-form--completa input[type="email"],
.aq-form--completa textarea {
	box-sizing: border-box;
	width: 100%;
	border: 0;
	border-bottom: 1px solid #c6ccd2;
	border-radius: 0;
	padding: 0.4rem 0;
	background: transparent;
	font: inherit;
	color: var(--wp--preset--color--tinta);
}

.aq-form--completa textarea {
	resize: vertical;
}

.aq-form-enviar {
	box-sizing: border-box;
	width: 100%;
	background: var(--wp--preset--color--azul);
	color: var(--wp--preset--color--blanco);
	border: 0;
	border-radius: 2px;
	padding: 0.8rem 1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.aq-form-enviar:hover,
.aq-form-enviar:focus-visible {
	background: var(--wp--preset--color--azul-profundo);
}

/* Mapa de Contáctenos */
.aq-mapa {
	margin-top: var(--wp--preset--spacing--60);
}

.aq-mapa iframe {
	display: block;
	width: 100%;
	height: 420px;
	border: 0;
	border-radius: 10px;
}

/* Honeypot fuera de pantalla; los bots lo rellenan, las personas no lo ven */
.aq-form-miel {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.aq-form-aviso--ok {
	color: #0a7d33;
	font-weight: 600;
}

.aq-form-aviso--error {
	color: #b3261e;
	font-weight: 600;
}

/* Por si el core no la imprime en el front: etiquetas solo para lectores */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Foco visible en todo el sitio: accesibilidad mínima no negociable */
:where(a, button, input, textarea, select):focus-visible {
	outline: 3px solid var(--wp--preset--color--celeste);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
