/* Shared product listing page layout — filters, toolbar, responsive drawer */
.plp-page {
    --plp-brand: var(--brand-primary, #045d48);
    --plp-brand-dark: var(--brand-primary-dark, #034436);
    --plp-brand-light: var(--brand-light, #e8f5f1);
    --plp-surface: #ffffff;
    --plp-border: var(--header-border, #e5ece9);
    --plp-text: var(--header-text, #1f2937);
    --plp-text-muted: var(--header-text-muted, #6b7280);
    --plp-radius: 16px;
    --plp-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    --plp-shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
    --plp-font: "Inter", system-ui, sans-serif;

    font-family: var(--plp-font);
    padding: 1.25rem 0 2.5rem;
    background:
        radial-gradient(ellipse 70% 45% at 50% -15%, rgba(4, 93, 72, 0.07), transparent),
        linear-gradient(180deg, #eef2f6 0%, #f8fafc 220px, transparent 420px);
    min-height: 60vh;
}

.plp-page__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.75rem;
}

.plp-hero {
    margin-bottom: 1.25rem;
}

.plp-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--plp-brand-light);
    color: var(--plp-brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plp-hero__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--plp-text);
}

.plp-hero__subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--plp-text-muted);
    max-width: 42rem;
    line-height: 1.55;
}

.plp-layout {
    display: grid;
    grid-template-columns: minmax(280px, 300px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.plp-filters {
    position: sticky;
    top: 88px;
    align-self: start;
    z-index: 20;
}

.plp-filters__scroll {
    padding-right: 4px;
}

.plp-filters .plf-panel {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(4, 93, 72, 0.14);
}

.plp-main {
    min-width: 0;
}

.plp-main__panel {
    background: var(--plp-surface);
    border: 1px solid var(--plp-border);
    border-radius: var(--plp-radius);
    box-shadow: var(--plp-shadow);
    padding: 1rem 1.1rem 1.25rem;
}

.plp-main__panel--flow {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 1.1rem !important;
}

#see-more-offers-page .plp-results,
#see-more-auctions-page .plp-results,
#no-reserve-page .plp-results {
    min-height: 0;
}

.plp-main__toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.plp-filters-toggle {
    display: none;
    align-items: center;
    gap: 0.45rem;
    height: 40px;
    padding: 0 0.95rem;
    border: 1px solid rgba(4, 93, 72, 0.25);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--plp-brand-light) 0%, #fff 100%);
    color: var(--plp-brand);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.plp-filters-toggle:hover {
    border-color: var(--plp-brand);
    box-shadow: 0 4px 12px rgba(4, 93, 72, 0.12);
}

.plp-filters-toggle:focus-visible {
    outline: 2px solid var(--plp-brand);
    outline-offset: 2px;
}

.plp-main__panel .listing-toolbar {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.plp-results {
    position: relative;
    min-height: 280px;
}

.plp-filters-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.plp-filters-backdrop.is-visible {
    display: block;
}

.plp-page .products-scroll-panel {
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

@media (min-width: 992px) {
    .plp-filters.is-height-synced {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .plp-filters.is-height-synced .plp-filters__scroll {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .plp-filters.is-height-synced .plf-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
    }

    .plp-filters.is-height-synced .plf-panel__header {
        flex-shrink: 0;
    }

    .plp-filters.is-height-synced .plf-panel__body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 2px;
    }

    .plp-filters.is-height-synced .plf-panel__body::-webkit-scrollbar {
        width: 6px;
    }

    .plp-filters.is-height-synced .plf-panel__body::-webkit-scrollbar-thumb {
        background: rgba(4, 93, 72, 0.35);
        border-radius: 999px;
    }

    .plp-filters.is-height-synced .plf-checklist {
        max-height: none;
        overflow: visible;
    }

    .plp-page.see-more-listing-page:not(#see-more-offers-page):not(#see-more-auctions-page):not(#no-reserve-page) .plp-main__panel {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 6px;
    }

    .plp-page.see-more-listing-page:not(#see-more-offers-page):not(#see-more-auctions-page):not(#no-reserve-page) .plp-main__panel::-webkit-scrollbar {
        width: 6px;
    }

    .plp-page.see-more-listing-page:not(#see-more-offers-page):not(#see-more-auctions-page):not(#no-reserve-page) .plp-main__panel::-webkit-scrollbar-thumb {
        background: rgba(4, 93, 72, 0.35);
        border-radius: 999px;
    }
}

@media (max-width: 991.98px) {
    .plp-layout {
        grid-template-columns: 1fr;
    }

    .plp-filters {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(340px, 92vw);
        height: auto;
        max-height: none;
        padding: 0;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        background: var(--plp-surface);
        box-shadow: var(--plp-shadow-lg);
        z-index: 1050;
        display: flex;
        flex-direction: column;
    }

    .plp-filters.is-open {
        transform: translateX(0);
    }

    .plp-filters__scroll {
        flex: 1;
        min-height: 0;
        max-height: 100vh;
        height: auto;
        overflow: hidden;
        padding: 1rem 0.85rem 1.25rem;
    }

    .plp-filters .plf-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .plp-filters .plf-panel__body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .plp-filters-toggle {
        display: inline-flex;
    }

    .plp-main__toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .plp-main__panel .listing-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .plp-main__panel .listing-toolbar__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .plp-main__panel .listing-toolbar__search {
        max-width: none;
    }
}

.plp-page .listing-empty-state,
.plp-page #products-container:has(.listing-empty-state) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: min(420px, calc(100vh - 220px));
    padding: 2rem 1rem;
}

.plp-page #products-container:has(.listing-empty-state) {
    flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
    .plp-filters {
        transition: none;
    }
}
