/*
 * Noghte Lost Sales frontend styles.
 * Every visual rule is scoped to .ngtls-scope.
 * Theme and Elementor button styles intentionally win over fallback button rules.
 */

.ngtls-scope {
  --ngtls-accent: var(--wp--preset--color--primary, var(--e-global-color-primary, var(--global-palette1, var(--ast-global-color-0, var(--wd-primary-color, var(--fs-color-primary, var(--porto-primary-color, var(--nectar-accent-color, var(--accent, var(--primary-color, #1f2937))))))))));
  --ngtls-accent-contrast: var(--wp--preset--color--base, var(--global-palette9, var(--ast-global-color-5, #fff)));
  --ngtls-text: currentColor;
  --ngtls-muted: rgba(31, 41, 55, .62);
  --ngtls-surface: var(--wp--preset--color--base, var(--global-palette9, var(--ast-global-color-5, var(--base-3, var(--wd-main-bgcolor, Canvas)))));
  --ngtls-surface-soft: #f7f8fa;
  --ngtls-border: rgba(31, 41, 55, .14);
  --ngtls-radius: 18px;
  --ngtls-shadow: 0 18px 46px rgba(15, 23, 42, .10);
  --ngtls-shadow-strong: 0 28px 76px rgba(15, 23, 42, .18);
  direction: rtl;
  box-sizing: border-box;
}

.ngtls-scope.ngtls-search,
.ngtls-scope.ngtls-modal {
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  text-align: start;
}

.ngtls-scope,
.ngtls-scope *,
.ngtls-scope *::before,
.ngtls-scope *::after {
  box-sizing: border-box;
}

:where(.ngtls-scope button,
.ngtls-scope input,
.ngtls-scope select,
.ngtls-scope textarea) {
  font-family: inherit;
}

.ngtls-scope.ngtls-search {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  color: inherit;
  isolation: isolate;
}

.ngtls-scope .ngtls-form {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  margin: 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--ngtls-border);
  border-radius: var(--ngtls-radius);
  background: color-mix(in srgb, var(--ngtls-surface) 94%, transparent);
  color: inherit;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: var(--ngtls-shadow), inset 0 1px 0 rgba(255, 255, 255, .72);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ngtls-scope .ngtls-form::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--ngtls-accent);
  opacity: .82;
  pointer-events: none;
}

.ngtls-scope .ngtls-form:focus-within {
  border-color: var(--ngtls-accent);
  box-shadow: var(--ngtls-shadow), 0 0 0 3px color-mix(in srgb, var(--ngtls-accent) 12%, transparent);
  transform: translateY(-1px);
}

.ngtls-scope .ngtls-input-icon {
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 42px;
  flex: 0 0 auto;
  border-radius: calc(var(--ngtls-radius) - 7px);
  background: color-mix(in srgb, var(--ngtls-accent) 9%, var(--ngtls-surface));
  color: var(--ngtls-accent);
}

.ngtls-scope .ngtls-input-icon svg {
  display: block;
  max-width: 100%;
}

/* Internal input reset: scoped, theme-safe and typography-aware. */
.ngtls-scope .ngtls-input {
  min-width: 0;
  width: 100%;
  height: 46px;
  min-height: 0;
  margin: 0;
  padding: 0 5px;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: .95em;
  line-height: 1.5;
  appearance: none;
  -webkit-appearance: none;
}

.ngtls-scope .ngtls-input:focus,
.ngtls-scope .ngtls-input:focus-visible {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.ngtls-scope .ngtls-input::-webkit-search-cancel-button,
.ngtls-scope .ngtls-input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

.ngtls-scope .ngtls-input::placeholder {
  color: inherit;
  opacity: .55;
}

/*
 * Theme-compatible buttons.
 * These selectors use :where() so theme .button/.wp-element-button rules and
 * Elementor controls override the fallback without !important.
 */
:where(.ngtls-scope .ngtls-submit),
:where(.ngtls-scope.ngtls-trigger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin: 0;
  padding: .65em 1.35em;
  border: 1px solid transparent;
  border-radius: calc(var(--ngtls-radius) - 7px);
  background: var(--ngtls-accent);
  color: var(--ngtls-accent-contrast);
  font: inherit;
  font-size: .9em;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

:where(.ngtls-scope .ngtls-submit:hover),
:where(.ngtls-scope .ngtls-submit:focus-visible),
:where(.ngtls-scope.ngtls-trigger:hover),
:where(.ngtls-scope.ngtls-trigger:focus-visible) {
  color: var(--ngtls-accent-contrast);
  filter: brightness(.97);
  transform: translateY(-1px);
  outline: 0;
}

.ngtls-scope .ngtls-clear,
.ngtls-scope .ngtls-modal-close,
.ngtls-scope .ngtls-modal-backdrop {
  -webkit-appearance: none;
  appearance: none;
}

.ngtls-scope .ngtls-clear {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 7%, transparent);
  color: inherit;
  opacity: .68;
  box-shadow: none;
  cursor: pointer;
  font: 21px/1 Arial, sans-serif;
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

.ngtls-scope .ngtls-clear:hover,
.ngtls-scope .ngtls-clear:focus-visible {
  background: color-mix(in srgb, currentColor 11%, transparent);
  color: inherit;
  opacity: 1;
  transform: rotate(8deg);
  outline: 0;
}

.ngtls-scope .ngtls-clear.is-visible {
  display: grid;
}

.ngtls-scope.ngtls-search.is-loading .ngtls-input-icon svg {
  animation: ngtls-pulse .9s ease-in-out infinite alternate;
}

.ngtls-scope .ngtls-status {
  min-height: 21px;
  padding: 7px 14px 0;
  color: inherit;
  font-size: .75em;
  line-height: 1.8;
  opacity: .6;
}

.ngtls-scope .ngtls-results {
  position: absolute;
  z-index: 99990;
  inset-inline: 0;
  top: calc(100% + 9px);
  max-height: min(540px, 66vh);
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--ngtls-border);
  border-radius: var(--ngtls-radius);
  background: color-mix(in srgb, var(--ngtls-surface) 98%, transparent);
  color: inherit;
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--ngtls-shadow-strong);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, currentColor 20%, transparent) transparent;
}

.ngtls-scope .ngtls-results::-webkit-scrollbar {
  width: 6px;
}

.ngtls-scope .ngtls-results::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 20%, transparent);
}

.ngtls-scope .ngtls-results[hidden] {
  display: none !important;
}

.ngtls-scope .ngtls-result {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--ngtls-radius) - 7px);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-decoration: none;
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ngtls-scope .ngtls-result + .ngtls-result {
  margin-top: 3px;
}

.ngtls-scope .ngtls-result:hover,
.ngtls-scope .ngtls-result:focus,
.ngtls-scope .ngtls-result.is-active {
  border-color: color-mix(in srgb, var(--ngtls-accent) 16%, transparent);
  background: color-mix(in srgb, var(--ngtls-accent) 7%, var(--ngtls-surface));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 7px 20px rgba(15, 23, 42, .045);
  transform: translateX(-2px);
  outline: 0;
}

.ngtls-scope .ngtls-result-image {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--ngtls-border);
  border-radius: calc(var(--ngtls-radius) - 4px);
  background: var(--ngtls-surface-soft);
  box-shadow: 0 4px 13px rgba(15, 23, 42, .06);
}

.ngtls-scope .ngtls-result-image img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.ngtls-scope .ngtls-result-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ngtls-scope .ngtls-result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ngtls-scope .ngtls-result-title {
  overflow: hidden;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: .92em;
  font-weight: 700;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ngtls-scope .ngtls-result-type {
  flex: 0 0 auto;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ngtls-accent) 10%, var(--ngtls-surface));
  color: var(--ngtls-accent);
  font-family: inherit;
  font-size: .68em;
  font-weight: 700;
  line-height: 1.4;
}

.ngtls-scope .ngtls-result-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: .78em;
  line-height: 1.75;
  opacity: .62;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.ngtls-scope .ngtls-result-price {
  margin: 0;
  color: var(--ngtls-accent);
  font-family: inherit;
  font-size: .8em;
  font-weight: 800;
  line-height: 1.5;
}

.ngtls-scope .ngtls-result-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: calc(var(--ngtls-radius) - 9px);
  background: color-mix(in srgb, currentColor 6%, transparent);
  color: inherit;
  opacity: .56;
  transition: transform .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}

.ngtls-scope .ngtls-result:hover .ngtls-result-arrow,
.ngtls-scope .ngtls-result.is-active .ngtls-result-arrow {
  background: var(--ngtls-accent);
  color: var(--ngtls-accent-contrast);
  opacity: 1;
  transform: translateX(-2px);
}

.ngtls-scope .ngtls-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 18px;
  color: inherit;
  font-family: inherit;
  text-align: center;
  opacity: .68;
}

.ngtls-scope .ngtls-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 3px;
  border-radius: calc(var(--ngtls-radius) - 2px);
  background: color-mix(in srgb, var(--ngtls-accent) 10%, var(--ngtls-surface));
  color: var(--ngtls-accent);
  font-size: 1.7em;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ngtls-accent) 10%, transparent);
}

