/* Sofa Smart Search · dropdown. Se adapta al tema con variables CSS: redefinilas en .sss para cambiar colores. */
.sss {
  --sss-accent: var(--theme-palette-color-1, #2563eb);
  --sss-bg: #fff;
  --sss-fg: var(--theme-palette-color-4, #0f172a);
  --sss-muted: #64748b;
  --sss-line: #e2e8f0;
  --sss-soft: #eef2ff;
  --sss-hi: #fff3b0;
  --sss-radius: 14px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.sss *, .sss *::before, .sss *::after { box-sizing: border-box; }
.sss-form { display: flex; align-items: center; gap: 0; position: relative; margin: 0; width: 100%; }

/* Campo y botón: selectores con más especificidad y !important en lo que el tema suele pisar
   (color del texto, borde, radio, alto, estado hover del botón). */
.sss .sss-form .sss-input {
  flex: 1 1 auto; min-width: 0; width: 100% !important; max-width: none; margin: 0 !important;
  height: 48px !important; min-height: 0 !important;
  padding: 0 54px 0 20px !important;
  border: 2px solid var(--sss-accent) !important; border-radius: 999px !important;
  background: var(--sss-bg) !important; background-image: none !important; box-shadow: none;
  color: var(--sss-fg) !important; -webkit-text-fill-color: var(--sss-fg) !important; caret-color: var(--sss-fg) !important;
  font: inherit; font-size: 15px !important; line-height: normal !important; letter-spacing: normal; text-transform: none;
  -webkit-appearance: none; appearance: none;
}
.sss .sss-form .sss-input::placeholder { color: var(--sss-muted) !important; -webkit-text-fill-color: var(--sss-muted) !important; opacity: 1 !important; }
.sss .sss-form .sss-input::-webkit-search-decoration,
.sss .sss-form .sss-input::-webkit-search-cancel-button,
.sss .sss-form .sss-input::-webkit-search-results-button { -webkit-appearance: none; display: none; }
.sss .sss-form .sss-input:hover,
.sss .sss-form .sss-input:focus {
  background: var(--sss-bg) !important; color: var(--sss-fg) !important; -webkit-text-fill-color: var(--sss-fg) !important;
  border-color: var(--sss-accent) !important;
}
.sss .sss-form .sss-input:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--sss-accent) 22%, transparent) !important; }
.sss .sss-form .sss-btn {
  position: absolute !important; top: 0 !important; bottom: 0 !important; right: 6px !important; left: auto !important;
  margin: auto 0 !important; transform: none !important;
  width: 36px !important; height: 36px !important; min-height: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important; box-shadow: none !important;
  background: transparent !important; color: var(--sss-accent) !important;
  cursor: pointer; display: grid; place-items: center; transition: background-color .15s;
}
.sss .sss-form .sss-btn:hover,
.sss .sss-form .sss-btn:focus,
.sss .sss-form .sss-btn:active {
  transform: none !important; background: color-mix(in srgb, var(--sss-accent) 12%, transparent) !important;
  color: var(--sss-accent) !important; border: 0 !important; box-shadow: none !important;
}
.sss .sss-form .sss-btn svg { width: 20px; height: 20px; stroke: currentColor; pointer-events: none; }
.sss .sss-form .sss-btn:focus-visible, .sss-chip:focus-visible, .sss-link:focus-visible { outline: 2px solid var(--sss-accent); outline-offset: 2px; }

/* En el header de Blocksy el contenedor del Text se encoge al contenido: se lo estira (clase puesta por el JS). */
.sss-ancho { flex: 1 1 auto !important; min-width: 0; max-width: 100% !important; }
.sss-ancho > .entry-content { width: 100% !important; }
.sss-ancho-p { flex: 1 1 auto !important; }

