/* ================================================= */
/* AutoExpo Modern Car Cards                         */
/* Premium automotive marketplace design             */
/* Bootstrap 4.6 compatible                          */
/* ================================================= */

/* Card Container - Modern premium look */
.car-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Image Wrapper with overflow hidden for zoom */
.car-card-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.car-card-image-wrapper img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.4s ease;
    cursor: pointer;
}

@media (max-width: 767px) {
    .car-card-image-wrapper img {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

.car-card:hover .car-card-image-wrapper img {
    transform: scale(1.04);
}

/* Source Badge - Small badge over the image */
.car-badge-source {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(44, 62, 80, 0.85);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
}

/* Card Body */
.car-card .card-body {
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Title Hierarchy */
.car-title {
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.3;
    color: var(--ae-text-dark, #2c3e50);
}

.car-brand {
    font-weight: 400;
}

.car-model {
    font-weight: 700;
}

/* Price - Compact and clear */
.car-price {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ae-primary, #2c3e50);
    margin-bottom: 8px;
}

.car-price .thousands {
    font-size: 1.1em;
}

.car-price .small-digits {
    font-size: 0.95em;
}

/* Meta Chips Container */
.car-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

/* Individual Chip */
.car-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f7;
    color: var(--ae-text-muted, #6c757d);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.car-chip i,
.car-chip .chip-icon {
    font-size: 0.75rem;
    color: var(--ae-primary, #2c3e50);
}

/* Minimalist CTA link - inline, no background/border, uses primary color via utility */
.btn-cta-minimal {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    margin-top: 6px; /* small separation from meta row */
    font-size: .9rem; /* slightly smaller than price */
    color: inherit; /* use color from utility classes like text-primary */
    text-decoration: none;
}

.btn-cta-minimal:hover,
.btn-cta-minimal:focus,
.btn-cta-minimal:active {
    text-decoration: none; /* no underline */
    color: #0069d9; /* darker primary on hover (Bootstrap 4.6) */
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
}

/* Card Grid Container - Light grey background */
.car-cards-container {
    background-color: #f5f5f7;
    padding: 20px 0;
    border-radius: 16px;
    margin-bottom: 20px;
}

/* Override Bootstrap card styles within car-card */
.car-card.card {
    border: none;
}

/* Results Header */
.car-results-header {
    margin-bottom: 20px;
}

.car-results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ae-text-dark, #2c3e50);
}

/* Reduced gutters for tighter card spacing */
.car-cards-row {
    margin-left: -10px;
    margin-right: -10px;
}

.car-cards-row > .car-card-col {
    padding-left: 10px;
    padding-right: 10px;
}

/* Ensure proper spacing in the grid */
.car-card-col {
    margin-bottom: 18px;
}

/* Focus states for accessibility */
.btn-cta-minimal:focus-visible {
    outline: 2px solid var(--ae-primary, #2c3e50);
    outline-offset: 2px;
}

.car-card-image-wrapper img:focus-visible {
    outline: 2px solid var(--ae-primary, #2c3e50);
    outline-offset: -2px;
}

/* ================================================= */
/* Filter Panel Modern Design                        */
/* ================================================= */

/* Modern filter panel card styling */
.filter-panel-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.filter-panel-card .card-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 16px 16px 0 0;
    padding: 13px 20px;
}

.filter-panel-card .card-header .card-title {
    font-weight: 600;
    color: var(--ae-text-dark, #2c3e50);
    margin: 0;
}

.filter-panel-card .card-body {
    padding: 20px;
}



/* ================================================= */
/* Valuation Result and Error Boxes                  */
/* ================================================= */

.result-box {
    background-color: #d4edda;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
}

.result-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #28a745;
    margin: 10px 0;
}

.error-box {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

/* ================================================= */
/* Valuation Information Card Styling                */
/* ================================================= */

/* Preserve original font sizes for valuation information cards only */
.valuation-info-card .card-body .card-title {
    font-size: 1.25rem;
}

.valuation-info-card .card-body .card-text {
    font-size: 0.875rem;
}


/* ================================================= */
/* Google AdSense Ad Positioning Fix                 */
/* ================================================= */

@media (max-width: 767px) {
    /* a row dos cards deixa de ser flex em mobile */
    .car-cards-row {
        display: block; /* em vez do flex herdado de .row */
    }

    /* cada coluna passa a comportar-se como bloco normal */
    .car-card-col {
        width: 100%;
        max-width: 100%;
    }
}
