/* ==========================================================================
   ARCHIVE PAGE LAYOUTS
   ========================================================================== */

.rv-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   ARCHIVE CARDS
   Base styles for product and review archive grid cards
   ========================================================================== */

/* Card container */
.rv-archive-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rv-archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Featured image */
.rv-archive-card .wp-block-post-featured-image {
    margin: 0.75rem 0.75rem 0 0.75rem !important;
    margin-block-start: 0.75rem !important;
    flex-shrink: 0;
    height: auto !important;
    overflow: visible !important;
}

.rv-archive-card .wp-block-post-featured-image img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4/3;
    object-fit: contain !important;
    border-radius: 8px;
}

/* Content area - override WP constrained layout margins */
.rv-archive-card.is-layout-constrained > .wp-block-group {
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-block-start: 0 !important;
}

.rv-archive-card > .wp-block-group:last-child {
    padding: 0.75rem 0.75rem 0 0.75rem !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Title link styling */
.rv-archive-card .wp-block-post-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.rv-archive-card .wp-block-post-title a:hover {
    color: var(--rv-brand-accent);
    text-decoration: underline;
}

/* Footer with category and status */
.rv-archive-card__footer {
    margin-top: auto;
    padding: 0.2rem 0;
    border-top: 1px solid var(--rv-border-primary);
    display: flex !important;
    justify-content: flex-end !important;
    width: 100%;
}

.rv-archive-card__footer .wp-block-read-more,
.rv-archive-card__footer .rv-archive-card__link {
    margin-left: auto !important;
}

.rv-archive-card__category {
    margin: 0;
}

.rv-archive-card__category a {
    text-decoration: none;
    color: var(--rv-text-heading) !important;
}

/* Small term badges in archive cards */
.rv-term-badge--small {
    font-size: var(--rv-text-xs);
    padding: 0.125rem 0.5rem;
}

.rv-term-badge--small a {
    text-decoration: none;
    color: inherit;
}

/* Excerpt */
.rv-archive-card .wp-block-post-excerpt {
    margin: 0 0 0.75rem 0 !important;
}

.rv-archive-card__link {
    margin: 0;
}

/* ==========================================================================
   ARCHIVE GRIDS
   Grid layout for product and review archives
   ========================================================================== */

.rv-product-archive .wp-block-post-template,
.rv-review-archive .wp-block-post-template {
    gap: 1.5rem;
}

/* Equal height cards */
.rv-product-archive .wp-block-post,
.rv-review-archive .wp-block-post {
    display: flex;
}

.rv-product-archive .rv-archive-card,
.rv-review-archive .rv-archive-card {
    flex: 1;
}

/* Responsive grid */
@media (max-width: 900px) {
    .rv-product-archive .wp-block-post-template,
    .rv-review-archive .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .rv-product-archive .wp-block-post-template,
    .rv-review-archive .wp-block-post-template {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Unified Archive Components
   ============================================ */

/* Archive Hero */
.rv-archive-hero {
    margin-bottom: var(--wp--preset--spacing--50, 2rem);
}

.rv-archive-hero__title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0.5rem;
}

.rv-archive-hero__title {
    font-size: var(--rv-text-4xl);
    font-weight: 800;
    color: var(--rv-text-heading);
    margin: 0;
    white-space: nowrap;
}

.rv-archive-hero__title-dash {
    margin: 0 0.625rem;
    color: var(--rv-text-muted);
    font-weight: 300;
    font-size: var(--rv-text-xl);
}

.rv-archive-hero .rv-archive-hero__description {
    font-size: var(--rv-text-xl);
    font-style: italic;
    color: var(--rv-text-secondary);
    margin: 0;
}

/* Category Entry Point Cards */
.rv-category-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.rv-category-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 8px;
    background: var(--rv-surface-secondary);
    text-decoration: none;
    color: var(--rv-text-primary);
    font-size: var(--rv-text-md);
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s;
}

.rv-category-card:hover {
    border-color: var(--rv-brand-accent);
    background: var(--rv-surface-primary);
}

.rv-category-card__count {
    font-weight: 400;
    color: var(--rv-text-muted);
    font-size: var(--rv-text-xs);
}

/* Archive Search (in filters bar) */
.rv-archive-search,
.rv-database-search {
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.rv-archive-search .wp-block-search__inside-wrapper,
.rv-database-search .wp-block-search__inside-wrapper {
    display: flex;
    border: 1px solid var(--rv-border-primary);
    border-radius: 8px;
    overflow: hidden;
    background: var(--rv-surface-primary, #fff);
}

.rv-archive-search .wp-block-search__input,
.rv-database-search .wp-block-search__input {
    flex: 1;
    border: none;
    padding: 0.5rem 0.875rem;
    font-size: var(--rv-text-md);
    outline: none;
    min-width: 180px;
}

.rv-database-search .wp-block-search__input:focus-visible {
    outline: 2px solid var(--rv-brand-accent);
    outline-offset: -2px;
}

.rv-archive-search .wp-block-search__button,
.rv-database-search .wp-block-search__button {
    background: var(--rv-brand-accent);
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-archive-search .wp-block-search__button svg,
.rv-database-search .wp-block-search__button svg {
    fill: #fff;
    width: 18px;
    height: 18px;
}

.rv-archive-search .wp-block-search__button:hover,
.rv-database-search .wp-block-search__button:hover {
    background: var(--rv-text-heading);
}

.rv-archive-hero__microcopy {
    font-size: var(--rv-text-md);
    font-style: italic;
    color: var(--rv-text-muted);
    margin: 0;
}

/* Archive Hero — clarifier line */
.rv-archive-hero__clarifier {
    font-size: var(--rv-text-md);
    color: var(--rv-text-muted);
    margin: 0.25rem 0 0 0;
}

/* ==========================================================================
   UNIFIED EXPLORE PANEL (hero + filters + sort + distribution)
   ========================================================================== */

.rv-explore-panel {
    background: var(--rv-surface-secondary);
    border: 1px solid var(--rv-border-primary);
    border-radius: 16px;
    padding: 1.75rem 2rem 1.25rem;
    margin-bottom: 1.5rem;
}

.rv-explore-panel__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.rv-explore-panel__hero {
    flex: 1;
}

.rv-explore-panel__title-row {
    display: flex;
    align-items: baseline;
    gap: 0;
    margin-bottom: 0.375rem;
}

.rv-explore-panel__breadcrumb {
    font-size: var(--rv-text-md);
    color: var(--rv-text-muted);
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.rv-explore-panel__breadcrumb a {
    color: var(--rv-text-secondary);
    text-decoration: none;
}

.rv-explore-panel__breadcrumb a:hover {
    color: var(--rv-brand-accent);
    text-decoration: underline;
}

.rv-explore-panel__title {
    font-size: var(--rv-text-4xl);
    font-weight: 800;
    color: var(--rv-text-heading);
    margin: 0;
    white-space: nowrap;
}

.rv-explore-panel__title-dash {
    margin: 0 0.625rem;
    color: var(--rv-text-muted);
    font-weight: 300;
    font-size: var(--rv-text-xl);
}

.rv-explore-panel__subtitle {
    font-size: var(--rv-text-xl);
    color: var(--rv-text-secondary);
    font-style: italic;
    font-weight: 400;
}

.rv-explore-panel__desc {
    font-size: var(--rv-text-md);
    color: var(--rv-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.rv-explore-panel__desc a {
    color: var(--rv-brand-accent, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Filter bar inside panel — strip its own styling, clean minimal look */
.rv-explore-panel__controls .rv-archive-filters {
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.rv-explore-panel__controls .rv-archive-filters__inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
}

/* Search takes available space */
.rv-explore-panel__controls .rv-archive-filters__left {
    flex: 1 1 auto;
}

/* Clean search input — hide the button */
.rv-explore-panel__controls .wp-block-search__button {
    display: none;
}

.rv-explore-panel__controls .wp-block-search__inside-wrapper {
    border: none;
    padding: 0;
    background: none;
}

.rv-explore-panel__controls .wp-block-search__input {
    width: 100%;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 8px;
    font-size: var(--rv-text-md);
    background: var(--rv-surface-primary);
    color: var(--rv-text-primary);
    box-sizing: border-box;
}

.rv-explore-panel__controls .wp-block-search__input::placeholder {
    color: var(--rv-text-muted) !important;
    opacity: 0.7 !important;
}

/* Match heights between search and selects */
.rv-explore-panel__controls .rv-filter-dropdown select {
    padding: 0.5rem 0.75rem;
}

/* Dropdowns flow inline */
.rv-explore-panel__controls .rv-archive-filters__right {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
}

/* Hide labels, reset button, and any wpautop <p> wrappers */
.rv-explore-panel__controls .rv-filter-dropdown label,
.rv-explore-panel__controls .rv-reset-filters-btn,
.rv-explore-panel__controls p {
    display: none;
}

/* Uniform select styling */
.rv-explore-panel__controls .rv-filter-dropdown select {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 8px;
    font-size: var(--rv-text-md);
    background: var(--rv-surface-primary);
    color: var(--rv-text-primary);
    cursor: pointer;
}

/* Sort row inside panel */
.rv-explore-panel__sort {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rv-border-primary);
}

.rv-explore-panel__sort .rv-archive-sort-row,
.rv-explore-panel__sort .wp-block-robovations-rv-sort-row {
    margin: 0;
    padding: 0;
    border: none;
}

.rv-explore-panel__sort .rv-sort-dropdown select {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 8px;
    font-size: var(--rv-text-md);
    background: var(--rv-surface-primary);
    color: var(--rv-text-primary);
}

/* Distribution chart inside panel — keeps its own card look (option B) */
.rv-explore-panel .rv-dist-chart {
    background: var(--rv-surface-primary);
    border: 1px solid var(--rv-border-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

@media (max-width: 768px) {
    .rv-explore-panel {
        padding: 1.25rem;
    }

    .rv-explore-panel__top {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ==========================================================================
   FILTER + DISTRIBUTION ROW (legacy 2/3 + 1/3 layout)
   ========================================================================== */

.rv-filter-distribution-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.rv-filter-distribution-row__filters {
    min-width: 0;
}

/* Combined filter + sort wrapper */
.rv-filter-sort-combined {
    background: var(--rv-surface-secondary);
    border: 1px solid var(--rv-border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Remove individual backgrounds/margins when inside combined wrapper */
.rv-filter-sort-combined .rv-archive-filters {
    margin-bottom: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.rv-filter-sort-combined .rv-archive-sort-row,
.rv-filter-sort-combined .wp-block-robovations-rv-sort-row {
    margin: 0;
    padding: 0;
    border: none;
}

/* Stack search on top, filters below in the constrained column */
.rv-filter-distribution-row__filters .rv-archive-filters__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.rv-filter-distribution-row__filters .rv-archive-filters__left {
    flex: 0 0 auto;
}

.rv-filter-distribution-row__filters .rv-archive-filters__right {
    gap: 0.5rem;
}

/* Hide labels inside the row — use select placeholder text instead */
.rv-filter-distribution-row__filters .rv-filter-dropdown label {
    display: none;
}

/* Make selects fill available space evenly */
.rv-filter-distribution-row__filters .rv-filter-dropdown {
    flex: 1 1 0;
    min-width: 0;
}

.rv-filter-distribution-row__filters .rv-filter-dropdown select {
    width: 100%;
}

.rv-filter-distribution-row__dist {
    min-width: 0;
}

/* --- Distribution Chart (vertical bars, option B) --- */

.rv-dist-chart {
    background: var(--rv-surface-primary);
    border: 1px solid var(--rv-border-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.rv-dist-chart__title-area {
    flex-shrink: 0;
}

.rv-dist-chart__title {
    display: block;
    font-size: var(--rv-text-md);
    font-weight: 800;
    color: var(--rv-text-heading);
    line-height: 1.25;
}

.rv-dist-chart__total {
    display: block;
    font-size: var(--rv-text-xs);
    color: var(--rv-text-muted);
    font-weight: 500;
    margin-top: 0.125rem;
}

.rv-dist-chart__bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex: 1;
}

.rv-dist-chart__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    text-decoration: none;
}

.rv-dist-chart__col:hover .rv-dist-chart__bar {
    opacity: 0.7;
}

.rv-dist-chart__pct {
    font-size: var(--rv-text-md);
    font-weight: 800;
    line-height: 1;
}

.rv-dist-chart__bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: opacity 0.15s;
}

.rv-dist-chart__bar--1 { background: var(--rv-autonomy-1); }
.rv-dist-chart__bar--2 { background: var(--rv-autonomy-2); }
.rv-dist-chart__bar--3 { background: var(--rv-autonomy-3); }
.rv-dist-chart__bar--4 { background: var(--rv-autonomy-4); }
.rv-dist-chart__bar--5 { background: var(--rv-autonomy-5); }

.rv-dist-chart__lbl {
    font-size: var(--rv-text-xs);
    font-weight: 600;
    color: var(--rv-text-muted);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .rv-filter-distribution-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   COMPARE ROBOTS ENTRY POINT
   ========================================================================== */

.rv-compare-robots {
    background: var(--rv-surface-secondary);
    border: 1px solid var(--rv-border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.rv-compare-robots__title {
    font-size: var(--rv-text-xl);
    font-weight: 700;
    color: var(--rv-text-heading);
    margin: 0 0 1rem 0;
}

.rv-compare-robots__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.rv-compare-robots__selects {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.rv-compare-robots__select {
    flex: 1;
    min-width: 180px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 8px;
    font-size: var(--rv-text-md);
    background: var(--rv-surface-primary);
    color: var(--rv-text-primary);
    cursor: pointer;
}

.rv-compare-robots__select:focus {
    outline: none;
    border-color: var(--rv-brand-accent);
}

.rv-compare-robots__select:focus-visible {
    outline: 2px solid var(--rv-brand-accent);
    outline-offset: 2px;
}

.rv-compare-robots__vs {
    font-size: var(--rv-text-md);
    font-weight: 600;
    color: var(--rv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rv-compare-robots__btn {
    padding: 0.625rem 1.5rem;
    background: var(--rv-brand-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: var(--rv-text-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.rv-compare-robots__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rv-compare-robots__add {
    padding: 0.625rem 1rem;
    background: transparent;
    color: var(--rv-brand-accent);
    border: 1px dashed var(--rv-brand-accent);
    border-radius: 8px;
    font-size: var(--rv-text-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.rv-compare-robots__add:hover {
    background: var(--rv-surface-primary);
}

.rv-compare-robots__select-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 180px;
}

.rv-compare-robots__select-wrap .rv-compare-robots__select {
    flex: 1;
}

.rv-compare-robots__remove {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--rv-border-primary);
    border-radius: 6px;
    color: var(--rv-text-muted);
    font-size: var(--rv-text-base);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}

.rv-compare-robots__remove:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.rv-compare-robots__btn:hover:not(:disabled) {
    background: var(--rv-text-heading);
}

.rv-compare-robots__btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.rv-compare-robots__error {
    color: var(--rv-text-muted);
    font-size: var(--rv-text-md);
    font-style: italic;
    margin: 1rem 0 0 0;
}

/* Comparison Results Table */
.rv-compare-robots__results:empty {
    display: none;
}

.rv-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: var(--rv-text-md);
}

.rv-compare-table thead th {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: var(--rv-text-heading);
    border-bottom: 2px solid var(--rv-border-primary);
    vertical-align: bottom;
}

.rv-compare-table__robot {
    overflow: visible;
    padding: 0.75rem 0.5rem;
    vertical-align: bottom;
}

.rv-compare-table__robot a {
    color: var(--rv-text-heading);
    text-decoration: none;
    font-size: var(--rv-text-base);
    display: block;
    margin-top: 0.5rem;
}

.rv-compare-table__robot a:hover {
    color: var(--rv-brand-accent);
}

.rv-compare-table,
.rv-compare-table th,
.rv-compare-table td {
    overflow: visible !important;
}

.rv-compare-img {
    width: auto;
    max-width: 140px;
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    background: #fff;
    padding: 0.5rem;
}

.rv-compare-img-placeholder {
    width: 200px;
    height: 150px;
    background: var(--rv-surface-secondary);
    border-radius: 8px;
    margin: 0 auto;
}

.rv-compare-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--rv-border-primary);
    text-align: center;
    color: var(--rv-text-primary);
}

.rv-compare-table__label {
    text-align: left !important;
    font-weight: 600;
    color: var(--rv-text-secondary);
    white-space: nowrap;
    width: 20%;
}

.rv-compare-score {
    font-weight: 700;
    font-size: var(--rv-text-base);
}


.rv-compare-table__view-row td {
    border-bottom: none;
    padding-top: 0.75rem;
}

.rv-compare-view-link {
    font-size: var(--rv-text-md);
    font-weight: 600;
    color: var(--rv-brand-accent);
    text-decoration: none;
}

.rv-compare-view-link:hover {
    text-decoration: underline;
}

.rv-compare-table-scroll {
    overflow-x: visible;
}

/* Availability row */
.rv-compare-table__availability td {
    border-top: 2px solid var(--rv-border-primary);
    padding-top: 0.75rem;
}

.rv-compare-buy {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--rv-surface-secondary);
    border: 1px solid var(--rv-border-primary);
    border-radius: 6px;
    color: var(--rv-text-heading);
    font-weight: 600;
    font-size: var(--rv-text-md);
    text-decoration: none;
    transition: border-color 0.15s;
}

.rv-compare-buy:hover {
    border-color: var(--rv-brand-accent);
}

.rv-compare-disclosure {
    font-size: var(--rv-text-xs);
    color: var(--rv-text-muted);
    text-align: center;
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* ==========================================================================
   LOAD MORE BUTTON (AJAX — Explore Robots page)
   ========================================================================== */

.rv-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.75rem 2.5rem;
    font-size: var(--rv-text-base);
    font-weight: 600;
    color: var(--rv-text-heading);
    background: var(--rv-surface-primary);
    border: 2px solid var(--rv-border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rv-load-more-btn:hover:not(:disabled) {
    border-color: var(--rv-brand-accent);
    background: var(--rv-surface-secondary);
}

.rv-load-more-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 600px) {
    .rv-compare-robots__selects {
        flex-direction: column;
    }

    .rv-compare-robots__select {
        min-width: 0;
        width: 100%;
    }

    .rv-compare-robots__btn {
        width: 100%;
    }

    .rv-load-more-btn {
        width: 100%;
    }

    .rv-compare-robots__actions {
        width: 100%;
    }

    .rv-compare-robots__add {
        flex: 1;
    }

    .rv-compare-robots__select-wrap {
        min-width: 0;
        width: 100%;
    }

    .rv-compare-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rv-compare-table {
        font-size: var(--rv-text-xs);
        min-width: 480px;
    }

    .rv-compare-img {
        max-width: 80px;
        max-height: 60px;
    }

    .rv-compare-table__label {
        font-size: var(--rv-text-xs);
    }
}

/* Archive Filters */
.rv-archive-filters {
    background: var(--rv-surface-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.rv-archive-filters__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.rv-archive-filters__left {
    flex: 1 1 100%;
}

.rv-archive-filters__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* Filter Dropdown */
.rv-filter-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rv-filter-dropdown label {
    font-size: var(--rv-text-md);
    font-weight: 500;
    color: var(--rv-text-secondary);
    white-space: nowrap;
}

.rv-filter-dropdown select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 6px;
    font-size: var(--rv-text-md);
    background: var(--rv-surface-primary, #fff);
    cursor: pointer;
}

.rv-filter-dropdown select:focus {
    outline: none;
    border-color: var(--rv-brand-accent);
}

.rv-filter-dropdown select:focus-visible {
    outline: 2px solid var(--rv-brand-accent);
    outline-offset: 2px;
}

/* Reset Filters Button */
.rv-reset-filters-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 6px;
    font-size: var(--rv-text-md);
    font-weight: 500;
    background: var(--rv-surface-primary, #fff);
    color: var(--rv-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.rv-reset-filters-btn:hover {
    border-color: var(--rv-brand-accent);
    color: var(--rv-brand-accent);
}

/* Archive Sort Row */
.rv-archive-sort-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rv-archive-sort-row__left {
    flex: 1;
}

.rv-archive-sort-row__right {
    flex-shrink: 0;
}

/* Sort Dropdown */
.rv-sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rv-sort-dropdown label {
    font-size: var(--rv-text-md);
    font-weight: 500;
    color: var(--rv-text-secondary);
    white-space: nowrap;
}

.rv-sort-dropdown select,
.rv-sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 6px;
    font-size: var(--rv-text-md);
    background: var(--rv-surface-primary, #fff);
    cursor: pointer;
}

.rv-sort-dropdown select:focus,
.rv-sort-select:focus {
    outline: none;
    border-color: var(--rv-brand-accent);
}

.rv-sort-dropdown select:focus-visible,
.rv-sort-select:focus-visible {
    outline: 2px solid var(--rv-brand-accent);
    outline-offset: 2px;
}

/* Sort/Filter Form Wrappers — transparent to flexbox layout */
.rv-sort-form,
.rv-filter-form {
    display: contents;
}

/* Fieldset reset — transparent to flexbox like the form wrapper */
.rv-filter-fieldset {
    display: contents;
    border: none;
    padding: 0;
    margin: 0;
    min-inline-size: 0;
}

/* Noscript fallback buttons */
.rv-sort-submit,
.rv-filter-submit {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rv-border-primary);
    border-radius: 6px;
    font-size: var(--rv-text-md);
    font-weight: 500;
    background: var(--rv-surface-primary, #fff);
    color: var(--rv-text-secondary);
    cursor: pointer;
}

/* Archive Stats */
.rv-archive-stats {
    font-size: var(--rv-text-md);
    color: var(--rv-text-muted);
}

@media (max-width: 782px) {
    .rv-archive-hero__title {
        font-size: var(--rv-text-4xl);
    }

    .rv-archive-filters__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .rv-archive-filters__left {
        order: 1;
    }

    .rv-archive-search,
    .rv-database-search {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .rv-archive-search .wp-block-search__input,
    .rv-database-search .wp-block-search__input {
        min-width: 0;
    }

    .rv-archive-filters__right {
        order: 2;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .rv-filter-dropdown {
        justify-content: space-between;
    }

    .rv-filter-dropdown select {
        flex: 1;
    }

    .rv-archive-sort-row {
        justify-content: flex-start;
    }

    .rv-sort-dropdown {
        justify-content: space-between;
        width: 100%;
    }

    .rv-sort-dropdown select {
        flex: 1;
    }

    .rv-reset-filters-btn {
        width: 100%;
    }
}

/* Breadcrumb Navigation */
/* Breadcrumb styles moved to blocks-shared.css (global) */

/* Search Page - Wider Hero and Filter Bar */
body.search .rv-archive-hero,
body.search .rv-archive-filters {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Remove visual gap and separator line on search page */
body.search .rv-archive-filters {
    margin-bottom: 0;
}

body.search .rv-sort-row {
    margin-top: 1.5rem;
}

body.search main > .wp-block-group:not(:first-child):not(.has-background)::before {
    display: none;
}

/* ==========================================================================
   ARCHIVE PAGINATION
   ========================================================================== */

.wp-block-query-pagination {
    gap: 0.5rem;
    margin-top: 2rem;
}

/* Previous/Next navigation links */
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: var(--rv-text-md);
    font-weight: 600;
    color: var(--rv-text-heading);
    background: var(--rv-surface-primary);
    border: 1px solid var(--rv-border-primary);
    border-radius: var(--rv-button-radius, 8px);
    text-decoration: none;
    transition: color var(--rv-transition, 200ms ease), border-color var(--rv-transition, 200ms ease), background-color var(--rv-transition, 200ms ease);
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    color: var(--rv-brand-accent);
    border-color: var(--rv-brand-accent);
    background: var(--rv-surface-secondary);
}

/* Page numbers container */
.wp-block-query-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Individual page number links */
.wp-block-query-pagination-numbers .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    font-size: var(--rv-text-md);
    font-weight: 500;
    color: var(--rv-text-secondary);
    background: var(--rv-surface-primary);
    border: 1px solid var(--rv-border-primary);
    border-radius: var(--rv-button-radius, 8px);
    text-decoration: none;
    transition: color var(--rv-transition, 200ms ease), border-color var(--rv-transition, 200ms ease), background-color var(--rv-transition, 200ms ease);
}

.wp-block-query-pagination-numbers .page-numbers:hover {
    color: var(--rv-brand-accent);
    border-color: var(--rv-brand-accent);
    background: var(--rv-surface-secondary);
}

/* Current page number */
.wp-block-query-pagination-numbers .page-numbers.current {
    color: var(--rv-surface-primary);
    background: var(--rv-text-heading);
    border-color: var(--rv-brand-primary);
    font-weight: 600;
}

/* Ellipsis dots */
.wp-block-query-pagination-numbers .page-numbers.dots {
    border: none;
    background: transparent;
    color: var(--rv-text-muted);
    min-width: 1.5rem;
    cursor: default;
}

.wp-block-query-pagination-numbers .page-numbers.dots:hover {
    background: transparent;
    border: none;
    color: var(--rv-text-muted);
}

/* Pagination responsive */
@media (max-width: 600px) {
    .wp-block-query-pagination {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .wp-block-query-pagination-previous,
    .wp-block-query-pagination-next {
        padding: 0.5rem 0.75rem;
        font-size: var(--rv-text-md);
    }

    .wp-block-query-pagination-numbers .page-numbers {
        min-width: 2.25rem;
        height: 2.25rem;
        font-size: var(--rv-text-md);
    }

    /* Hide some page numbers on very small screens */
    .wp-block-query-pagination-numbers .page-numbers:not(.current):not(.prev):not(.next):not(.dots) {
        display: none;
    }

    /* But show first, last, and neighbors of current */
    .wp-block-query-pagination-numbers .page-numbers:first-child,
    .wp-block-query-pagination-numbers .page-numbers:last-child,
    .wp-block-query-pagination-numbers .page-numbers.current,
    .wp-block-query-pagination-numbers .page-numbers.current + .page-numbers,
    .wp-block-query-pagination-numbers .page-numbers:has(+ .page-numbers.current) {
        display: inline-flex;
    }
}
