/* ==========================================================================
   RTP Auto – <x-vehicle-card> (resources/views/components/vehicle-card.blade.php)
   Shared by the homepage and the listing search page. Depends on site.css tokens.
   ========================================================================== */

.vcard {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: .5rem;
    border: 1px solid var(--c-line);
    border-radius: 22px;
    background: var(--c-surface);
    transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.vcard:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.vcard:focus-within { box-shadow: 0 0 0 3px var(--c-brand); }
.vcard--featured { background: linear-gradient(var(--c-surface), var(--c-surface)) padding-box, linear-gradient(135deg, rgb(217 54 62 / 55%), rgb(43 182 232 / 55%)) border-box; border-color: transparent; }

.vcard__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    background: linear-gradient(160deg, #eef2f7, #e0e7f0);
    overflow: hidden;
}
.vcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.vcard:hover .vcard__media img { transform: scale(1.06); }

.vcard__nophoto {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: #a3b1c2;
    font-size: .8rem;
    font-weight: 600;
}
.vcard__nophoto .body-icon { width: 46%; height: auto; }

.vcard__flag {
    position: absolute;
    top: .7rem;
    left: .7rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--c-coral);
    color: #fff;
    font-family: var(--f-display);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    box-shadow: 0 6px 14px -6px rgb(217 54 62 / 80%);
}
.vcard__flag::before { content: "★"; font-size: .75rem; letter-spacing: 0; }

.vcard__body { display: flex; flex-direction: column; flex: 1; padding: .9rem .6rem .6rem; }

