/* Home page layouts — theme-aware sections, tabs, promo */

.home-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: var(--card-light, #f3f4f6);
    color: var(--text-secondary);
}
.home-tab-pill:hover {
    background: var(--background-light, #e5e7eb);
    color: var(--text-main);
}
.home-tab-pill--active {
    background-color: var(--primary-color);
    color: #fff;
}
.home-tab-pill--active:hover {
    background-color: var(--primary-hover, var(--primary-color));
    color: #fff;
}

.home-rank-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    background-color: var(--primary-color);
    color: #fff;
}

.home-link-viewall {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--link-color, var(--primary-color));
    transition: color 0.15s ease;
    white-space: nowrap;
}
.home-link-viewall:hover {
    color: var(--text-main);
}

.home-section-badge {
    color: var(--primary-color);
}

.home-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.home-pill-btn:hover {
    opacity: 0.92;
}

.home-tab-underline--active {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    font-weight: 700;
}

/* Promo banner */
.home-promo {
    background: linear-gradient(
        135deg,
        var(--primary-color) 0%,
        var(--accent-color, var(--primary-hover, var(--primary-color))) 100%
    );
}
.home-promo--boxed {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
}
.home-promo--boxed::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 30% 20%, #fff 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, #fff 0%, transparent 35%);
}
.home-promo-inner {
    position: relative;
}
.home-promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    margin-bottom: 1.5rem;
}
.home-promo-title {
    color: #fff;
    font-weight: 800;
    margin: 0 0 0.75rem;
}
.home-promo-desc {
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 1.5rem;
}
.home-promo-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    background: #fff;
    color: var(--primary-color);
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.home-promo-cta:hover {
    transform: scale(1.03);
    opacity: 0.95;
}
.home-promo-cta--rounded {
    border-radius: 0.75rem;
}

/* Masonry product grid — full-width responsive grid */
.home-masonry-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .home-masonry-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .home-masonry-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .home-masonry-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.home-masonry-item {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.home-masonry-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.home-masonry-card-media {
    width: 100%;
    overflow: hidden;
}

.home-masonry-card-media--square {
    aspect-ratio: 1 / 1;
}

.home-masonry-card-media--tall {
    aspect-ratio: 4 / 5;
}

.home-masonry-card-media--wide {
    aspect-ratio: 5 / 4;
}

.home-masonry-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-masonry-card-body {
    flex: 1 1 auto;
    min-height: 4.25rem;
}

.home-masonry-card > .px-3 {
    margin-top: auto;
}

.home-masonry-featured-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary-color);
    pointer-events: none;
}

/* Product carousel — home page product rows */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.product-carousel {
    position: relative;
    padding: 0 2.75rem;
}
@media (max-width: 639px) {
    .product-carousel {
        padding: 0 2.25rem;
    }
}

.product-carousel__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.125rem 0 0.5rem;
}

.product-carousel__slide {
    flex: 0 0 calc(50% - 0.5rem);
    scroll-snap-align: start;
    min-width: 0;
}

@media (min-width: 640px) {
    .product-carousel__slide {
        flex: 0 0 calc(33.333% - 0.667rem);
    }
}

@media (min-width: 1024px) {
    .product-carousel__slide {
        flex: 0 0 calc(25% - 0.75rem);
    }
}

.product-carousel--compact .product-carousel__track {
    gap: 0.75rem;
}

.product-carousel--compact .product-carousel__slide {
    flex: 0 0 calc(50% - 0.375rem);
}

@media (min-width: 640px) {
    .product-carousel--compact .product-carousel__slide {
        flex: 0 0 calc(33.333% - 0.5rem);
    }
}

@media (min-width: 1024px) {
    .product-carousel--compact .product-carousel__slide {
        flex: 0 0 calc(25% - 0.5625rem);
    }
}

@media (min-width: 1280px) {
    .product-carousel--compact .product-carousel__slide {
        flex: 0 0 calc(20% - 0.6rem);
    }
}

