.tnb-ls {
  --tnb-ls-border: #d8e0ea;
  --tnb-ls-border-strong: #c5d0dc;
  --tnb-ls-bg: #ffffff;
  --tnb-ls-bg-soft: #f8fafc;
  --tnb-ls-text: #0f172a;
  --tnb-ls-subtle: #64748b;
  --tnb-ls-primary: #0284c7;
  --tnb-ls-primary-soft: rgba(2, 132, 199, 0.16);

  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 350px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--tnb-ls-text);
  margin-left: 10px;
}

.tnb-ls,
.tnb-ls * {
  box-sizing: border-box;
}

.tnb-ls-panel {
  position: relative;
  width: 100%;
}

.tnb-ls-panel[hidden] {
  display: none !important;
}

.tnb-ls-panel-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    padding: 30px 0 10px 0;
}

/* .tnb-ls-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
} */

.tnb-ls-panel-close {
    border-radius: 10px;
    border: none;
    background: #ff0000;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    margin: 0;
}
.tnb-ls-panel-close span {
    font-size: 18px;
}
.tnb-ls-panel-close:hover {
  background: #e2e8f0;
}

.tnb-ls-form {
  margin: 0;
  width: 100%;
}

.tnb-ls-field {
  position: relative;
  width: 100%;
}

.tnb-ls-field-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: #94a3b8;
  line-height: 1;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tnb-ls-input {
  width: 100% !important;
  min-width: 0;
  height: 45px !important;
  padding: 10px 72px 10px 42px;
  border: 1px solid var(--tnb-ls-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--tnb-ls-text) !important;
  font-size: 14px !important;
  margin: 0 !important;
}

.tnb-ls-clear {
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  margin: 0;
  background: #e2e8f0;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tnb-ls-clear:hover {
  background: #cbd5e1;
}

.tnb-ls-clear span {
  font-size: 16px;
  line-height: 1;
}

.tnb-ls-clear[hidden] {
  display: none !important;
}

.tnb-ls-input:focus {
  outline: none;
  border-color: var(--tnb-ls-primary);
  box-shadow: 0 0 0 3px var(--tnb-ls-primary-soft);
}

.tnb-ls-trigger {
  display: none;
  width: 35px;
  height: 35px;
  border: 1px solid var(--tnb-ls-border);
  border-radius: 999px;
  background: #fff;
  color: var(--tnb-ls-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tnb-ls-trigger:hover {
  background: #f8fafc;
}

.tnb-ls-trigger-icon {
  display: inline-flex;
  line-height: 1;
}

.tnb-ls-overlay {
  display: none;
}

.tnb-ls-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 140;
  background: var(--tnb-ls-bg);
  border: 1px solid var(--tnb-ls-border);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.tnb-ls-state {
  display: none;
  padding: 12px 14px;
  color: #475569;
}

.tnb-ls-state.is-loading,
.tnb-ls-state.is-empty,
.tnb-ls-state.is-error {
  display: block;
}

.tnb-ls-state.is-loading {
  color: #bbbbbb;
}

.tnb-ls-state.is-error {
  color: #b91c1c;
}

.tnb-ls-results {
  max-height: min(540px, 70vh);
  overflow-y: auto;
}

.tnb-ls-section + .tnb-ls-section {
  border-top: 1px solid #edf2f7;
}

.tnb-ls-section-title {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f8fafc;
  color: #64748b;
}

.tnb-ls-categories,
.tnb-ls-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tnb-ls-category-item + .tnb-ls-category-item,
.tnb-ls-item + .tnb-ls-item {
  border-top: 1px solid #edf2f7;
}

.tnb-ls-category-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: #0f172a;
}

.tnb-ls-category-link:hover {
  background: #f8fafc;
}

.tnb-ls-category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.tnb-ls-category-count {
  flex: 0 0 auto;
  font-size: 11px;
  color: #64748b;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
}

.tnb-ls-link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  text-decoration: none;
  color: #0f172a;
}

.tnb-ls-link:hover {
  background: #f8fafc;
}