.vcard__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0 0 .35rem;
    color: var(--c-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.vcard__meta span + span::before { content: "·"; margin-right: .4rem; }

.vcard__title { margin: 0; font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.vcard__title a { color: var(--c-text); text-decoration: none; }
.vcard__title a:focus { outline: none; }
/* Whole card is clickable, but only one link is announced to screen readers */
.vcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.vcard__trim { margin: .15rem 0 0; color: var(--c-muted); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.vcard__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: auto;
    padding-top: .9rem;
}
.vcard__price {
    margin: 0;
    font-family: var(--f-display);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--c-text) !important;
}
.vcard__go {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-bg);
    color: var(--c-text);
    transition: background-color .3s, color .3s, transform .4s var(--ease);
}
.vcard__go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.vcard:hover .vcard__go { background: var(--c-coral); color: #fff; transform: rotate(45deg); }

.vcard__facts {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin: .7rem 0 0;
    padding: .7rem 0 0;
    border-top: 1px dashed var(--c-line);
    list-style: none;
    color: var(--c-muted);
    font-size: .85rem;
}
.vcard__facts li { display: inline-flex; align-items: center; gap: .35rem; }
.vcard__facts svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   All-in pricing: "Price includes fees" badge + breakdown (<x-price-fees>)
   ========================================================================== */
.fee-badge {
    position: relative;
    z-index: 2; /* above the card's full-size link */
    align-self: flex-start; /* cards are flex columns: keep the badge its own width */
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .45rem;
    padding: .28rem .6rem .28rem .5rem;
    border: 0;
    border-radius: 999px;
    background: #e3f6eb;
    color: #11603a;
    font-family: var(--f-display);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s;
}
.fee-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fee-badge__info { opacity: .7; }
.fee-badge:hover { background: #cdeedb; }
.fee-badge:focus-visible { outline: 3px solid var(--c-brand, #2bb6e8); outline-offset: 2px; }


/* ---------- Breakdown modal (<dialog class="fee-modal">) ---------- */
/* Lock the page behind an open modal on <body>, not <html>: body already has overflow-x: hidden,
   and putting overflow on <html> moves scrolling from the window to <body> and back, which
   makes some browsers jump to the top when the modal closes. */
.fee-modal-open body { overflow: hidden; }

.fee-modal {
    width: min(94vw, 440px);
    max-height: min(92dvh, 760px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: var(--c-surface, #fff);
    color: var(--c-text, #0b1626);
    box-shadow: 0 40px 90px -30px rgb(11 22 38 / 65%), 0 0 0 1px rgb(11 22 38 / 6%);
    font-family: var(--f-body);
    overflow: hidden auto;
    overscroll-behavior: contain;
}
.fee-modal[open] { animation: fee-modal-in .38s var(--ease, cubic-bezier(.2, .7, .2, 1)); }
.fee-modal::backdrop { background: rgb(6 13 24 / 55%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.fee-modal[open]::backdrop { animation: fee-fade .3s ease-out; }
@keyframes fee-modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes fee-fade { from { opacity: 0; } }

/* Hero: the brand's ink with a cyan/coral glow, a faint grid and two triangles */
.fee-modal__hero {
    position: relative;
    isolation: isolate;
    padding: 1.5rem 1.5rem 1.4rem;
    background:
        radial-gradient(70% 120% at 100% 0%, rgb(43 182 232 / 32%), transparent 60%),
        radial-gradient(60% 110% at 0% 100%, rgb(217 54 62 / 22%), transparent 65%),
        var(--c-ink, #0b1626);
    color: var(--c-on-dark, #f3f6fa);
    overflow: hidden;
}
.fee-modal__hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(90% 100% at 85% 0%, #000, transparent 75%);
    -webkit-mask-image: radial-gradient(90% 100% at 85% 0%, #000, transparent 75%);
}
.fee-modal__tri { position: absolute; z-index: -1; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.fee-modal__tri--a { top: 18px; right: 64px; width: 74px; height: 64px; background: linear-gradient(160deg, rgb(43 182 232 / 45%), transparent 80%); }
.fee-modal__tri--b { right: 18px; bottom: 26px; width: 36px; height: 31px; background: linear-gradient(160deg, rgb(217 54 62 / 55%), transparent 80%); }

.fee-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 50%;
    background: rgb(255 255 255 / 8%);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s, transform .2s;
}
.fee-modal__close:hover { background: rgb(255 255 255 / 18%); transform: rotate(90deg); }
.fee-modal__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fee-modal__close:focus-visible, .fee-modal__ok:focus-visible { outline: 3px solid var(--c-brand, #2bb6e8); outline-offset: 2px; }

.fee-modal__car { margin: 0 3rem .35rem 0; color: rgb(243 246 250 / 78%) !important; font-family: var(--f-display); font-size: .95rem; font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.fee-modal__total {
    margin: 0;
    color: #fff !important;
    font-family: var(--f-display);
    font-size: clamp(2.3rem, 2rem + 2vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.fee-modal__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: .85rem 0 0; color: var(--c-on-dark-muted, #9fb0c6); font-size: .84rem; }
.fee-modal__chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .65rem .25rem .5rem;
    border-radius: 999px;
    background: rgb(61 220 132 / 16%);
    color: #7fe8ad;
    font-family: var(--f-display);
    font-size: .74rem;
    font-weight: 800;
}
.fee-modal__chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.fee-modal__body { padding: 1.35rem 1.5rem 1.5rem; }

/* How the price splits */
.fee-meter { display: flex; gap: 3px; height: 12px; border-radius: 999px; overflow: hidden; }
.fee-meter span { width: var(--w); min-width: 10px; border-radius: 999px; transform-origin: left; animation: fee-grow .8s .15s var(--ease, ease-out) both; }
.fee-meter__car { background: linear-gradient(90deg, #2bb6e8, #6fd0f2); }
.fee-meter__fees { background: linear-gradient(90deg, #ff8a5c, #d9363e); animation-delay: .3s !important; }
@keyframes fee-grow { from { transform: scaleX(0); } }
.fee-meter__legend { display: flex; justify-content: space-between; gap: 1rem; margin: .5rem 0 0; color: var(--c-muted, #5a6b80); font-size: .78rem; font-weight: 600; }
.fee-meter__legend span { display: inline-flex; align-items: center; gap: .35rem; }
.fee-meter__legend i { width: 8px; height: 8px; border-radius: 50%; }
.fee-meter__legend .is-car { background: #2bb6e8; }
.fee-meter__legend .is-fees { background: #d9363e; }

/* Line items */
.fee-lines { display: grid; gap: .1rem; margin: 1.1rem 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.fee-line { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .6rem 0; }
.fee-line + .fee-line { border-top: 1px dashed var(--c-line, #e2e8f0); }
.fee-line__icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: rgb(217 54 62 / 9%); color: #c0303a; }
.fee-line__icon.is-car { background: rgb(43 182 232 / 12%); color: var(--c-brand-text, #07759c); }
.fee-line__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fee-line__name { display: grid; color: var(--c-text, #0b1626); font-size: .95rem; font-weight: 700; }
.fee-line__name small { color: var(--c-muted, #5a6b80); font-size: .75rem; font-weight: 500; }
.fee-line__amount { color: var(--c-text, #0b1626); font-size: .98rem; font-weight: 800; }
.fee-line--total {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: .5rem;
    padding: .9rem 1rem;
    border: 0 !important;
    border-radius: 16px;
    background: var(--c-bg, #f4f6f9);
}
.fee-line--total .fee-line__name { font-family: var(--f-display); font-size: 1rem; font-weight: 800; }
.fee-line--total .fee-line__amount { font-family: var(--f-display); font-size: 1.3rem; letter-spacing: -.02em; }

.fee-extra { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1rem; padding: .85rem 1rem; border: 1px solid var(--c-line, #e2e8f0); border-radius: 16px; }
.fee-extra__icon { display: grid; flex: none; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: var(--c-bg, #f4f6f9); color: var(--c-muted, #5a6b80); }
.fee-extra__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fee-extra p { margin: 0; color: var(--c-muted, #5a6b80); font-size: .84rem; line-height: 1.5; }
.fee-extra strong { color: var(--c-text, #0b1626); }

.fee-modal__ok { width: 100%; margin-top: 1.1rem; }

/* Phones: a bottom sheet */
@media (max-width: 575.98px) {
    .fee-modal {
        width: 100%;
        max-width: none;
        max-height: 88dvh;
        margin: auto 0 0;
        border-radius: 26px 26px 0 0;
    }
    .fee-modal[open] { animation: fee-sheet-in .38s var(--ease, cubic-bezier(.2, .7, .2, 1)); }
    .fee-modal__hero::after { content: ""; position: absolute; top: .55rem; left: 50%; width: 40px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / 30%); transform: translateX(-50%); }
}
@keyframes fee-sheet-in { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
    .fee-modal[open], .fee-modal[open]::backdrop, .fee-meter span { animation: none; }
    .fee-modal__close:hover { transform: none; }
}

/* ==========================================================================
   Monthly payment estimate (<x-finance-chip>); the calculator is in finance.css
   ========================================================================== */
/* The fee badge and the estimate share a row under the price. */
.vcard__extras { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .45rem; }
.vcard__extras:not(:has(*)) { display: none; }
.vcard__extras .fee-badge { margin-top: 0; }

.fin-chip {
    position: relative;
    z-index: 2; /* above the card's full-size link */
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    margin-top: .6rem;
    padding: .5rem .55rem .5rem .5rem;
    border: 1px solid rgb(43 182 232 / 28%);
    border-radius: 14px;
    background: linear-gradient(100deg, rgb(43 182 232 / 12%), rgb(43 182 232 / 4%) 70%);
    color: var(--c-text, #0b1626);
    font-family: var(--f-display);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.fin-chip__icon { display: grid; flex: none; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: var(--c-ink, #0b1626); color: var(--c-brand, #2bb6e8); }
.fin-chip__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fin-chip__text { display: grid; flex: 1; min-width: 0; gap: .05rem; }
.fin-chip__text small { color: var(--c-muted, #5a6b80); font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.fin-chip__amount { color: var(--c-muted, #5a6b80); font-size: .8rem; white-space: nowrap; }
.fin-chip__amount strong { color: var(--c-text, #0b1626); font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; }
.fin-chip__info { display: grid; flex: none; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: #fff; color: var(--c-brand-text, #07759c); box-shadow: 0 1px 3px rgb(11 22 38 / 12%); transition: background-color .15s, color .15s; }
.fin-chip__info svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fin-chip:hover { border-color: rgb(43 182 232 / 60%); box-shadow: 0 6px 16px -10px rgb(43 182 232 / 80%); }
.fin-chip:hover .fin-chip__info { background: var(--c-brand-text, #07759c); color: #fff; }
.fin-chip:focus-visible { outline: 3px solid var(--c-brand, #2bb6e8); outline-offset: 2px; }
/* On the homepage's big dark featured card */
.vehicle-grid--bento > li:first-child .fin-chip { border-color: rgb(255 255 255 / 16%); background: rgb(255 255 255 / 8%); backdrop-filter: blur(6px); }
.vehicle-grid--bento > li:first-child .fin-chip__icon { background: rgb(255 255 255 / 12%); }
.vehicle-grid--bento > li:first-child .fin-chip__text small,
.vehicle-grid--bento > li:first-child .fin-chip__amount { color: var(--c-on-dark-muted, #9fb0c6); }
.vehicle-grid--bento > li:first-child .fin-chip__amount strong { color: #fff; }

/* Car page price box */
.fin-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .75rem .85rem;
    margin-top: 1rem;
    padding: .85rem .9rem;
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgb(43 182 232 / 30%), transparent 60%),
        var(--c-ink, #0b1626);
    color: var(--c-on-dark, #f3f6fa);
}
.fin-panel__icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 14px; background: rgb(255 255 255 / 9%); color: var(--c-brand, #2bb6e8); }
.fin-panel__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fin-panel p { margin: 0; }
.fin-panel__label { color: var(--c-on-dark-muted, #9fb0c6) !important; font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fin-panel__value { color: var(--c-on-dark-muted, #9fb0c6) !important; font-size: .95rem; font-variant-numeric: tabular-nums; }
.fin-panel__value strong { color: #fff; font-family: var(--f-display); font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; }
.fin-panel__terms { color: var(--c-on-dark-muted, #9fb0c6) !important; font-size: .78rem; }
.fin-panel__btn {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 44px;
    padding: .55rem .9rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--c-ink, #0b1626);
    font-family: var(--f-display);
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.fin-panel__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fin-panel__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgb(43 182 232 / 70%); }
.fin-panel__btn:focus-visible { outline: 3px solid var(--c-brand, #2bb6e8); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .fin-panel__btn:hover { transform: none; }
}