.ngtls-scope .ngtls-empty strong {
  color: inherit;
  font-family: inherit;
  font-size: .92em;
  font-weight: 700;
  opacity: 1;
}

.ngtls-scope .ngtls-empty small {
  max-width: 440px;
  color: inherit;
  font-family: inherit;
  font-size: .75em;
  line-height: 1.9;
}

.ngtls-scope.ngtls-trigger {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  white-space: nowrap;
}

.ngtls-scope.ngtls-trigger .ngtls-trigger-text {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
  line-height: inherit;
}

.ngtls-scope.ngtls-trigger .ngtls-trigger-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 27px;
  height: 27px;
  margin: 0;
  border-radius: 9px;
  background: color-mix(in srgb, currentColor 13%, transparent);
  color: inherit;
  font-size: 1.25em;
  line-height: 1;
}

.ngtls-scope.ngtls-trigger .ngtls-trigger-icon > :is(svg, i) {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  line-height: 1;
}

.ngtls-scope.ngtls-trigger .ngtls-trigger-icon svg {
  width: 1em;
  height: 1em;
}

.ngtls-scope.ngtls-trigger--icon-only {
  min-width: 46px;
  padding-inline: .75em;
  aspect-ratio: 1 / 1;
}

.ngtls-scope.ngtls-trigger--icon-only .ngtls-trigger-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}

