/* ============================================================
   UNIFIED IMAGE FIX FOR ALL CARDS - CARNBIKEHUB
   ============================================================ */

/* ── Search Results Images ── */
.result-image-container {
    position: relative;
    overflow: hidden;
    height: 180px;
    background: #f3f4f6;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center;
    transition: transform 0.5s ease;
}

/* ── Car Card Images (Components) ── */
.car-card img,
.car-image {
    width: 100%;
    height: 160px;
    object-fit: contain !important;
    object-position: center;
    background: #f3f4f6;
}

/* ── Vehicle Card Images (Home Page) ── */
.veh-card__img-wrap img {
    width: 100%;
    /* height: 170px; */
    object-fit: contain !important;
    object-position: center;
    background: #f3f4f6;
}

/* ── Budget Card Images ── */
.budget-img,
.budget-card img,
.budget-card-pro img {
    width: 100%;
    height: 160px;
    object-fit: cover !important;
    object-position: center;
    background: #f3f4f6;
}

/* ── Blog Card Images ── */
.blog-thumb,
.blog-card__image img,
.news-card-pro__img img {
    width: 100%;
    height: 175px;
    object-fit: cover !important;
    object-position: center;
    display: block;
    background: #f3f4f6;
}

.trending-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
}

/* ── Brand Logo Images ── */
.brand-logo,
.brand-card img,
.brand-card-pro img {
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain !important;
    object-position: center;
}

/* ── Compare Card Images ── */
.vehicle-img,
.compare-card-pro__imgs .vimg img {
    width: 100%;
    height: 140px;
    object-fit: contain !important;
    object-position: center;
    background: #f3f4f6;
}

/* ── Model Showcase Images ── */
.carousel-item img {
    width: 100%;
    height: 218px;
    object-fit: contain !important;
    object-position: center;
    background: #f3f4f6;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
}

/* ── Dealer Card Images ── */
.dealer-icon {
    width: 100px;
    height: 65px;
    object-fit: contain !important;
    object-position: center;
}

/* ── Filter Page Images ── */
.filter-sidebar img,
.content-area img {
    object-fit: contain !important;
    object-position: center;
}

/* ── Mobile Responsive Adjustments ── */
@media (max-width: 767px) {
    .result-image-container,
    .car-card img,
    .car-image {
        height: 140px;
    }

    .veh-card__img-wrap img {
        height: 140px;
    }

    .budget-img,
    .budget-card img {
        height: 130px;
    }

    .blog-thumb,
    .blog-card__image img {
        height: 180px;
    }

    .vehicle-img,
    .compare-card-pro__imgs .vimg img {
        height: 110px;
    }

    .carousel-item img {
        height: 180px;
    }
}

@media (max-width: 575px) {
    .result-image-container,
    .car-card img,
    .car-image {
        height: 120px;
    }

    .veh-card__img-wrap img {
        height: 120px;
    }

    .budget-img,
    .budget-card img,
    .budget-card-pro img {
        height: 110px;
    }

    .blog-thumb,
    .blog-card__image img,
    .news-card-pro__img img {
        height: 150px;
    }

    .brand-logo,
    .brand-card img,
    .brand-card-pro img {
        height: 40px;
    }

    .vehicle-img,
    .compare-card-pro__imgs .vimg img {
        height: 95px;
    }

    .carousel-item img {
        height: 150px;
    }

    .dealer-icon {
        width: 80px;
        height: 55px;
    }
}

/* ── Ensure No Image Distortion ── */
img {
    max-width: 100%;
    height: auto;
}

/* ── Fallback for Missing Images ── */
img[src=""],
img:not([src]) {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

img[src=""]:after,
img:not([src]):after {
    content: "📷";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.3;
}


/* ============================================================
   COMPARISON CAROUSEL SPECIFIC STYLES
   ============================================================ */

/* ── Compare Carousel Container ── */
.compare-owl.owl-carousel {
    position: relative;
}

.compare-owl .owl-stage-outer {
    padding: 10px 0;
}

.compare-owl .item {
    padding: 0 8px;
}

/* ── Compare Card in Carousel ── */
.compare-owl .compare-card-pro {
    margin: 0;
    height: 100%;
}

/* ── Navigation Arrows for Compare Carousel ── */
.compare-owl .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: block;
    pointer-events: none;
}

.compare-owl .owl-nav button.owl-prev,
.compare-owl .owl-nav button.owl-next {
    position: absolute;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.compare-owl .owl-nav button.owl-prev {
    left: -15px;
}

.compare-owl .owl-nav button.owl-next {
    right: -15px;
}

.compare-owl .owl-nav button:hover {
    background: var(--cb-primary) !important;
    transform: scale(1.1);
}

/* ── Dots for Mobile ── */
.compare-owl .owl-dots {
    display: flex !important;
    justify-content: center;
    margin-top: 20px;
    gap: 8px;
}

.compare-owl .owl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
}

