/* ============================================
   Navbar Search – Compact Autocomplete Input
   ============================================ */

:root {
  --ts-primary: #2a7d2a;
  --ts-primary-dark: #1e5e1e;
}

.ts-nav-search-group {
  position: relative;
  max-width: 320px;
  min-width: 200px;
}

.ts-nav-search-group .form-control {
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  padding: 0 72px 0 16px;
  font-size: 0.875rem;
  background: #f8fafc;
  transition:
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
  width: 100%;
  outline: none;
  box-sizing: border-box;
}

.ts-nav-search-group .form-control:focus {
  border-color: var(--ts-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 125, 42, 0.12);
}

.ts-nav-search-group .form-control::placeholder {
  color: #94a3b8;
  font-size: 0.8rem;
}

.ts-nav-search-group .ts-clear-btn {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  display: none;
  z-index: 5;
}

.ts-nav-search-group .ts-clear-btn:hover {
  color: #64748b;
}

.ts-nav-search-group .ts-clear-btn.visible {
  display: block;
}

.ts-nav-search-group .ts-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  width: 32px;
  border-radius: 50%;
  border: none;
  background: var(--ts-primary);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ts-nav-search-group .ts-search-btn:hover {
  background: var(--ts-primary-dark);
}

.ts-nav-search-group .ts-search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Sugerencias dropdown ---- */
.ts-nav-suggestions {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  overflow: hidden;
  display: none;
}

.ts-nav-suggestions.active {
  display: block;
}

.ts-nav-suggestions .ts-suggest-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.15s;
  gap: 8px;
}

.ts-nav-suggestions .ts-suggest-item:last-child {
  border-bottom: none;
}

.ts-nav-suggestions .ts-suggest-item:hover {
  background: #f8f9fa;
}

.ts-nav-suggestions .ts-suggest-item .ts-suggest-icon {
  color: #adb5bd;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.ts-nav-suggestions .ts-suggest-item .ts-suggest-text {
  color: #212529;
  font-size: 0.85rem;
}

.ts-nav-suggestions .ts-suggest-item .ts-suggest-text mark {
  background: #fef08a;
  color: #212529;
  padding: 0 2px;
}

.ts-nav-suggestions .ts-suggest-item .ts-suggest-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: #adb5bd;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .ts-nav-search-group .form-control {
    font-size: 0.8rem;
    padding: 0 68px 0 12px;
  }

  .ts-nav-suggestions {
    border-radius: 8px;
  }
}

/* ---- Contexto: dentro del menú mobile de WoodMart ---- */
.mobile-nav .ts-nav-search-group {
  max-width: none;
  min-width: 0;
  padding: 10px 15px;
}

.mobile-nav .ts-nav-search-group .form-control {
  height: 42px;
  font-size: 0.875rem;
  border-radius: 6px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  padding: 0 44px 0 14px;
}

.mobile-nav .ts-nav-search-group .form-control:focus {
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 3px rgba(42, 125, 42, 0.15);
}

.mobile-nav .ts-nav-suggestions {
  position: absolute;
  top: 54px;
  left: 15px;
  right: 15px;
  z-index: 10001;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.mobile-nav .ts-nav-search-group .ts-clear-btn {
  right: 48px;
}

.mobile-nav .ts-nav-search-group .ts-search-btn {
  right: 6px;
  height: 30px;
  width: 30px;
}

/* Ocultar el search nativo de WoodMart dentro del mobile menu
   porque ya tenemos nuestro custom search */
.mobile-nav > .searchform {
  display: none !important;
}