.ngtls-scope.ngtls-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: clamp(24px, 8vh, 88px) 18px 20px;
  visibility: hidden;
  opacity: 0;
  color: inherit;
  transition: opacity .2s ease, visibility .2s ease;
}

.ngtls-scope.ngtls-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.ngtls-scope .ngtls-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, .48);
  box-shadow: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: default;
}

.ngtls-scope .ngtls-modal-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: visible;
  padding: clamp(22px, 3.4vw, 38px);
  border: 1px solid color-mix(in srgb, currentColor 11%, transparent);
  border-radius: 30px;
  background: color-mix(in srgb, var(--ngtls-surface) 98%, transparent);
  color: inherit;
  box-shadow: 0 38px 110px rgba(2, 6, 23, .34), inset 0 1px 0 rgba(255, 255, 255, .72);
  transform: translateY(-14px) scale(.982);
  transition: transform .24s ease;
}

.ngtls-scope.ngtls-modal.is-open .ngtls-modal-panel {
  transform: none;
}

.ngtls-scope .ngtls-modal-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  margin: 0 0 19px;
  padding-inline: 3px 42px;
  color: inherit;
}

.ngtls-scope .ngtls-modal-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--ngtls-accent) 10%, var(--ngtls-surface));
  color: var(--ngtls-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ngtls-accent) 10%, transparent);
}

.ngtls-scope .ngtls-modal-title {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: clamp(1.1em, 2vw, 1.5em);
  font-style: inherit;
  font-weight: 800;
  line-height: 1.45;
}

.ngtls-scope .ngtls-modal-description {
  margin: 3px 0 0;
  color: inherit;
  font-family: inherit;
  font-size: .82em;
  line-height: 1.9;
  opacity: .62;
}

.ngtls-scope .ngtls-modal-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  inset-inline-end: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ngtls-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ngtls-surface) 94%, transparent);
  color: inherit;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .09);
  cursor: pointer;
  font: 24px/1 Arial, sans-serif;
  transition: transform .18s ease, background .18s ease;
}

