/* QBT Buscador y galería. Las clases van con el contenedor delante para ganarle a los estilos generales de Astra. */

.qbt-bar,
.qbt-page {
	--qbt-brand: #c8102e;
	--qbt-brand-dark: #a00d25;
	--qbt-tint: #fdf0f2;
	--qbt-ring: rgba(200, 16, 46, 0.28);
	--qbt-ink: #1f2328;
	--qbt-muted: #5f6368;
	--qbt-line: #d9dce1;
	--qbt-soft: #f5f6f7;
	--qbt-radius: 10px;
}

.qbt-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Barra bajo el encabezado (alto fijo desde el primer pintado: sin saltos) ---------- */
.qbt-bar {
	position: relative;
	z-index: 30;
	background: #fff;
	border-bottom: 1px solid #eceef1;
	padding: 10px 0;
}

/*
 * z-index 30 crea un contexto de apilamiento: la lista de sugerencias (1000) no puede pasar de 30 en la página, y la
 * lupa de la galería u otro elemento posicionado más alto la taparían. Mientras la lista está abierta (clase que pone el
 * JavaScript) la barra sube; cerrada vuelve a 30, debajo de la cabecera de Astra y sus menús.
 */
.qbt-bar.is-open {
	z-index: 1000;
}

.qbt-bar .qbt-bar__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

/* ---------- Formulario (barra y página) ---------- */
.qbt-search {
	margin: 0;
}

.qbt-search .qbt-search__field {
	position: relative;
	display: flex;
	align-items: stretch;
	max-width: 720px;
	margin: 0 auto;
}

.qbt-search .qbt-search__input {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	height: 44px;
	margin: 0;
	padding: 0 14px;
	font-family: inherit;
	font-size: 16px; /* 16 px o más: iOS no hace zoom al enfocar. */
	line-height: 1.2;
	color: var(--qbt-ink);
	background: #fff;
	border: 1px solid #c4c8ce;
	border-right: 0;
	border-radius: var(--qbt-radius) 0 0 var(--qbt-radius);
	box-shadow: none;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

.qbt-search .qbt-search__input::placeholder {
	color: #80868b;
	opacity: 1;
}

.qbt-search .qbt-search__input:focus {
	outline: 2px solid transparent;
	border-color: var(--qbt-brand);
	box-shadow: 0 0 0 3px var(--qbt-ring);
}

.qbt-search .qbt-search__btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 44px;
	margin: 0;
	padding: 0;
	color: #fff;
	background: var(--qbt-brand);
	border: 1px solid var(--qbt-brand);
	border-radius: 0 var(--qbt-radius) var(--qbt-radius) 0;
	box-shadow: none;
	cursor: pointer;
	line-height: 1;
}

.qbt-search .qbt-search__btn:hover,
.qbt-search .qbt-search__btn:focus {
	color: #fff;
	background: var(--qbt-brand-dark);
	border-color: var(--qbt-brand-dark);
}

.qbt-search .qbt-search__btn:focus-visible {
	outline: 3px solid var(--qbt-ring);
	outline-offset: 2px;
}

.qbt-search .qbt-search__icon {
	display: block;
	width: 20px;
	height: 20px;
}

.qbt-search--page .qbt-search__field {
	max-width: none;
}

.qbt-search--page .qbt-search__input,
.qbt-search--page .qbt-search__btn {
	height: 52px;
}

@media (min-width: 768px) {
	.qbt-search--page .qbt-search__input {
		font-size: 18px;
	}
}

@media (max-width: 544px) {
	.qbt-bar {
		padding: 8px 0;
	}

	.qbt-bar .qbt-bar__inner {
		padding: 0 16px;
	}

	.qbt-search .qbt-search__field {
		max-width: none;
	}
}

/* ---------- Lista de sugerencias ---------- */
.qbt-search .qbt-dd {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 1000;
	max-height: min(70vh, 540px);
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	text-align: left;
	background: #fff;
	border: 1px solid #e3e5e8;
	border-radius: var(--qbt-radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
	color: var(--qbt-ink);
}

.qbt-search .qbt-dd[hidden] {
	display: none;
}

.qbt-dd .qbt-dd__status:empty {
	display: none;
}

.qbt-dd .qbt-dd__status {
	padding: 14px;
	font-size: 14px;
	color: var(--qbt-muted);
}

.qbt-dd .qbt-dd__group {
	padding: 6px 0;
}

.qbt-dd .qbt-dd__group + .qbt-dd__group {
	border-top: 1px solid #eef0f2;
}

.qbt-dd .qbt-dd__hdr {
	padding: 6px 14px 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--qbt-muted);
}

