/* ==========================================================================
   Pattern: Footer — maquetación alineada con Figma (node 4071:4367)
   ========================================================================== */

/*
 * Estructura Figma (bottom):
 * - Fila: [ contacto flex-1 ] [ bloque derecho flex-1 = nav + sello con gap 24 ]
 * - Bloque nav (4071:4266): columna flex, justify-between → menú arriba, legal/abajo
 * - Columna sello (4071:4255): columna flex, justify-between, items-center
 */

/* Anula estilos globales de enlace (accent / subrayado) del theme.json */
.mwm-footer__wrapper a:where(:not(.wp-element-button)),
.mwm-footer__wrapper a:where(:not(.wp-element-button)):visited,
.mwm-footer__wrapper a:where(:not(.wp-element-button)):hover,
.mwm-footer__wrapper a:where(:not(.wp-element-button)):focus {
	color: inherit;
	text-decoration: none;
}

/* Shell del template part: flex para que .mwm-footer__wrapper use flex: 1 */
.wp-block-template-part.mwm-footer {
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
	overflow-x: clip;
}

/* Contenedor alignfull + fondo + bloques logo / bottom (.mwm-footer__wrapper) */
.mwm-footer__wrapper {
	display: flex !important;
	flex-direction: column;
	justify-content: space-between;
	row-gap: 2rem;
	overflow-x: clip;
	overflow-y: visible;
	box-sizing: border-box;
}

.mwm-footer__wrapper.alignfull {
	max-width: none !important;
	width: 100% !important;
}

/* --------------------------------------------------------------------------
   Anula márgenes verticales del layout “flow” del editor/tema en todo el footer
   (sustituidos por gap en cada bloque flex).
   -------------------------------------------------------------------------- */
.mwm-footer .is-layout-flow > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* Layout interior: el reveal fuerza altura mínima en .mwm-footer; el wrapper ocupa el alto */
.mwm-footer > .mwm-footer__wrapper {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
}

/* ---- Logo (636×329 máx. en diseño) ---- */

.footer-logo {
	flex: 1 1 auto !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: stretch !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	overflow: visible;
	box-sizing: border-box;
}

.mwm-footer .footer-logo .wp-block-image.footer-logo__img {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 636px !important;
	margin-inline: auto !important;
}

.footer-logo__img {
	display: block;
	margin: 0 !important;
	line-height: 0;
	width: 100% !important;
	max-width: 636px !important;
	margin-inline: auto !important;
}

.footer-logo__img img {
	box-sizing: border-box;
	display: block;
	width: 100% !important;
	max-width: 636px !important;
	height: auto !important;
	margin-inline: auto;
}

.footer-logo__img a {
	color: inherit;
	text-decoration: none;
	display: block;
	line-height: 0;
	width: 100%;
}

.footer-logo__img svg {
	width: 100%;
	height: auto;
	display: block;
}

.wp-block-nerjavillas-theme-image {
	margin: 0;
}

.wp-block-nerjavillas-theme-image img {
	width: 100%;
	height: auto;
	display: block;
}

/* ---- Bottom: dos mitades iguales (4071:4074) ---- */

.footer-bottom {
	flex-shrink: 0;
	max-width: 100% !important;
	margin: 0 !important;
	width: 100% !important;
	min-width: 0 !important;
	box-sizing: border-box;
}

.footer-bottom .footer-bottom-inner {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	align-items: start;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
}

/* Mitad derecha: nav flexible + columna sello ancho contenido (4071:4092) */
.footer-meta {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 24px;
	align-items: stretch;
	align-self: stretch;
	min-width: 0;
	min-height: 0;
}

.footer-bottom-inner > .footer-col,
.footer-meta > .footer-col {
	min-width: 0;
}

.footer-col-contact {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	min-width: 0;
	width: 100%;
}

/*
 * Desktop: fila para hijos directos del grupo (p. ej. varios bloques en el editor).
 * Los hijos reparten espacio horizontal; .footer-nav-wrapper sigue siendo columna dentro.
 */
.footer-col-nav {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	align-content: flex-start;
	align-self: stretch;
	gap: 24px;
	min-width: 0 !important;
	min-height: 100%;
	height: 100%;
}

.footer-col-nav > * {
	flex: 1 1 auto;
	min-width: 0;
}

/* 4071:4266 — nav principal arriba, bloque legal/copyright abajo */
.footer-nav-wrapper {
	box-sizing: border-box;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	min-height: 100%;
	height: 100%;
	gap: 24px;
}

/* 4071:4364 — Menu Links: gap vertical 12px entre fila legal y textos */
.footer-nav-meta {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	min-width: 0;
}

/* ---- Columna contacto (4071:4076): gap 12px entre filas ---- */

