/* =========================================================================
   Header desktop — Finca del Gallero
   Una sola fila, ancho completo: logo + menú + buscador + botón de contacto.
   Marca: navy #010A28 + rojo #FF0000. Sustituye al header portado de Gabic.
   ========================================================================= */

/* --- Header fijo con auto-ocultar al hacer scroll --- */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	transition: transform .3s ease;
	will-change: transform;
}
/* Oculto: se desliza hacia arriba (JS alterna esta clase) */
.site-header.fdg-hidden {
	transform: translateY(-100%);
}
/* Compensa la barra de administrador de WordPress cuando hay sesión */
body.admin-bar .site-header {
	top: 32px;
}
@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}
/* El JS añade el padding-top exacto al contenido; este valor evita el salto
   inicial mientras el JS calcula la altura real. */
.site {
	padding-top: 90px;
}

#header-desktop.site-header {
	display: block;
	width: 100%;
	background: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.fdg-header {
	width: 100%;
	background: #fff;
}

.fdg-header__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	width: 100%;
	min-height: 90px;
	box-sizing: border-box;
	padding-left: 40px;  /* aire a la izquierda del logo */
	padding-right: 0;    /* el botón de contacto va pegado al borde derecho */
}

/* --- Logo --- */
.fdg-header__logo {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	align-items: center;
}

/* Grupo central: menú + buscador, centrado en el header */
.fdg-header__center {
	flex: 0 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	min-width: 0;
}
.fdg-header__logo img,
.fdg-header__logo .custom-logo {
	display: block;
	width: 300px;        /* tamaño objetivo del logo */
	max-width: 100%;     /* nunca excede su columna → nunca se solapa con el menú */
	height: auto;
}

/* --- Menú principal --- */
.fdg-nav {
	flex: 0 0 auto;
}
.fdg-nav__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 26px;
}
.fdg-nav__menu li {
	margin: 0;
	position: relative;
}
.fdg-nav__menu a {
	display: block;
	text-decoration: none;
	color: #0a1440;
	font-weight: 600;
	font-size: 16px;
	line-height: 1;
	padding: 10px 0;
	white-space: nowrap;
	transition: color .15s ease;
}
.fdg-nav__menu a:hover,
.fdg-nav__menu .current-menu-item > a,
.fdg-nav__menu .current-menu-parent > a,
.fdg-nav__menu .current_page_item > a {
	color: #FF0000;
}
/* submenús */
.fdg-nav__menu ul.sub-menu {
	list-style: none;
	margin: 0;
	padding: 10px 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	background: #010A28;
	border-top: 3px solid #FF0000;
	box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: .18s ease;
	z-index: 60;
}
.fdg-nav__menu li:hover > ul.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.fdg-nav__menu ul.sub-menu a {
	color: #fff;
	font-weight: 500;
	font-size: 14px;
	padding: 8px 18px;
}
.fdg-nav__menu ul.sub-menu a:hover {
	color: #FF0000;
}

/* --- Buscador (pill + resultados en vivo) --- */
.fdg-search {
	position: relative;
	flex: 0 1 440px;
	width: 440px;
	max-width: 100%;
	min-width: 0;
}
.fdg-search__form {
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #cfcfcf;
	border-radius: 40px;
	padding: 0 6px 0 22px;
	height: 48px;
}
.fdg-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font-size: 15px;
	color: #333;
	height: 100%;
}
.fdg-search__input::placeholder {
	color: #9a9a9a;
}
.fdg-search__btn {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #010A28;
	cursor: pointer;
}
.fdg-search__btn:hover {
	color: #FF0000;
}

/* Desplegable de resultados */
.fdg-search__results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 14px;
	box-shadow: 0 16px 34px rgba(0, 0, 0, .16);
	max-height: 440px;
	overflow-y: auto;
	z-index: 90;
	padding: 6px;
}
.fdg-search__results[hidden] {
	display: none;
}
.fdg-sr-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 10px;
	text-decoration: none;
	color: #0a1440;
}
.fdg-sr-item + .fdg-sr-item {
	border-top: 1px solid #f1f1f4;
}
.fdg-sr-item:hover {
	background: #f4f6fb;
}
.fdg-sr-item__img {
	width: 46px;
	height: 46px;
	flex: 0 0 46px;
	object-fit: cover;
	border-radius: 8px;
	background: #f0f0f0;
}
.fdg-sr-item__name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
}
.fdg-sr-item__price {
	font-size: 13px;
	font-weight: 700;
	color: #FF0000;
	margin-top: 2px;
}
.fdg-sr-msg {
	padding: 14px 16px;
	font-size: 14px;
	color: #666;
}
.fdg-sr-all {
	display: block;
	text-align: center;
	padding: 10px;
	margin-top: 4px;
	border-top: 1px solid #eee;
	font-size: 13px;
	font-weight: 700;
	color: #010A28;
	text-decoration: none;
}
.fdg-sr-all:hover {
	color: #FF0000;
}

