/* =========================================================
   Annonce detail page (resources/views/automoto/annonce.blade.php)
   + sponsored block (automoto/sponsorships/detail-sponsored.blade.php).
   Everything is scoped under .amp-ad-page (the page's <main>).

   Layout (.amp-detail-layout, CSS grid):
     desktop  : left column = gallery, specs, description, location, seller
                right column = sticky summary (title, price, contact)
     <=1024px : one column, in this order: gallery, summary, specs,
                description, location, seller
   then, full width: CarVertical banner, sponsored vehicles, related vehicles.
========================================================= */

.amp-ad-page {
    --ad-navy: #011e40;
    --ad-navy-2: #0a2d57;
    --ad-orange: #ee5721;
    --ad-orange-dark: #d9481a;
    --ad-orange-soft: #fff3ed;
    --ad-text: #334155;
    --ad-muted: #64748b;
    --ad-faint: #94a3b8;
    --ad-line: #e5eaf1;
    --ad-line-soft: #eef2f7;
    --ad-soft: #f6f8fb;
    --ad-bg: #f5f7fa;
    --ad-radius: 18px;
    --ad-radius-sm: 12px;
    --ad-shadow: 0 1px 2px rgba(1, 30, 64, .04), 0 4px 14px rgba(1, 30, 64, .04);
    --ad-sticky-top: calc(var(--m-top, 64px) + 16px);

    min-height: 100vh;
    padding: 28px 24px 64px !important;
    /* no own background: <main> is capped at 1280px by the layout container, so the
       body's very light background shows everywhere without a visible seam */
    background: transparent;
    color: var(--ad-text);
}

.amp-ad-page .amp-detail-shell {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- layout ---------- */

.amp-ad-page .amp-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    grid-template-areas:
        "gallery  summary"
        "specs    summary"
        "desc     summary"
        "location summary"
        "seller   summary";
    grid-template-rows: auto auto auto auto 1fr;
    column-gap: 24px;
    row-gap: 18px;
    align-items: start;
}

.amp-ad-page .amp-area-gallery  { grid-area: gallery; min-width: 0; }
.amp-ad-page .amp-area-summary  { grid-area: summary; min-width: 0; }
.amp-ad-page .amp-area-specs    { grid-area: specs; min-width: 0; }
.amp-ad-page .amp-area-desc     { grid-area: desc; min-width: 0; }
.amp-ad-page .amp-area-location { grid-area: location; min-width: 0; }
.amp-ad-page .amp-area-seller   { grid-area: seller; min-width: 0; }

/* The layout's inline `html, body { overflow-x: hidden }` makes <body> a scroll container that never scrolls,
   which disables position: sticky. On this page only, `clip` keeps the same horizontal clipping without
   creating a scroll container (browsers without `clip` keep the old rule: the summary simply does not stick). */
html:has(.amp-ad-page) body {
    overflow-x: clip;
}

/* the summary follows the reader while the left column scrolls (inside its grid area only) */
.amp-ad-page .amp-area-summary {
    position: sticky;
    top: var(--ad-sticky-top);
}

/* ---------- cards ---------- */

.amp-ad-page .amp-card {
    background: #fff;
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow);
    padding: 22px 24px;
}

.amp-ad-page .amp-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--ad-navy);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.amp-ad-page .amp-card-title ion-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 10px;
    background: var(--ad-orange-soft);
    color: var(--ad-orange);
    box-sizing: border-box;
}

.amp-ad-page .amp-block-label,
.amp-ad-page .amp-section-label {
    margin: 0;
    color: var(--ad-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    line-height: 1.3;
    text-transform: uppercase;
}

/* ---------- gallery ---------- */

.amp-ad-page .amp-gallery {
    overflow: hidden;
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
    background: #eef2f6;
    box-shadow: var(--ad-shadow);
}

.amp-ad-page .insta-0 {
    inset: 0;
}

.amp-ad-page .amp-gallery-shade {
    height: 96px;
    background: linear-gradient(to top, rgba(1, 30, 64, .38), rgba(1, 30, 64, 0));
}

.amp-ad-page .amp-gallery .nav-prev,
.amp-ad-page .amp-gallery .nav-next {
    z-index: 5;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--ad-navy);
    box-shadow: 0 2px 8px rgba(1, 30, 64, .16);
    font-size: 18px;
    transition: background-color .18s ease, color .18s ease;
}