.qbt-dd .qbt-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 8px 14px;
	font-size: 15px;
	line-height: 1.3;
	color: var(--qbt-ink);
	cursor: pointer;
	box-sizing: border-box;
}

.qbt-dd .qbt-opt.is-active {
	background: var(--qbt-tint);
}

/* El mouse solo resalta: la opción que abre Enter la eligen las flechas del teclado. */
@media (hover: hover) {
	.qbt-dd .qbt-opt:hover {
		background: var(--qbt-tint);
	}

	.qbt-dd .qbt-opt.qbt-chip:hover {
		color: var(--qbt-brand);
		border-color: var(--qbt-brand);
	}
}

.qbt-dd .qbt-opt__label {
	flex: 1 1 auto;
	min-width: 0;
}

.qbt-dd .qbt-opt__type {
	flex: 0 0 auto;
	padding: 2px 8px;
	font-size: 12px;
	white-space: nowrap;
	color: var(--qbt-muted);
	background: var(--qbt-soft);
	border-radius: 999px;
}

.qbt-dd .qbt-opt__img {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	max-width: none;
	object-fit: contain;
	background: var(--qbt-soft);
	border-radius: 6px;
}

.qbt-dd .qbt-opt__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	gap: 1px;
}

.qbt-dd .qbt-opt__title {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 600;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.qbt-dd .qbt-opt__meta {
	overflow: hidden;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--qbt-muted);
}

.qbt-dd .qbt-opt__price {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
}

.qbt-dd .qbt-opt__badges {
	display: inline-flex;
	gap: 4px;
}

.qbt-dd .qbt-opt--all {
	justify-content: center;
	font-weight: 600;
	color: var(--qbt-brand);
	border-top: 1px solid #eef0f2;
}

.qbt-dd .qbt-opt--dym strong {
	color: var(--qbt-brand);
}

.qbt-dd .qbt-dd__group--dym .qbt-dd__hdr {
	display: none; /* El texto de la opción ya lo dice; el grupo conserva su nombre para lectores de pantalla. */
}

.qbt-dd .qbt-chips {
	padding: 4px 14px 10px;
}

.qbt-dd .qbt-opt.qbt-chip {
	display: inline-flex;
	min-height: 36px;
	padding: 6px 14px;
	font-size: 14px;
}

.qbt-dd .qbt-opt.qbt-chip.is-active {
	color: var(--qbt-brand);
	border-color: var(--qbt-brand);
	background: var(--qbt-tint);
}

/* ---------- Piezas compartidas ---------- */
.qbt-mark {
	padding: 0;
	color: inherit;
	background: rgba(200, 16, 46, 0.13);
	border-radius: 2px;
}

.qbt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.qbt-chip {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 14px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.2;
	color: var(--qbt-ink);
	background: #fff;
	border: 1px solid var(--qbt-line);
	border-radius: 999px;
	cursor: pointer;
}

.qbt-page .qbt-chip:hover,
.qbt-page .qbt-chip:focus {
	color: var(--qbt-brand);
	background: var(--qbt-tint);
	border-color: var(--qbt-brand);
}

.qbt-badge {
	display: inline-block;
	padding: 2px 6px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 4px;
}

.qbt-badge--out {
	color: #5f6368;
	background: #eceef1;
}

.qbt-badge--used {
	color: #7a4300;
	background: #fff1dc;
}

.qbt-page :focus-visible,
.qbt-dd :focus-visible {
	outline: 3px solid var(--qbt-brand);
	outline-offset: 2px;
}

/* ---------- Página de resultados ---------- */
.qbt-page {
	margin: 0 0 32px;
	color: var(--qbt-ink);
}

.qbt-page .qbt-page__status {
	min-height: 1.5em;
	margin: 12px 0 4px;
	font-size: 15px;
	color: var(--qbt-muted);
}

