/**
 * RB Vehicle Hub — Stylesheet
 *
 * Matches Raybuck theme conventions:
 *   Primary red:    #EE3732
 *   Dark navy:      #06233C
 *   Dark charcoal:  #3a3a3a  (facet header color)
 *   Max width:      1180px
 *   Sidebar width:  24%
 *   Content width:  76%
 *   Scroll height:  420px    (matches Ubermenu content block)
 *
 * Enqueue via rb-vehicle-hub-functions.php or functions.php:
 *   wp_enqueue_style(
 *     'rb-vehicle-hub',
 *     get_template_directory_uri() . '/rb-vehicle-hub.css',
 *     [],
 *     '1.0.0'
 *   );
 * Hook: wp_enqueue_scripts, conditional on is_page_template( 'rb-vehicle-hub.php' )
 */

/* ============================================================
   LAYOUT
   ============================================================ */

.rb-vehicle-hub {
    width: 100%;
}


/* Two-column layout: sidebar left, main content right */
.rb-hub-layout {
    display: flex;
    align-items: flex-start;
    gap: 0px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 0 40px;
    padding-left: 0 !important;
}

.rb-hub-sidebar {
    flex: 0 0 24%;
    width: 24%;
    min-width: 0;
    margin-left: 0 !important;
padding-left: 0 !important;
}

.rb-hub-main {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 30px;
}

.content-sidebar-wrap .rb-hub-layout {
    padding-left: 0 !important;
}

.rb-vehicle-hub .content-sidebar-wrap {
    padding-left: 0 !important;
}

/* ============================================================
   SIDEBAR WIDGET
   Matches .sidebar .widget from style.css:
   padding: 25px 30px, background dark, color #fff
   ============================================================ */

.rb-sidebar-widget {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 0;
    margin-bottom: 30px;
    word-wrap: break-word;
}

.rb-sidebar-header {
    background: #3a3a3a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rb-sidebar-subheader {
    background: #f5f5f5;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 7px 16px;
    border-top: 1px solid #e0e0e0;
}

/* Featured models section — always visible, no scroll */
.rb-sidebar-section--featured {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* All models section — scrollable */
.rb-sidebar-section--all {
    /* no extra padding — subheader handles top spacing */
}

/* ============================================================
   MODEL LIST LINKS
   ============================================================ */

.rb-model-list {
    display: flex;
    flex-direction: column;
}

/* Featured model links — bold, Raybuck red */
.rb-model-link--featured {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #EE3732;
    text-decoration: none;
    transition: background 0.15s;
}

.rb-model-link--featured:hover,
.rb-model-link--featured:focus {
    background: #fef2f2;
    color: #EE3732;
    text-decoration: none;
}

.rb-model-link--featured.is-active {
    background: #5B9BD5;
    color: #fff;
}

.rb-model-link--featured.is-active .rb-model-count {
    color: rgba(255,255,255,0.8);
}

/* All models scrollable list */
.rb-model-list--scrollable {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Thin scrollbar matching Ubermenu content block */
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.rb-model-list--scrollable::-webkit-scrollbar {
    width: 6px;
}

.rb-model-list--scrollable::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.rb-model-list--scrollable::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* All models links — lighter weight, less prominent */
.rb-model-link--all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 400;
    color: #444;
    text-decoration: none;
    transition: background 0.15s;
}

.rb-model-link--all:hover,
.rb-model-link--all:focus {
    background: #f5f5f5;
    color: #EE3732;
    text-decoration: none;
}

.rb-model-count {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin-left: 6px;
    flex-shrink: 0;
}

.rb-model-link--featured .rb-model-count {
    color: #c07a78;
}

/* ============================================================
   MAIN CONTENT — SECTIONS
   ============================================================ */

.rb-hub-section {
    margin-bottom: 40px;
}

.rb-section-title {
    font-size: 22px;
    color: #06233C;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #EE3732;
}

.rb-subsection-title {
    font-size: 17px;
    color: #06233C;
    margin: 24px 0 12px;
}

.rb-intro-content {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.rb-bottom-content {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* ============================================================
   TILES — SHARED
   ============================================================ */

.rb-tiles {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 24px;
}

.rb-tiles--2col {
    grid-template-columns: repeat(2, 1fr);
}

.rb-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.rb-tile:hover,
.rb-tile:focus {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: #EE3732;
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   MODEL TILES (Level 1 make hub)
   Large tiles with image, description, Shop button
   ============================================================ */

.rb-tile--model .rb-tile__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
}

.rb-tile--model .rb-tile__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.rb-tile--model:hover .rb-tile__img img {
    transform: scale(1.03);
}

.rb-tile--model .rb-tile__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rb-tile--model .rb-tile__title {
    font-size: 18px;
    font-weight: 700;
    color: #06233C;
    margin: 0 0 8px;
}

.rb-tile--model .rb-tile__desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 10px;
    flex: 1;
}

.rb-tile--model .rb-tile__count {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
}

.rb-tile__btn {
    display: inline-block;
    background: #EE3732;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 9px 16px;
    border-radius: 3px;
    text-align: center;
    transition: background 0.2s;
    align-self: flex-start;
}

.rb-tile:hover .rb-tile__btn {
    background: #c42d29;
}

/* ============================================================
   GROUP / SUBCAT TILES (Levels 2 & 3)
   Smaller compact tiles — title + count
   ============================================================ */

.rb-tile--group,
.rb-tile--subcat {
    padding: 14px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.rb-tile--group .rb-tile__title,
.rb-tile--subcat .rb-tile__title {
    font-size: 14px;
    font-weight: 600;
    color: #06233C;
    margin: 0;
}

.rb-tile--group .rb-tile__meta,
.rb-tile--subcat .rb-tile__meta {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    margin-left: 8px;
}

/* Featured group/subcat tiles — larger with image */
.rb-tile--featured {
    flex-direction: column;
    padding: 0;
}

.rb-tile--featured .rb-tile__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
}

.rb-tile--featured .rb-tile__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.rb-tile--featured:hover .rb-tile__img img {
    transform: scale(1.03);
}

.rb-tile--featured .rb-tile__body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rb-tile--featured .rb-tile__title {
    font-size: 16px;
    font-weight: 700;
    color: #06233C;
    margin: 0 0 6px;
}

.rb-tile--featured .rb-tile__desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 8px;
    flex: 1;
}

.rb-tile--featured .rb-tile__count {
    font-size: 12px;
    color: #888;
    margin: 0 0 10px;
}

/* ============================================================
   YEAR / BRAND PILLS
   Static display — not interactive filters
   ============================================================ */

.rb-filterbar {
    margin-bottom: 20px;
}

.rb-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: #06233C;
    margin-right: 8px;
}

