/* Car View Page Styles - Reusable */

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
    --cv-green:        #1c1917;   /* primary brand brown  */
    --cv-green-dark:   #0f0f0e;   /* hover / darker shade */
    --cv-green-light:  #fef9f5;   /* tint backgrounds     */
    --cv-green-border: #ede1d0;   /* tint borders         */
    --cv-red:          #c0152a;   /* price / danger       */
    --cv-red-light:    #fee2e2;   /* tint backgrounds     */
    --cv-navy:         #0f172a;   /* deep headings        */
    --cv-wa:           #25d366;   /* WhatsApp green       */
    --cv-wa-dark:      #1ebe5d;   /* WhatsApp hover       */
    --cv-text:         #111827;
    --cv-muted:        #6b7280;
    --cv-border:       #e5e7eb;
    --cv-surface:      #f8fafc;
}

[data-theme="dark"] {
    --cv-text:    #f1f5f9;
    --cv-muted:   #94a3b8;
    --cv-border:  rgba(148,163,184,0.2);
    --cv-surface: rgba(51,65,85,0.4);
}

/* ── Gallery layers (image / youtube / video inside same stage) ─────────── */

/* Hidden utility — used to toggle layers without display:none so transitions work */
.g-hidden {
    display: none !important;
}

/* Video layers fill the stage exactly like the main image */
.main-video-layer {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    position: relative;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* YouTube facade inside the video layer */
.yt-facade {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.yt-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1 !important;
    transition: filter 0.2s ease !important;
}

.yt-facade:hover .yt-thumb {
    filter: brightness(0.8);
}

.yt-play-btn {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.6));
    transition: transform 0.2s ease;
    pointer-events: none;
}

.yt-facade:hover .yt-play-btn {
    transform: scale(1.1);
}

/* Play badge on video thumbnails in the strip */
.thumb-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.thumb-play-badge i {
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    padding-left: 2px; /* optical centre for play triangle */
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Video section removed — now part of gallery */
.video-section { display: none !important; }



/* ── Lazy-load fade-in ──────────────────────────────────────────────────── */
.img-lazy {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.img-lazy.img-loaded {
    opacity: 1;
}

.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 0.75rem;
    overflow-x: hidden;
}

.vehicle-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.82fr);
    gap: 1rem;
    align-items: start;
    max-width: 1120px;
    margin: 0 auto;
}

.card-surface {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

/* Dark mode card surface */
[data-theme="dark"] .card-surface {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.gallery-panel {
    padding: 0;
    background: transparent;
    position: relative;
}

/* Add subtle backdrop for dark mode visibility */
.gallery-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.03) 0%, rgba(100, 116, 139, 0.03) 100%);
    border-radius: 18px;
    pointer-events: none;
}

[data-theme="dark"] .gallery-panel::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(148, 163, 184, 0.04) 100%);
}

.main-image {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: contain;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: block;
    cursor: zoom-in;
    /* smooth fade transition driven by JS */
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-theme="dark"] .main-image {
    background: linear-gradient(135deg, rgba(51,65,85,0.3) 0%, rgba(71,85,105,0.3) 100%);
    border: 1px solid rgba(148,163,184,0.15);
}

/* ── Gallery Stage ──────────────────────────────────────────────────────── */

.gallery-stage {
    position: relative;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    background: #f3f4f6;
    line-height: 0; /* remove gap under inline image */
    user-select: none;
}

[data-theme="dark"] .gallery-stage {
    background: rgba(15,23,42,0.6);
}

/* Counter badge — top-left */
.gallery-counter {
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    pointer-events: none;
    line-height: 1.4;
    letter-spacing: 0.03em;
}

/* Expand / fullscreen button — top-right */
.gallery-expand-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    min-width: 44px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    background: #ffffff;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2);
    transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    z-index: 10;
}
.gallery-expand-btn i {
    display: block;
    color: #0f172a !important;
    font-family: "Font Awesome 6 Free", "Font Awesome 7 Free", FontAwesome !important;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    font-size: 0.9rem;
}
.gallery-expand-icon {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: #0f172a;
    stroke-width: 2.2;
    stroke-linecap: square;
    stroke-linejoin: miter;
}
.gallery-expand-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    transform: scale(1.08);
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.26);
}
.gallery-expand-btn:active {
    transform: scale(0.96);
}

@media (max-width: 480px) {
    .gallery-expand-btn {
        min-width: 40px;
        width: 40px;
        height: 40px;
        padding: 0;
    }
}

/* Prev / Next arrows */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    color: #111827;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    transition: background 0.18s, transform 0.18s;
    z-index: 2;
    opacity: 0;
}
.gallery-stage:hover .gallery-arrow {
    opacity: 1;
}
.gallery-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}
.gallery-arrow-left  { left: 0.75rem; }
.gallery-arrow-right { right: 0.75rem; }

