/* Home page section UI — complements listing.css for compare/brands/news */

.home-section-wrap {
    padding: 0;
}

.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: 18px 20px 12px;
    border-bottom: 1px solid #f0f2f5;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.home-section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #24272c;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.home-section-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6b7280;
    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;
}

.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: #d81517;
    box-shadow: 0 4px 14px rgba(216, 21, 23, 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 12px 0;
    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: 50px;
}

.tb-home-product-cta {
    padding: 10px 12px 14px;
    text-align: center;
}

.tb-home-product-btn,
.tb-home-product-cta .card-link,
.tb-home-product-cta a {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: #d81517;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    border: none;
    transition: background 0.15s;
}

.tb-home-product-btn:hover,
.tb-home-product-cta a:hover {
    background: #b01012;
    color: #fff !important;
}

/* 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-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: 20px;
}

.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: 17px;
    }

    .home-section-sub {
        font-size: 12px;
    }

    .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:first-child {
    flex: 0 0 176px;
    width: 176px;
}

.tb-story-card:first-child .tb-story-card-title {
    font-size: 14px;
}

.tb-story-card-img {
    border-radius: 14px;
    overflow: hidden;
    background: #e8ecf0;
    aspect-ratio: 9 / 14;
    line-height: 0;
}

.tb-story-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    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:first-child {
        flex-basis: 158px;
        width: 158px;
    }

    .home-media-section .home-section-header,
    .home-stories-section .home-section-header {
        padding: 14px 14px 8px;
    }
}