.amp-ad-page .amp-gallery .nav-prev:hover,
.amp-ad-page .amp-gallery .nav-next:hover {
    background: var(--ad-orange);
    color: #fff;
}

.amp-ad-page .amp-gallery.is-single .nav-prev,
.amp-ad-page .amp-gallery.is-single .nav-next {
    display: none;
}

.amp-ad-page .amp-photo-count {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(1, 30, 64, .72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.amp-ad-page .amp-thumbs {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 12px 12px;
}

.amp-ad-page .amp-thumb {
    display: block;
    width: 64px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 10px;
    object-fit: cover;
    background: #e9eef4;
    opacity: .82;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
    transition: opacity .18s ease, border-color .18s ease;
}

.amp-ad-page .amp-thumbs li:hover .amp-thumb {
    opacity: 1;
}

.amp-ad-page .amp-thumbs li.uk-active .amp-thumb {
    border-color: var(--ad-orange);
    opacity: 1;
}

/* listing without photo: light, centred illustration instead of a grey cover */
.amp-ad-page .amp-photo-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
    color: var(--ad-faint);
}

.amp-ad-page .amp-photo-empty img {
    width: min(42%, 220px);
    height: auto;
    opacity: .55;
}

.amp-ad-page .amp-photo-empty span {
    color: var(--ad-muted);
    font-size: 14px;
    font-weight: 600;
}

/* ---------- summary (sticky card) ---------- */

.amp-ad-page .amp-summary {
    padding: 22px 22px 20px;
}

.amp-ad-page .amp-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.amp-ad-page .amp-summary-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.amp-ad-page .amp-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ecf3ff;
    color: var(--ad-navy);
    font-size: 12px;
    font-weight: 700;
}

.amp-ad-page .amp-verified-badge ion-icon {
    color: #1d6fe0;
    font-size: 15px;
}

.amp-ad-page .amp-icon-btn,
.amp-ad-page .amp-like-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--ad-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ad-navy);
    font-size: 13px;
    font-weight: 700;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.amp-ad-page .amp-icon-btn ion-icon,
.amp-ad-page .amp-like-detail ion-icon {
    font-size: 18px;
}

.amp-ad-page .amp-icon-btn:hover,
.amp-ad-page .amp-like-detail:hover {
    border-color: var(--ad-orange);
    color: var(--ad-orange);
}

.amp-ad-page .amp-like-detail ion-icon {
    color: #e11d48;
}

.amp-ad-page .amp-main-title {
    margin: 14px 0 6px;
    color: var(--ad-navy);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.amp-ad-page .amp-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    color: var(--ad-muted);
    font-size: 13px;
}

.amp-ad-page .amp-summary-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.amp-ad-page .amp-summary-meta ion-icon {
    flex: 0 0 auto;
    color: var(--ad-faint);
    font-size: 15px;
}

.amp-ad-page .amp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.amp-ad-page .amp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1px solid var(--ad-line);
    border-radius: 999px;
    background: var(--ad-soft);
    color: var(--ad-navy);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.amp-ad-page .amp-chip ion-icon {
    color: var(--ad-orange);
    font-size: 15px;
}

.amp-ad-page .amp-price-card {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--ad-soft);
    border: 1px solid var(--ad-line-soft);
}

.amp-ad-page .amp-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

.amp-ad-page .amp-price-amount {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: var(--ad-navy);
}

.amp-ad-page .amp-price-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.01em;
}

.amp-ad-page .amp-price-currency {
    font-size: 22px;
    font-weight: 800;
}

.amp-ad-page .amp-price-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.amp-ad-page .amp-price-badge.green {
    background: #e8f7ee;
    color: #15803d;
}

.amp-ad-page .amp-price-badge.orange {
    background: var(--ad-orange-soft);
    color: var(--ad-orange-dark);
}

