/* ==========================================================================
   EL FRASQUERÍO — HEADER (buscador, header móvil, menú lateral, carrito)
   --------------------------------------------------------------------------
   Colores tomados de la marca actual del sitio:
     --elf-negro    #090302  fondo del header
     --elf-mostaza  #DAA520  cinta superior / detalles activos
     --elf-rojo     #C4533F  botón principal (global color 2 de Astra)
     --elf-crema    #F1E5E3  fondos suaves (global color 4 de Astra)
   ========================================================================== */

:root {
	--elf-negro: #090302;
	--elf-negro-2: #1c1412;      /* un poco más claro, para submenús */
	--elf-mostaza: #daa520;
	--elf-rojo: #c4533f;
	--elf-rojo-oscuro: #a8412f;
	--elf-crema: #f1e5e3;
	--elf-borde: #e7dcd9;
	--elf-texto: #2a211f;
	--elf-texto-suave: #6d625f;
	--elf-radio: 10px;
	--elf-alto-barra: 60px;
	--elf-z: 99990;               /* por encima de Elementor y del carrito lateral */
}

/* Texto solo para lectores de pantalla */
.elf-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* Foco visible para quien navega con teclado */
.elf-buscador :focus-visible,
.elf-hm :focus-visible,
.elf-drawer :focus-visible,
.elf-buscar-overlay :focus-visible {
	outline: 2px solid var(--elf-mostaza);
	outline-offset: 2px;
}

/* Bloquea el scroll de la página mientras hay una capa abierta */
html.elf-sin-scroll,
html.elf-sin-scroll body {
	overflow: hidden !important;
}


/* ==========================================================================
   1. BUSCADOR
   ========================================================================== */

.elf-buscador {
	position: relative;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	font-size: 15px;
	color: var(--elf-texto);
}

.elf-buscador__form {
	position: relative;
	display: flex;
	align-items: center;
	height: 48px;
	background: #fff;
	border: 2px solid transparent;
	border-radius: var(--elf-radio);
	transition: border-color .15s ease;
}

/* El buscador "se enciende" con un borde mostaza al usarlo */
.elf-buscador.is-abierto .elf-buscador__form,
.elf-buscador__form:focus-within {
	border-color: var(--elf-mostaza);
}

.elf-buscador.is-error .elf-buscador__form {
	border-color: var(--elf-rojo);
	animation: elf-sacudir .3s ease;
}

@keyframes elf-sacudir {
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

.elf-buscador__lupa {
	flex: none;
	margin: 0 6px 0 14px;
	color: var(--elf-texto-suave);
}

.elf-buscador .elf-buscador__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 6px;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;   /* el borde del formulario ya muestra el foco */
	font-size: 16px;            /* 16px evita que iPhone haga zoom al tocar */
	color: var(--elf-texto);
	-webkit-appearance: none;
	appearance: none;
}

.elf-buscador__input::placeholder { color: #9a8f8c; opacity: 1; }
.elf-buscador__input::-webkit-search-cancel-button { display: none; }

.elf-buscador__limpiar {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px; height: 36px;
	padding: 0;
	margin-right: 4px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--elf-texto-suave);
	cursor: pointer;
}
.elf-buscador__limpiar:hover { background: var(--elf-crema); color: var(--elf-texto); }
.elf-buscador__limpiar[hidden] { display: none; }

.elf-buscador__enviar {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: calc(100% + 4px);
	margin: -2px -2px -2px 0;
	padding: 0 22px;
	border: 0;
	border-radius: 0 var(--elf-radio) var(--elf-radio) 0;
	background: var(--elf-rojo);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .15s ease;
}
.elf-buscador__enviar:hover { background: var(--elf-rojo-oscuro); }
.elf-buscador__enviar-icono { display: none; }

/* ---------- Panel de sugerencias ---------- */

.elf-buscador__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0; right: 0;
	z-index: var(--elf-z);
	max-height: min(70vh, 560px);
	overflow-y: auto;
	padding: 14px;
	background: #fff;
	border-radius: var(--elf-radio);
	box-shadow: 0 18px 40px -12px rgba(9, 3, 2, .45);
	text-align: left;
}
.elf-buscador__panel[hidden] { display: none; }

.elf-buscador__titulo {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--elf-texto-suave);
}

.elf-buscador__sugeridas[hidden] { display: none; }

/* Chips de categorías */
.elf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.elf-chips li { margin: 0; }
.elf-chip {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 16px;
	border: 1px solid var(--elf-borde);
	border-radius: 999px;
	background: #fff;
	color: var(--elf-texto) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background-color .15s ease, border-color .15s ease;
}
.elf-chip:hover {
	background: var(--elf-crema);
	border-color: var(--elf-mostaza);
}

