/* ==========================================================================
   Speed Search — Frontend Styles v1.3.11
   ========================================================================== */

/* Reset for plugin elements */
.ss-page,
.ss-page *,
.ss-search-form,
.ss-search-form * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ss-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1f2937;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Home / Landing State */
.ss-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.ss-home-logo {
    margin-bottom: 32px;
}

.ss-logo-text {
    font-size: 48px;
    font-weight: 700;
    color: #374151;
    letter-spacing: -1px;
}

.ss-logo-text span {
    color: #2563eb;
}

.ss-home-form {
    width: 100%;
    max-width: 600px;
}

/* Search Form */
.ss-search-form {
    position: relative;
    width: 100%;
}

.ss-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.ss-search-wrap:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ss-search-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ss-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px 14px 20px;
    font-size: 16px;
    color: #1f2937;
    background: transparent;
    font-family: inherit;
    width: 100%;
    -webkit-appearance: none;
}

.ss-search-input::placeholder {
    color: #9ca3af;
}

.ss-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.ss-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 2px;
    border: none;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.ss-search-btn:hover {
    background: #1d4ed8;
}

.ss-search-btn svg {
    display: block;
}

/* Suggestions Dropdown */
.ss-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
}

.ss-suggestion-item {
    padding: 10px 20px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ss-suggestion-item:hover,
.ss-suggestion-item.ss-suggestion-active {
    background: #f3f4f6;
}

.ss-suggestion-item:last-child {
    border-radius: 0 0 16px 16px;
}

.ss-suggestion-icon {
    color: #9ca3af;
    flex-shrink: 0;
}

/* Results Header */
.ss-results-header {
    position: relative;
    z-index: 20;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 20px;
}

.ss-results-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.ss-logo-small {
    font-size: 22px;
    font-weight: 700;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.ss-logo-small span {
    color: #2563eb;
}

.ss-logo-small:hover {
    color: #374151;
}

.ss-results-header .ss-search-wrap {
    border-radius: 20px;
}

.ss-results-header .ss-search-input {
    padding: 10px 14px 10px 18px;
    font-size: 15px;
}

.ss-results-header .ss-search-btn {
    width: 36px;
    height: 36px;
}

.ss-results-header .ss-search-btn svg {
    width: 16px;
    height: 16px;
}

/* Results Body */
.ss-results-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.ss-results-container {
    max-width: 700px;
}

.ss-results-info {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.ss-results-info strong {
    color: #1f2937;
}

/* Result Items */
.ss-results-list {
    min-height: 100px;
}

.ss-result-item {
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.ss-result-item:last-child {
    border-bottom: none;
}

.ss-result-item:hover {
    background-color: var(--ss-hover-bg-light, #fafbfc);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.ss-page.ss-dark-mode .ss-result-item:hover {
    background-color: var(--ss-hover-bg-dark, #2a2a2a);
}

.ss-page.ss-hover-light-disabled:not(.ss-dark-mode) .ss-result-item:hover {
    background-color: transparent;
}

.ss-page.ss-hover-dark-disabled.ss-dark-mode .ss-result-item:hover {
    background-color: transparent;
}

.ss-result-url {
    font-size: 13px;
    color: #1a7f37;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-result-url a {
    color: #1a7f37;
    text-decoration: none;
}

.ss-result-url a:hover {
    text-decoration: underline;
}

.ss-result-title {
    margin-bottom: 4px;
}

.ss-result-title a {
    font-size: 18px;
    font-weight: 500;
    color: #1a0dab;
    text-decoration: none;
    line-height: 1.3;
}

.ss-result-title a:hover {
    text-decoration: underline;
}

.ss-result-title a:visited {
    color: #681da8;
}

.ss-result-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ss-result-favicon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    margin-top: 1px;
}

.ss-result-text {
    flex: 1;
    min-width: 0;
}

.ss-result-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-top: 4px;
}

/* Result Badges */
.ss-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.ss-result-badge-featured {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: #dbeafe;
    color: #2563eb;
}

.ss-result-badge-ad {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
}

.ss-result-category {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
    background: #f3f4f6;
    color: #6b7280;
}

/* No Results */
.ss-no-results {
    text-align: center;
    padding: 48px 20px;
    color: #6b7280;
}

.ss-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.ss-no-results p {
    font-size: 15px;
    margin: 0;
}

/* Loading / Spinner */
.ss-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.ss-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ss-spin 0.7s linear infinite;
}

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

/* Error message */
.ss-error {
    text-align: center;
    padding: 24px;
    color: #dc2626;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .ss-home {
        min-height: 50vh;
        padding: 32px 16px;
    }

    .ss-logo-text {
        font-size: 36px;
    }

    .ss-results-header-inner {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .ss-logo-small {
        font-size: 18px;
        text-align: center;
    }

    .ss-results-body {
        padding: 16px;
    }

    .ss-result-title a {
        font-size: 16px;
    }

    .ss-result-desc {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ss-logo-text {
        font-size: 28px;
    }

    .ss-search-input {
        padding: 12px 12px 12px 16px;
        font-size: 15px;
    }

    .ss-search-btn {
        width: 38px;
        height: 38px;
    }
}


/* Result images */
.ss-result-image {
    float: right;
    margin-left: 16px;
    margin-bottom: 8px;
}
.ss-result-image img {
    width: 92px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Ad block in results */
.ss-ad-block {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.ss-ad-inner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 14px;
    background: #fffbf0;
    border: 1px solid #f0e6c0;
    border-radius: 8px;
}
.ss-ad-image img {
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    /* Width/height set via inline styles from settings */
}
.ss-ad-content {
    flex: 1;
}
.ss-ad-label {
    font-size: 11px;
    color: #8a6d00;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.ss-ad-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a0dab;
    margin-bottom: 4px;
}
.ss-ad-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}
.ss-ad-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #1a73e8;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.ss-ad-btn:hover {
    background: #1557b0;
    color: #fff;
}



/* Logo image in home state */
.ss-home-logo img {
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto 8px;
}

/* Logo image in results header */
.ss-logo-small-img {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.ss-logo-small-img img {
    height: auto;
    width: auto;
    display: block;
}

/* Crawled result badge */
.ss-result-badge-crawled {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

body.ss-hide-indexed .ss-result-badge-crawled {
    display: none !important;
}

body.ss-hide-favicons .ss-result-favicon {
    display: none !important;
}


/* Pagination */
.ss-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 16px 0;
}
.ss-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    line-height: 34px;
}
.ss-page-btn:hover {
    background: #f5f5f5;
    border-color: #1a73e8;
}
.ss-page-active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}
.ss-page-active:hover {
    background: #1557b0;
}
.ss-page-ellipsis {
    padding: 0 4px;
    color: #999;
    font-size: 14px;
    line-height: 36px;
}
.ss-page-prev,
.ss-page-next {
    font-weight: 700;
}

/* Ad contact info */
.ss-ad-contact {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.ss-ad-phone,
.ss-ad-address {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}
.ss-ad-icon {
    flex-shrink: 0;
    opacity: 0.7;
}
.ss-ad-phone:hover,
.ss-ad-address:hover {
    color: #1a73e8;
}


/* v1.2.3 additions */

/* Desktop sticky results header only */
@media (min-width: 769px) {
    .ss-results-header {
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
}

/* Filter controls wrapper */
.ss-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ss-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ss-filter-group label {
    white-space: nowrap;
    font-size: 14px;
    color: #666;
    margin: 0;
}

.ss-select-inline,
.ss-filter-group select {
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    line-height: 1.2;
}

.ss-filters-toggle {
    display: none;
}

.ss-filters-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

/* Backwards compatibility with old classes */
.ss-search-toolbar {
    display: block;
}

.ss-search-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ss-related-searches{margin-top:18px;padding:12px 14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px}
.ss-related-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.ss-related-link{display:inline-block;background:#e5edff;color:#1d4ed8;padding:4px 10px;border-radius:999px;text-decoration:none;font-size:12px}
.ss-related-link:hover{text-decoration:underline}
.ss-spelling{margin-top:10px;font-size:14px}
.ss-spell-link{font-weight:700}
.ss-result-badge-product{display:inline-block;padding:2px 8px;border-radius:10px;background:#f0fdf4;color:#166534;font-size:11px;font-weight:700}
.ss-product-meta{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.ss-product-price{font-weight:700;color:#166534}
.ss-product-stock{font-size:12px;color:#6b7280}
.ss-product-cart{font-size:12px;padding:4px 8px;border-radius:6px;background:#111827;color:#fff;text-decoration:none}

/* Responsive */
@media (max-width: 768px) {
    .ss-results-header {
        position: relative;
        box-shadow: none;
    }

    .ss-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }

    .ss-filters-toggle {
        display: block;
        width: 100%;
        padding: 10px;
        background: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 8px;
        cursor: pointer;
        margin-bottom: 0;
        text-align: left;
    }

    .ss-filters-content {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .ss-filters-content.active {
        display: flex;
    }

    .ss-filter-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .ss-select-inline,
    .ss-filter-group select {
        min-width: 0;
        width: 100%;
        flex: 1;
    }

    .ss-dark-toggle {
        width: fit-content;
    }
}



/* v1.2.3 related searches title */
.ss-related-searches-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Back to search link */
.ss-back-link {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.ss-back-link:hover {
    background: #e0e0e0;
}

.ss-page.ss-dark-mode .ss-back-link,
.ss-dark-mode .ss-back-link {
    background: #2a2a2a;
    color: #fff;
}

.ss-page.ss-dark-mode .ss-back-link:hover,
.ss-dark-mode .ss-back-link:hover {
    background: #3a3a3a;
}