.amp-ad-page .amp-price-none strong {
    display: block;
    color: var(--ad-navy);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.amp-ad-page .amp-price-none small {
    display: block;
    margin-top: 4px;
    color: var(--ad-muted);
    font-size: 13px;
}

/* ---------- contact actions ---------- */

.amp-ad-page .amp-contact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.amp-ad-page .amp-contact-actions:empty {
    display: none;
}

.amp-ad-page .amp-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.amp-ad-page .amp-contact-btn ion-icon {
    flex: 0 0 auto;
    font-size: 18px;
}

/* primary CTA: full width, first */
.amp-ad-page .amp-contact-btn.is-primary {
    grid-column: 1 / -1;
    order: -1;
    height: 50px;
    background: var(--ad-orange);
    color: #fff;
    font-size: 15px;
}

.amp-ad-page .amp-contact-btn.is-primary:hover {
    background: var(--ad-orange-dark);
}

.amp-ad-page .amp-contact-btn.is-call {
    background: var(--ad-navy);
    color: #fff;
    grid-column: 1 / -1; /* SMS is hidden above 768px: the call button takes the full row */
}

.amp-ad-page .amp-contact-btn.is-call:hover {
    background: var(--ad-navy-2);
}

.amp-ad-page .amp-contact-btn.is-secondary {
    border-color: var(--ad-line);
    background: #fff;
    color: var(--ad-navy);
}

.amp-ad-page .amp-contact-btn.is-secondary:hover {
    border-color: var(--ad-navy);
}

.amp-ad-page .amp-contact-btn:disabled {
    cursor: default;
    opacity: 1;
}

/* the SMS link is useful on a phone only */
.amp-ad-page #Sms {
    display: none;
}

.amp-ad-page .amp-owner-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ecf3ff;
    color: var(--ad-navy);
    font-size: 13px;
    font-weight: 600;
}

.amp-ad-page .amp-favorite-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px dashed var(--ad-line);
    border-radius: 12px;
    color: var(--ad-navy);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .18s ease, background-color .18s ease;
}

.amp-ad-page .amp-favorite-link:hover {
    border-color: var(--ad-orange);
    background: var(--ad-orange-soft);
}

/* seller mini-row of the summary */
.amp-ad-page .amp-summary-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--ad-line-soft);
}

.amp-ad-page .amp-summary-seller img {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 999px;
    object-fit: cover;
    background: var(--ad-soft);
}

.amp-ad-page .amp-summary-seller-name {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--ad-navy);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amp-ad-page .amp-summary-seller-name small {
    display: block;
    color: var(--ad-muted);
    font-size: 12px;
    font-weight: 500;
}

.amp-ad-page .amp-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    color: var(--ad-orange);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.amp-ad-page .amp-link-btn:hover {
    color: var(--ad-orange-dark);
}

/* ---------- characteristics ---------- */

.amp-ad-page .amp-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.amp-ad-page .amp-spec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--ad-line-soft);
    border-radius: 12px;
    background: var(--ad-soft);
}

.amp-ad-page .amp-spec-item ion-icon {
    flex: 0 0 auto;
    color: var(--ad-orange);
    font-size: 20px;
}

.amp-ad-page .amp-spec-item div {
    min-width: 0;
}

.amp-ad-page .amp-spec-item dt {
    color: var(--ad-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.amp-ad-page .amp-spec-item dd {
    margin: 2px 0 0;
    color: var(--ad-navy);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* ---------- description ---------- */

.amp-ad-page .amp-description {
    margin: 0;
    color: var(--ad-text);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line; /* the seller's line breaks, text stays escaped */
    overflow-wrap: anywhere;
}

.amp-ad-page .amp-description.is-empty {
    color: var(--ad-faint);
    font-style: italic;
}

/* ---------- location (approximate public map) ---------- */

.amp-ad-page .amp-location-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    margin-bottom: 14px;
}

.amp-ad-page .amp-location-head strong {
    color: var(--ad-navy);
    font-size: 16px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.amp-ad-page .amp-location-head span {
    color: var(--ad-muted);
    font-size: 14px;
}

.amp-ad-page .amp-location-map {
    position: relative;
    height: 360px;
    overflow: hidden;
    border: 1px solid var(--ad-line);
    border-radius: 14px;
    background: #e8eef4;
}

.amp-ad-page .amp-location-map-fallback,
.amp-ad-page .amp-location-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ad-muted);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.amp-ad-page .amp-location-map-fallback {
    position: absolute;
    inset: 0;
    padding: 16px;
}

.amp-ad-page .amp-location-unavailable {
    min-height: 96px;
    padding: 16px;
    border: 1px dashed var(--ad-line);
    border-radius: 14px;
    background: var(--ad-soft);
}

.amp-ad-page .amp-location-map-fallback ion-icon,
.amp-ad-page .amp-location-unavailable ion-icon {
    flex: 0 0 auto;
    color: var(--ad-faint);
    font-size: 20px;
}

.amp-ad-page .amp-location-map.is-unavailable {
    height: auto;
    min-height: 96px;
    border-style: dashed;
    background: var(--ad-soft);
}

.amp-ad-page .amp-location-map.is-unavailable .amp-location-map-fallback {
    position: static;
    min-height: 96px;
}

.amp-ad-page .amp-location-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    color: var(--ad-muted);
    font-size: 13px;
    line-height: 1.5;
}

.amp-ad-page .amp-location-note ion-icon {
    flex: 0 0 auto;
    margin-top: 1px;
    color: #15803d;
    font-size: 17px;
}

/* ---------- seller ---------- */

.amp-ad-page .amp-seller-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.amp-ad-page .amp-seller-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border: 2px solid #fff;
    border-radius: 999px;
    object-fit: cover;
    background: var(--ad-soft);
    box-shadow: 0 0 0 1px var(--ad-line);
}