.ngtls-scope .ngtls-modal-close:hover,
.ngtls-scope .ngtls-modal-close:focus-visible {
  background: color-mix(in srgb, currentColor 7%, var(--ngtls-surface));
  color: inherit;
  transform: rotate(5deg);
  outline: 0;
}

.ngtls-scope.ngtls-modal .ngtls-search {
  max-width: 100%;
}

.ngtls-scope.ngtls-modal .ngtls-results {
  position: relative;
  top: auto;
  margin-top: 8px;
  max-height: min(460px, 48vh);
}

html.ngtls-modal-open {
  overflow: hidden;
}

.ngtls-global-popup-host > .ngtls-trigger {
  display: none !important;
}

@keyframes ngtls-pulse {
  to {
    transform: scale(.86);
    opacity: .46;
  }
}

/* Fallback for browsers without color-mix(). */
@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
  .ngtls-scope {
    --ngtls-muted: #6b7280;
    --ngtls-surface: #fff;
    --ngtls-surface-soft: #f7f8fa;
    --ngtls-border: #e4e7ec;
  }

  .ngtls-scope .ngtls-form,
  .ngtls-scope .ngtls-results,
  .ngtls-scope .ngtls-modal-panel {
    background: #fff;
  }

  .ngtls-scope .ngtls-input-icon,
  .ngtls-scope .ngtls-result-type,
  .ngtls-scope .ngtls-empty-icon,
  .ngtls-scope .ngtls-modal-badge {
    background: #f1f3f8;
  }

  .ngtls-scope .ngtls-result:hover,
  .ngtls-scope .ngtls-result:focus,
  .ngtls-scope .ngtls-result.is-active {
    background: #f7f8fb;
  }
}

@media (max-width: 640px) {
  .ngtls-scope.ngtls-search {
    max-width: 100%;
  }

  .ngtls-scope .ngtls-form {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 58px;
    gap: 5px;
    padding: 6px;
    border-radius: 17px;
  }

  .ngtls-scope .ngtls-input-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .ngtls-scope .ngtls-input {
    height: 42px;
    font-size: .9em;
  }

  .ngtls-scope .ngtls-clear {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  :where(.ngtls-scope .ngtls-submit) {
    min-height: 42px;
    padding-inline: 1em;
    border-radius: 12px;
    font-size: .78em;
  }

  .ngtls-scope .ngtls-status {
    padding-inline: 8px;
  }

  .ngtls-scope .ngtls-results {
    max-height: 58vh;
    border-radius: 17px;
  }

  .ngtls-scope .ngtls-result {
    gap: 9px;
    min-height: 66px;
    padding: 7px;
  }

  .ngtls-scope .ngtls-result-image {
    width: 50px;
    height: 50px;
    border-radius: 12px;
  }

  .ngtls-scope .ngtls-result-excerpt {
    display: none;
  }

  .ngtls-scope .ngtls-result-arrow {
    width: 27px;
    height: 27px;
  }

  .ngtls-scope.ngtls-modal {
    align-items: start;
    padding: 12px;
  }

  .ngtls-scope .ngtls-modal-panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 20px 12px 14px;
    border-radius: 23px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .ngtls-scope .ngtls-modal-head {
    gap: 10px;
    margin-bottom: 15px;
    padding-inline: 4px 38px;
  }

  .ngtls-scope .ngtls-modal-badge {
    width: 41px;
    height: 41px;
    border-radius: 13px;
  }

  .ngtls-scope .ngtls-modal-title {
    font-size: 1.05em;
  }

  .ngtls-scope .ngtls-modal-description {
    font-size: .72em;
  }

  .ngtls-scope .ngtls-modal-close {
    top: 12px;
    inset-inline-end: 12px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 11px;
  }

  .ngtls-scope.ngtls-modal .ngtls-results {
    max-height: 52vh;
  }
}

@media (max-width: 380px) {
  :where(.ngtls-scope .ngtls-submit) {
    padding-inline: .8em;
  }

  .ngtls-scope .ngtls-input-icon {
    width: 33px;
  }

  .ngtls-scope .ngtls-result-type {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ngtls-scope *,
  .ngtls-scope *::before,
  .ngtls-scope *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