.rb-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}

.rb-filter-pill {
    display: inline-block;
    background: #f0f4f8;
    border: 1px solid #d0dce8;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    color: #444;
    white-space: nowrap;
}

.rb-filter-pill--year {
    background: #eaf2fb;
    border-color: #b8d4ec;
    color: #06233C;
}
/* Clickable year pill links */
.rb-filter-pill--link {
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rb-filter-pill--link:hover,
.rb-filter-pill--link:focus {
    background: #EE3732;
    border-color: #EE3732;
    color: #fff;
    text-decoration: none;
}

.rb-filter-pill--link:hover .rb-pill-count,
.rb-filter-pill--link:focus .rb-pill-count {
    color: rgba(255,255,255,0.8);
}

.rb-pill-count {
    font-size: 11px;
    color: #888;
    margin-left: 3px;
}


.rb-brand-section {
    margin-top: 24px;
}

.rb-brand-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.rb-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 12px;
    color: #444;
}

.rb-filter-count {
    color: #888;
    font-size: 11px;
}

/* ============================================================
   YEAR RANGE DISPLAY
   ============================================================ */

.rb-hub-year-range {
    font-size: 14px;
    color: #555;
    margin-bottom: 16px;
}

/* ============================================================
   LEVEL 4 — PRODUCT LISTING
   ============================================================ */

/* L4: sidebar facet widgets */

/* Hide FacetWP's toggle button label */
.rb-sidebar-facet .toggle-btn {
    display: none !important;
}

.rb-sidebar-facet {
    padding: 8px 0;
}

.rb-sidebar-facet .facetwp-facet {
    padding: 0 12px 4px;
    display: block;
}

/* L4 product section — 2-column product grid */
.rb-hub-section--products {
    display: block;
}

.rb-hub-section--products .products {
    grid-template-columns: repeat( 3, 1fr ) !important;
    display: grid !important;
    gap: 20px;
}