[data-theme="dark"] .gallery-arrow {
    background: rgba(30,41,59,0.85);
    color: #f1f5f9;
}
[data-theme="dark"] .gallery-arrow:hover {
    background: rgba(30,41,59,1);
}

/* ── Thumbnail Strip ────────────────────────────────────────────────────── */

.thumb-strip {
    display: flex;
    gap: 0.55rem;
    padding: 0.65rem 0.5rem 0.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    background: transparent;
}
.thumb-strip::-webkit-scrollbar { height: 4px; }
.thumb-strip::-webkit-scrollbar-track { background: transparent; }
.thumb-strip::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.thumb {
    flex: 0 0 76px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2.5px solid transparent;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.thumb-active {
    border-color: #1bb55c;
    box-shadow: 0 0 0 1px rgba(27,181,92,0.35), 0 2px 8px rgba(27,181,92,0.2);
}
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.22s ease;
}
.thumb:hover img {
    transform: scale(1.07);
}
.thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.18s;
}
.thumb:not(.thumb-active):hover .thumb-overlay {
    background: rgba(0,0,0,0.08);
}
.thumb-active .thumb-overlay {
    box-shadow: inset 0 0 0 2px rgba(27,181,92,0.5);
}

[data-theme="dark"] .thumb {
    background: linear-gradient(135deg, rgba(51,65,85,0.4) 0%, rgba(71,85,105,0.4) 100%);
    border-color: rgba(148,163,184,0.15);
}
[data-theme="dark"] .thumb-active {
    border-color: #1bb55c;
}

/* ── Dot navigation ─────────────────────────────────────────────────────── */

.gallery-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0 0.1rem;
}
.gallery-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s, width 0.18s;
    padding: 0;
    flex-shrink: 0;
}
.gallery-dot:hover {
    background: #6b7280;
    transform: scale(1.25);
}
.gallery-dot-active {
    background: #1bb55c;
    width: 18px;
    border-radius: 4px;
}
[data-theme="dark"] .gallery-dot {
    background: rgba(148,163,184,0.35);
}
[data-theme="dark"] .gallery-dot-active {
    background: #1bb55c;
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */

#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s ease;
}
#lightbox.lb-open    { opacity: 1; }
#lightbox.lb-closing { opacity: 0; pointer-events: none; }

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5,8,16,0.88);
    backdrop-filter: blur(6px);
}

.lb-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    padding: 0 3.5rem;
    gap: 0.75rem;
    z-index: 1;
}

.lb-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s;
    z-index: 10;
}
.lb-close:hover { background: rgba(255,255,255,0.22); }

.lb-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s;
    z-index: 10;
}
.lb-arrow:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-50%) scale(1.1);
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

.lb-img-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 82vh;
    overflow: hidden;
}
#lbImg {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.12s ease, transform 0.12s ease;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-drag: none;
}

.lb-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}
.lb-counter {
    color: rgba(255,255,255,0.65);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.lb-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.lb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.18s, transform 0.18s, width 0.18s;
    padding: 0;
}
.lb-dot:hover { background: rgba(255,255,255,0.6); transform: scale(1.2); }
.lb-dot-active {
    background: #1bb55c;
    width: 18px;
    border-radius: 4px;
}

/* Mobile lightbox */
@media (max-width: 640px) {
    .lb-shell { padding: 0 0.5rem; }
    .lb-prev  { left: 0.25rem; }
    .lb-next  { right: 0.25rem; }
    .lb-arrow { width: 38px; height: 38px; font-size: 0.85rem; }
    #lbImg    { max-height: 72vh; border-radius: 8px; }
}

.spec-section {
    padding: 0.75rem 1rem 0.25rem;
    margin-top: 0.75rem;
    background: transparent;
    border-radius: 0;
    border-top: 1px solid #e5e7eb;
}

[data-theme="dark"] .spec-section {
    border-top-color: #334155;
}

.spec-section h3 {
    color: #111827;
}

[data-theme="dark"] .spec-section h3 {
    color: #f1f5f9;
}

.spec-grid {
    display: flex;
    gap: 0.6rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.65rem;
    flex-wrap: wrap;
}

[data-theme="dark"] .spec-grid {
    border-top-color: #334155;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 70px;
}

.spec-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
}

[data-theme="dark"] .spec-label {
    color: #94a3b8;
}

.spec-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
    text-align: left;
}

[data-theme="dark"] .spec-value {
    color: #f1f5f9;
}

/* Description section dark mode support */
.spec-section h4 {
    color: #111827;
}

[data-theme="dark"] .spec-section h4 {
    color: #f1f5f9;
}

.spec-section p {
    color: #4b5563;
}

[data-theme="dark"] .spec-section p {
    color: #cbd5e1;
}

.side-panel {
    padding: 1rem 1.1rem;
    position: sticky;
    top: 1rem;
}