.product-carousel__nav {
    position: absolute;
    top: 38%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: var(--card-light, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    color: var(--text-main, #111);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.product-carousel__nav:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
}
.product-carousel__nav--prev {
    left: 0;
}
.product-carousel__nav--next {
    right: 0;
}

/* ── Automotive home & header ─────────────────────────────────────────────── */

.auto-header-promo {
    background: linear-gradient(90deg, #f5a623 0%, #f39c12 50%, #f5a623 100%);
    color: #1a1d24;
    padding: 0.45rem 0;
    font-weight: 500;
}

.auto-trust-bar {
    background: #fff;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    padding: 1rem 0;
}

.auto-trust-bar__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

@media (min-width: 768px) {
    .auto-trust-bar__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.auto-trust-bar__item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.auto-trust-bar__item .material-symbols-outlined {
    font-size: 1.375rem;
    color: var(--primary-color, #E10600);
    flex-shrink: 0;
}

.auto-trust-bar__item strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-main, #1A1D24);
    line-height: 1.3;
}

.auto-trust-bar__item span {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-secondary, #6B7177);
    line-height: 1.35;
    margin-top: 0.1rem;
}

.auto-section-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color, #E10600);
}

.auto-section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main, #1A1D24);
}

.auto-section-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary, #6B7177);
    max-width: 36rem;
}

.auto-categories__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .auto-categories__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .auto-categories__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.auto-category-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--background-light, #F2F3F5);
    color: #fff;
    text-decoration: none;
    isolation: isolate;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auto-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(26, 29, 36, 0.16);
}

.auto-category-card__media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #FFFFFF 0%, #EEF0F3 100%);
}

.auto-category-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.auto-category-card:hover .auto-category-card__img {
    transform: scale(1.05);
}

/* Categories without a picture still need to look deliberate rather than broken. */
.auto-category-card__icon {
    font-size: 3rem;
    color: var(--primary-color, #E10600);
    opacity: 0.5;
}

/* The scrim is what makes white text readable over product shots, which are mostly light. */
.auto-category-card__body {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 2.5rem 0.9rem 0.85rem;
    background: linear-gradient(
        to top,
        rgba(16, 18, 23, 0.92) 0%,
        rgba(16, 18, 23, 0.65) 45%,
        rgba(16, 18, 23, 0) 100%
    );
}

.auto-category-card__name {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.auto-category-card__meta {
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
}

.auto-category-card__arrow {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.05rem;
    border-radius: 9999px;
    color: #fff;
    background: var(--primary-color, #E10600);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.auto-category-card:hover .auto-category-card__arrow,
.auto-category-card:focus-visible .auto-category-card__arrow {
    opacity: 1;
    transform: translateY(0);
}

.auto-category-card:focus-visible {
    outline: 2px solid var(--primary-color, #E10600);
    outline-offset: 3px;
}

@media (min-width: 640px) {
    .auto-category-card__name { font-size: 1rem; }
    .auto-category-card__body { padding: 2.75rem 1.1rem 1rem; }
}

/* A hover lift and an image zoom are exactly the motion some visitors ask not to see. */
@media (prefers-reduced-motion: reduce) {
    .auto-category-card,
    .auto-category-card__img,
    .auto-category-card__arrow {
        transition: none;
    }

    .auto-category-card:hover { transform: none; }
    .auto-category-card:hover .auto-category-card__img { transform: none; }
}

.auto-promo {
    background: var(--background-light, #F2F3F5);
}

.auto-promo__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 2rem 1.5rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #1A1D24 0%, #2A2F38 55%, #1A1D24 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 40px rgba(26, 29, 36, 0.18);
    overflow: hidden;
    position: relative;
}

@media (min-width: 768px) {
    .auto-promo__inner {
        grid-template-columns: 1.4fr 0.6fr;
        padding: 2.5rem 2rem;
    }
}

.auto-promo__inner::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225, 6, 0, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

.auto-promo__content {
    position: relative;
    z-index: 1;
}

.auto-promo__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: rgba(225, 6, 0, 0.2);
    border: 1px solid rgba(225, 6, 0, 0.4);
    margin-bottom: 1rem;
}

.auto-promo__title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

.auto-promo__desc {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(242, 243, 245, 0.78);
    max-width: 32rem;
}

.auto-promo__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1A1D24;
    background: #fff;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.auto-promo__cta:hover {
    transform: translateY(-1px);
    opacity: 0.95;
    color: #1A1D24;
}

.auto-promo__cta--ghost {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.auto-promo__cta--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.auto-promo__icons {
    position: relative;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) {
    .auto-promo__icons {
        display: flex;
    }
}

.auto-promo__icons .material-symbols-outlined:nth-child(1) { font-size: 4.5rem; }
.auto-promo__icons .material-symbols-outlined:nth-child(2) { font-size: 3rem; margin-left: 2rem; }
.auto-promo__icons .material-symbols-outlined:nth-child(3) { font-size: 3.5rem; margin-right: 1.5rem; }
