/* Home page section UI — complements listing.css for compare/brands/news */

.home-section-wrap {
    padding: 0;
    margin-bottom: 28px;
}

.home-section {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 2px 12px rgba(36, 39, 44, 0.06);
    overflow: hidden;
    margin: 0 auto;
}

.home-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 14px;
    border-bottom: 1px solid #f0f2f5;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.home-section-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 800;
    color: #12263a;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.home-section-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.home-section-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 20px 0;
    margin: 0;
    list-style: none;
    border-bottom: 1px solid #f0f2f5;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.home-section-tabs::-webkit-scrollbar {
    display: none;
}

.home-section-tabs > li {
    flex: 0 0 auto;
    margin: 0;
}

.home-section-tabs > li > a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.home-section-tabs > li > a:hover,
.home-section-tabs > li > a:focus {
    color: #24272c;
    text-decoration: none;
    background: #e8eaed;
}

.home-section-tabs > li.active > a,
.home-section-tabs > li.active > a:hover,
.home-section-tabs > li.active > a:focus {
    background: #d81517;
    color: #fff;
}

/* Price range chips (secondary filter under type tabs) */
.home-price-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 20px 0;
    margin: 0;
    list-style: none;
    border-bottom: 1px solid #f0f2f5;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.home-price-chips::-webkit-scrollbar {
    display: none;
}

.home-price-chips > li {
    flex: 0 0 auto;
    margin: 0;
}

.home-price-chips > li > a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.home-price-chips > li > a:hover,
.home-price-chips > li > a:focus {
    color: #24272c;
    border-color: #d1d5db;
    text-decoration: none;
    background: #f9fafb;
}

.home-price-chips > li.active > a,
.home-price-chips > li.active > a:hover,
.home-price-chips > li.active > a:focus {
    background: #fff5f5;
    color: #d81517;
    border-color: #d81517;
}

.home-section-body {
    padding: 16px 0 6px;
}

.home-section-footer {
    padding: 4px 20px 18px;
    text-align: center;
}

.home-section-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #d81517;
    text-decoration: none;
}

.home-section-view-all:hover {
    color: #b01012;
    text-decoration: none;
}

/* Product cards (Popular / Latest) */
.tb-home-product-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 20px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tb-home-product-track::-webkit-scrollbar {
    display: none;
}

.tb-home-product-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(36, 39, 44, 0.05);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tb-home-product-card:hover {
    border-color: #e5e7eb;
    box-shadow: 0 6px 18px rgba(36, 39, 44, 0.1);
    transform: translateY(-2px);
}

.tb-home-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tb-home-product-link:hover {
    text-decoration: none;
    color: inherit;
}

.tb-home-product-img {
    aspect-ratio: 16 / 10;
    background: #f8f9fb;
    overflow: hidden;
}

.tb-home-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tb-home-product-name {
    margin: 0;
    padding: 12px 14px 4px;
    font-size: 14px;
    font-weight: 700;
    color: #24272c;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.tb-home-product-cta {
    padding: 8px 12px 12px;
    margin-top: auto;
    text-align: center;
}

/* Outline CTA — product image/name lead; button is secondary action */
.home-section .tb-home-product-btn,
.home-section .tb-home-product-cta .card-link,
.home-section .tb-home-product-cta a,
.tb-home-product-btn,
.tb-home-product-cta .card-link,
.tb-home-product-cta a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #c92127 !important;
    border: 1.5px solid #c92127 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    text-align: center;
    text-transform: none !important;
    box-shadow: none !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.home-section .tb-home-product-btn:hover,
.home-section .tb-home-product-cta a:hover,
.tb-home-product-btn:hover,
.tb-home-product-cta a:hover,
.home-section .tb-home-product-btn:focus,
.tb-home-product-cta a:focus {
    background: #c92127 !important;
    border-color: #c92127 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(201, 33, 39, 0.22) !important;
    text-decoration: none !important;
}

.home-section .tb-home-product-btn:active,
.tb-home-product-cta a:active {
    transform: scale(0.98);
}

/* Category cards */
.tb-home-category-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 20px 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tb-home-category-track::-webkit-scrollbar {
    display: none;
}