.sss-dd {
  position: absolute; z-index: 99999; left: 0; top: calc(100% + 8px);
  width: min(680px, calc(100vw - 24px)); max-height: min(75vh, 640px); overflow: auto;
  background: var(--sss-bg); color: var(--sss-fg); border: 1px solid var(--sss-line); border-radius: var(--sss-radius);
  box-shadow: 0 14px 44px rgba(10, 25, 60, .22); text-align: left; font-size: 14px; line-height: 1.35;
}
.sss-dd[hidden] { display: none; }
.sss-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 11px 16px 8px; color: var(--sss-muted); font-size: 13px; }
.sss-top b { color: var(--sss-fg); font-weight: 600; }
.sss-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sss-chips--c, .sss-sec { padding: 0 16px 10px; }
.sss-sec { padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sss-chip {
  display: inline-flex; align-items: center; padding: 5px 11px; border: 0; border-radius: 999px;
  background: var(--sss-soft); color: var(--sss-fg); font: inherit; font-size: 12.5px; cursor: pointer;
}
.sss-chip.on { background: var(--sss-accent); color: #fff; }
.sss-gt { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--sss-muted); font-weight: 600; }
.sss-gt--b { padding: 10px 16px 6px; border-top: 1px solid var(--sss-line); }

.sss-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--sss-line); color: inherit; text-decoration: none;
}
.sss .sss-row, .sss .sss-row:hover, .sss .sss-row:focus { color: var(--sss-fg) !important; text-decoration: none !important; }
.sss .sss-row:hover, .sss .sss-row.is-act { background: var(--sss-soft); }
.sss .sss-foot, .sss .sss-foot:hover { color: var(--sss-fg) !important; text-decoration: none !important; }
.sss-th { width: 48px; height: 48px; border-radius: 10px; background: var(--sss-soft); overflow: hidden; display: grid; place-items: center; }
.sss-th img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sss-rb { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sss-t { font-weight: 500; }
.sss-t mark { background: var(--sss-hi); color: inherit; border-radius: 3px; padding: 0 2px; }
.sss-m { font-size: 12.5px; color: var(--sss-muted); display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
.sss-p { font-weight: 600; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.sss-p s { display: block; font-weight: 400; font-size: 11.5px; color: var(--sss-muted); }
.sss-foot { display: block; padding: 12px 16px; border-top: 1px solid var(--sss-line); font-weight: 500; color: inherit; text-decoration: none; }
.sss-foot:hover { background: var(--sss-soft); }
.sss-vacio { padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.sss-vacio p { margin: 0; color: var(--sss-muted); }
.sss-link { background: none; border: 0; padding: 0; font: inherit; color: var(--sss-accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sss-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Desktop: el panel no cambia el diseño y el botón de abrir no se ve. */
.sss-panel { display: contents; }
.sss .sss-abrir { display: none; }

@media (max-width: 689px) {
  .sss-dd { left: 0; right: 0; width: auto; max-height: 70vh; }
  .sss-row { gap: 12px; padding: 10px 14px; }

  /* Mobile: en el header queda solo un botón redondo con la lupa; el buscador se abre en un overlay. */
  .sss-ancho { flex: 0 0 auto !important; }
  .sss-ancho-p { flex: 0 1 auto !important; }
  .sss { width: auto; }
  .sss > .sss-panel { display: none; }
  .sss .sss-abrir {
    display: grid !important; place-items: center; width: 44px !important; height: 44px !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 2px solid var(--sss-accent) !important; border-radius: 50% !important;
    background: var(--sss-bg) !important; color: var(--sss-accent) !important; box-shadow: none !important; transform: none !important; cursor: pointer;
  }
  .sss .sss-abrir:hover, .sss .sss-abrir:focus, .sss .sss-abrir:active {
    background: color-mix(in srgb, var(--sss-accent) 12%, var(--sss-bg)) !important; color: var(--sss-accent) !important;
    border-color: var(--sss-accent) !important; transform: none !important; box-shadow: none !important;
  }
}

/* Overlay (se arma por JS al tocar el botón; el panel se mueve acá y vuelve al cerrar). */
html.sss-lock { overflow: hidden; }
.sss-ov {
  position: fixed !important; inset: 0; z-index: 999999; width: auto !important;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px; background: rgba(10, 25, 60, .62); overflow: auto; overscroll-behavior: contain;
}
.sss-ov .sss-panel { display: block !important; width: 100%; max-width: 560px; margin-top: 9vh; }
.sss-ov .sss-form { position: relative; }
.sss-ov .sss-dd {
  position: static; width: 100%; max-height: calc(100vh - 9vh - 96px); max-height: calc(100dvh - 9vh - 96px);
  margin-top: 10px; left: auto; right: auto;
}
.sss .sss-cerrar {
  position: absolute !important; top: 12px; right: 12px; left: auto !important; width: 40px !important; height: 40px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; box-shadow: none !important; transform: none !important;
  background: rgba(255, 255, 255, .18) !important; color: #fff !important; cursor: pointer; display: grid; place-items: center;
}
.sss .sss-cerrar:hover, .sss .sss-cerrar:focus { background: rgba(255, 255, 255, .32) !important; color: #fff !important; }
.sss .sss-cerrar svg { width: 20px; height: 20px; stroke: currentColor; pointer-events: none; }

/* Nivel 2 (IA): bloque "Interpretado como" con filtros que se pueden quitar. */
.sss-ia { border-top: 1px solid var(--sss-line); }
.sss-ia-top { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 8px; }
.sss-ia-top .sss-gt { margin: 0; }
.sss .sss-chip--f { background: var(--sss-soft); color: var(--sss-fg) !important; border: 1px solid var(--sss-line) !important; }
.sss .sss-chip--f:hover { background: color-mix(in srgb, var(--sss-accent) 14%, var(--sss-bg)); }
.sss-ia-carga { padding: 12px 16px; color: var(--sss-muted); border-top: 1px solid var(--sss-line); font-size: 13px; }

.sss-ia-nota { color: var(--sss-muted); font-size: 12.5px; }