/* --- Botón de contacto + panel desplegable --- */
.fdg-contact {
	flex: 1 1 0;
	min-width: 0;
	position: relative;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: flex-end; /* botón pegado a la derecha del bloque */
}
.fdg-contact__btn {
	background: #010A28;
	border: 0;
	border-radius: 24px 0 0 24px; /* redondeado solo a la izquierda, pegado al borde derecho */
	width: 104px;
	height: 90px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: filter .2s ease;
}
.fdg-contact__btn:hover {
	filter: brightness(1.18);
}
.fdg-contact__btn img {
	width: 46px;
	height: auto;
	object-fit: contain;
}
.fdg-contact__panel {
	position: absolute;
	top: 100%;
	right: 0;
	width: 340px;
	max-width: 92vw;
	background: #010A28;
	border-top: 4px solid #FF0000;
	color: #fff;
	padding: 18px 24px 26px;
	box-shadow: 0 16px 30px rgba(0, 0, 0, .28);
	z-index: 80;
}
.fdg-contact__panel[hidden] {
	display: none;
}
.fdg-contact__panel::after {
	content: "\203A";
	position: absolute;
	right: 12px;
	bottom: 6px;
	color: rgba(255, 255, 255, .5);
	font-size: 18px;
	line-height: 1;
}
.fdg-contact__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.fdg-contact__list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	line-height: 1.45;
	border-bottom: 1px solid rgba(255, 255, 255, .22);
	padding: 11px 0;
}
.fdg-contact__list li:last-child {
	border-bottom: 0;
}
.fdg-contact__list li img {
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	object-fit: contain;
	margin-top: 1px;
}
.fdg-contact__list a {
	color: #fff;
	text-decoration: none;
}
.fdg-contact__list a:hover {
	text-decoration: underline;
}

/* --- Ajustes en pantallas medianas (el header desktop se muestra hasta 992px;
   por debajo entra el header móvil). Se compacta de forma gradual para que
   logo + menú + buscador + contacto quepan SIEMPRE en una sola fila y el logo
   no se solape con el menú. El buscador es el primero en ceder ancho. --- */

/* ≤1366px (tablet apaisada / laptop pequeña) */
@media (max-width: 1366px) {
	.fdg-header__inner {
		gap: 20px;
		padding-left: 24px;
		padding-right: 0;
	}
	.fdg-header__center {
		gap: 20px;
	}
	.fdg-nav__menu {
		gap: 18px;
	}
	.fdg-nav__menu a {
		font-size: 15px;
	}
	.fdg-search {
		max-width: 320px;
	}
	.fdg-header__logo img,
	.fdg-header__logo .custom-logo {
		width: 230px;
	}
}

/* ≤1200px */
@media (max-width: 1200px) {
	.fdg-header__inner {
		gap: 16px;
		padding-left: 18px;
	}
	.fdg-header__center {
		gap: 16px;
	}
	.fdg-nav__menu {
		gap: 14px;
	}
	.fdg-nav__menu a {
		font-size: 14px;
	}
	.fdg-search {
		max-width: 260px;
	}
	.fdg-header__logo img,
	.fdg-header__logo .custom-logo {
		width: 200px;
	}
}

/* ≤1040px: última compactación antes de pasar al header móvil (<992px) */
@media (max-width: 1040px) {
	.fdg-nav__menu {
		gap: 11px;
	}
	.fdg-nav__menu a {
		font-size: 13.5px;
	}
	.fdg-search {
		max-width: 200px;
	}
	.fdg-header__logo img,
	.fdg-header__logo .custom-logo {
		width: 180px;
	}
	.fdg-contact__btn {
		width: 84px;
	}
}
