/* ==========================================================================
   Category Product Listing Page (PLP) Stylesheet
   ========================================================================== */

.category-page-container {
    max-width: 1360px;
    width: 100%;
    margin: 12px auto 40px;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Breadcrumbs */
.category-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #878787;
    margin-bottom: 12px;
}

.category-breadcrumbs a {
    color: #878787;
    text-decoration: none;
    transition: color 0.15s;
}

.category-breadcrumbs a:hover {
    color: #2874f0;
}

.category-breadcrumbs .sep {
    color: #cbd5e1;
}

.category-breadcrumbs .current {
    color: #212121;
    font-weight: 600;
}

/* Category Top Banner */
.category-hero-banner {
    border-radius: 6px;
    padding: 24px 32px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.cat-banner-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.cat-banner-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 4px;
}

.cat-banner-sub {
    font-size: 13.5px;
    opacity: 0.9;
    max-width: 600px;
}

.category-hero-banner .cat-svg {
    width: 40px;
    height: 40px;
}

/* 2-Column PLP Layout */
.category-layout-grid {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Filter Sidebar (280px) - Sticky on Scroll
   -------------------------------------------------------------------------- */
.filter-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #edf2f7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: calc(var(--site-header-height, 195px) + 10px);
    max-height: calc(100vh - var(--site-header-height, 195px) - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 90;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.filter-sidebar::-webkit-scrollbar {
    width: 5px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    background: #ffffff;
    border-radius: 8px 8px 0 0;
    z-index: 2;
}

.filter-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #212121;
    margin: 0;
}

.btn-clear-filters {
    background: none;
    border: none;
    color: #2874f0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.btn-clear-filters:hover {
    text-decoration: underline;
}

.filter-block {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-block:last-child {
    border-bottom: none;
}

.filter-block-title {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #212121;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.price-select {
    flex: 1;
    padding: 6px 8px;
    font-size: 12.5px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #ffffff;
}

.filter-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #212121;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox-label input[type="checkbox"],
.filter-checkbox-label input[type="radio"] {
    accent-color: #2874f0;
    cursor: pointer;
}

.filter-count {
    color: #878787;
    font-size: 11.5px;
    margin-left: auto;
}

/* --------------------------------------------------------------------------
   Product Showcase Area & Sticky Sort Bar
   -------------------------------------------------------------------------- */
.category-products-area {
    flex: 1;
    min-width: 0;
}

/* Sorting Bar - Sticky on Scroll */
.category-sort-bar {
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 6px;
    border: 1px solid #edf2f7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: var(--site-header-height, 195px);
    z-index: 95;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, border-radius 0.2s ease;
}

.category-sort-bar.is-stuck {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.category-results-count {
    font-size: 14px;
    color: #212121;
}

.category-results-count strong {
    font-weight: 700;
}

.sort-options-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sort-label {
    font-size: 13px;
    font-weight: 700;
    color: #212121;
}

.sort-tab-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.sort-tab-btn:hover {
    color: #2874f0;
}

.sort-tab-btn.active {
    color: #2874f0;
    font-weight: 700;
    border-bottom-color: #2874f0;
}

/* Products Grid */
.category-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.plp-product-card {
    background: #ffffff;
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

.plp-product-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.plp-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    z-index: 2;
    transition: color 0.15s, transform 0.15s;
}

.plp-wishlist-btn:hover,
.plp-wishlist-btn.active {
    color: #ef4444;
    transform: scale(1.1);
}

.plp-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    padding: 14px;
}

.plp-product-img,
.prod-card-img--main {
    max-height: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    margin: auto !important;
    transform-origin: center center !important;
    opacity: 1;
    transform: translateZ(0);
    transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.plp-img-container .prod-card-img--alt {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 0 !important;
    pointer-events: none !important;
    padding: inherit !important;
    box-sizing: border-box !important;
    margin: auto !important;
    transform-origin: center center !important;
    transform: translateZ(0);
    transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity;
    z-index: 2 !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.plp-product-card.is-showing-alt .prod-card-img--alt,
.plp-product-card:hover .prod-card-img--alt {
    opacity: 1 !important;
}

.plp-product-card.is-showing-alt .prod-card-img--main {
    opacity: 0 !important;
}

.plp-product-card:hover .plp-product-img,
.plp-product-card:hover .prod-card-img--alt {
    transform: scale(1.05) translateZ(0) !important;
}

.plp-brand-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #878787;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.plp-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    margin: 0 0 6px;
    line-height: 1.35;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
}

.plp-product-title:hover {
    color: #2874f0;
}

.plp-rating-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.plp-rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #388e3c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.plp-rating-count {
    font-size: 11.5px;
    color: #878787;
}

.plp-pricing-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.plp-price-current {
    font-size: 17px;
    font-weight: 800;
    color: #212121;
}

.plp-price-orig {
    font-size: 12.5px;
    color: #878787;
    text-decoration: line-through;
}

.plp-price-discount {
    font-size: 12.5px;
    color: #388e3c;
    font-weight: 700;
}

.plp-specs-list {
    list-style: disc;
    padding-left: 16px;
    margin: 6px 0 12px;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
    flex: 1;
}

.plp-specs-list li {
    margin-bottom: 2px;
}

.plp-btn-add {
    width: 100%;
    background: #fb641b;
    color: #ffffff;
    border: none;
    padding: 9px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s;
    margin-top: auto;
}

.plp-btn-add:hover {
    background: #e45510;
}

/* Responsive */
@media (max-width: 960px) {
    .category-layout-grid {
        flex-direction: column;
    }
    .filter-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 12px;
    }
    .category-sort-bar {
        position: sticky;
        top: calc(var(--site-header-height, 150px) + var(--sticky-top-margin, 12px));
        z-index: 95;
    }
    .category-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 580px) {
    .category-sort-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .sort-options-wrap {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .category-products-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Search Empty State & Recommendations
   ========================================================================== */
.search-empty-state-wrap {
    width: 100%;
}

.search-empty-header-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 36px 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.search-empty-icon {
    width: 56px;
    height: 56px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.search-empty-title {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.search-empty-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0 auto 16px;
    max-width: 520px;
    line-height: 1.5;
}

.search-rec-section {
    margin-bottom: 24px;
}

.search-rec-section-bordered {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px 24px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.search-rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 2px;
}

.search-rec-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-rec-tag {
    background: #eff6ff;
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #dbeafe;
}

.search-rec-viewall {
    font-size: 13px;
    font-weight: 600;
    color: #2874f0;
    text-decoration: none;
}

.search-rec-viewall:hover {
    text-decoration: underline;
}

.search-category-pill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.search-cat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    gap: 8px;
    transition: all 0.2s ease;
}

.search-cat-card:hover {
    border-color: #2874f0;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.search-cat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-cat-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
}

@media (max-width: 580px) {
    .search-category-pill-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   PLP Pagination Controls
   ========================================================================== */
.plp-pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 20px 0;
    flex-wrap: wrap;
    user-select: none;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pagination-btn:hover {
    background: #f8fafc;
    border-color: #2874f0;
    color: #2874f0;
    transform: translateY(-1px);
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-num:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2874f0;
}

.pagination-num.active {
    background: #2874f0;
    border-color: #2874f0;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(40, 116, 240, 0.35);
}

.pagination-ellipsis {
    color: #94a3b8;
    padding: 0 4px;
    font-size: 14px;
}

/* Infinite Scroll Sentinel & Loader */
.infinite-scroll-sentinel {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    margin-top: 10px;
}

.infinite-scroll-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 12px 24px;
    border-radius: 30px;
    color: #334155;
    font-size: 13.5px;
    font-weight: 600;
}

.infinite-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #2874f0;
    border-radius: 50%;
    animation: infiniteSpin 0.75s linear infinite;
}

@keyframes infiniteSpin {
    to { transform: rotate(360deg); }
}

.infinite-scroll-end {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 12px 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.plp-product-card.card-fade-in {
    animation: plpCardFadeIn 0.35s ease forwards;
}

@keyframes plpCardFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}


