/* ==========================================================================
   Buscador Arymar
   ========================================================================== */

.ay-sbox { position: relative; width: 100%; }
.ay-sbox__field {
	position: relative; display: flex; align-items: center; height: 50px; padding: 4px 4px 4px 0; border-radius: 999px;
	background: var(--ay-soft); border: 1.5px solid var(--ay-line); transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.ay-sbox.is-open .ay-sbox__field, .ay-sbox__field:focus-within {
	background: #fff; border-color: var(--ay-blue);
	box-shadow: 0 0 0 4px rgba(0, 48, 138, 0.1), 0 12px 30px -12px rgba(10, 26, 74, 0.35);
}
.ay-sbox__icon { display: grid; place-items: center; width: 46px; flex: none; color: var(--ay-muted); }
.ay-sbox__icon .ay-icon { width: 20px; height: 20px; }
.ay-sbox__field:focus-within .ay-sbox__icon { color: var(--ay-blue); }
.ay-sbox__input {
	flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
	font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ay-ink); -webkit-appearance: none; appearance: none;
}
.ay-sbox__input::placeholder { color: #8a92ad; font-weight: 500; }
.ay-sbox__input::-webkit-search-cancel-button, .ay-sbox__input::-webkit-search-decoration { -webkit-appearance: none; }
.ay-sbox__input:focus-visible { box-shadow: none; }
.ay-sbox__clear { display: grid; place-items: center; width: 34px; height: 34px; margin-right: 4px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ay-muted); cursor: pointer; }
.ay-sbox__clear:hover { background: var(--ay-soft); color: var(--ay-night); }
.ay-sbox__clear .ay-icon { width: 16px; height: 16px; }
.ay-sbox__go {
	display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
	background: linear-gradient(135deg, var(--ay-blue), var(--ay-purple)); color: #fff; font: inherit; font-size: 14.5px; font-weight: 800;
	transition: transform 0.2s, box-shadow 0.2s;
}
.ay-sbox__go:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -6px rgba(0, 48, 138, 0.6); }
.ay-sbox__go .ay-icon { display: none; width: 18px; height: 18px; }
.ay-sbox__back { display: none; }

