I’ll build this as a production-ready rx-search.css file for your RX Theme: global variables, search form UI, live results, archive/search page layouts, filters, pagination, dark mode, responsive design, accessibility, RTL, and print support.
Friend, below is a strong advanced-level assets/css/rx-search.css for your RX Theme. It is written safely with the prefix rx- so it will not easily conflict with WordPress, plugins, or future app/chunk CSS.
/*!
Theme Name: RX Theme
File: assets/css/rx-search.css
Purpose: Advanced search UI, search archive, live search, filters, result cards, empty states, pagination
Author: RxHarun
Version: 1.0.0
*/
/* =========================================================
RX SEARCH CSS INDEX
---------------------------------------------------------
01. Root Variables
02. Base Search Wrapper
03. Search Hero / Header
04. Search Form
05. Search Input
06. Search Button
07. Search Icon / Loader
08. Advanced Search Panel
09. Filter Chips
10. Search Suggestions
11. Live Search Dropdown
12. Search Results Layout
13. Search Result Card
14. Result Meta
15. Result Thumbnail
16. Highlighted Search Terms
17. No Result / Empty State
18. Search Sidebar
19. Search Filters
20. Sorting Bar
21. Search Pagination
22. Search Breadcrumb
23. Search Tabs
24. Search Statistics
25. Popular Searches
26. Voice Search UI
27. Mobile Search Overlay
28. Header Search
29. WooCommerce Search Support
30. Accessibility
31. Dark Mode
32. RTL Support
33. Responsive Design
34. Print Support
35. Utility Classes
========================================================= */
/* =========================================================
01. Root Variables
========================================================= */
:root {
--rx-search-bg: #ffffff;
--rx-search-soft-bg: #f8fafc;
--rx-search-muted-bg: #f1f5f9;
--rx-search-card-bg: #ffffff;
--rx-search-border: #e2e8f0;
--rx-search-border-strong: #cbd5e1;
--rx-search-text: #0f172a;
--rx-search-text-soft: #334155;
--rx-search-text-muted: #64748b;
--rx-search-placeholder: #94a3b8;
--rx-search-primary: #0f766e;
--rx-search-primary-hover: #0d9488;
--rx-search-primary-soft: rgba(15, 118, 110, 0.1);
--rx-search-primary-border: rgba(15, 118, 110, 0.25);
--rx-search-danger: #dc2626;
--rx-search-danger-soft: rgba(220, 38, 38, 0.08);
--rx-search-warning: #f59e0b;
--rx-search-warning-soft: rgba(245, 158, 11, 0.12);
--rx-search-success: #16a34a;
--rx-search-success-soft: rgba(22, 163, 74, 0.1);
--rx-search-radius-xs: 4px;
--rx-search-radius-sm: 8px;
--rx-search-radius-md: 12px;
--rx-search-radius-lg: 18px;
--rx-search-radius-xl: 24px;
--rx-search-radius-full: 999px;
--rx-search-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
--rx-search-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.08);
--rx-search-shadow-md: 0 12px 30px rgba(15, 23, 42, 0.12);
--rx-search-shadow-lg: 0 18px 55px rgba(15, 23, 42, 0.16);
--rx-search-font: inherit;
--rx-search-transition-fast: 150ms ease;
--rx-search-transition-normal: 250ms ease;
--rx-search-transition-slow: 400ms ease;
--rx-search-container: 1180px;
--rx-search-sidebar-width: 310px;
--rx-search-input-height: 56px;
--rx-search-z-dropdown: 60;
--rx-search-z-overlay: 999;
--rx-search-z-modal: 1000;
}
/* =========================================================
02. Base Search Wrapper
========================================================= */
.rx-search,
.rx-search-page,
.rx-search-archive {
width: 100%;
color: var(--rx-search-text);
font-family: var(--rx-search-font);
}
.rx-search-container {
width: min(100% - 32px, var(--rx-search-container));
margin-inline: auto;
}
.rx-search-section {
padding-block: clamp(28px, 5vw, 72px);
}
.rx-search-inner {
display: grid;
gap: 28px;
}
.rx-search-main {
min-width: 0;
}
.rx-search-layout {
display: grid;
grid-template-columns: minmax(0, 1fr) var(--rx-search-sidebar-width);
gap: clamp(22px, 4vw, 40px);
align-items: start;
}
.rx-search-layout--left-sidebar {
grid-template-columns: var(--rx-search-sidebar-width) minmax(0, 1fr);
}
.rx-search-layout--left-sidebar .rx-search-main {
order: 2;
}
.rx-search-layout--left-sidebar .rx-search-sidebar {
order: 1;
}
.rx-search-fullwidth {
display: block;
}
/* =========================================================
03. Search Hero / Header
========================================================= */
.rx-search-hero {
position: relative;
overflow: hidden;
padding: clamp(40px, 8vw, 96px) 0;
background:
radial-gradient(circle at top left, var(--rx-search-primary-soft), transparent 35%),
linear-gradient(135deg, var(--rx-search-soft-bg), #ffffff);
border-bottom: 1px solid var(--rx-search-border);
}
.rx-search-hero::before {
content: "";
position: absolute;
inset: auto -10% -40% auto;
width: min(420px, 45vw);
aspect-ratio: 1;
border-radius: 50%;
background: var(--rx-search-primary-soft);
filter: blur(20px);
pointer-events: none;
}
.rx-search-hero__content {
position: relative;
z-index: 1;
max-width: 820px;
}
.rx-search-title,
.rx-search-hero__title {
margin: 0 0 14px;
color: var(--rx-search-text);
font-size: clamp(2rem, 5vw, 4rem);
font-weight: 800;
line-height: 1.08;
letter-spacing: -0.04em;
}
.rx-search-subtitle,
.rx-search-hero__subtitle {
max-width: 680px;
margin: 0 0 26px;
color: var(--rx-search-text-muted);
font-size: clamp(1rem, 2vw, 1.16rem);
line-height: 1.75;
}
.rx-search-query-label {
display: inline-flex;
align-items: center;
gap: 8px;
margin-bottom: 14px;
padding: 7px 12px;
color: var(--rx-search-primary);
font-size: 0.875rem;
font-weight: 700;
background: var(--rx-search-primary-soft);
border: 1px solid var(--rx-search-primary-border);
border-radius: var(--rx-search-radius-full);
}
.rx-search-query-text {
color: var(--rx-search-text);
font-weight: 800;
}
/* =========================================================
04. Search Form
========================================================= */
.rx-search-form {
position: relative;
width: 100%;
}
.rx-search-form,
.search-form.rx-search-form {
display: flex;
align-items: stretch;
gap: 10px;
}
.rx-search-form--stacked {
flex-direction: column;
}
.rx-search-form--inline {
flex-direction: row;
}
.rx-search-form--boxed {
padding: 10px;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
box-shadow: var(--rx-search-shadow-sm);
}
.rx-search-form--pill {
padding: 6px;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-full);
box-shadow: var(--rx-search-shadow-sm);
}
.rx-search-form--glass {
background: rgba(255, 255, 255, 0.76);
border: 1px solid rgba(226, 232, 240, 0.7);
box-shadow: var(--rx-search-shadow-md);
backdrop-filter: blur(16px);
}
.rx-search-field {
position: relative;
flex: 1 1 auto;
min-width: 0;
}
.rx-search-label {
display: inline-block;
margin-bottom: 8px;
color: var(--rx-search-text-soft);
font-size: 0.9rem;
font-weight: 700;
}
.rx-search-label--screen-reader,
.rx-search-form .screen-reader-text {
position: absolute !important;
width: 1px;
height: 1px;
overflow: hidden;
white-space: nowrap;
clip-path: inset(50%);
}
/* =========================================================
05. Search Input
========================================================= */
.rx-search-input,
.rx-search-form input[type="search"],
.rx-search-form input[type="text"],
.search-form.rx-search-form input[type="search"] {
width: 100%;
min-height: var(--rx-search-input-height);
padding: 0 18px;
color: var(--rx-search-text);
font-size: 1rem;
font-weight: 500;
line-height: 1;
background: var(--rx-search-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-md);
outline: none;
box-shadow: var(--rx-search-shadow-xs);
transition:
border-color var(--rx-search-transition-fast),
box-shadow var(--rx-search-transition-fast),
background-color var(--rx-search-transition-fast);
}
.rx-search-input::placeholder,
.rx-search-form input[type="search"]::placeholder {
color: var(--rx-search-placeholder);
font-weight: 400;
}
.rx-search-input:hover,
.rx-search-form input[type="search"]:hover {
border-color: var(--rx-search-border-strong);
}
.rx-search-input:focus,
.rx-search-form input[type="search"]:focus {
border-color: var(--rx-search-primary);
box-shadow:
0 0 0 4px var(--rx-search-primary-soft),
var(--rx-search-shadow-xs);
}
.rx-search-form--pill .rx-search-input,
.rx-search-form--pill input[type="search"] {
border: 0;
border-radius: var(--rx-search-radius-full);
box-shadow: none;
}
.rx-search-form--icon-left .rx-search-input,
.rx-search-form--icon-left input[type="search"] {
padding-left: 48px;
}
.rx-search-form--icon-right .rx-search-input,
.rx-search-form--icon-right input[type="search"] {
padding-right: 48px;
}
.rx-search-input::-webkit-search-decoration,
.rx-search-input::-webkit-search-cancel-button,
.rx-search-input::-webkit-search-results-button,
.rx-search-input::-webkit-search-results-decoration {
appearance: none;
}
/* =========================================================
06. Search Button
========================================================= */
.rx-search-button,
.rx-search-form button[type="submit"],
.rx-search-form input[type="submit"] {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
min-height: var(--rx-search-input-height);
padding: 0 24px;
color: #ffffff;
font-size: 0.96rem;
font-weight: 800;
line-height: 1;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
background: var(--rx-search-primary);
border: 1px solid var(--rx-search-primary);
border-radius: var(--rx-search-radius-md);
box-shadow: var(--rx-search-shadow-xs);
transition:
transform var(--rx-search-transition-fast),
background-color var(--rx-search-transition-fast),
border-color var(--rx-search-transition-fast),
box-shadow var(--rx-search-transition-fast);
}
.rx-search-button:hover,
.rx-search-form button[type="submit"]:hover,
.rx-search-form input[type="submit"]:hover {
color: #ffffff;
background: var(--rx-search-primary-hover);
border-color: var(--rx-search-primary-hover);
box-shadow: var(--rx-search-shadow-sm);
transform: translateY(-1px);
}
.rx-search-button:active,
.rx-search-form button[type="submit"]:active {
transform: translateY(0);
}
.rx-search-button:focus-visible,
.rx-search-form button[type="submit"]:focus-visible {
outline: 3px solid var(--rx-search-primary-soft);
outline-offset: 3px;
}
.rx-search-button--ghost {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
border-color: var(--rx-search-primary-border);
}
.rx-search-button--ghost:hover {
color: #ffffff;
background: var(--rx-search-primary);
border-color: var(--rx-search-primary);
}
.rx-search-button--icon {
width: var(--rx-search-input-height);
padding: 0;
border-radius: 50%;
}
.rx-search-form--pill .rx-search-button {
border-radius: var(--rx-search-radius-full);
}
/* =========================================================
07. Search Icon / Loader
========================================================= */
.rx-search-icon {
position: absolute;
top: 50%;
z-index: 2;
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
color: var(--rx-search-text-muted);
transform: translateY(-50%);
pointer-events: none;
}
.rx-search-icon--left {
left: 17px;
}
.rx-search-icon--right {
right: 17px;
}
.rx-search-loading {
position: absolute;
top: 50%;
right: 16px;
display: none;
width: 20px;
height: 20px;
border: 2px solid var(--rx-search-border);
border-top-color: var(--rx-search-primary);
border-radius: 50%;
transform: translateY(-50%);
animation: rx-search-spin 700ms linear infinite;
}
.rx-search-form.is-loading .rx-search-loading {
display: block;
}
.rx-search-form.is-loading .rx-search-icon--right {
display: none;
}
@keyframes rx-search-spin {
to {
transform: translateY(-50%) rotate(360deg);
}
}
/* =========================================================
08. Advanced Search Panel
========================================================= */
.rx-advanced-search {
margin-top: 18px;
padding: clamp(18px, 3vw, 28px);
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
box-shadow: var(--rx-search-shadow-sm);
}
.rx-advanced-search__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 18px;
}
.rx-advanced-search__title {
margin: 0;
color: var(--rx-search-text);
font-size: 1.15rem;
font-weight: 800;
}
.rx-advanced-search__toggle {
display: inline-flex;
align-items: center;
gap: 8px;
color: var(--rx-search-primary);
font-weight: 800;
background: transparent;
border: 0;
cursor: pointer;
}
.rx-advanced-search__grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px;
}
.rx-advanced-search__field {
min-width: 0;
}
.rx-advanced-search__field label {
display: block;
margin-bottom: 7px;
color: var(--rx-search-text-soft);
font-size: 0.88rem;
font-weight: 800;
}
.rx-advanced-search__field input,
.rx-advanced-search__field select {
width: 100%;
min-height: 44px;
padding: 0 12px;
color: var(--rx-search-text);
background: var(--rx-search-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-sm);
outline: none;
}
.rx-advanced-search__field input:focus,
.rx-advanced-search__field select:focus {
border-color: var(--rx-search-primary);
box-shadow: 0 0 0 3px var(--rx-search-primary-soft);
}
/* =========================================================
09. Filter Chips
========================================================= */
.rx-search-chips {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-block: 18px;
}
.rx-search-chip {
display: inline-flex;
align-items: center;
gap: 7px;
min-height: 34px;
padding: 0 12px;
color: var(--rx-search-text-soft);
font-size: 0.86rem;
font-weight: 700;
text-decoration: none;
background: var(--rx-search-soft-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-full);
transition:
color var(--rx-search-transition-fast),
background-color var(--rx-search-transition-fast),
border-color var(--rx-search-transition-fast);
}
.rx-search-chip:hover,
.rx-search-chip.is-active {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
border-color: var(--rx-search-primary-border);
}
.rx-search-chip__remove {
display: inline-grid;
place-items: center;
width: 18px;
height: 18px;
color: var(--rx-search-text-muted);
font-size: 12px;
line-height: 1;
background: rgba(15, 23, 42, 0.06);
border-radius: 50%;
}
.rx-search-chip__remove:hover {
color: #ffffff;
background: var(--rx-search-danger);
}
/* =========================================================
10. Search Suggestions
========================================================= */
.rx-search-suggestions {
margin-top: 18px;
}
.rx-search-suggestions__title {
margin: 0 0 10px;
color: var(--rx-search-text-soft);
font-size: 0.9rem;
font-weight: 800;
}
.rx-search-suggestions__list {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 0;
padding: 0;
list-style: none;
}
.rx-search-suggestions__item {
margin: 0;
}
.rx-search-suggestions__link {
display: inline-flex;
align-items: center;
min-height: 34px;
padding: 0 12px;
color: var(--rx-search-text-soft);
font-size: 0.88rem;
font-weight: 700;
text-decoration: none;
background: var(--rx-search-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-full);
}
.rx-search-suggestions__link:hover {
color: var(--rx-search-primary);
border-color: var(--rx-search-primary-border);
}
/* =========================================================
11. Live Search Dropdown
========================================================= */
.rx-live-search {
position: absolute;
top: calc(100% + 10px);
left: 0;
z-index: var(--rx-search-z-dropdown);
width: 100%;
max-height: min(520px, 70vh);
overflow: auto;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
box-shadow: var(--rx-search-shadow-lg);
opacity: 0;
visibility: hidden;
transform: translateY(8px);
transition:
opacity var(--rx-search-transition-fast),
visibility var(--rx-search-transition-fast),
transform var(--rx-search-transition-fast);
}
.rx-search-form.is-live-open .rx-live-search,
.rx-live-search.is-active {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.rx-live-search__header {
position: sticky;
top: 0;
z-index: 1;
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
padding: 14px 16px;
background: var(--rx-search-card-bg);
border-bottom: 1px solid var(--rx-search-border);
}
.rx-live-search__title {
margin: 0;
color: var(--rx-search-text);
font-size: 0.95rem;
font-weight: 800;
}
.rx-live-search__count {
color: var(--rx-search-text-muted);
font-size: 0.82rem;
font-weight: 700;
}
.rx-live-search__list {
margin: 0;
padding: 8px;
list-style: none;
}
.rx-live-search__item {
margin: 0;
}
.rx-live-search__link {
display: grid;
grid-template-columns: 52px minmax(0, 1fr);
gap: 12px;
padding: 10px;
color: inherit;
text-decoration: none;
border-radius: var(--rx-search-radius-md);
transition: background-color var(--rx-search-transition-fast);
}
.rx-live-search__link:hover,
.rx-live-search__link:focus-visible {
background: var(--rx-search-soft-bg);
outline: none;
}
.rx-live-search__thumb {
width: 52px;
height: 52px;
overflow: hidden;
background: var(--rx-search-muted-bg);
border-radius: var(--rx-search-radius-sm);
}
.rx-live-search__thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
.rx-live-search__content {
min-width: 0;
}
.rx-live-search__post-title {
display: block;
margin-bottom: 4px;
color: var(--rx-search-text);
font-size: 0.94rem;
font-weight: 800;
line-height: 1.35;
}
.rx-live-search__excerpt {
display: -webkit-box;
overflow: hidden;
color: var(--rx-search-text-muted);
font-size: 0.82rem;
line-height: 1.45;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.rx-live-search__footer {
padding: 12px 16px;
border-top: 1px solid var(--rx-search-border);
}
.rx-live-search__all {
display: inline-flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 42px;
color: var(--rx-search-primary);
font-weight: 800;
text-decoration: none;
background: var(--rx-search-primary-soft);
border-radius: var(--rx-search-radius-md);
}
/* =========================================================
12. Search Results Layout
========================================================= */
.rx-search-results {
display: grid;
gap: 18px;
}
.rx-search-results--grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rx-search-results--two {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rx-search-results--list {
grid-template-columns: 1fr;
}
.rx-search-results-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 18px;
margin-bottom: 22px;
padding-bottom: 18px;
border-bottom: 1px solid var(--rx-search-border);
}
.rx-search-results-title {
margin: 0;
color: var(--rx-search-text);
font-size: clamp(1.45rem, 3vw, 2.25rem);
font-weight: 850;
line-height: 1.18;
letter-spacing: -0.03em;
}
.rx-search-results-count {
color: var(--rx-search-text-muted);
font-size: 0.94rem;
font-weight: 700;
}
.rx-search-results-count strong {
color: var(--rx-search-text);
}
/* =========================================================
13. Search Result Card
========================================================= */
.rx-search-card {
position: relative;
display: grid;
gap: 14px;
height: 100%;
padding: 18px;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
box-shadow: var(--rx-search-shadow-xs);
transition:
transform var(--rx-search-transition-normal),
box-shadow var(--rx-search-transition-normal),
border-color var(--rx-search-transition-normal);
}
.rx-search-card:hover {
border-color: var(--rx-search-primary-border);
box-shadow: var(--rx-search-shadow-md);
transform: translateY(-3px);
}
.rx-search-card--horizontal {
grid-template-columns: 220px minmax(0, 1fr);
align-items: start;
}
.rx-search-card__content {
min-width: 0;
}
.rx-search-card__title {
margin: 0 0 9px;
color: var(--rx-search-text);
font-size: clamp(1.08rem, 2vw, 1.35rem);
font-weight: 850;
line-height: 1.28;
letter-spacing: -0.02em;
}
.rx-search-card__title a {
color: inherit;
text-decoration: none;
background-image: linear-gradient(var(--rx-search-primary), var(--rx-search-primary));
background-repeat: no-repeat;
background-position: left bottom;
background-size: 0 2px;
transition:
color var(--rx-search-transition-fast),
background-size var(--rx-search-transition-fast);
}
.rx-search-card__title a:hover {
color: var(--rx-search-primary);
background-size: 100% 2px;
}
.rx-search-card__excerpt {
margin: 0;
color: var(--rx-search-text-muted);
font-size: 0.96rem;
line-height: 1.75;
}
.rx-search-card__excerpt p {
margin: 0;
}
.rx-search-card__readmore {
display: inline-flex;
align-items: center;
gap: 8px;
width: fit-content;
margin-top: 14px;
color: var(--rx-search-primary);
font-size: 0.92rem;
font-weight: 850;
text-decoration: none;
}
.rx-search-card__readmore:hover {
color: var(--rx-search-primary-hover);
}
/* =========================================================
14. Result Meta
========================================================= */
.rx-search-meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 14px;
margin-bottom: 9px;
color: var(--rx-search-text-muted);
font-size: 0.82rem;
font-weight: 700;
}
.rx-search-meta__item {
display: inline-flex;
align-items: center;
gap: 6px;
}
.rx-search-meta__item a {
color: inherit;
text-decoration: none;
}
.rx-search-meta__item a:hover {
color: var(--rx-search-primary);
}
.rx-search-meta__dot {
width: 4px;
height: 4px;
background: var(--rx-search-border-strong);
border-radius: 50%;
}
.rx-search-type-badge {
display: inline-flex;
align-items: center;
min-height: 24px;
padding: 0 9px;
color: var(--rx-search-primary);
font-size: 0.74rem;
font-weight: 850;
text-transform: uppercase;
letter-spacing: 0.04em;
background: var(--rx-search-primary-soft);
border: 1px solid var(--rx-search-primary-border);
border-radius: var(--rx-search-radius-full);
}
/* =========================================================
15. Result Thumbnail
========================================================= */
.rx-search-card__thumb {
position: relative;
display: block;
overflow: hidden;
aspect-ratio: 16 / 10;
background: var(--rx-search-muted-bg);
border-radius: var(--rx-search-radius-md);
}
.rx-search-card--horizontal .rx-search-card__thumb {
aspect-ratio: 4 / 3;
}
.rx-search-card__thumb img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform var(--rx-search-transition-slow);
}
.rx-search-card:hover .rx-search-card__thumb img {
transform: scale(1.045);
}
.rx-search-card__thumb-placeholder {
display: grid;
place-items: center;
width: 100%;
height: 100%;
color: var(--rx-search-text-muted);
font-weight: 800;
background:
linear-gradient(135deg, var(--rx-search-muted-bg), var(--rx-search-soft-bg));
}
/* =========================================================
16. Highlighted Search Terms
========================================================= */
.rx-search-highlight,
.rx-search-card mark,
.rx-live-search mark {
color: var(--rx-search-text);
font-weight: 850;
background: linear-gradient(
180deg,
transparent 45%,
var(--rx-search-warning-soft) 45%
);
border-radius: 3px;
}
.rx-search-highlight--primary {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
}
.rx-search-highlight--danger {
color: var(--rx-search-danger);
background: var(--rx-search-danger-soft);
}
/* =========================================================
17. No Result / Empty State
========================================================= */
.rx-search-empty {
max-width: 760px;
margin-inline: auto;
padding: clamp(28px, 5vw, 56px);
text-align: center;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-xl);
box-shadow: var(--rx-search-shadow-sm);
}
.rx-search-empty__icon {
display: grid;
place-items: center;
width: 76px;
height: 76px;
margin: 0 auto 18px;
color: var(--rx-search-primary);
font-size: 2rem;
background: var(--rx-search-primary-soft);
border-radius: 50%;
}
.rx-search-empty__title {
margin: 0 0 10px;
color: var(--rx-search-text);
font-size: clamp(1.45rem, 3vw, 2rem);
font-weight: 850;
letter-spacing: -0.03em;
}
.rx-search-empty__text {
max-width: 540px;
margin: 0 auto 22px;
color: var(--rx-search-text-muted);
line-height: 1.75;
}
.rx-search-empty__tips {
max-width: 520px;
margin: 22px auto 0;
padding: 18px;
text-align: left;
background: var(--rx-search-soft-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-md);
}
.rx-search-empty__tips-title {
margin: 0 0 10px;
font-size: 0.95rem;
font-weight: 850;
}
.rx-search-empty__tips ul {
margin: 0;
padding-left: 20px;
color: var(--rx-search-text-muted);
line-height: 1.7;
}
/* =========================================================
18. Search Sidebar
========================================================= */
.rx-search-sidebar {
position: sticky;
top: 24px;
display: grid;
gap: 18px;
min-width: 0;
}
.admin-bar .rx-search-sidebar {
top: 56px;
}
.rx-search-widget {
padding: 18px;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
box-shadow: var(--rx-search-shadow-xs);
}
.rx-search-widget__title {
margin: 0 0 14px;
color: var(--rx-search-text);
font-size: 1rem;
font-weight: 850;
}
.rx-search-widget ul {
margin: 0;
padding: 0;
list-style: none;
}
.rx-search-widget li + li {
border-top: 1px solid var(--rx-search-border);
}
.rx-search-widget a {
display: flex;
justify-content: space-between;
gap: 12px;
padding-block: 10px;
color: var(--rx-search-text-soft);
font-size: 0.92rem;
font-weight: 700;
text-decoration: none;
}
.rx-search-widget a:hover {
color: var(--rx-search-primary);
}
/* =========================================================
19. Search Filters
========================================================= */
.rx-search-filter {
display: grid;
gap: 12px;
}
.rx-search-filter__group {
display: grid;
gap: 10px;
}
.rx-search-filter__label {
color: var(--rx-search-text);
font-size: 0.9rem;
font-weight: 850;
}
.rx-search-filter__option {
display: flex;
align-items: center;
gap: 9px;
color: var(--rx-search-text-soft);
font-size: 0.9rem;
font-weight: 650;
cursor: pointer;
}
.rx-search-filter__option input {
width: 17px;
height: 17px;
accent-color: var(--rx-search-primary);
}
.rx-search-filter__count {
margin-left: auto;
color: var(--rx-search-text-muted);
font-size: 0.78rem;
font-weight: 800;
background: var(--rx-search-soft-bg);
border-radius: var(--rx-search-radius-full);
padding: 2px 8px;
}
.rx-search-filter__reset {
display: inline-flex;
justify-content: center;
align-items: center;
min-height: 40px;
padding-inline: 14px;
color: var(--rx-search-danger);
font-weight: 800;
text-decoration: none;
background: var(--rx-search-danger-soft);
border: 1px solid rgba(220, 38, 38, 0.15);
border-radius: var(--rx-search-radius-md);
}
/* =========================================================
20. Sorting Bar
========================================================= */
.rx-search-sortbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 22px;
padding: 14px;
background: var(--rx-search-soft-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
}
.rx-search-sortbar__left,
.rx-search-sortbar__right {
display: flex;
align-items: center;
gap: 12px;
}
.rx-search-sortbar label {
color: var(--rx-search-text-soft);
font-size: 0.86rem;
font-weight: 800;
}
.rx-search-sortbar select {
min-height: 38px;
padding: 0 34px 0 12px;
color: var(--rx-search-text);
font-weight: 700;
background-color: var(--rx-search-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-sm);
}
.rx-search-view-toggle {
display: inline-flex;
overflow: hidden;
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-sm);
}
.rx-search-view-toggle button,
.rx-search-view-toggle a {
display: grid;
place-items: center;
width: 38px;
height: 38px;
color: var(--rx-search-text-muted);
background: var(--rx-search-bg);
border: 0;
border-right: 1px solid var(--rx-search-border);
cursor: pointer;
}
.rx-search-view-toggle button:last-child,
.rx-search-view-toggle a:last-child {
border-right: 0;
}
.rx-search-view-toggle .is-active,
.rx-search-view-toggle button:hover,
.rx-search-view-toggle a:hover {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
}
/* =========================================================
21. Search Pagination
========================================================= */
.rx-search-pagination,
.rx-search .pagination,
.rx-search .nav-links {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: clamp(26px, 5vw, 52px);
}
.rx-search-pagination a,
.rx-search-pagination span,
.rx-search .page-numbers {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 42px;
height: 42px;
padding-inline: 12px;
color: var(--rx-search-text-soft);
font-size: 0.92rem;
font-weight: 800;
text-decoration: none;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-sm);
box-shadow: var(--rx-search-shadow-xs);
}
.rx-search-pagination a:hover,
.rx-search .page-numbers:hover {
color: var(--rx-search-primary);
border-color: var(--rx-search-primary-border);
background: var(--rx-search-primary-soft);
}
.rx-search-pagination .current,
.rx-search .page-numbers.current {
color: #ffffff;
background: var(--rx-search-primary);
border-color: var(--rx-search-primary);
}
/* =========================================================
22. Search Breadcrumb
========================================================= */
.rx-search-breadcrumb {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 7px;
margin-bottom: 18px;
color: var(--rx-search-text-muted);
font-size: 0.86rem;
font-weight: 700;
}
.rx-search-breadcrumb a {
color: var(--rx-search-text-muted);
text-decoration: none;
}
.rx-search-breadcrumb a:hover {
color: var(--rx-search-primary);
}
.rx-search-breadcrumb__separator {
color: var(--rx-search-border-strong);
}
/* =========================================================
23. Search Tabs
========================================================= */
.rx-search-tabs {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 22px;
padding: 6px;
background: var(--rx-search-soft-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
}
.rx-search-tab {
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 42px;
padding: 0 15px;
color: var(--rx-search-text-soft);
font-size: 0.92rem;
font-weight: 800;
text-decoration: none;
border-radius: var(--rx-search-radius-md);
transition:
color var(--rx-search-transition-fast),
background-color var(--rx-search-transition-fast);
}
.rx-search-tab:hover,
.rx-search-tab.is-active {
color: var(--rx-search-primary);
background: var(--rx-search-card-bg);
box-shadow: var(--rx-search-shadow-xs);
}
.rx-search-tab__count {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 22px;
height: 22px;
padding-inline: 7px;
color: var(--rx-search-text-muted);
font-size: 0.74rem;
font-weight: 850;
background: var(--rx-search-muted-bg);
border-radius: var(--rx-search-radius-full);
}
/* =========================================================
24. Search Statistics
========================================================= */
.rx-search-stats {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 14px;
margin-bottom: 24px;
}
.rx-search-stat {
padding: 16px;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-lg);
}
.rx-search-stat__number {
display: block;
color: var(--rx-search-primary);
font-size: 1.65rem;
font-weight: 900;
line-height: 1;
}
.rx-search-stat__label {
display: block;
margin-top: 7px;
color: var(--rx-search-text-muted);
font-size: 0.84rem;
font-weight: 750;
}
/* =========================================================
25. Popular Searches
========================================================= */
.rx-popular-searches {
margin-top: 24px;
}
.rx-popular-searches__title {
margin: 0 0 12px;
color: var(--rx-search-text);
font-size: 1rem;
font-weight: 850;
}
.rx-popular-searches__grid {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.rx-popular-searches__item {
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 38px;
padding: 0 13px;
color: var(--rx-search-text-soft);
font-size: 0.9rem;
font-weight: 750;
text-decoration: none;
background: var(--rx-search-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-full);
}
.rx-popular-searches__item:hover {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
border-color: var(--rx-search-primary-border);
}
/* =========================================================
26. Voice Search UI
========================================================= */
.rx-voice-search {
position: absolute;
top: 50%;
right: 14px;
z-index: 3;
display: grid;
place-items: center;
width: 34px;
height: 34px;
color: var(--rx-search-text-muted);
background: transparent;
border: 0;
border-radius: 50%;
cursor: pointer;
transform: translateY(-50%);
}
.rx-voice-search:hover {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
}
.rx-voice-search.is-listening {
color: #ffffff;
background: var(--rx-search-danger);
animation: rx-search-pulse 1.2s infinite;
}
@keyframes rx-search-pulse {
0% {
box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35);
}
70% {
box-shadow: 0 0 0 12px rgba(220, 38, 38, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
}
}
/* =========================================================
27. Mobile Search Overlay
========================================================= */
.rx-search-overlay {
position: fixed;
inset: 0;
z-index: var(--rx-search-z-overlay);
display: grid;
align-items: start;
padding: 76px 18px 18px;
background: rgba(15, 23, 42, 0.58);
backdrop-filter: blur(10px);
opacity: 0;
visibility: hidden;
transition:
opacity var(--rx-search-transition-normal),
visibility var(--rx-search-transition-normal);
}
.rx-search-overlay.is-active {
opacity: 1;
visibility: visible;
}
.rx-search-overlay__panel {
width: min(100%, 760px);
margin-inline: auto;
padding: 18px;
background: var(--rx-search-card-bg);
border: 1px solid var(--rx-search-border);
border-radius: var(--rx-search-radius-xl);
box-shadow: var(--rx-search-shadow-lg);
transform: translateY(-12px);
transition: transform var(--rx-search-transition-normal);
}
.rx-search-overlay.is-active .rx-search-overlay__panel {
transform: translateY(0);
}
.rx-search-overlay__close {
position: absolute;
top: 22px;
right: 22px;
display: grid;
place-items: center;
width: 42px;
height: 42px;
color: #ffffff;
background: rgba(255, 255, 255, 0.16);
border: 1px solid rgba(255, 255, 255, 0.22);
border-radius: 50%;
cursor: pointer;
}
/* =========================================================
28. Header Search
========================================================= */
.rx-header-search {
position: relative;
width: min(100%, 360px);
}
.rx-header-search .rx-search-input {
min-height: 44px;
padding-inline: 42px 14px;
font-size: 0.92rem;
border-radius: var(--rx-search-radius-full);
}
.rx-header-search .rx-search-button {
position: absolute;
top: 50%;
left: 5px;
width: 34px;
height: 34px;
min-height: 34px;
padding: 0;
color: var(--rx-search-text-muted);
background: transparent;
border: 0;
border-radius: 50%;
box-shadow: none;
transform: translateY(-50%);
}
.rx-header-search .rx-search-button:hover {
color: var(--rx-search-primary);
background: var(--rx-search-primary-soft);
transform: translateY(-50%);
}
/* =========================================================
29. WooCommerce Search Support
========================================================= */
.woocommerce .rx-search-card .price,
.rx-search-card .woocommerce-Price-amount {
display: inline-flex;
align-items: center;
margin-top: 8px;
color: var(--rx-search-primary);
font-size: 1rem;
font-weight: 900;
}
.woocommerce .rx-search-card .star-rating {
margin-top: 8px;
}
.rx-search-product-badge {
position: absolute;
top: 12px;
left: 12px;
z-index: 2;
display: inline-flex;
align-items: center;
min-height: 26px;
padding: 0 10px;
color: #ffffff;
font-size: 0.75rem;
font-weight: 850;
background: var(--rx-search-primary);
border-radius: var(--rx-search-radius-full);
}
/* =========================================================
30. Accessibility
========================================================= */
.rx-search a:focus-visible,
.rx-search button:focus-visible,
.rx-search input:focus-visible,
.rx-search select:focus-visible,
.rx-search textarea:focus-visible {
outline: 3px solid var(--rx-search-primary-soft);
outline-offset: 3px;
}
.rx-search [hidden] {
display: none !important;
}
.rx-search [aria-disabled="true"] {
opacity: 0.55;
pointer-events: none;
}
.rx-search-skip {
position: absolute;
left: 12px;
top: 12px;
z-index: 9999;
padding: 10px 14px;
color: #ffffff;
background: var(--rx-search-primary);
border-radius: var(--rx-search-radius-sm);
transform: translateY(-140%);
}
.rx-search-skip:focus {
transform: translateY(0);
}
/* Reduce motion for users who prefer less animation */
@media (prefers-reduced-motion: reduce) {
.rx-search *,
.rx-search *::before,
.rx-search *::after {
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
transition-duration: 0.001ms !important;
}
}
/* =========================================================
31. Dark Mode
========================================================= */
@media (prefers-color-scheme: dark) {
:root {
--rx-search-bg: #020617;
--rx-search-soft-bg: #0f172a;
--rx-search-muted-bg: #1e293b;
--rx-search-card-bg: #0b1220;
--rx-search-border: #1e293b;
--rx-search-border-strong: #334155;
--rx-search-text: #f8fafc;
--rx-search-text-soft: #cbd5e1;
--rx-search-text-muted: #94a3b8;
--rx-search-placeholder: #64748b;
--rx-search-primary: #2dd4bf;
--rx-search-primary-hover: #5eead4;
--rx-search-primary-soft: rgba(45, 212, 191, 0.12);
--rx-search-primary-border: rgba(45, 212, 191, 0.28);
--rx-search-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
--rx-search-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
--rx-search-shadow-md: 0 16px 42px rgba(0, 0, 0, 0.35);
--rx-search-shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.48);
}
.rx-search-hero {
background:
radial-gradient(circle at top left, var(--rx-search-primary-soft), transparent 35%),
linear-gradient(135deg, #020617, #0f172a);
}
.rx-search-form--glass {
background: rgba(15, 23, 42, 0.72);
border-color: rgba(51, 65, 85, 0.82);
}
}
/* Manual dark mode class support */
.rx-theme-dark .rx-search,
.dark .rx-search,
[data-theme="dark"] .rx-search {
--rx-search-bg: #020617;
--rx-search-soft-bg: #0f172a;
--rx-search-muted-bg: #1e293b;
--rx-search-card-bg: #0b1220;
--rx-search-border: #1e293b;
--rx-search-border-strong: #334155;
--rx-search-text: #f8fafc;
--rx-search-text-soft: #cbd5e1;
--rx-search-text-muted: #94a3b8;
--rx-search-placeholder: #64748b;
--rx-search-primary: #2dd4bf;
--rx-search-primary-hover: #5eead4;
--rx-search-primary-soft: rgba(45, 212, 191, 0.12);
--rx-search-primary-border: rgba(45, 212, 191, 0.28);
}
/* =========================================================
32. RTL Support
========================================================= */
[dir="rtl"] .rx-search-form--icon-left .rx-search-input,
[dir="rtl"] .rx-search-form--icon-left input[type="search"] {
padding-right: 48px;
padding-left: 18px;
}
[dir="rtl"] .rx-search-icon--left {
right: 17px;
left: auto;
}
[dir="rtl"] .rx-search-icon--right {
right: auto;
left: 17px;
}
[dir="rtl"] .rx-search-card__title a {
background-position: right bottom;
}
[dir="rtl"] .rx-search-filter__count {
margin-right: auto;
margin-left: 0;
}
[dir="rtl"] .rx-header-search .rx-search-input {
padding-inline: 14px 42px;
}
[dir="rtl"] .rx-header-search .rx-search-button {
right: 5px;
left: auto;
}
/* =========================================================
33. Responsive Design
========================================================= */
@media (max-width: 1100px) {
.rx-search-results--grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rx-search-stats {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rx-advanced-search__grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 900px) {
.rx-search-layout,
.rx-search-layout--left-sidebar {
grid-template-columns: 1fr;
}
.rx-search-layout--left-sidebar .rx-search-main,
.rx-search-layout--left-sidebar .rx-search-sidebar {
order: initial;
}
.rx-search-sidebar {
position: static;
}
.rx-search-card--horizontal {
grid-template-columns: 180px minmax(0, 1fr);
}
}
@media (max-width: 700px) {
.rx-search-container {
width: min(100% - 24px, var(--rx-search-container));
}
.rx-search-form,
.search-form.rx-search-form {
flex-direction: column;
}
.rx-search-form--pill {
border-radius: var(--rx-search-radius-lg);
}
.rx-search-form--pill .rx-search-input,
.rx-search-form--pill input[type="search"],
.rx-search-form--pill .rx-search-button {
border-radius: var(--rx-search-radius-md);
}
.rx-search-button,
.rx-search-form button[type="submit"],
.rx-search-form input[type="submit"] {
width: 100%;
}
.rx-search-results--grid,
.rx-search-results--two {
grid-template-columns: 1fr;
}
.rx-search-card--horizontal {
grid-template-columns: 1fr;
}
.rx-search-results-header,
.rx-search-sortbar {
align-items: stretch;
flex-direction: column;
}
.rx-search-sortbar__left,
.rx-search-sortbar__right {
justify-content: space-between;
}
.rx-advanced-search__grid {
grid-template-columns: 1fr;
}
.rx-live-search__link {
grid-template-columns: 44px minmax(0, 1fr);
}
.rx-live-search__thumb {
width: 44px;
height: 44px;
}
}
@media (max-width: 480px) {
.rx-search-section {
padding-block: 30px;
}
.rx-search-hero {
padding-block: 42px;
}
.rx-search-card,
.rx-search-widget,
.rx-advanced-search,
.rx-search-empty {
padding: 16px;
border-radius: var(--rx-search-radius-md);
}
.rx-search-stats {
grid-template-columns: 1fr;
}
.rx-search-tabs {
overflow-x: auto;
flex-wrap: nowrap;
scrollbar-width: thin;
}
.rx-search-tab {
flex: 0 0 auto;
}
.rx-search-pagination a,
.rx-search-pagination span,
.rx-search .page-numbers {
min-width: 38px;
height: 38px;
}
}
/* =========================================================
34. Print Support
========================================================= */
@media print {
.rx-search-form,
.rx-search-sidebar,
.rx-search-sortbar,
.rx-search-pagination,
.rx-live-search,
.rx-search-overlay,
.rx-search-button,
.rx-search-tabs,
.rx-search-chips {
display: none !important;
}
.rx-search-layout,
.rx-search-results,
.rx-search-results--grid,
.rx-search-results--two {
display: block !important;
}
.rx-search-card {
break-inside: avoid;
margin-bottom: 18px;
box-shadow: none;
}
.rx-search-card a {
color: #000000;
text-decoration: underline;
}
}
/* =========================================================
35. Utility Classes
========================================================= */
.rx-search-hidden {
display: none !important;
}
.rx-search-visually-hidden {
position: absolute !important;
width: 1px;
height: 1px;
overflow: hidden;
white-space: nowrap;
clip-path: inset(50%);
}
.rx-search-text-center {
text-align: center;
}
.rx-search-text-left {
text-align: left;
}
.rx-search-text-right {
text-align: right;
}
.rx-search-mt-0 {
margin-top: 0 !important;
}
.rx-search-mt-sm {
margin-top: 10px !important;
}
.rx-search-mt-md {
margin-top: 18px !important;
}
.rx-search-mt-lg {
margin-top: 28px !important;
}
.rx-search-mb-0 {
margin-bottom: 0 !important;
}
.rx-search-mb-sm {
margin-bottom: 10px !important;
}
.rx-search-mb-md {
margin-bottom: 18px !important;
}
.rx-search-mb-lg {
margin-bottom: 28px !important;
}
.rx-search-shadow-none {
box-shadow: none !important;
}
.rx-search-border-none {
border: 0 !important;
}
.rx-search-rounded {
border-radius: var(--rx-search-radius-md) !important;
}
.rx-search-rounded-lg {
border-radius: var(--rx-search-radius-lg) !important;
}
.rx-search-rounded-full {
border-radius: var(--rx-search-radius-full) !important;
}
Use this file here:
rx-theme/assets/css/rx-search.css
Then enqueue it from your theme, for example inside your enqueue file:
wp_enqueue_style(
'rx-search',
get_template_directory_uri() . '/assets/css/rx-search.css',
array(),
wp_get_theme()->get('Version')
);
Best naming system for this file:
assets/css/rx-search.css
Best related future files:
assets/js/rx-search.js
template-parts/search/search-form.php
template-parts/search/search-results.php
template-parts/search/search-empty.php
template-parts/search/search-filters.php
search.php
searchform.php
This CSS is safe for an advanced WordPress theme because it uses rx-search- scoped class names, CSS variables, responsive layout, dark mode, RTL, accessibility, live-search dropdown styling, mobile overlay, and search archive result design.