/* ===== WooCommerce Live Search (GRACIA) ===== */

/* Contenedor principal */
.gr-wc-live-search {
	position: relative;
	width: 100%;
}

/* Input container */
.gr-wc-live-search .gr-wc-input-wrap {
	position: relative;
	border: 1px solid #274377;
	background: #EFF6FF;
	z-index: 9000; /* siempre sobre el overlay */
	display: flex;
	flex-direction: row;
}

/* Icono lupa */
.gr-wc-live-search .gr-wc-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #274377;
}

/* Input */
.gr-wc-live-search .gr-wc-input {
	width: 100%;
	border: 0;
	outline: 0;
	font-size: 16px;
	font-weight: 500;
	color: #153665;
	background: transparent;
    margin-left: 40px;
	height: 46px;
	padding: 16px 10px;
	font-family: "Space Grotesk", sans-serif;
}

/* Botón limpiar (X) */
.gr-wc-live-search .gr-wc-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 16px;
  color: #274377;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s;
  opacity: 0;
  pointer-events: none;   /* por defecto oculta/inactiva */
}

.gr-wc-live-search .gr-wc-clear:hover {
  background: #eef3ff;
  color: #132146;
}

/* Loader dentro del input */
.gr-wc-live-search .gr-wc-loader {
  display: none;
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #c5cde0;
  border-top-color: #173f8a;
  animation: gr-wc-spin 0.7s linear infinite;
}

/* Cuando está cargando, mostramos loader y ocultamos X */
.gr-wc-live-search .gr-wc-input-wrap.is-loading .gr-wc-loader {
  display: block;
}

.gr-wc-live-search .gr-wc-input-wrap.is-loading .gr-wc-clear {
  opacity: 0;
  pointer-events: none;
}

@keyframes gr-wc-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Panel de resultados */
.gr-wc-live-search .gr-wc-panel {
	position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    max-height: 70vh;
    overflow: auto;
    background: #ffffff;
    border: 1px solid #d7deea;
    border-radius: 0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
    padding: 14px 14px 10px 14px;
  	z-index: 9600; /* sobre overlay */
	display: none;
}

.gr-wc-live-search .gr-wc-panel.is-open {
  display: block;
}

/* Tabs */
.gr-wc-live-search .gr-wc-tabs {
  display: flex;
  gap: 18px;
  padding: 0 6px 10px 6px;
  border-bottom: 1px solid #e7ebf3;
}

.gr-wc-live-search .gr-wc-tab {
	border: 0;
	background: transparent;
	color: #2a3f6a;
	font-weight: 800;
	font-size: 14px;
	padding: 0 0 6px 0;
	cursor: pointer;
	position: relative;
	font-family: "Space Grotesk", sans-serif;
	outline: none;
}

.gr-wc-live-search .gr-wc-tab:hover {
	color: #3A5792;
}

.gr-wc-live-search .gr-wc-tab.is-active {
  color: #0f2247;
}

.gr-wc-live-search .gr-wc-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  background: #FAC12E;
  border-radius: 2px;
}

/* Resultados */
.gr-wc-live-search .gr-wc-results {
  padding-top: 10px;
}

.gr-wc-live-search .gr-wc-list {
  display: none;
}

.gr-wc-live-search .gr-wc-list.is-active {
  display: block;
}

/* Item de resultado */
.gr-wc-live-search .gr-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 8px;
  text-decoration: none;
}

.gr-wc-live-search .gr-item:hover {
  background: #f5f7fb;
}

.gr-wc-live-search .gr-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f2f7;
}

.gr-wc-live-search .gr-title {
  font-weight: 800;
  font-size: 15px;
  color: #0e1a33;
  margin-bottom: 3px;
}

.gr-wc-live-search .gr-price {
  color: #1a7a1f;
  font-weight: 700;
  font-size: 14px;
}

/* Mensaje sin resultados */
.gr-wc-live-search .gr-empty {
  padding: 12px 8px;
  color: #6b7895;
  font-size: 14px;
}

/* Overlay pantalla completa (detrás del input/panel) */
.gr-wc-live-search .gr-wc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
}

.gr-wc-live-search .gr-wc-overlay.is-open {
  display: block;
}

/* Footer "Ver todos los resultados" */
.gr-wc-live-search .gr-wc-footer {
  margin-top: 4px;
  padding: 8px 8px 4px 8px;
  border-top: 1px solid #e7ebf3;
}

.gr-wc-live-search .gr-wc-view-all {
  font-size: 14px;
  font-weight: 700;
  color: #173f8a;
  text-decoration: none;
}

.gr-wc-live-search .gr-wc-view-all:hover {
  text-decoration: underline;
}

/* Resaltado del término buscado */
.gr-wc-live-search mark {
  background: #fff2b8;
  color: #0e1a33;
  padding: 0 1px;
  border-radius: 2px;
}

.gr-wc-live-search .gr-wc-input-wrap.has-value .gr-wc-clear {
  opacity: 1;
  pointer-events: auto;   /* sólo cuando hay texto */
}

.gr-wc-live-search .gr-wc-clear:hover {
  background: #eef3ff;
  color: #132146;
}

/* cuando está cargando ya tenías esto: */
.gr-wc-live-search .gr-wc-input-wrap.is-loading .gr-wc-clear {
  opacity: 0;
  pointer-events: none;
}

.gr-wc-live-search .gr-empty--global {
  padding: 18px 12px 16px;
  font-size: 15px;
  color: #323a4d;
  line-height: 1.5;
}