.elf-buscador__estado {
	margin: 0;
	font-size: 14px;
	color: var(--elf-texto-suave);
}
.elf-buscador__estado:empty { display: none; }
.elf-buscador__estado:not(:empty) { margin-bottom: 8px; }

/* Lista de productos */
.elf-buscador__lista {
	margin: 0;
	padding: 0;
	list-style: none;
}
.elf-buscador__lista li { margin: 0; }

.elf-resultado {
	display: grid;
	grid-template-columns: 52px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 8px;
	color: var(--elf-texto) !important;
	text-decoration: none !important;
}
.is-activo > .elf-resultado,
.elf-resultado:hover {
	background: var(--elf-crema);
}

.elf-resultado__img {
	width: 52px; height: 52px;
	object-fit: cover;
	border-radius: 6px;
	background: #f6f1f0;
}

.elf-resultado__info { display: grid; gap: 2px; min-width: 0; }

.elf-resultado__nombre {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Coincidencia resaltada: subrayado mostaza, no color, para que se lea bien */
.elf-resultado__nombre mark {
	background: none;
	color: inherit;
	font-weight: 800;
	box-shadow: inset 0 -3px 0 rgba(218, 165, 32, .55);
}

.elf-resultado__cat {
	font-size: 12px;
	color: var(--elf-texto-suave);
}

.elf-resultado__precio {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	text-align: right;
}
.elf-resultado__precio del { display: block; font-size: 12px; font-weight: 400; color: var(--elf-texto-suave); }
.elf-resultado__precio ins { text-decoration: none; color: var(--elf-rojo); }
.elf-resultado__agotado { font-size: 12px; font-weight: 600; color: var(--elf-texto-suave); }

.elf-buscador__todos {
	display: block;
	margin-top: 8px;
	padding: 12px;
	border-radius: 8px;
	background: var(--elf-negro);
	color: #fff !important;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
}
.elf-buscador__todos:hover { background: #2a1f1c; }
.elf-buscador__todos[hidden] { display: none; }

/* Indicador de carga: una línea mostaza que avanza bajo el campo */
.elf-buscador.is-cargando .elf-buscador__form::after {
	content: '';
	position: absolute;
	left: 12px; right: 12px; bottom: -2px;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--elf-mostaza), transparent);
	background-size: 50% 100%;
	background-repeat: no-repeat;
	animation: elf-cargando 1s linear infinite;
}
@keyframes elf-cargando {
	from { background-position: -50% 0; }
	to   { background-position: 150% 0; }
}


/* ==========================================================================
   2. CARRITO (ícono con contador)
   ========================================================================== */

.elf-carrito {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 44px; height: 44px;
	color: #fff !important;
	text-decoration: none !important;
}
.elf-carrito:hover { color: var(--elf-mostaza) !important; }

.elf-carrito__n {
	position: absolute;
	top: 4px; right: 2px;
	min-width: 18px; height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--elf-rojo);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 18px;
	text-align: center;
}
.elf-carrito__n.is-vacio { display: none; }


/* ==========================================================================
   3. HEADER MÓVIL (una fila)
   ========================================================================== */

.elf-hm {
	height: var(--elf-alto-barra);   /* reserva el espacio aunque la barra quede fija */
	width: 100%;
}

/* Ancho completo garantizado: si el contenedor de Elementor está en
   dirección "Fila", Elementor ajusta el widget al ancho de su contenido y la
   barra quedaba más angosta que la pantalla (ej. 388 px de 1024). Aquí
   forzamos que el widget del shortcode se estire siempre al 100 %. */