.tb-home-category-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(36, 39, 44, 0.05);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tb-home-category-card:hover {
    border-color: #d81517;
    box-shadow: 0 4px 14px rgba(216, 21, 23, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.tb-home-category-img {
    aspect-ratio: 16 / 10;
    background: #f0f2f5;
    overflow: hidden;
}

.tb-home-category-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tb-home-category-body {
    padding: 14px 14px 16px;
    background: #fafbfc;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tb-home-category-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #24272c;
    line-height: 1.35;
}

.tb-home-category-cta {
    font-size: 13px;
    font-weight: 600;
    color: #d81517;
    margin-top: auto;
}

/* Used vehicle cards */
.tb-home-used-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 20px 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tb-home-used-track::-webkit-scrollbar {
    display: none;
}

.tb-home-used-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(36, 39, 44, 0.05);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tb-home-used-card:hover {
    border-color: #d81517;
    box-shadow: 0 4px 14px rgba(216, 21, 23, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.tb-home-used-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f2f5;
}

.tb-home-used-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tb-home-used-body {
    padding: 14px 14px 16px;
}

.tb-home-used-name {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #24272c;
}

.tb-home-used-cta {
    font-size: 13px;
    font-weight: 600;
    color: #d81517;
}

/* Compare on home — tabs inside section */
.home-compare-section .listing-compare-header {
    border-bottom: none;
    padding-bottom: 0;
}

.home-compare-section .home-section-tabs {
    border-bottom: none;
    padding-top: 0;
}

.home-compare-section .listing-compare-body {
    padding-top: 8px;
}

.home-compare-section .listing-compare-footer {
    display: none;
}

.home-promo-banner {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 2px 12px rgba(36, 39, 44, 0.06);
    overflow: hidden;
}

.home-promo-banner .card-body {
    padding: 16px;
}

.tb-home-promo {
    text-align: center;
}

.tb-home-promo img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

/* Home hero carousel */
.tb-home-page .tb-home-hero {
    margin: 0;
    overflow: hidden;
    background: #f0f2f5;
}

.tb-home-h1 {
    margin: 18px 0 8px;
    padding: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: #12263a;
}

@media (max-width: 767px) {
    .tb-home-h1 {
        margin: 14px 0 6px;
        font-size: 1.15rem;
    }
}

.tb-home-page .tb-home-carousel {
    margin: 0;
}

.tb-home-page .tb-home-carousel .carousel-inner > .item {
    max-height: none;
}

.tb-home-page .tb-home-carousel .carousel-inner > .item > a {
    display: block;
    line-height: 0;
}

.tb-home-page .tb-home-carousel .carousel-inner img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 395px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.tb-home-page .tb-home-carousel .carousel-control {
    width: 44px;
    background-image: none;
    opacity: 0.85;
}

.tb-home-page .tb-home-carousel .carousel-control .glyphicon {
    width: 36px;
    height: 36px;
    margin-top: -18px;
    font-size: 18px;
    line-height: 36px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    text-shadow: none;
}

.tb-home-page .home-section-wrap {
    margin-bottom: 28px;
}

.home-section {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(36, 39, 44, 0.04);
    overflow: hidden;
}

.tb-home-page .home-section > .container,
.tb-home-page .listing-brands-section > .container,
.tb-home-page .listing-news-section > .container,
.tb-home-page .listing-compare-section > .container {
    width: 100%;
    max-width: 1170px;
}

/* Compare header on home */
.home-compare-section .listing-compare-header {
    flex-wrap: wrap;
}

@media (max-width: 991px) {
    .tb-home-page .home-section-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tb-home-page .home-section,
    .tb-home-page .listing-brands-section,
    .tb-home-page .listing-news-section,
    .tb-home-page .home-promo-banner,
    .tb-home-page .listing-compare-section {
        border-radius: 12px;
    }
}

@media (max-width: 767px) {
    .tb-home-page {
        overflow-x: hidden;
    }

    .tb-home-page .tb-home-carousel .carousel-inner img {
        max-height: 220px;
        object-fit: cover;
    }

    .tb-home-page .tb-home-carousel .carousel-control {
        width: 36px;
    }

    .tb-home-page .tb-home-carousel .carousel-control .glyphicon {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        font-size: 14px;
        line-height: 32px;
    }

    .tb-home-page .home-section-wrap {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 14px !important;
    }

    .tb-home-page .home-section > .container,
    .tb-home-page .listing-brands-section > .container,
    .tb-home-page .listing-news-section > .container,
    .tb-home-page .listing-compare-section > .container {
        padding-left: 0;
        padding-right: 0;
    }

    .home-section-header {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 14px 10px;
        gap: 8px;
    }

    .home-section-title {
        font-size: 1.35rem;
    }

    .home-section-sub {
        font-size: 13px;
    }

    .home-section-tabs {
        padding: 8px 14px 0;
        gap: 6px;
    }

    .home-section-tabs > li > a {
        padding: 7px 12px;
        font-size: 12px;
    }

    .home-section-body {
        padding: 12px 0 4px;
    }

    .tb-home-product-track,
    .tb-home-category-track,
    .tb-home-used-track {
        padding: 4px 14px 12px;
        gap: 10px;
        scroll-padding-left: 14px;
    }

    /* Peek next card so swipe is obvious */
    .tb-home-product-card {
        flex: 0 0 72vw;
        max-width: 240px;
    }

    .tb-home-category-card {
        flex: 0 0 70vw;
        max-width: 250px;
    }

    .tb-home-used-card {
        flex: 0 0 78vw;
        max-width: 280px;
    }

    .tb-home-product-name {
        font-size: 13px;
        min-height: 44px;
        padding: 10px 10px 0;
    }

    .tb-home-product-cta {
        padding: 8px 10px 12px;
    }

    .tb-home-product-btn,
    .tb-home-product-cta .card-link,
    .tb-home-product-cta a {
        padding: 11px 10px;
        font-size: 13px;
        min-height: 42px;
    }

    .tb-home-used-name {
        font-size: 15px;
    }

    .home-section-footer {
        padding: 2px 14px 14px;
    }

    .home-promo-banner .card-body {
        padding: 10px;
    }

    .tb-home-promo__mobile img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .home-compare-section .listing-compare-header {
        padding: 14px 14px 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .home-compare-section .listing-compare-view-all--header {
        display: none;
    }

    .home-compare-section .home-section-tabs {
        padding: 0 14px 0;
    }

    .home-compare-section .listing-compare-footer {
        display: block;
        text-align: center;
        padding: 4px 14px 16px;
    }

    .tb-home-page .rm-footer-wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    .tb-home-page button.scroltop {
        bottom: 20px !important;
        right: 16px !important;
        width: 40px;
        height: 40px;
    }
}

/* Home media + Web Stories — match Popular/Latest rhythm */
.home-media-section .home-section-header,
.home-stories-section .home-section-header {
    display: block;
}

.home-media-section .home-section-footer,
.home-stories-section .home-section-footer {
    display: block;
    text-align: center;
}

.tb-stories-wrap {
    position: relative;
}

.tb-stories-swipe-hint {
    display: none;
    margin: 0 0 8px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.tb-stories-swipe-hint span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tb-stories-swipe-hint span::after {
    content: "";
    width: 18px;
    height: 10px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(-45deg);
    opacity: 0.85;
    animation: tbStoriesSwipe 1.4s ease-in-out infinite;
}

@keyframes tbStoriesSwipe {
    0%, 100% { transform: rotate(-45deg) translateX(0); opacity: 0.45; }
    50% { transform: rotate(-45deg) translateX(4px); opacity: 1; }
}

.tb-stories-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 12px;
}

.tb-stories-track::-webkit-scrollbar {
    height: 6px;
}

.tb-story-card {
    flex: 0 0 148px;
    width: 148px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.tb-story-card-img {
    position: relative;
    width: 100%;
    height: 230px;
    border-radius: 14px;
    overflow: hidden;
    background: #eef1f4;
    line-height: 0;
}

.tb-story-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

.tb-story-card-title {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    color: #1f2933;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.9em;
}

.tb-story-card:hover .tb-story-card-title {
    color: #c8102e;
}

@media (max-width: 767px) {
    .tb-stories-swipe-hint {
        display: block;
    }

    .tb-story-card {
        flex-basis: 132px;
        width: 132px;
    }

    .tb-story-card-img {
        height: 205px;
    }

    .home-media-section .home-section-header,
    .home-stories-section .home-section-header {
        padding: 14px 14px 8px;
    }
}