.qbt-page .qbt-page__results.is-loading {
	min-height: 240px;
}

.qbt-page .qbt-dym {
	margin: 6px 0;
	font-size: 16px;
}

.qbt-page .qbt-dym a {
	font-weight: 600;
	color: var(--qbt-brand);
}

.qbt-page .qbt-note {
	margin: 4px 0;
	font-size: 14px;
	color: var(--qbt-muted);
}

.qbt-page .qbt-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 10px 0 16px;
	padding: 10px 0 14px;
	border-bottom: 1px solid #eef0f2;
}

.qbt-page .qbt-tools__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.qbt-page .qbt-fchip {
	min-height: 36px;
	margin: 0;
	padding: 6px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--qbt-ink);
	background: #fff;
	border: 1px solid var(--qbt-line);
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
}

.qbt-page .qbt-fchip:hover,
.qbt-page .qbt-fchip:focus {
	color: var(--qbt-brand);
	background: var(--qbt-tint);
	border-color: var(--qbt-brand);
}

.qbt-page .qbt-fchip.is-on,
.qbt-page .qbt-fchip.is-on:hover,
.qbt-page .qbt-fchip.is-on:focus {
	color: #fff;
	background: var(--qbt-brand);
	border-color: var(--qbt-brand);
}

.qbt-page .qbt-fchip:disabled {
	color: var(--qbt-ink);
	background: #fff;
	border-color: var(--qbt-line);
	opacity: 0.45;
	cursor: default;
}

.qbt-page .qbt-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	margin: 0;
	font-size: 14px;
	cursor: pointer;
}

.qbt-page .qbt-switch__input {
	position: absolute;
	top: 6px;
	left: 0;
	width: 40px;
	height: 24px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.qbt-page .qbt-switch__track {
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 24px;
	background: #c4c8ce;
	border-radius: 999px;
	transition: background 0.15s;
}

.qbt-page .qbt-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s;
}

.qbt-page .qbt-switch__input:checked + .qbt-switch__track {
	background: var(--qbt-brand);
}

.qbt-page .qbt-switch__input:checked + .qbt-switch__track::after {
	transform: translateX(16px);
}

.qbt-page .qbt-switch__input:focus-visible + .qbt-switch__track {
	outline: 3px solid var(--qbt-brand);
	outline-offset: 2px;
}

.qbt-page .qbt-sort {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 0 auto;
	font-size: 14px;
}

.qbt-page .qbt-sort__select {
	height: 36px;
	min-width: 150px;
	margin: 0;
	padding: 0 10px;
	font-family: inherit;
	font-size: 14px;
	color: var(--qbt-ink);
	background-color: #fff;
	border: 1px solid var(--qbt-line);
	border-radius: 8px;
}

@media (max-width: 600px) {
	.qbt-page .qbt-sort {
		margin-left: 0;
	}
}

@media (max-width: 767px) {
	.qbt-page .qbt-sort__select {
		font-size: 16px; /* Con menos, iOS hace zoom al tocar la lista. */
	}
}

.qbt-page ul.qbt-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.qbt-page ul.qbt-grid {
		grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
		gap: 16px;
	}
}

.qbt-page ul.qbt-grid > li {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qbt-page .qbt-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	color: var(--qbt-ink);
	text-decoration: none;
	background: #fff;
	border: 1px solid #eceef1;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.15s, transform 0.15s;
}

.qbt-page .qbt-card:hover {
	color: var(--qbt-ink);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
	transform: translateY(-1px);
}

/* Astra subraya los enlaces del contenido (.ast-single-post .entry-content a), que también se aplica a las páginas. */
.qbt-page a.qbt-card,
.qbt-page a.qbt-card:hover,
.qbt-page a.qbt-card:focus,
.qbt-page a.qbt-btn,
.qbt-page a.qbt-btn:hover,
.qbt-page a.qbt-btn:focus {
	text-decoration: none !important;
}

.qbt-page .qbt-card__img {
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--qbt-soft);
}

.qbt-page .qbt-card__pic {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
}

.qbt-page .qbt-card.is-out .qbt-card__pic {
	opacity: 0.6;
}