.price-label {
    color: #6b7280;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

[data-theme="dark"] .price-label {
    color: #94a3b8;
}

.price-value {
    margin-top: 0.5rem;
    font-size: 1.8rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.15;
}

[data-theme="dark"] .price-value {
    color: #f1f5f9;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
}

[data-theme="dark"] .meta-badge {
    color: #cbd5e1;
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1rem 0;
}

.mini-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.8rem;
}

[data-theme="dark"] .mini-box {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.15);
}

.mini-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 700;
}

[data-theme="dark"] .mini-label {
    color: #94a3b8;
}

.mini-value {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}

[data-theme="dark"] .mini-value {
    color: #f1f5f9;
}

.progress-box {
    margin-top: 1rem;
    background: linear-gradient(135deg, #0f766e 0%, #0f172a 100%);
    color: #fff;
    border-radius: 14px;
    padding: 1rem;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.95;
    margin-bottom: 0.65rem;
}

.progress-bar {
    height: 9px;
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    display: block;
    height: 100%;
    background: #fff;
    border-radius: inherit;
}

.action-box {
    margin-top: 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
}

[data-theme="dark"] .action-box {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.15);
}

/* Dark mode form labels */
[data-theme="dark"] .action-box label {
    color: #cbd5e1 !important;
}

/* Dark mode form inputs */
[data-theme="dark"] .action-box input,
[data-theme="dark"] .action-box select {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
}

/* Dark mode form heading */
[data-theme="dark"] .action-box h3 {
    color: #f1f5f9 !important;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.related-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

[data-theme="dark"] .related-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
}

.related-card:hover {
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .related-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.related-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .related-card img {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.2) 0%, rgba(71, 85, 105, 0.2) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.related-body {
    padding: 0.8rem 0.9rem 1rem;
}

.related-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    margin: 0.2rem 0 0.35rem;
}

[data-theme="dark"] .related-name {
    color: #f1f5f9;
}

.related-price {
    font-weight: 800;
    color: #16a34a;
}

.related-status-badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 6.2rem;
    padding: 0.52rem 0.72rem 0.52rem 0.52rem;
    border-radius: 0.6rem;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
    clip-path: polygon(0 18%, 90% 0, 100% 50%, 90% 100%, 0 82%, 8% 50%);
    transform: rotate(-7deg);
}

.related-status-badge::before {
    content: "";
    display: inline-block;
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.related-status-sold {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.related-status-reserved {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}

[data-theme="dark"] .related-price {
    color: #6ee7b7;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .page-shell {
        padding: 0 0.75rem;
    }
    .spec-section {
        margin-top: 1rem;
    }
    .gallery-arrow {
        opacity: 1; /* always visible on touch */
        width: 34px;
        height: 34px;
        font-size: 0.78rem;
    }
    .gallery-arrow-left  { left: 0.4rem; }
    .gallery-arrow-right { right: 0.4rem; }

    /* ── Thumbnail strip wraps to a grid instead of scrolling off-screen ── */
    .thumb-strip {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
        gap: 0.45rem;
        padding: 0.65rem 0.5rem 0.5rem;
        overflow-x: visible; /* no horizontal scroll */
    }
    .thumb {
        flex: unset; /* override the flex shorthand */
        width: 100%;
        height: 54px;
    }

    /* Dots are redundant when the full grid is visible */
    .gallery-dots {
        display: none;
    }
}

@media (max-width: 900px) {
    .vehicle-layout {
        grid-template-columns: 1fr;
    }
    .side-panel {
        position: static;
    }
    .main-image {
        max-height: 320px;
        border-radius: 10px 10px 0 0;
    }
    .gallery-stage {
        border-radius: 10px 10px 0 0;
    }
    .spec-grid { gap: 1rem; }
    .spec-item {
        min-width: calc(50% - 0.5rem);
        flex: 0 0 calc(50% - 0.5rem);
    }
}

@media (max-width: 640px) {
    .related-grid { grid-template-columns: 1fr; }
    .main-image   { max-height: 260px; }
    .thumb-strip  {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
        gap: 0.35rem;
    }
    .thumb        { height: 48px; }
    .spec-grid    { gap: 0.6rem; }
    .spec-item {
        min-width: calc(50% - 0.3rem);
        flex: 0 0 calc(50% - 0.3rem);
    }
    .spec-label  { font-size: 0.58rem; }
    .spec-value  { font-size: 0.72rem; }
    .side-panel  { padding: 1rem; }
    .price-value { font-size: 1.75rem; }
}

@media (max-width: 400px) {
    .main-image  { max-height: 220px; }
    .price-value { font-size: 1.5rem; }
    .page-shell  { padding: 0 0.5rem; }
}

/* ── Shimmer animation for image loading ─────────────────────────────────── */
@keyframes vc-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
