.tresnak-home-top-slider-wrap {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #0b84ff 0%, #0a6ad9 48%, #042a57 100%);
}

.tresnak-home-top-slider {
  position: relative;
}

.tresnak-home-top-slider__viewport {
  overflow: hidden;
}

.tresnak-home-top-slider__track {
  display: flex;
  gap: 0.8rem;
  transition: transform 500ms ease;
  will-change: transform;
}

.tresnak-home-top-slider__item {
  flex: 0 0 calc((100% - 1.6rem) / 3);
  min-width: 220px;
  text-decoration: none;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  display: block;
}

.tresnak-home-top-slider__item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tresnak-home-top-slider__item-sub {
  opacity: 0.85;
}

.tresnak-home-top-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(16, 30, 45, 0.45);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tresnak-home-top-slider__btn--prev {
  left: 8px;
}

.tresnak-home-top-slider__btn--next {
  right: 8px;
}

.tresnak-home-top-slider__btn:hover {
  background: rgba(16, 30, 45, 0.72);
}

@media (max-width: 980px) {
  .tresnak-home-top-slider__item {
    flex-basis: calc((100% - 0.8rem) / 2);
  }
}

@media (max-width: 680px) {
  .tresnak-home-top-slider__item {
    flex-basis: 100%;
    min-width: 100%;
  }
}

.tresnak-home-search-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.tresnak-home-search-modal.is-open {
  display: block;
}

.tresnak-home-search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
}

.tresnak-home-search-modal__dialog {
  position: fixed;
  box-sizing: border-box;
  margin: 0;
  width: min(760px, calc(100% - 2rem));
  max-height: 78vh;
  /* top / left / width / max-height se ajustan por JS al abrir, bajo el campo de búsqueda */
  background: linear-gradient(135deg, #0b84ff 0%, #0a6ad9 48%, #042a57 100%);
  color: #f8fafc;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tresnak-home-search-modal__header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.tresnak-home-search-modal__header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.tresnak-home-search-modal__query {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
  color: rgba(248, 250, 252, 0.98);
  min-height: 1.35em;
}

.tresnak-home-search-modal__close {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(16, 30, 45, 0.45);
  color: #f8fafc;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}

.tresnak-home-search-modal__close:hover {
  background: rgba(16, 30, 45, 0.72);
}

.tresnak-home-search-modal__body {
  padding: 0.6rem 0.8rem;
  overflow: auto;
}

.tresnak-home-search-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.tresnak-home-search-modal__card {
  text-decoration: none;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.75rem;
  display: block;
  background: rgba(255, 255, 255, 0.12);
}

.tresnak-home-search-modal__card:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.28);
}

.tresnak-home-search-modal__card-icon {
  display: block;
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.tresnak-home-search-modal__card-title {
  display: block;
  font-size: 0.96rem;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.tresnak-home-search-modal__card-desc {
  display: block;
  color: rgba(248, 250, 252, 0.9);
  font-size: 0.86rem;
  line-height: 1.4;
}

.tresnak-home-search-modal__empty {
  color: rgba(248, 250, 252, 0.92);
  margin: 0.5rem;
}

.tresnak-home-recent-tools {
  margin: 0 0 1.25rem;
}

.tresnak-home-recent-tools[hidden] {
  display: none !important;
}

.tresnak-home-recent-tools__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.tresnak-home-recent-tools__item {
  text-decoration: none;
  color: #0f172a;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  padding: 0.75rem;
  background: #ffffff;
  display: block;
}

.tresnak-home-recent-tools__item:hover {
  border-color: #0a6ad9;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.1);
}

.tresnak-home-recent-tools__icon {
  display: block;
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.tresnak-home-recent-tools__title {
  display: block;
  font-size: 0.96rem;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.tresnak-home-recent-tools__desc {
  display: block;
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.45;
}

.tresnak-tool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tresnak-tool-badge--top {
  background: #dbeafe;
  color: #0c4a6e;
}

.tresnak-tool-badge--new {
  background: #dcfce7;
  color: #166534;
}

.tresnak-home-extra-cta {
  margin-top: 1.1rem;
}

.tresnak-home-faq details {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.55rem;
}

.tresnak-home-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.tresnak-home-faq p {
  margin: 0.5rem 0 0;
  color: #475569;
}

@media (max-width: 860px) {
  .tresnak-home-search-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tresnak-home-recent-tools__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tresnak-home-search-modal__grid {
    grid-template-columns: 1fr;
  }

  .tresnak-home-recent-tools__grid {
    grid-template-columns: 1fr;
  }
}

/* Buscador de herramientas compacto ([tresnak_buscador_herramientas_menu]) */
/* Evita que el <a> del menú intercepte clics cuando el shortcode va en la etiqueta del ítem. */
li.tresnak-menu-tool-search > a,
li.menu-item:has(.tresnak-tools-search--menu) > a {
  pointer-events: none;
  cursor: default;
}

li.tresnak-menu-tool-search > a .tresnak-tools-search--menu,
li.menu-item:has(.tresnak-tools-search--menu) > a .tresnak-tools-search--menu {
  pointer-events: auto;
  cursor: default;
}

.tresnak-tools-search--menu {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  max-width: 100%;
}

.tresnak-tools-search--menu__row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: text;
}

.tresnak-tools-search--menu__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  /* Alineado con --tresnak-color-accent (#2563eb) del panel Tresnak */
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #eff6ff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.tresnak-tools-search--menu__icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  color: #2563eb;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Quitar borde/“search field” del sistema y del tema (input[type=search]). */
.tresnak-tools-search--menu input.tresnak-tools-search--menu__input[type='search'] {
  width: 8.5rem;
  min-width: 0;
  padding: 0.28rem 0.15rem;
  margin: 0;
  border: 0 !important;
  border-style: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  font-size: 0.875rem;
  line-height: 1.2;
  color: #0f172a;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  transition: width 0.2s ease;
}

.tresnak-tools-search--menu input.tresnak-tools-search--menu__input[type='search']::-webkit-search-decoration,
.tresnak-tools-search--menu input.tresnak-tools-search--menu__input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.tresnak-tools-search--menu input.tresnak-tools-search--menu__input[type='search']:focus {
  outline: none;
  border: 0 !important;
  box-shadow: none !important;
}

.tresnak-tools-search--menu:focus-within .tresnak-tools-search--menu__icon-wrap {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.tresnak-tools-search--menu:focus-within input.tresnak-tools-search--menu__input[type='search'] {
  width: 11rem;
}

@media (max-width: 480px) {
  .tresnak-tools-search--menu:focus-within input.tresnak-tools-search--menu__input[type='search'] {
    width: 8rem;
  }
}