.qbt-page .qbt-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	padding: 10px 12px 12px;
}

.qbt-page .qbt-card__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.qbt-page .qbt-card__author {
	overflow: hidden;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--qbt-muted);
}

.qbt-page .qbt-card__price {
	margin-top: auto;
	padding-top: 4px;
	font-size: 16px;
	font-weight: 700;
}

.qbt-page .qbt-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.qbt-page .qbt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 22px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	text-decoration: none;
	background: var(--qbt-brand);
	border: 1px solid var(--qbt-brand);
	border-radius: 999px;
	cursor: pointer;
}

.qbt-page .qbt-btn:hover,
.qbt-page .qbt-btn:focus {
	color: #fff;
	background: var(--qbt-brand-dark);
	border-color: var(--qbt-brand-dark);
}

.qbt-page .qbt-btn--ghost,
.qbt-page .qbt-btn--ghost:hover,
.qbt-page .qbt-btn--ghost:focus {
	color: var(--qbt-brand);
	background: #fff;
}

.qbt-page .qbt-more {
	display: flex;
	margin: 24px auto 0;
}

.qbt-page .qbt-none {
	padding: 24px 8px;
	text-align: center;
}

.qbt-page .qbt-none--filters {
	padding: 16px 8px;
}

.qbt-page .qbt-none__title {
	margin: 0 0 8px;
	font-size: 22px;
}

.qbt-page .qbt-none .qbt-chips {
	justify-content: center;
	margin-bottom: 16px;
}

.qbt-page .qbt-pop__title {
	margin: 18px 0 8px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--qbt-muted);
}

.qbt-page .qbt-page__noscript {
	margin-top: 16px;
}

.qbt-page ul.qbt-page__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

/* ---------- Flechas de la galería del producto ---------- */
.woocommerce-product-gallery .flex-direction-nav,
.woocommerce-product-gallery .flex-direction-nav li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-product-gallery .flex-direction-nav a {
	position: absolute;
	top: 50%;
	z-index: 10; /* Encima de la imagen ampliada (zoom). */
	display: block;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	overflow: hidden;
	text-indent: 100%; /* El texto queda para lectores de pantalla. */
	white-space: nowrap;
	color: #1f2328;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);
	transition: opacity 0.2s, visibility 0.2s, background-color 0.2s;
	-webkit-tap-highlight-color: transparent;
}

.woocommerce-product-gallery .flex-direction-nav a::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.4 4.6 14 3.2 5.2 12l8.8 8.8 1.4-1.4L8 12z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.4 4.6 14 3.2 5.2 12l8.8 8.8 1.4-1.4L8 12z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.woocommerce-product-gallery .flex-direction-nav .flex-next::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.6 4.6 10 3.2l8.8 8.8-8.8 8.8-1.4-1.4L16 12z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.6 4.6 10 3.2l8.8 8.8-8.8 8.8-1.4-1.4L16 12z'/%3E%3C/svg%3E");
}

.woocommerce-product-gallery .flex-direction-nav .flex-prev {
	left: 10px;
}

.woocommerce-product-gallery .flex-direction-nav .flex-next {
	right: 10px;
}

.woocommerce-product-gallery .flex-direction-nav a:hover {
	color: #000;
	background: #fff;
}

.woocommerce-product-gallery .flex-direction-nav a:focus {
	outline: none;
}

.woocommerce-product-gallery .flex-direction-nav a:focus-visible {
	outline: 3px solid #c8102e;
	outline-offset: 2px;
}

/* Primera o última imagen (animationLoop está apagado): FlexSlider marca la flecha como deshabilitada. */
.woocommerce-product-gallery .flex-direction-nav a.flex-disabled {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

@media (max-width: 544px) {
	.woocommerce-product-gallery .flex-direction-nav .flex-prev {
		left: 6px;
	}

	.woocommerce-product-gallery .flex-direction-nav .flex-next {
		right: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qbt-page .qbt-card,
	.qbt-page .qbt-switch__track,
	.qbt-page .qbt-switch__track::after,
	.woocommerce-product-gallery .flex-direction-nav a {
		transition: none;
	}

	.qbt-page .qbt-card:hover {
		transform: none;
	}
}