.footer-contact {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.footer-contact-item {
	padding-block: 8px;
	box-sizing: border-box;
}

.footer-contact-link {
	display: inline-flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
}

.footer-contact-item:first-child .footer-contact-link {
	align-items: flex-start;
}

.footer-contact > .footer-contact-item:first-child {
	padding-block-start: 0;
	padding-block-end: 8px;
}

.footer-contact-item .has-normal-font-size,
.footer-contact-item p {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
}

.footer-social.wp-block-social-links {
	gap: 8px !important;
	padding: 0 !important;
	margin: 0 !important;
}

.footer-social .wp-social-link {
	margin: 0 !important;
	padding: 0 !important;
}

.wp-block-social-links .wp-social-link span:not(.screen-reader-text) {
	margin: 0;
}

.footer-social .wp-block-social-link-anchor {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	line-height: 0;
	text-decoration: none;
}

.footer-contact .wp-block-nerjavillas-contact-item {
	display: flex;
}

.company-info__social {
	margin-top: 8px !important;
	gap: 8px !important;
}

.company-info__social .wp-social-link {
	background: none !important;
}

.company-info__social .wp-social-link svg {
	width: 20px;
	height: 20px;
}

/* ---- Navegación ---- */

.footer-nav-main,
.footer-nav-legal {
	padding: 0 !important;
}

.footer-nav-main .wp-block-navigation__responsive-container,
.footer-nav-legal .wp-block-navigation__responsive-container {
	display: block !important;
	position: static !important;
}

.footer-nav-main .wp-block-navigation__responsive-container-open,
.footer-nav-legal .wp-block-navigation__responsive-container-open,
.footer-nav-main .wp-block-navigation__responsive-close,
.footer-nav-legal .wp-block-navigation__responsive-close {
	display: none !important;
}

/* 4071:4093 — fila principal; 4071:4099 — legal h-36 */
.footer-nav-main .wp-block-navigation__container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 24px;
	min-height: 36px;
}

.footer-nav-main .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	padding-block: 8px;
	border-radius: 6px;
	color: var(--wp--preset--color--tertiary);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	text-decoration: none;
	white-space: nowrap;
}

.footer-nav-legal .wp-block-navigation__container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 24px;
	min-height: 36px;
}

.footer-nav-legal .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	padding-block: 8px;
	border-radius: 6px;
	color: var(--wp--preset--color--secondary);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	text-decoration: none;
	white-space: nowrap;
}

.footer-copyright,
.footer-credit {
	margin: 0 !important;
	padding-block: 8px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	color: var(--wp--preset--color--secondary);
}

.footer-credit a {
	display: inline-block;
}

/* ---- Columna sello + registro (4071:4255) ---- */

.footer-col-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	align-self: stretch;
	min-width: 0;
}

.footer-badge-wrapper {
	box-sizing: border-box;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	max-width: 120px;
	min-width: 0;
	min-height: 100%;
	height: 100%;
	gap: 16px;
}

.footer-badge__img {
	width: 100%;
	max-width: 120px !important;
	margin: 0 !important;
}

.footer-badge__img img {
	width: 100%;
	max-width: 120px;
	height: auto;
	display: block;
}

.footer-badge-top {
	gap: 5px !important;
}

.footer-badge {
	gap: 12px !important;
}

.footer-badge p,
.footer-beach-tag p {
	margin: 0 !important;
}

/* 4071:4365 — dos líneas, 16px, ancho mínimo contenido centrado bajo sello */
.footer-registro {
	color: var(--wp--preset--color--tertiary);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	margin: 0 !important;
	padding: 0;
	width: min(100%, max-content);
	max-width: 100%;
	box-sizing: border-box;
	text-align: left;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	align-self: center;
	gap: 0;
}

.footer-registro__label,
.footer-registro__code {
	display: block;
	width: 100%;
	color: inherit;
}

/* ---- Editor ---- */

.editor-styles-wrapper .mwm-footer,
.editor-styles-wrapper .mwm-footer__wrapper {
	position: relative;
	height: auto;
	min-height: auto;
}

.editor-styles-wrapper .mwm-footer::before {
	display: none;
}

/* ---- Mobile ---- */

@media (max-width: 782px) {
	.mwm-footer {
		position: relative;
		height: auto;
		min-height: 100vh;
	}

	.footer-bottom .footer-bottom-inner {
		grid-template-columns: 1fr;
		align-items: start;
		gap: 40px !important;
	}

	.footer-bottom-inner > .footer-col,
	.footer-meta > .footer-col {
		justify-content: flex-start !important;
		width: 100%;
		max-width: 100%;
	}

	.footer-meta {
		grid-template-columns: 1fr;
		align-items: start;
		min-height: 0;
	}

	.footer-col-nav {
		flex-direction: column !important;
		align-items: stretch;
		align-content: stretch;
		gap: 24px;
		min-height: 0;
		height: auto;
	}

	.footer-col-nav > * {
		flex: none;
		min-width: 0;
		width: 100%;
	}

	.footer-col-badge {
		max-width: 100% !important;
	}

	.footer-badge-wrapper {
		min-height: 0;
		height: auto !important;
		justify-content: flex-start !important;
		gap: 24px !important;
	}

	.footer-nav-wrapper {
		min-height: 0 !important;
		height: auto !important;
		justify-content: flex-start !important;
		gap: 24px !important;
	}

	.footer-nav-main .wp-block-navigation__container,
	.footer-nav-legal .wp-block-navigation__container {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		min-height: 0;
	}
}