.rb-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.rb-no-results {
    padding: 40px;
    text-align: center;
    color: #666;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.rb-error {
    color: #c00;
    font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
    .rb-hub-layout {
        flex-direction: column;
    }

    .rb-hub-sidebar {
        width: 100%;
        flex: none;
    }

    /* On mobile collapse the sidebar scrollable list shorter */
    .rb-model-list--scrollable {
        max-height: 220px;
    }

    .rb-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .rb-tiles--2col {
        grid-template-columns: repeat(2, 1fr);
    }
    .rb-hub-section--products .products {
        grid-template-columns: repeat( 2, 1fr ) !important;
    }
}

@media (max-width: 600px) {
    .rb-tiles,
    .rb-tiles--2col {
        grid-template-columns: 1fr;
    }

    .rb-tile--group,
    .rb-tile--subcat {
        padding: 12px 14px;
    }
}

/* ============================================================
   YEAR LIST (sidebar)
   Scrollable list of clickable year links
   ============================================================ */

.rb-year-list {
    display: block !important;
}

.rb-year-list--scrollable {
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.rb-year-list--scrollable::-webkit-scrollbar {
    width: 6px;
}

.rb-year-list--scrollable::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.rb-year-list--scrollable::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.rb-year-link {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 400;
    color: #444;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.rb-year-link:hover,
.rb-year-link:focus {
    background: #fef2f2;
    color: #EE3732;
    text-decoration: none;
}

/* ============================================================
   CATEGORY / SUBCATEGORY LIST (sidebar)
   Simple link list with counts — no scroll, shows all
   ============================================================ */

.rb-cat-list {
    display: block !important;
    padding: 6px 0;
}

.rb-cat-link,
.rb-cat-link--static {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 400;
    color: #444;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.rb-cat-link:hover,
.rb-cat-link:focus {
    background: #fef2f2;
    color: #EE3732;
    text-decoration: none;
}

.rb-cat-link.is-active {
    background: #fef2f2;
    color: #EE3732;
    font-weight: 600;
}

/* Static brand entries — not clickable links */
.rb-cat-link--static {
    cursor: default;
    color: #555;
}

.rb-cat-link--static:hover {
    background: transparent;
    color: #555;
}

/* Sidebar section spacing */
.rb-sidebar-section--years {
    padding: 4px 0;
}

/* SKU line in product loop cards */
.rb-loop-sku {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* ============================================================
   L4 PRODUCT CARDS
   Match theme content-product.php / .product-item-wrap style
   ============================================================ */

/* Remove default li bullet/padding WooCommerce adds */
.rb-hub-section--products .products li.product {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Card shell */
.rb-hub-section--products .product-item-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s ease;
}

.rb-hub-section--products .product-item-wrap:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.13);
}

/* Product image — square, full width */
.rb-hub-section--products .product-item-wrap > a {
    display: block;
    overflow: hidden;
    background: #fff;
}

.rb-hub-section--products .product-item-wrap > a img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 12px;
    box-sizing: border-box;
}

/* Detail area below image */
.rb-hub-section--products .item-detail-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

/* Title — grey background band matching theme */
.rb-hub-section--products .item-detail-wrap h3 {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.4;
    margin: 0;
    padding: 12px 14px;
    color: #222;
    background: #f0f0f0;
}

.rb-hub-section--products .item-detail-wrap h3 a {
    color: inherit;
    text-decoration: none;
}

.rb-hub-section--products .item-detail-wrap h3 a:hover {
    color: #c00;
}

/* Price / SKU / Add-to-cart wrapper */
.rb-hub-section--products .hjs-price-review-add-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 12px 14px 16px;
}

/* Price */
.rb-hub-section--products .hjs-price-review-add-wrap .price {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.rb-hub-section--products .hjs-price-review-add-wrap .price del {
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.rb-hub-section--products .hjs-price-review-add-wrap .price ins {
    text-decoration: none;
}

/* SKU */
.rb-hub-section--products .rb-loop-sku {
    font-size: 14px;
    color: #666;
    display: block;
    margin: 0;
}

/* Add to cart button */
.rb-hub-section--products .hjs-price-review-add-wrap .button,
.rb-hub-section--products .hjs-price-review-add-wrap a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #c00;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 18px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.rb-hub-section--products .hjs-price-review-add-wrap .button:hover,
.rb-hub-section--products .hjs-price-review-add-wrap a.button:hover {
    background: #a00;
    color: #fff !important;
}

/* Sale badge */
.rb-hub-section--products .onsale {
    background: #c00;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

/* Responsive: 2 columns on mobile */
@media (max-width: 600px) {
    .rb-hub-section--products .products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