/* Panel ------------------------------------------------------------------- */
.ay-sbox__panel {
	position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 1000; min-width: min(680px, 92vw);
	max-height: min(72vh, 680px); overflow: auto; overscroll-behavior: contain; padding: 10px; border-radius: 22px;
	background: #fff; border: 1px solid var(--ay-line); box-shadow: 0 30px 70px -20px rgba(10, 26, 74, 0.45);
	transform-origin: top center; animation: aySpIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes aySpIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.ay-sp__sec { padding: 8px 8px 12px; }
.ay-sp__label { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ay-muted); }
.ay-sp__chips, .ay-sp__cats { display: flex; flex-wrap: wrap; gap: 8px; }
.ay-sp__cats { padding: 6px 6px 10px; border-bottom: 1px solid var(--ay-line); margin-bottom: 6px; }
.ay-chip {
	display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--ay-line); border-radius: 999px;
	background: var(--ay-soft); color: var(--ay-night); font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer;
	transition: all 0.2s;
}
.ay-chip .ay-icon { width: 15px; height: 15px; color: var(--ay-blue); }
.ay-chip:hover { background: var(--ay-blue); border-color: var(--ay-blue); color: #fff; transform: translateY(-1px); }
.ay-chip:hover .ay-icon { color: var(--ay-gold); }
.ay-chip mark { background: none; color: inherit; text-decoration: underline 2px var(--ay-gold); text-underline-offset: 3px; }
.ay-sp__hint { padding: 18px; color: var(--ay-muted); font-size: 14.5px; }

.ay-sp__list { list-style: none; margin: 0; padding: 0; }
.ay-sp__item {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border-radius: 16px;
	animation: aySpItem 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 25ms); transition: background 0.15s;
}
@keyframes aySpItem { from { opacity: 0; transform: translateY(6px); } }
.ay-sp__item:hover, .ay-sp__item.is-active { background: #f2f5fc; }
.ay-sp__item.is-active { box-shadow: inset 3px 0 0 var(--ay-blue); }
.ay-sp__link { display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; text-decoration: none; }
.ay-sp__img { flex: none; display: grid; place-items: center; width: 60px; height: 60px; overflow: hidden; border-radius: 14px; background: #fff; border: 1px solid var(--ay-line); }
.ay-sp__img img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s; }
.ay-sp__item:hover .ay-sp__img img { transform: scale(1.08); }
.ay-sp__txt { display: grid; gap: 3px; min-width: 0; }
.ay-sp__name { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14.5px; font-weight: 700; line-height: 1.3; color: var(--ay-night); }
.ay-sp__name mark, .ay-sp__sku mark { background: linear-gradient(transparent 58%, rgba(245, 179, 1, 0.55) 58%); color: inherit; padding: 0 1px; }
.ay-sp__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ay-muted); }
.ay-sp__sku { padding: 2px 8px; border-radius: 6px; background: var(--ay-soft); font-weight: 700; color: var(--ay-night); }
.ay-sp__price { font-size: 15px; font-weight: 800; color: var(--ay-blue); }
.ay-sp__price del { margin-right: 6px; font-weight: 600; font-size: 13px; color: var(--ay-muted); }
.ay-sp__price ins { text-decoration: none; }
.ay-sp__price small, .ay-sp__price .woocommerce-price-suffix { display: block; font-size: 11.5px; font-weight: 600; color: var(--ay-muted); }
.is-loading i { display: inline-block; width: 74px; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef1f8 25%, #dfe5f2 50%, #eef1f8 75%); background-size: 200% 100%; animation: ayShimmer 1.1s linear infinite; }
.ay-sp__act.is-loading i { width: 150px; height: 38px; border-radius: 999px; }
@keyframes ayShimmer { to { background-position: -200% 0; } }

.ay-sp__act { display: flex; align-items: center; gap: 8px; }
.ay-sp__act .added_to_cart { display: none !important; }
.ay-sp__qty { display: inline-flex; align-items: stretch; height: 38px; border: 1.5px solid var(--ay-line); border-radius: 999px; overflow: hidden; background: #fff; }
.ay-sp__qty button { width: 30px; padding: 0; border: 0; background: var(--ay-soft); color: var(--ay-night); font-size: 17px; font-weight: 700; cursor: pointer; }
.ay-sp__qty button:hover { background: #e6eaf4; color: var(--ay-blue); }
.ay-sp__qty input { width: 38px; padding: 0; border: 0; background: transparent; text-align: center; font: inherit; font-weight: 800; font-size: 14px; color: var(--ay-night); -moz-appearance: textfield; appearance: textfield; }
.ay-sp__qty input::-webkit-outer-spin-button, .ay-sp__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ay-sp__add {
	display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--ay-blue); color: #fff; font: inherit; font-size: 13.5px; font-weight: 800; transition: background 0.2s, transform 0.2s;
}
.ay-sp__add .ay-icon { width: 17px; height: 17px; }
.ay-sp__add:hover { background: var(--ay-night); transform: translateY(-1px); }
.ay-sp__add.is-loading { opacity: 0.7; cursor: progress; }
.ay-sp__add.is-loading .ay-icon { animation: ayCartBounce 0.5s ease-in-out infinite alternate; }
@keyframes ayCartBounce { to { transform: translateX(4px); } }
.ay-sp__add.is-done { background: #1faa53; animation: ayPopBtn 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes ayPopBtn { 50% { transform: scale(1.08); } }
.ay-sp__more { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--ay-blue); color: var(--ay-blue); font-size: 13.5px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.ay-sp__more:hover { background: var(--ay-blue); color: #fff; }

.ay-sp__all {
	display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 2px; padding: 13px; border-radius: 14px;
	background: linear-gradient(135deg, var(--ay-blue), var(--ay-purple)); color: #fff; font-weight: 800; font-size: 14.5px; text-decoration: none;
	transition: filter 0.2s;
}
.ay-sp__all .ay-icon { width: 18px; height: 18px; transition: transform 0.25s; }
.ay-sp__all:hover { color: #fff; filter: brightness(1.1); }
.ay-sp__all:hover .ay-icon { transform: translateX(4px); }
.ay-sp__all b { color: var(--ay-gold); }
.ay-sp__preview { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 6px 2px; font-size: 12px; color: var(--ay-muted); }
.ay-sp__preview select { padding: 4px 8px; border: 1px solid var(--ay-line); border-radius: 8px; font: inherit; font-size: 12px; }

.ay-sp__none { padding: 26px 18px; text-align: center; }
.ay-sp__none-ico { font-size: 34px; margin-bottom: 8px; animation: ayBob 2.5s ease-in-out infinite; }
.ay-sp__none p { margin: 0 0 4px; color: var(--ay-night); }
.ay-sp__muted { color: var(--ay-muted) !important; font-size: 14px; }
.ay-sp__wa { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 18px; border-radius: 999px; background: #1faa53; color: #fff; font-weight: 800; text-decoration: none; }
.ay-sp__wa .ay-icon { width: 18px; height: 18px; }
.ay-sp__wa:hover { background: #158a42; color: #fff; }

/* Celular: pantalla completa ------------------------------------------------ */
@media (max-width: 767px) {
	.ay-sbox__go { padding: 0 14px; }
	.ay-sbox__go span { display: none; }
	.ay-sbox__go .ay-icon { display: block; }
	.ay-sbox__field { height: 46px; }
	.ay-sbox.is-full { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; padding: 10px 10px 0; background: #fff; }
	.ay-sbox.is-full .ay-sbox__back { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ay-night); cursor: pointer; }
	.ay-sbox.is-full .ay-sbox__back .ay-icon { width: 20px; height: 20px; transform: rotate(180deg); }
	.ay-sbox.is-full .ay-sbox__icon { display: none; }
	.ay-sbox.is-full .ay-sbox__input { padding-left: 4px; font-size: 16px; }
	.ay-sbox.is-full .ay-sbox__panel { position: static; flex: 1; min-width: 0; max-height: none; margin-top: 10px; padding: 4px 0 24px; border: 0; border-radius: 0; box-shadow: none; animation: none; }
	.ay-search-lock, .ay-search-lock body { overflow: hidden; }
	/* La búsqueda a pantalla completa queda por encima de todo (barra de administración,
	   botón de WhatsApp, carrito flotante). */
	.ay-search-lock .ay-header { z-index: 2147483000; }
	.ay-search-lock #wpadminbar, .ay-search-lock .ht-ctc, .ay-search-lock .xoo-wsc-basket, .ay-search-lock [class*="ctc-chat"] { visibility: hidden; }
	.ay-sbox.is-full { padding-top: max(10px, env(safe-area-inset-top)); }
	.ay-sp__item { grid-template-columns: 1fr; gap: 8px; padding: 10px 6px; border-bottom: 1px solid var(--ay-line); border-radius: 0; }
	.ay-sp__act { padding-left: 74px; }
	.ay-sp__add { flex: 1; justify-content: center; }
	.ay-sp__img { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
	.ay-sbox__panel, .ay-sp__item, .ay-sp__none-ico { animation: none; }
}