.elementor-widget:has(.elf-hm),
.elementor-shortcode:has(.elf-hm) {
	flex: 1 1 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	align-self: stretch !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* El contenedor que lo envuelve no debe tener relleno en ningún lado
   (Elementor pone 10 px por defecto en tablet, entre 768 y 1024 px):
   la barra queda pegada a la cinta de arriba y al contenido de abajo. */
.e-con:has(> .elementor-widget .elf-hm),
.e-con:has(> .e-con-inner > .elementor-widget .elf-hm) {
	padding: 0 !important;
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
}
.e-con:has(> .e-con-inner > .elementor-widget .elf-hm) > .e-con-inner {
	max-width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.elf-hm__barra {
	display: grid;
	grid-template-columns: 1fr minmax(0, auto) 1fr;   /* el logo queda centrado de verdad */
	align-items: center;
	height: var(--elf-alto-barra);
	padding: 0 6px;
	background: var(--elf-negro);
	color: #fff;
	z-index: calc(var(--elf-z) - 10);
	transition: transform .25s ease;
}

.elf-hm.is-fijo .elf-hm__barra {
	position: fixed;
	top: 0; left: 0; right: 0;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.elf-hm.is-fijo.is-oculto .elf-hm__barra { transform: translateY(-100%); }

/* Si estás conectado a WordPress, la barra negra del admin ocupa 46px arriba */
.admin-bar .elf-hm.is-fijo .elf-hm__barra { top: 46px; }
@media (max-width: 600px) {
	.admin-bar .elf-hm.is-fijo .elf-hm__barra { top: 0; }
}

.elf-hm__icono {
	display: inline-grid;
	place-items: center;
	width: 44px; height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent !important;
	color: #fff !important;
	cursor: pointer;
}
.elf-hm__icono:hover { color: var(--elf-mostaza) !important; }

.elf-hm__barra > .elf-hm__icono { justify-self: start; }

.elf-hm__logo {
	display: block;
	min-width: 0;
	line-height: 0;
}
/* Logo horizontal: ocupa el centro sin chocar con los íconos.
   En un celular de 375 px queda de unos 172 × 31 px. */
.elf-hm .elf-hm__logo img {
	display: block;
	width: clamp(130px, 46vw, 200px) !important;
	height: auto !important;
	max-width: 100%;
}
.elf-logo-texto {
	color: #fff;
	font-size: 18px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}

.elf-hm__acciones {
	justify-self: end;
	display: flex;
	align-items: center;
}

/* Cuando el header móvil está activo, ocultamos la burbuja flotante del carrito */
body.elf-hm-activo .xoo-wsc-basket { display: none !important; }


/* Logo de escritorio [elf_logo] */
.elf-logo {
	display: inline-block;
	line-height: 0;
}
.elf-logo .elf-logo__img {
	display: block;
	width: var(--elf-logo-ancho, 280px) !important;
	max-width: 100%;
	height: auto !important;
}


/* ==========================================================================
   4. MENÚ LATERAL
   ========================================================================== */

.elf-drawer {
	position: fixed;
	inset: 0;
	z-index: var(--elf-z);
}
.elf-drawer[hidden] { display: none; }

.elf-drawer__fondo {
	position: absolute;
	inset: 0;
	background: rgba(9, 3, 2, .6);
	opacity: 0;
	transition: opacity .25s ease;
}

.elf-drawer__panel {
	position: absolute;
	top: 0; bottom: 0; left: 0;
	display: flex;
	flex-direction: column;
	width: min(86vw, 340px);
	background: var(--elf-negro);
	color: #fff;
	transform: translateX(-100%);
	transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}

.elf-drawer.is-visible .elf-drawer__fondo { opacity: 1; }
.elf-drawer.is-visible .elf-drawer__panel { transform: translateX(0); }

.elf-drawer__cabecera {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--elf-alto-barra);
	padding: 0 8px 0 20px;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.elf-drawer__titulo { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .7); }

.elf-drawer__cerrar {
	display: grid;
	place-items: center;
	width: 44px; height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent !important;
	color: #fff !important;
	cursor: pointer;
}

.elf-drawer__contenido {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px 0;
}

.elf-drawer__lista,
.elf-drawer__lista .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.elf-drawer__lista > li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
}

.elf-drawer__lista a {
	display: flex;
	align-items: center;
	flex: 1;
	min-height: 52px;
	padding: 0 20px;
	color: #fff !important;
	font-size: 17px;
	font-weight: 600;
	text-decoration: none !important;
	border-left: 3px solid transparent;
}
.elf-drawer__lista a:hover { background: rgba(255, 255, 255, .06); }

/* Página actual: línea mostaza a la izquierda */
.elf-drawer__lista .current-menu-item > a,
.elf-drawer__lista .current_page_item > a {
	border-left-color: var(--elf-mostaza);
	color: var(--elf-mostaza) !important;
}
/* "Categorias" es solo un agrupador: no se marca como página actual */
.elf-drawer__lista .menu-item-has-children.menu-item-type-custom > a {
	border-left-color: transparent;
	color: #fff !important;
}

.elf-drawer__toggle {
	display: grid;
	place-items: center;
	width: 52px; height: 52px;
	padding: 0;
	border: 0;
	background: transparent !important;
	color: #fff !important;
	cursor: pointer;
}
.elf-drawer__toggle svg { transition: transform .2s ease; }
.elf-drawer__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Submenú (Categorías) */
.elf-drawer__lista .sub-menu {
	flex-basis: 100%;
	padding: 4px 0 8px;
	background: var(--elf-negro-2);
}
.elf-drawer__lista .sub-menu[hidden] { display: none; }
.elf-drawer__lista .sub-menu a {
	min-height: 46px;
	padding-left: 34px;
	font-size: 15px;
	font-weight: 500;
	color: rgba(255, 255, 255, .88) !important;
}

.elf-drawer__aviso { padding: 20px; color: var(--elf-mostaza); }

.elf-drawer__pie {
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
	border-top: 1px solid rgba(255, 255, 255, .1);
}
.elf-drawer__whatsapp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	border: 1px solid var(--elf-mostaza);
	border-radius: var(--elf-radio);
	color: var(--elf-mostaza) !important;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none !important;
}
.elf-drawer__whatsapp:hover { background: rgba(218, 165, 32, .1); }


