/* Search Page Styling */
body.page-template-page-search,
body.search-results,
body.search {
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

.search-page-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Area: Back Arrow + Search Input */
.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 100;
    padding-top: 10px;
    padding-bottom: 10px;
}

.back-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text-main, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: #f3f4f6;
}

.back-button svg {
    width: 24px;
    height: 24px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    /* No icon padding needed inside if icons are outside or minimal */
    border: none;
    border-radius: 8px;
    background-color: #f3f4f6;
    font-size: 16px;
    color: #111827;
    outline: none;
    font-weight: 500;
}

.search-input-wrapper input::placeholder {
    color: #9ca3af;
}

.clear-search {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: none;
    /* Hidden by default */
    padding: 4px;
}

.search-input-wrapper input:not(:placeholder-shown)+.clear-search {
    display: block;
}

/* Content Sections */
.search-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-history {
    font-size: 12px;
    color: var(--color-primary, #6366f1);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

/* Lists (Recent, Suggestions) */
.search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.item-icon {
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.item-text {
    font-size: 15px;
    color: #374151;
    font-weight: 500;
}

.remove-item {
    background: none;
    border: none;
    color: #d1d5db;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.remove-item:hover {
    color: #ef4444;
}

/* Suggestions Dropdown (Live Search) */
#search-suggestions {
    display: none;
    /* Hidden initially */
}

/* Loading State */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 40px;
    /* Adjust based on clear button */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}