.amp-ad-page .amp-seller-info {
    flex: 1 1 200px;
    min-width: 0;
}

.amp-ad-page .amp-seller-name {
    color: var(--ad-navy);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amp-ad-page .amp-seller-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.amp-ad-page .amp-seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--ad-soft);
    color: var(--ad-muted);
    font-size: 12px;
    font-weight: 600;
}

.amp-ad-page .amp-seller-badge.is-pro {
    background: #ecf3ff;
    color: var(--ad-navy);
}

.amp-ad-page .amp-seller-badge ion-icon {
    font-size: 14px;
}

.amp-ad-page .amp-seller-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--ad-navy);
    border-radius: 12px;
    color: var(--ad-navy);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease;
}

.amp-ad-page .amp-seller-profile:hover {
    background: var(--ad-navy);
    color: #fff;
}

/* ---------- CarVertical: history button (in the card) ---------- */

.amp-ad-page .amp-history-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease;
}

.amp-ad-page .amp-history-btn.has-vin {
    border: 1px solid var(--ad-navy);
    background: var(--ad-navy);
    color: #fff;
    box-shadow: none;
}

.amp-ad-page .amp-history-btn.has-vin:hover {
    background: var(--ad-navy-2);
}

.amp-ad-page .amp-history-btn.no-vin {
    border: 1px solid rgba(238, 87, 33, .22);
    background: #fff;
    color: var(--ad-navy);
}

.amp-ad-page .amp-history-btn.no-vin:hover {
    background: #fffaf6;
}

.amp-ad-page .amp-history-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
    font-size: 20px;
}

.amp-ad-page .amp-history-btn.no-vin .amp-history-icon {
    background: var(--ad-orange-soft);
    color: var(--ad-orange);
}

.amp-ad-page .amp-history-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.amp-ad-page .amp-history-text strong {
    font-size: 14.5px;
    font-weight: 700;
}

.amp-ad-page .amp-history-text small {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 500;
    opacity: .78;
}

.amp-ad-page .amp-history-arrow {
    flex: none;
    font-size: 18px;
    opacity: .85;
    transition: transform .18s ease;
}

.amp-ad-page .amp-history-btn:hover .amp-history-arrow {
    transform: translateX(2px);
}

/* ---------- CarVertical: banner ---------- */

.amp-ad-page .amp-history-banner {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 24px;
    overflow: hidden;
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.amp-ad-page .amp-history-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(1, 30, 64, .10);
}

.amp-ad-page .amp-history-banner-img {
    display: block;
    width: 100%;
    height: auto;
}

/* the banner image carries its own text: the VIN message + CTA sit in a bar under it, not over it */
.amp-ad-page .amp-history-overlay {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--ad-line);
    background: #fff;
}

.amp-ad-page .amp-history-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.amp-ad-page .amp-history-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--ad-navy);
}

.amp-ad-page .amp-history-left ion-icon {
    flex: none;
    font-size: 20px;
    color: var(--ad-orange);
}

.amp-ad-page .amp-history-banner.has-vin .amp-history-left ion-icon {
    color: #16a34a;
}

.amp-ad-page .amp-history-left small {
    font-size: 13.5px;
    font-weight: 600;
}

.amp-ad-page .amp-history-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.amp-ad-page .amp-history-banner.has-vin .amp-history-cta {
    background: #16a34a;
}

.amp-ad-page .amp-history-banner.no-vin .amp-history-cta {
    background: var(--ad-orange);
}