.compare-owl .owl-dot.active {
    background: var(--cb-primary);
    width: 24px;
    border-radius: 5px;
}

/* ── Responsive Adjustments ── */
@media (max-width: 991px) {
    .compare-owl .owl-nav button.owl-prev {
        left: -10px;
    }
    
    .compare-owl .owl-nav button.owl-next {
        right: -10px;
    }
}

@media (max-width: 767px) {
    .compare-owl .owl-nav {
        display: none !important;
    }
    
    .compare-owl .owl-dots {
        display: flex !important;
    }
}

@media (max-width: 575px) {
    .compare-owl .item {
        padding: 0 4px;
    }
    
    .compare-owl .owl-dots {
        margin-top: 15px;
        gap: 6px;
    }
    
    .compare-owl .owl-dot {
        width: 8px;
        height: 8px;
    }
    
    .compare-owl .owl-dot.active {
        width: 20px;
    }
}

/* ── Ensure Compare Cards Display Properly in Carousel ── */
.compare-owl .compare-card-pro__imgs {
    background: linear-gradient(135deg, #f1f5f9, #e8edf3);
}

.compare-owl .compare-card-pro__imgs .vimg img {
    transition: transform 0.3s ease;
}

.compare-owl .item:hover .compare-card-pro__imgs .vimg img {
    transform: scale(1.04);
}

/* ── Smooth Animation ── */
.compare-owl .owl-item {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.compare-owl .owl-item.active {
    opacity: 1;
}

.compare-owl .owl-item.center {
    opacity: 1;
    transform: scale(1.02);
}


/* ============================================================
   NEWS CARD IMAGE FIX - ADDITIONAL STYLES
   ============================================================ */

/* ── Ensure News Card Images Load Properly ── */
.news-card-pro__img {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    min-height: 175px;
}

.news-card-pro__img img {
    width: 100%;
    height: 175px;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

/* ── Loading State for Images ── */
.news-card-pro__img img[src=""],
.news-card-pro__img img:not([src]) {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

.news-card-pro__img img[src=""]:before,
.news-card-pro__img img:not([src]):before {
    content: "📰";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.3;
}

/* ── Category Badge Positioning ── */
.news-card-pro__cat {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: linear-gradient(135deg, var(--cb-primary-600), var(--cb-primary));
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Hover Effect ── */
.news-card-pro:hover .news-card-pro__img img {
    transform: scale(1.05);
}

/* ── Responsive Adjustments ── */
@media (max-width: 767px) {
    .news-card-pro__img,
    .news-card-pro__img img {
        height: 160px;
        min-height: 160px;
    }
}

@media (max-width: 575px) {
    .news-card-pro__img,
    .news-card-pro__img img {
        height: 150px;
        min-height: 150px;
    }
    
    .news-card-pro__cat {
        font-size: 0.58rem;
        padding: 3px 10px;
    }
}

/* ── Fix for Blog Component Images ── */
.trending-news-img {
    flex-shrink: 0;
    width: 100px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background: #f3f4f6;
}

.trending-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

/* ── Blog Card Images ── */
.blog-card__image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f3f4f6;
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}

.blog-card:hover .blog-card__image img {
    transform: scale(1.05);
}

/* ── Ensure All News/Blog Images Have Proper Dimensions ── */
.news-item .news-img,
.news-section .news-img {
    flex-shrink: 0;
    width: 100px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    background: #f3f4f6;
}

.news-item .news-img img,
.news-section .news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
    display: block;
}


/* ============================================================
   NEWS CAROUSEL SPECIFIC STYLES
   ============================================================ */

/* ── News Carousel Container ── */
.news-owl.owl-carousel {
    position: relative;
    padding: 0;
}

.news-owl .owl-stage-outer {
    padding: 10px 0 20px;
    overflow: visible;
}

.news-owl .item {
    padding: 0 8px;
    height: 100%;
}

/* ── News Card in Carousel ── */
.news-owl .news-card-pro {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e8edf3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.news-owl .news-card-pro:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--cb-primary);
}

/* ── News Card Image Container ── */
.news-owl .news-card-pro__img {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    height: 180px;
    flex-shrink: 0;
}

.news-owl .news-card-pro__img img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-owl .news-card-pro:hover .news-card-pro__img img {
    transform: scale(1.08);
}

/* ── Category Badge ── */
.news-owl .news-card-pro__cat {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: linear-gradient(135deg, var(--cb-primary-600), var(--cb-primary));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 5px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(247, 4, 4, 0.3);
    backdrop-filter: blur(4px);
}

/* ── News Card Body ── */
.news-owl .news-card-pro__body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.news-owl .news-card-pro__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    transition: color 0.3s ease;
}

.news-owl .news-card-pro:hover .news-card-pro__title {
    color: var(--cb-primary);
}

.news-owl .news-card-pro__excerpt {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
    flex: 1;
}

.news-owl .news-card-pro__meta {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.news-owl .news-card-pro__meta i {
    color: var(--cb-primary);
    font-size: 0.7rem;
}

/* ── Navigation Arrows for News Carousel ── */
.news-owl .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: block;
    pointer-events: none;
    z-index: 10;
}

.news-owl .owl-nav button.owl-prev,
.news-owl .owl-nav button.owl-next {
    position: absolute;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.85) !important;
    color: #fff !important;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.news-owl .owl-nav button.owl-prev {
    left: -20px;
}

