@import url("variables.css");

/* =========================================================
   KHODROSUP HOME SLIDERS (FINAL STABLE VERSION)
========================================================= */

.vehicle-slider-section,
.home-products-section,
.home-banner-section {
    width: 100%;
    box-sizing: border-box;
}

.vehicle-slider-section,
.home-products-section {
    background: #ffffff !important;
    color: #111111;
    position: relative !important;
}

/* 1. SECTION HEADING */
.section-heading {
    width: min(1400px, 94%);
    margin: 0 auto 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    direction: rtl;
    position: relative;
}

.section-kicker {
    display: block;
    margin-bottom: 4px;
    color: #e50914;
    font-size: 13px;
    font-weight: 800;
}

.section-heading h2 {
    margin: 0;
    color: #111111;
    font-size: 24px;
    font-weight: 900;
    white-space: nowrap;
}

.section-heading::after {
    content: "";
    display: block;
    flex: 1;
    height: 2px;
    margin-right: 25px;
    background: linear-gradient(to left, #e50914 0%, #222222 40%, #e5e7eb 100%);
    border-radius: 10px;
}

/* =========================================================
   2. VEHICLE SLIDER
========================================================= */
.vehicle-slider-section {
    padding: 35px 0 25px;
    position: relative;
}

.vehicle-slider {
    width: min(1400px, 94%);
    margin: 0 auto;
    position: relative !important;
    padding: 12px 5px 22px;
    box-sizing: border-box;
    direction: rtl;
    display: flex !important;
    gap: 18px !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.vehicle-slider::-webkit-scrollbar {
    display: none;
}

.vehicle-track {
    display: flex !important;
    gap: 18px !important;
    width: auto !important;
}

.vehicle-card {
    flex: 0 0 180px !important;
    width: 180px !important;
    scroll-snap-align: start;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    overflow: hidden;
    color: #111111 !important;
    text-decoration: none !important;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.vehicle-card:hover {
    transform: translateY(-5px) !important;
    border-color: #e50914 !important;
    box-shadow: 0 10px 24px rgba(229, 9, 20, 0.15) !important;
}

.vehicle-image {
    width: 100%;
    height: 125px;
    background: #f8f9fa;
    overflow: hidden;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.vehicle-card:hover .vehicle-image img {
    transform: scale(1.06);
}

.vehicle-name {
    min-height: 50px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #111111;
    font-size: 14px;
    font-weight: 800;
}

/* =========================================================
   3. HOME PRODUCTS SLIDER
========================================================= */
.home-products-section {
    padding: 40px 0 45px !important;
    position: relative;
}

.home-products-slider {
    position: relative !important;
    width: min(1420px, 96%);
    margin: 0 auto;
    padding: 15px 5px 30px !important;
    box-sizing: border-box;
    direction: rtl;
    display: flex !important;
    gap: 18px !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.home-products-slider::-webkit-scrollbar {
    display: none;
}

.home-products-track {
    display: flex !important;
    gap: 18px !important;
    width: auto !important;
}

.home-products-track .product-card {
    flex: 0 0 230px !important;
    width: 230px !important;
    min-height: 385px;
    scroll-snap-align: start;
    position: relative;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.home-products-track .product-card:hover {
    border-color: #e50914 !important;
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.15) !important;
    transform: translateY(-4px) !important;
}

.home-products-track .product-card-link {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    height: 100% !important;
    color: #111111 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.product-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    background: #e50914;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.home-products-track .product-card-image {
    width: 100%;
    height: 175px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-products-track .product-card-image img {
    display: block;
    max-width: 88%;
    max-height: 88%;
    object-fit: contain !important;
    transition: transform 0.35s ease;
}

.home-products-track .product-card:hover .product-card-image img {
    transform: scale(1.06);
}

.home-products-track .product-card-body {
    padding: 15px 12px 14px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    flex-grow: 1;
    background: #ffffff;
}

.home-products-track .product-card-title {
    color: #1f2937 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.5;
    margin: 0 0 6px 0 !important;
    min-height: 42px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-desc {
    color: #6b7280 !important;
    font-size: 11px !important;
    margin: 0 0 8px 0 !important;
}

/* =========================================================
   4. PRICE DISPLAY (STRUCTURAL OVERRIDE FIX)
========================================================= */
.product-card-price-wrap {
    margin-bottom: 12px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-height: 46px !important;
}

/* --- حالت اول: وقتی فقط یک قیمت وجود دارد (بدون تخفیف) --- */
.product-card-price-wrap > *:only-child {
    order: 1 !important;
    color: #159447 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
}

/* --- حالت دوم: وقتی دو قیمت وجود دارد (محصول تخفیف‌دار) --- */
/* عنصر اول در کدهای شما (قیمت 1,440,000): انتقال به پایین، رنگ سبز، فونت درشت */
.product-card-price-wrap > *:nth-child(1):not(:last-child) {
    order: 2 !important;
    color: #159447 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
}

/* عنصر دوم در کدهای شما (قیمت 1,600,000): انتقال به بالا، رنگ خاکستری، خط‌خورده */
.product-card-price-wrap > *:nth-child(2) {
    order: 1 !important;
    color: #9ca3af !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: line-through !important;
    text-decoration-color: #222222 !important;
    text-decoration-thickness: 1.5px !important;
    line-height: 1.3 !important;
}

.price-currency,
.product-card-price-wrap .price-currency {
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-right: 3px !important;
    color: inherit !important;
}

/* =========================================================
   5. BUTTON & ARROWS STYLING
========================================================= */
.product-card-btn {
    width: 90% !important;
    min-height: 36px;
    padding: 6px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    background: #e50914 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.25);
    transition: background 0.2s ease, transform 0.2s ease !important;
}

.product-card-btn:hover {
    background: #111111 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.vehicle-prev, .vehicle-next,
.product-prev, .product-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    transition: all 0.2s ease;
}

.vehicle-prev:hover, .vehicle-next:hover,
.product-prev:hover, .product-next:hover {
    background: #e50914;
    color: #fff;
    border-color: #e50914;
}

.vehicle-prev, .product-prev { right: 10px; }
.vehicle-next, .product-next { left: 10px; }

/* =========================================================
   7. RESPONSIVE MEDIA QUERIES
========================================================= */
@media (max-width: 768px) {
    /* باز کردن قفل اسکرول افقی و لمس در موبایل */
    .vehicle-slider,
    .home-products-slider {
        touch-action: pan-x pan-y !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .vehicle-prev, .vehicle-next,
    .product-prev, .product-next {
        display: none !important;
    }

    .home-products-track .product-card {
        flex: 0 0 165px !important;
        width: 165px !important;
        min-width: 165px !important;
        min-height: 330px;
    }

    .home-products-track .product-card-image {
        height: 130px !important;
    }

    .home-products-track .product-card-title {
        font-size: 13px !important;
    }

    .product-card-price-wrap > *:only-child {
        font-size: 14px !important;
    }
    .product-card-price-wrap > *:nth-child(1):not(:last-child) {
        font-size: 14px !important;
    }
    .product-card-price-wrap > *:nth-child(2) {
        font-size: 10px !important;
    }
}