/* ---------- sponsored (detail-sponsored.blade.php) ---------- */

.amp-ad-page .detail-sponsored-section {
    margin-top: 24px;
    padding: 20px 22px 22px;
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
    background: #fff;
    box-shadow: var(--ad-shadow);
}

.amp-ad-page .detail-sponsored-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.amp-ad-page .detail-sponsored-title,
.amp-ad-page .amp-related-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ad-navy);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.amp-ad-page .detail-sponsored-title-icon,
.amp-ad-page .amp-related-title-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--ad-orange-soft);
    color: var(--ad-orange);
    font-size: 17px;
}

/* the title is an <h2> since the redesign: same look as the shared title rule above */
.amp-ad-page .detail-sponsored-title {
    margin: 0;
}

.amp-ad-page .detail-sponsored-tag {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ad-muted);
    font-size: 11.5px;
    font-weight: 600;
}

/* up to 4 cards per row (6 = 4 + 2, 8 = 4 + 4), equal heights; phones: swipe row (below) */
.amp-ad-page .detail-sponsored-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.amp-ad-page .detail-sponsored-item {
    display: flex;
    min-width: 0;
}

.amp-ad-page .detail-sponsored-card {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ad-line);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.amp-ad-page .detail-sponsored-card:hover {
    transform: translateY(-2px);
    border-color: #d5dde8;
    box-shadow: 0 8px 20px rgba(1, 30, 64, .08);
}

.amp-ad-page .detail-sponsored-card:focus-visible {
    outline: 2px solid var(--ad-orange);
    outline-offset: 2px;
}

.amp-ad-page .detail-sponsored-img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9eef4;
}

.amp-ad-page .detail-sponsored-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.amp-ad-page .detail-sponsored-card:hover .detail-sponsored-img img:not(.is-placeholder) {
    transform: scale(1.03);
}

.amp-ad-page .detail-sponsored-img img.is-placeholder {
    object-fit: contain;
    padding: 18%;
}

/* discreet label, same for both placements */
.amp-ad-page .detail-sponsored-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--ad-navy);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 1px 4px rgba(1, 30, 64, .14);
}

.amp-ad-page .detail-sponsored-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 11px 12px 12px;
}

.amp-ad-page .detail-sponsored-price {
    color: var(--ad-navy);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.amp-ad-page .detail-sponsored-price .is-none {
    color: var(--ad-muted);
    font-size: 13px;
    font-weight: 600;
}

/* full title, 2 lines max */
.amp-ad-page .detail-sponsored-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--ad-navy);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.amp-ad-page .detail-sponsored-card:hover .detail-sponsored-name {
    color: var(--ad-orange);
}

.amp-ad-page .detail-sponsored-meta {
    overflow: hidden;
    color: var(--ad-muted);
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* bottom of the card: aligned on every card of a row */
.amp-ad-page .detail-sponsored-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: auto;
    padding-top: 8px;
    color: var(--ad-muted);
    font-size: 12px;
}

.amp-ad-page .detail-sponsored-specs span + span::before {
    content: "·";
    margin-right: 8px;
    color: var(--ad-faint);
}

@media (prefers-reduced-motion: reduce) {
    .amp-ad-page .detail-sponsored-card,
    .amp-ad-page .detail-sponsored-img img {
        transition: none;
    }

    .amp-ad-page .detail-sponsored-card:hover,
    .amp-ad-page .detail-sponsored-card:hover .detail-sponsored-img img:not(.is-placeholder) {
        transform: none;
    }
}

/* ---------- related vehicles ---------- */

.amp-ad-page .amp-related-title {
    margin: 32px 0 14px;
}

.amp-ad-page .amp-related-slider {
    margin: 0 -2px;
    padding: 2px;
}