/* ==========================================================================
   5. BUSCADOR A PANTALLA COMPLETA (celular)
   ========================================================================== */

.elf-buscar-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--elf-z);
	display: flex;
	flex-direction: column;
	background: #fff;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .18s ease, transform .18s ease;
}
.elf-buscar-overlay[hidden] { display: none; }
.elf-buscar-overlay.is-visible { opacity: 1; transform: none; }

.elf-buscar-overlay__barra {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	padding: 6px 10px 6px 12px;
	background: var(--elf-negro);
	padding-top: calc(6px + env(safe-area-inset-top));
}

.elf-buscar-overlay__cerrar {
	flex: none;
	height: 48px;
	padding: 0 6px;
	border: 0;
	background: transparent !important;
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

/* El buscador dentro del overlay ocupa toda la pantalla */
.elf-buscador--overlay { flex: 1; max-width: none; position: static; }
.elf-buscador--overlay .elf-buscador__enviar { display: none; }  /* se busca con "Ir" del teclado */
.elf-buscador--overlay .elf-buscador__panel {
	position: fixed;
	top: calc(60px + env(safe-area-inset-top));
	bottom: 0; left: 0; right: 0;
	max-height: none;
	border-radius: 0;
	box-shadow: none;
	padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}


/* ==========================================================================
   6. PÁGINA "SIN RESULTADOS" Y AVISO DE CORRECCIÓN
   ========================================================================== */

.elf-sin-resultados {
	max-width: 640px;
	margin: 24px 0;
	padding: 24px;
	border: 1px solid var(--elf-borde);
	border-radius: var(--elf-radio);
	background: #fff;
}
.elf-sin-resultados__titulo { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: var(--elf-negro); }
.elf-sin-resultados__texto  { margin: 0 0 16px; color: var(--elf-texto-suave); }
.elf-sin-resultados__wa {
	display: inline-block;
	margin-top: 18px;
	color: var(--elf-rojo) !important;
	font-weight: 700;
}

.elf-aviso-correccion { margin: 6px 0 0; font-size: 15px; color: var(--elf-texto-suave); }

/* Cuando aparece nuestro bloque en español, ocultamos el mensaje en inglés
   ("It seems we can't find what you're looking for") del widget
   "Productos de archivo" de Elementor, para no mostrar dos avisos. */
body:has(.elf-sin-resultados) .elementor-products-nothing-found {
	display: none !important;
}


/* ==========================================================================
   7. AJUSTES AL HEADER DE ELEMENTOR EXISTENTE
   ========================================================================== */

/* Sin animaciones de entrada en el header: aparece de inmediato (mejor LCP/CLS) */
.elementor-location-header .elementor-invisible { visibility: visible !important; }
.elementor-location-header .animated,
.elementor-location-header .animated-slow { animation: none !important; }

/* Cinta superior: más delgada en celular */
@media (max-width: 767px) {
	.elf-marquee-container { padding: 6px 0; }
	.elf-marquee-item { font-size: 11px; padding: 0 20px; }
}


/* ==========================================================================
   8. RESPONSIVE Y ACCESIBILIDAD
   ========================================================================== */

/* En pantallas pequeñas, el botón "Buscar" muestra solo la lupa */
@media (max-width: 600px) {
	.elf-buscador__enviar { padding: 0 16px; }
	.elf-buscador__enviar-texto { display: none; }
	.elf-buscador__enviar-icono { display: block; }
	.elf-buscador__lupa { display: none; }
	.elf-buscador .elf-buscador__input { padding-left: 14px; }
}

/* Respeta "reducir movimiento" del sistema */
@media (prefers-reduced-motion: reduce) {
	.elf-hm__barra,
	.elf-drawer__panel,
	.elf-drawer__fondo,
	.elf-buscar-overlay,
	.elf-drawer__toggle svg { transition: none !important; }
	.elf-buscador.is-cargando .elf-buscador__form::after,
	.elf-buscador.is-error .elf-buscador__form { animation: none !important; }
	.elf-marquee-track { animation: none !important; }
}
