﻿/* ==========================================
   5. HERO SECTION
   ========================================== */
.hero {
    min-height: 600px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slider, .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity .8s;
}

    .slide.active {
        opacity: 1;
    }

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 0; /* Removed fixed top padding so Flexbox handles centering */
    padding-bottom: 0;
    width: 100%;
}

.finder-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}

    .finder-card h4 {
        margin-bottom: 25px;
        font-weight: 700;
    }

    .finder-card select, .finder-card input {
        margin-bottom: 15px;
        height: 52px;
    }

        /* Red border on unselected required dropdowns */
        .finder-card select.is-invalid {
            border: 2px solid #e63946 !important;
            animation: shake 0.3s ease-in-out;
        }

/* Error message banner above the search button */
.finder-error-msg {
    display: none;
    color: #d90429;
    background-color: #fdf0f0;
    border: 1px solid #f8d7da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
    margin-bottom: 12px;
    text-align: center;
}

/* Subtle shake animation for invalid inputs */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20%, 60% {
        transform: translateX(-5px);
    }

    40%, 80% {
        transform: translateX(5px);
    }
}

.divider {
    text-align: center;
    font-weight: 700;
    margin: 20px 0;
    color: #666;
}

.btn-search {
    width: 100%;
    height: 52px;
    background: var(--yellow);
    color: #222;
}

    .btn-search:hover {
        background: #ffca00;
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(255,213,0,.4);
    }

.hero-text {
    color: white;
    padding-left: 50px;
}

    .hero-text h1 {
        font-size: 3rem;
        font-weight: 900;
        line-height: 1;
        color: var(--yellow);
    }

    .hero-text span {
        display: block;
        color: #fff;
    }

    .hero-text p {
        max-width: 600px;
        font-size: 1.3rem;
        margin-top: 25px;
    }

.shop-btn {
    text-decoration: none;
    padding: 15px 40px;
    margin-top: 30px;
}

.custom-select {
    max-height: 300px !important;
}

/* --- Add these hero-text-slider styles near the hero section rules --- */

/* container for multiple hero text blocks; they stack/fade in place */
.hero-text-slider {
    position: relative;
    min-height: 220px; /* adjust to fit the largest block */
}

    /* each hero text is absolutely positioned and centered vertically */
    .hero-text-slider .hero-text {
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        transform: translateY(-50%);
        opacity: 0;
        transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
        text-align: left;
        padding-left: 50px; /* align with existing hero-text padding */
        z-index: 3;
    }

        /* visible state */
        .hero-text-slider .hero-text.active {
            opacity: 1;
            transform: translateY(-50%);
        }

/* responsive: reduce min-height on smaller screens and center text */
@media (max-width: 992px) {
    .hero-text-slider {
        min-height: 180px;
    }

        .hero-text-slider .hero-text {
            text-align: center;
            padding-left: 0;
            left: 0;
            right: 0;
        }
}

/* ==========================================
   6. SHOP BY CATEGORY & BRANDS
   ========================================== */
.shop-category {
    margin: 15px 0 35px;
}

.shop-header, .section-header, .section-title {
    margin-bottom: 35px;
}

    .shop-category h2, .section-header h2, .section-title h2 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 10px;
    }

        .shop-category h2::after, .section-header::after, .section-title::after {
            content: '';
            display: block;
            height: 3px;
            background: #f5b400;
            margin-top: 12px;
        }

/*        .shop-category h2::after {
            width: 260px;
        }

    .section-header::after {
        width: 230px;
    }

    .section-title::after {
        width: 270px;
    }*/

.category-card, .brand-card {
    background: #fff;
    border: 1px solid #eee;
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card {
    padding: 20px;
    cursor: pointer;
    height: 220px; /* Fixed height for all cards */
    display: flex;
    flex-direction: column;
}

    .category-card:hover, .brand-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 25px rgba(0,0,0,.08);
    }

    .category-card a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: inherit;
        width: 100%;
        height: 100%;
        justify-content: flex-start;
    }

    .category-card img {
        width: 100%;
        height: 120px; /* Slightly reduced to make room for title */
        object-fit: contain;
        margin-bottom: 10px;
        display: inline-block;
        flex-shrink: 0;
    }

    .category-card h6,
    .category-card a h6 {
        margin: 0;
        font-weight: 600;
        font-size: 16px;
        text-align: center;
        color: #333333;
        text-decoration: none;
        width: 100%;
        padding: 0 4px;
        box-sizing: border-box;

        /* Reserve space for up to 2 lines, with extra buffer to avoid clipping */
        line-height: 1.4;
        min-height: 46px; /* buffer added so ascenders/descenders aren't cut */

        /* Allow wrapping to a second line instead of cutting text */
        white-space: normal;
        word-wrap: break-word;
        overflow: visible; /* don't clip text */

        /* Vertically center the text within the reserved 2-line box */
        display: flex;
        align-items: center;
        justify-content: center;
    }