.amp-ad-page .amp-related-card {
    overflow: hidden;
    border: 1px solid var(--ad-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.amp-ad-page .amp-related-card:hover {
    transform: translateY(-2px);
    border-color: #d5dde8;
    box-shadow: 0 8px 20px rgba(1, 30, 64, .08);
}

.amp-ad-page .amp-related-img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9eef4;
}

.amp-ad-page .amp-related-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amp-ad-page .amp-related-fav {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 4px rgba(1, 30, 64, .18);
    transition: background-color .15s ease, transform .15s ease;
}

.amp-ad-page .amp-related-fav:hover {
    background: #fff;
    transform: scale(1.06);
}

.amp-ad-page .amp-related-fav ion-icon {
    font-size: 18px;
}

.amp-ad-page .amp-related-body {
    padding: 12px;
}

.amp-ad-page .amp-related-name {
    display: -webkit-box;
    min-height: 2.6em;
    overflow: hidden;
    color: var(--ad-navy);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.amp-ad-page .amp-related-card a:hover .amp-related-name {
    color: var(--ad-orange);
}

.amp-ad-page .amp-related-price {
    display: block;
    margin-top: 8px;
    color: var(--ad-navy);
    font-size: 15px;
    font-weight: 800;
}

.amp-ad-page .amp-related-price.is-none {
    color: var(--ad-muted);
    font-size: 13px;
    font-weight: 600;
}

.amp-ad-page .amp-related-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ad-line-soft);
    color: var(--ad-muted);
    font-size: 12px;
}

.amp-ad-page .amp-related-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.amp-ad-page .amp-related-nav {
    position: absolute;
    top: 30%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--ad-navy);
    box-shadow: 0 2px 8px rgba(1, 30, 64, .18);
    font-size: 18px;
    transform: translateY(-50%);
    transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}

.amp-ad-page .amp-related-nav:hover {
    background: var(--ad-orange);
    color: #fff;
}

.amp-ad-page .amp-related-nav.is-prev {
    left: 10px;
}

.amp-ad-page .amp-related-nav.is-next {
    right: 22px; /* the list is 10px wider than the slider + 12px item gutter */
}


/* ---------- smaller screens ---------- */

@media (max-width: 1280px) {
    .amp-ad-page .amp-detail-layout {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    }

    .amp-ad-page .amp-spec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .amp-ad-page .detail-sponsored-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* tablet and below: one column; the summary comes right after the gallery and is no longer sticky */
@media (max-width: 1024px) {
    .amp-ad-page .amp-detail-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "gallery"
            "summary"
            "specs"
            "desc"
            "location"
            "seller";
        grid-template-rows: none;
        row-gap: 16px;
    }

    .amp-ad-page .amp-area-summary {
        position: static;
    }

    .amp-ad-page .amp-spec-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .amp-ad-page .amp-contact-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .amp-ad-page .detail-sponsored-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .amp-ad-page {
        padding: 14px 10px 90px !important;
    }

    .amp-ad-page .amp-detail-layout {
        row-gap: 14px;
    }

    .amp-ad-page .amp-card {
        padding: 16px;
    }

    .amp-ad-page .amp-card-title {
        margin-bottom: 12px;
        font-size: 17px;
    }

    .amp-ad-page .amp-main-title {
        font-size: 22px;
    }

    .amp-ad-page .amp-price-value {
        font-size: 30px;
    }

    .amp-ad-page .amp-spec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .amp-ad-page .amp-spec-item {
        padding: 10px;
    }

    .amp-ad-page .amp-location-map {
        height: 240px;
    }

    .amp-ad-page #Sms {
        display: inline-flex;
    }

    .amp-ad-page .amp-contact-btn.is-call {
        grid-column: auto;
    }

    .amp-ad-page .amp-thumb {
        width: 48px;
        height: 38px;
    }

    .amp-ad-page .amp-seller-profile {
        width: 100%;
    }

    .amp-ad-page .detail-sponsored-section {
        padding: 14px;
    }

    .amp-ad-page .detail-sponsored-grid {
        gap: 10px;
    }
}

/* phones: one swipe row (scroll-snap, native touch) instead of up to 8 stacked cards;
   the row bleeds into the section padding, never wider than the section */
@media (max-width: 640px) {
    .amp-ad-page .detail-sponsored-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 68%;
        margin: 0 -14px;
        padding: 2px 14px 6px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 14px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .amp-ad-page .detail-sponsored-grid::-webkit-scrollbar {
        display: none;
    }

    .amp-ad-page .detail-sponsored-item {
        scroll-snap-align: start;
    }

    .amp-ad-page .detail-sponsored-card:hover {
        transform: none;
    }
}

@media (max-width: 420px) {
    .amp-ad-page .amp-main-title {
        font-size: 21px;
    }

    .amp-ad-page .amp-contact-btn {
        padding: 0 10px;
        font-size: 13px;
    }

    .amp-ad-page .amp-spec-item dd {
        font-size: 13px;
    }
}
