/* ============================================================
   Elway Inventory Card — inventory-card-elway.css
   Shared card component used by SRP grid + Featured Carousel.
   Mobile-first, ew-card prefix.
   ============================================================ */

/* --- Card wrapper (integration anchor: .octane-asset + data attrs live here) --- */
.ew-card-wrap {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--accent) 35%, transparent);
    transition: box-shadow 0.3s ease;
}

.ew-card-wrap:hover {
    box-shadow: 0 8px 30px -4px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* --- Card link (fills wrapper, all visual content inside) --- */
.ew-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    flex: 1;
}

/* Third-party mount point — Octane injects CTA buttons here */
.ol-target-element {
    padding: 8px 12px;
}

.ol-target-element:empty {
    display: none;
}

/* --- Card icon action bar (Ask a Question, Trade) --- */
.ew-card-actions {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e9eaeb;
    padding: 10px 8px;
}

.ew-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #000;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
}

.ew-card-action:hover { color: var(--accent, #de1c21); }
.ew-card-action svg { stroke: currentColor; }

/* --- Card body (hoverable link to VDP) --- */
.ew-card-body {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    flex: 1;
}

/* --- Image area --- */
.ew-card-image-wrap {
    position: relative;
    background: #fff;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ew-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

/* --- Hover overlay --- */
.ew-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.ew-card-body:hover .ew-card-overlay,
a.ew-card:hover .ew-card-overlay {
    opacity: 1;
}

.ew-card-overlay-btn {
    padding: 14px 36px;
    border: 2px solid #fff;
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* --- Condition badge --- */
.ew-card-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    padding: 3px 9px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    z-index: 1;
    background: #181d27;
    color: #fff;
}

.ew-card-badge-used {
    background: #535862;
}

/* --- Image dots --- */
.ew-card-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: center;
}

.ew-dot {
    width: 6px;
    height: 6px;
    border-radius: 100px;
    background: #ddd;
}

.ew-dot.active {
    background: #de1c21;
}

/* --- Vehicle type badge --- */
.ew-card-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    padding: 3px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    color: #535862;
    text-transform: capitalize;
}

/* --- Card info --- */
.ew-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 12px 8px;
    flex: 1;
}

/* --- Meta icons --- */
.ew-card-meta-icon {
    width: 14px;
    height: 14px;
    color: #006883;
    vertical-align: -2px;
    flex-shrink: 0;
}

.ew-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: #000;
    margin: 0;
}

.ew-card-desc {
    font-size: 12px;
    color: #535862;
    margin: 4px 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ew-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: #535862;
    margin: 0;
}

.ew-dot-sep {
    font-size: 11px;
    margin: 0 2px;
}

.ew-card-price {
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    color: #000;
    margin: 0;
}

.ew-card-price-strike {
    text-decoration: line-through;
    color: #535862;
    font-weight: 400;
    margin-right: 4px;
}

.ew-card-price-sale {
    color: #de1c21;
}

.ew-card-savings {
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    color: #47916f;
    margin: 0;
}

/* --- Monthly estimate (used by Featured Carousel) --- */
.ew-card-monthly {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
}

.ew-monthly-amount {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: #47916f;
}

.ew-monthly-period {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: #414651;
    margin-right: 4px;
}

.ew-info-icon {
    width: 12px;
    height: 12px;
    color: #535862;
    margin-right: 2px;
    flex-shrink: 0;
}

.ew-monthly-note {
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
    color: #535862;
}

/* --- CTA bar (bottom of card, links to VDP) --- */
.ew-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    background: #006883;
    border-radius: 0;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

.ew-card-cta:hover {
    background: #005770;
}

.ew-cta-price {
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.ew-cta-amount {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: #fff;
}

.ew-cta-period {
    font-size: 11px;
    font-weight: 400;
    line-height: 18px;
    color: rgba(255, 255, 255, 0.85);
}

.ew-cta-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: #fff;
}

.ew-cta-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ew-cta-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #fff;
}

/* --- No-image fallback --- */
.ew-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.25);
    font-size: 0.85rem;
}

/* ============================================================
   Desktop (1025px+)
   ============================================================ */
@media (min-width: 1025px) {
    .ew-card-info {
        padding: 16px 16px 8px;
    }

    .ew-card-title {
        font-size: 14px;
        line-height: 20px;
    }

    .ew-card-meta {
        font-size: 14px;
        line-height: 20px;
    }

    .ew-dot-sep {
        font-size: 12px;
    }

    .ew-card-price {
        font-size: 16px;
        font-weight: 600;
        line-height: 24px;
    }

    .ew-card-savings {
        font-size: 14px;
        line-height: 20px;
    }

    .ew-monthly-amount {
        font-size: 20px;
        line-height: 30px;
    }

    .ew-info-icon {
        width: 16px;
        height: 16px;
    }

    .ew-monthly-note {
        font-size: 14px;
        font-weight: 600;
        line-height: 20px;
    }

    .ew-card-cta {
        height: 54px;
        margin: 0;
        padding: 0 16px;
    }

    .ew-cta-amount {
        font-size: 20px;
        line-height: 30px;
    }

    .ew-cta-label {
        font-size: 12px;
    }

    .ew-cta-icon {
        width: 16px;
        height: 16px;
    }

    .ew-cta-arrow {
        width: 20px;
        height: 20px;
    }
}
