/* Smart Search Widget - Frontend Styles */

.ssw-widget-wrap {
    position: relative;
    width: 100%;
}

/* Search Box */
.ssw-search-box {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ssw-search-box:focus-within {
    border-color: #6b7cf6;
    box-shadow: 0 0 0 3px rgba(107, 124, 246, 0.1);
}

.ssw-input {
    flex: 1;
    width: 100%;
    padding: 12px 8px;
    font-size: 15px;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

/* Spinner */
.ssw-spinner {
    position: absolute;
    right: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #6b7cf6;
    border-radius: 50%;
    animation: ssw-spin 0.7s linear infinite;
}

@keyframes ssw-spin {
    to { transform: rotate(360deg); }
}

/* Results Grid */
.ssw-results {
    width: 100%;
    transition: opacity 0.2s ease;
}

.ssw-results.ssw-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Live Grid loading state — dim the target grid + show a spinner overlay
   while matches are being fetched. */
.ssw-grid-loading {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.ssw-grid-loading::after {
    content: "";
    position: absolute;
    top: 24px;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    border: 3px solid #e0e0e0;
    border-top-color: #6b7cf6;
    border-radius: 50%;
    animation: ssw-spin 0.7s linear infinite;
    z-index: 5;
}

.ssw-results-grid {
    display: grid;
    grid-template-columns: repeat(var(--ssw-columns, 3), 1fr);
    gap: var(--ssw-gap, 20px);
}

.ssw-result-item {
    width: 100%;
}

/* Messages */
.ssw-no-results,
.ssw-error {
    font-size: 14px;
    color: #888;
    padding: 16px 0;
    margin: 0;
}

.ssw-error {
    color: #e05c5c;
}

/* Responsive */
@media (max-width: 768px) {
    .ssw-results-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Clickable result items ── */
.jet-listing-grid__item {
    position: relative;
}

.ssw-item-link {
    display: block;
    text-decoration: none;
}

.ssw-item-link:hover {
    text-decoration: none;
}

/* ── Icon ── */
.ssw-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9ca3af;
}

.ssw-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ssw-icon img {
    display: block;
    object-fit: contain;
}
/* ── See More Button ── */
.ssw-see-more-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}

.ssw-see-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.ssw-see-more-btn:hover {
    opacity: 1;
}

/* ── Clear Button ── */
.ssw-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    margin-left: 6px;
    background: none;
    border: none;          /* reset browser default button border */
    outline: none;         /* reset focus outline */
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    transition: color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ssw-clear-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}

.ssw-clear-btn:hover {
    color: #374151;
}

/* ── Tabs Bar ─────────────────────────────────────────────────────────────── */
.ssw-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.ssw-tab-btn {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px !important;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.ssw-tab-btn.ssw-tab-active {
  background-color: #f0ede8;
  color: inherit;
}

.ssw-tab-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ssw-tab-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.ssw-tab-icon svg,
.ssw-tab-icon i {
  width: 1em;
  height: 1em;
}