.category-carousel {
    position: relative; /* Anchor point for the absolutely positioned nav arrows */
}

    .category-carousel .owl-nav {
        position: absolute;
        top: -75px;
        right: 0;
    }

        .category-carousel .owl-nav button {
            width: 36px;
            height: 36px;
            border-radius: 50% !important;
            background: #fff !important;
            border: 1px solid #ddd !important;
            margin-left: 8px;
        }

            .category-carousel .owl-nav button:hover {
                background: var(--primary) !important;
                color: white !important;
            }

/* Responsive: on smaller screens, move nav arrows below the header
   instead of overlapping the heading/underline */
@media (max-width: 767px) {
    .shop-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .category-carousel .owl-nav {
        position: static; /* remove from absolute positioning flow */
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
        margin-bottom: 10px;
    }
}

.popular-brands {
    background-color: #e0f1fb;
    padding: 30px 0;
}

.brand-card {
    height: 170px;
    text-decoration: none;
    color: #111;
}

    .brand-card img {
        width: 90px;
        height: 60px;
        object-fit: contain;
        margin-bottom: 12px;
    }

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

/* ==========================================
   7. SERVICE FEATURES
   ========================================== */
.service-features {
    background: #eeeeee;
    padding: 35px 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-right: 1px solid #ddd;
    transition: all .3s ease;
}

    .feature-item:hover {
        transform: translateY(-3px);
        background: white;
        box-shadow: 0 5px 15px rgba(0,0,0,.08);
    }

.feature-content h6 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.feature-content p {
    font-size: 14px;
    margin: 0;
}

.feature-icon {
    color: var(--secondary);
    font-size: 30px;
    transition: all .3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
}

/* ==========================================
   FEATURED PRODUCTS
   ========================================== */
.featured-products {
    padding: 50px 0;
    background: #f5f5f5;
}

.fitment-row {
    font-size: .92rem;
    color: var(--primary);
    padding: 4px 0;
}

.fitment-row {
    font-weight: 700;
    color: var(--primary);
    margin-right: 6px;
}

.product-card {
    position: relative;
    border: 1px solid #ececec;
    background: #fff;
    padding: 15px;
    height: 100%;
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 30px rgba(0,0,0,.08);
    }

.product-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

    .product-image img {
        max-width: 100%;
        max-height: 180px;
        object-fit: contain;
    }

.product-brand {
    color: var(--secondary);
    font-weight: 900;
    font-size: .9rem;
    margin-bottom: 8px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    min-height: 38px;
    line-height: 1.2;
}
.product-sku {
    color: var(--primary);
    font-size: .8rem;
    margin-top: 4px;
    margin-bottom: 4px;
}
.product-location {
    color: var(--primary);
    font-size: .8rem;
    margin-top: 4px;
    margin-bottom: 4px;
}

/* Featured product titles are rendered as links to the product detail page.
   Keep them looking like plain text (no underline, inherit color) so they
   visually match the non-linked product cards in the listing page. */
.featured-products .product-title a {
    color: inherit;
    text-decoration: none;
}

/*    .featured-products .product-title a:hover {
        color: var(--primary, #e53935);
        text-decoration: none;
    }*/

.product-rating {
    color: #f5b400;
    margin: 10px 0;
}

.product-price {
    margin-bottom: 18px;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 700;
}

.old-price {
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.add-cart-btn {
    width: 100%;
    height: 48px;
    margin-top: auto;
}

.badge-sale, .badge-new {
    position: absolute;
    top: 12px;
    font-size: .8rem;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
}

.badge-sale {
    left: 12px;
    background: #ef2b10;
}