.news-owl .owl-nav button.owl-next {
    right: -20px;
}

.news-owl .owl-nav button:hover {
    background: linear-gradient(135deg, var(--cb-primary-600), var(--cb-primary)) !important;
    border-color: var(--cb-primary);
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(247, 4, 4, 0.4);
}

.news-owl .owl-nav button:active {
    transform: scale(0.95);
}

/* ── Dots for Mobile ── */
.news-owl .owl-dots {
    display: flex !important;
    justify-content: center;
    margin-top: 24px;
    gap: 8px;
}

.news-owl .owl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-owl .owl-dot:hover {
    background: #94a3b8;
}

.news-owl .owl-dot.active {
    background: var(--cb-primary);
    width: 28px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(247, 4, 4, 0.3);
}

/* ── Smooth Animation for Items ── */
.news-owl .owl-item {
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.news-owl .owl-item.active {
    opacity: 1;
}

.news-owl .owl-item.center {
    opacity: 1;
}

/* ── Loading State ── */
.news-owl .news-card-pro__img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.news-owl .news-card-pro__img img[src] ~ ::before {
    display: none;
}

/* ── Responsive Adjustments ── */
@media (max-width: 1199px) {
    .news-owl .news-card-pro__img {
        height: 170px;
    }
    
    .news-owl .owl-nav button.owl-prev {
        left: -15px;
    }
    
    .news-owl .owl-nav button.owl-next {
        right: -15px;
    }
}

@media (max-width: 991px) {
    .news-owl .news-card-pro__img {
        height: 160px;
    }
    
    .news-owl .owl-nav button.owl-prev,
    .news-owl .owl-nav button.owl-next {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .news-owl .owl-nav button.owl-prev {
        left: -10px;
    }
    
    .news-owl .owl-nav button.owl-next {
        right: -10px;
    }
}

@media (max-width: 767px) {
    .news-owl .news-card-pro__img {
        height: 150px;
    }
    
    .news-owl .news-card-pro__body {
        padding: 14px;
    }
    
    .news-owl .news-card-pro__title {
        font-size: 0.9rem;
    }
    
    .news-owl .news-card-pro__excerpt {
        font-size: 0.78rem;
    }
    
    .news-owl .owl-nav {
        display: none !important;
    }
    
    .news-owl .owl-dots {
        display: flex !important;
    }
}

@media (max-width: 575px) {
    .news-owl .item {
        padding: 0 6px;
    }
    
    .news-owl .news-card-pro__img {
        height: 140px;
    }
    
    .news-owl .news-card-pro__body {
        padding: 12px;
    }
    
    .news-owl .news-card-pro__title {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .news-owl .news-card-pro__excerpt {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }
    
    .news-owl .news-card-pro__meta {
        font-size: 0.7rem;
        padding-top: 8px;
    }
    
    .news-owl .news-card-pro__cat {
        font-size: 0.6rem;
        padding: 4px 10px;
        top: 10px;
        left: 10px;
    }
    
    .news-owl .owl-dots {
        margin-top: 18px;
        gap: 6px;
    }
    
    .news-owl .owl-dot {
        width: 8px;
        height: 8px;
    }
    
    .news-owl .owl-dot.active {
        width: 24px;
    }
}

@media (max-width: 480px) {
    .news-owl .news-card-pro__img {
        height: 130px;
    }
    
    .news-owl .news-card-pro__body {
        padding: 10px;
    }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    .news-owl .news-card-pro,
    .news-owl .news-card-pro__img img,
    .news-owl .owl-nav button {
        transition: none;
    }
    
    .news-owl .news-card-pro:hover {
        transform: none;
    }
    
    .news-owl .news-card-pro:hover .news-card-pro__img img {
        transform: none;
    }
}

/* ── Print Styles ── */
@media print {
    .news-owl .owl-nav,
    .news-owl .owl-dots {
        display: none !important;
    }
    
    .news-owl .news-card-pro {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ── High DPI Screens ── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .news-owl .news-card-pro__img img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