.tnb-ls-thumb {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.tnb-ls-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tnb-ls-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.tnb-ls-thumb-fallback-service {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.tnb-ls-thumb-fallback-product {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.tnb-ls-thumb-fallback-article {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.tnb-ls-thumb-fallback-other {
  background: linear-gradient(135deg, #64748b, #334155);
}

.tnb-ls-body {
  min-width: 0;
  flex: 1;
}

.tnb-ls-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tnb-ls-title {
  min-width: 0;
  flex: 1;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tnb-ls-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tnb-ls-badge-service {
  background: #e0f2fe;
  color: #075985;
}

.tnb-ls-badge-product {
  background: #fff7ed;
  color: #9a3412;
}

.tnb-ls-badge-article {
  background: #ecfccb;
  color: #365314;
}

.tnb-ls-badge-other {
  background: #f1f5f9;
  color: #334155;
}

.tnb-ls-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tnb-ls-price {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tnb-ls-price-sale,
.tnb-ls-price-current {
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
}

.tnb-ls-price-regular {
  color: #94a3b8;
  font-size: 12px;
  text-decoration: line-through;
}

.tnb-ls-price-contact {
  display: inline-flex;
  align-items: center;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  padding: 4px 8px;
}

.tnb-ls-footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.tnb-ls-view-all {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-decoration: none;
  color: #0369a1;
  font-weight: 600;
}

.tnb-ls-view-all:hover {
  background: #f0f9ff;
}

.tnb-ls[data-mode="modal"] .tnb-ls-trigger {
  display: inline-flex;
}

.tnb-ls[data-mode="responsive"].is-mobile-context .tnb-ls-trigger {
  display: inline-flex;
  margin: 5px;
}

.tnb-ls[data-mode="responsive"].is-mobile-context:not(.is-modal-open) .tnb-ls-panel {
  display: none;
}

.tnb-ls[data-mode="modal"]:not(.is-modal-open) .tnb-ls-panel {
  display: none;
}

.tnb-ls.is-modal-open .tnb-ls-overlay {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(15, 23, 42, 0.45);
}

.tnb-ls.is-modal-open .tnb-ls-panel {
  position: fixed;
  z-index: 2147483647;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: #fff;
  border-radius: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.tnb-ls.is-modal-open .tnb-ls-trigger {
  display: none !important;
}

.tnb-ls.is-modal-open .tnb-ls-panel-header {
  display: flex;
}

.tnb-ls.is-modal-open .tnb-ls-dropdown {
  position: relative;
  inset: auto;
  top: 10px;
  left: auto;
  right: auto;
  box-shadow: none;
  border: 1px solid var(--tnb-ls-border);
  border-radius: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.tnb-ls.is-modal-open .tnb-ls-results {
  max-height: calc(100dvh - 170px);
}

.tnb-ls-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.tnb-ls-root-portal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-width: 0 !important;
  margin: 0 !important;
  pointer-events: none;
}

.tnb-ls-root-portal .tnb-ls-panel,
.tnb-ls-root-portal .tnb-ls-overlay,
.tnb-ls-root-portal .tnb-ls-trigger {
  pointer-events: auto;
}

@media (max-width: 992px) {
  .tnb-ls {
    min-width: 0;
  }

  .tnb-ls.is-modal-open .tnb-ls-input {
    font-size: 16px !important;
  }

  .tnb-ls-link {
    gap: 10px;
    padding: 11px 12px;
  }

  .tnb-ls-thumb {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .tnb-ls-title {
    font-size: 13px;
  }

  .tnb-ls.is-modal-open .tnb-ls-panel {
    overscroll-behavior: contain;
  }

  .tnb-ls.is-modal-open .tnb-ls-results {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  .tnb-ls[data-mode="responsive"] .tnb-ls-trigger {
    display: inline-flex;
  }

  .tnb-ls[data-mode="responsive"]:not(.is-modal-open) .tnb-ls-panel {
    display: none;
  }
}

@media (max-width: 992px) {
  .tnb-ls[data-mode="responsive"] .tnb-ls-trigger {
    display: inline-flex;
    margin: 0;
  }

  .tnb-ls[data-mode="responsive"]:not(.is-modal-open) .tnb-ls-panel {
    display: none;
  }
}
