/**
 * Vehicle Details Page - Mobile-First CSS
 * Cars24-inspired 60/40 layout with stacked mobile view
 *
 * @package ZeroDetail
 * @subpackage CSS Pages
 */

/* ==================== BREADCRUMBS ==================== */
.vd-breadcrumbs {
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}

.vd-breadcrumbs a {
    color: #6c757d;
    text-decoration: none;
}

.vd-breadcrumbs a:hover {
    color: #007bff;
}

.vd-breadcrumb-sep {
    margin: 0 0.4rem;
    color: #adb5bd;
}

.vd-breadcrumbs span:last-child {
    color: #343a40;
    font-weight: 500;
}

/* ==================== LAYOUT (Mobile-first: single column) ==================== */
.vd-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
}

.vd-main {
    min-width: 0; /* Prevent flex overflow */
}

.vd-sidebar {
    order: -1; /* On mobile, sidebar CTA comes before main content sections */
}

.vd-sidebar-sticky {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==================== GALLERY ==================== */
.vd-gallery {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.vd-gallery-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.vd-gallery-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vd-gallery-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.vd-gallery-thumbs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.vd-gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.vd-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, border 0.2s;
    scroll-snap-align: center;
    border: 2px solid transparent;
}

.vd-thumb:hover {
    opacity: 0.85;
}

.vd-thumb.active {
    opacity: 1;
    border-color: #007bff;
}

.vd-gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

.vd-gallery-empty i {
    margin-bottom: 1rem;
    display: block;
}

/* ==================== TITLE / META ==================== */
.vd-vehicle-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #212529;
    line-height: 1.3;
}

.vd-variant {
    font-size: 0.85em;
    font-weight: 400;
    color: #6c757d;
    display: block;
}

.vd-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.vd-meta-pills span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #495057;
    background: #f1f3f5;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.vd-meta-pills span i {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Badges */
.vd-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.vd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.vd-badge-cert.score-excellent {
    background: #d4edda;
    color: #155724;
}

.vd-badge-cert.score-good {
    background: #fff3cd;
    color: #856404;
}

.vd-badge-cert.score-fair {
    background: #f8d7da;
    color: #721c24;
}

.vd-badge-condition {
    background: #d1ecf1;
    color: #0c5460;
}

.vd-badge-pending {
    background: #e2e3e5;
    color: #383d41;
}

.vd-badge-featured {
    background: #fff3cd;
    color: #856404;
}

/* Mobile: title below gallery, desktop title hidden */
.vd-title-mobile {
    display: block;
    margin-bottom: 1rem;
}

.vd-title-desktop {
    display: none;
}

/* ==================== SECTIONS ==================== */
.vd-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.vd-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
}

.vd-section-title i {
    margin-right: 0.4rem;
    color: #007bff;
}

/* ==================== KEY HIGHLIGHTS GRID ==================== */
.vd-highlights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.vd-highlight-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.vd-highlight-item > i {
    font-size: 1.25rem;
    color: #007bff;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.vd-highlight-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

.vd-highlight-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
}

/* ==================== SPECS TABLE ==================== */
.vd-specs-table {
    display: flex;
    flex-direction: column;
}

.vd-spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.vd-spec-row:last-child {
    border-bottom: none;
}

.vd-spec-label {
    font-size: 0.85rem;
    color: #6c757d;
    flex: 0 0 40%;
}

.vd-spec-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #212529;
    text-align: right;
    flex: 1;
}

/* ==================== DESCRIPTION ==================== */
.vd-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
}

/* ==================== CERTIFICATION ==================== */
.vd-cert-summary {
    display: flex;
    justify-content: space-around;
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 1rem;
}

.vd-cert-score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.vd-cert-score-card > span {
    font-size: 0.75rem;
    color: #6c757d;
}

.vd-cert-score {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.vd-cert-score.score-excellent {
    background: #d4edda;
    color: #155724;
}

.vd-cert-score.score-good {
    background: #fff3cd;
    color: #856404;
}

.vd-cert-score.score-fair {
    background: #f8d7da;
    color: #721c24;
}

.vd-cert-label {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Rating bars */
.vd-cert-ratings {
    margin-bottom: 1rem;
}

.vd-rating-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.vd-rating-label {
    font-size: 0.8rem;
    color: #6c757d;
    flex: 0 0 80px;
}

.vd-progress {
    flex: 1;
    height: 22px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.vd-progress-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.vd-progress-fill.bg-info { background: #17a2b8; }
.vd-progress-fill.bg-success { background: #28a745; }
.vd-progress-fill.bg-warning { background: #ffc107; color: #212529; }

/* Locked content */
.vd-locked-content {
    text-align: center;
    padding: 1.5rem;
    background: #fff3cd;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

.vd-locked-content i.fa-lock {
    font-size: 2rem;
    color: #856404;
    margin-bottom: 0.5rem;
}

.vd-locked-content h5 {
    margin-bottom: 0.5rem;
}

.vd-locked-content p {
    font-size: 0.85rem;
    color: #856404;
    margin-bottom: 0.75rem;
}

/* Valuator info */
.vd-valuator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 1rem;
}

.vd-valuator-info > i {
    font-size: 1.5rem;
    color: #28a745;
}

.vd-valuator-info div {
    display: flex;
    flex-direction: column;
}

.vd-valuator-info strong {
    font-size: 0.9rem;
}

.vd-valuator-info span {
    font-size: 0.8rem;
    color: #6c757d;
}

/* ==================== DEALER INFO (Admin Only) ==================== */
.vd-dealer-info {
    padding: 0.5rem 0;
}

.vd-dealer-info h5 {
    margin-bottom: 0.5rem;
}

/* ==================== SIDEBAR CARDS ==================== */
.vd-sidebar-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.vd-sidebar-card h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #212529;
}

.vd-sidebar-card h6 i {
    margin-right: 0.3rem;
    color: #007bff;
}

/* Price card */
.vd-price-card {
    background: #f0f7ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.vd-price {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #007bff;
}

.vd-price-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CTA card */
.vd-cta-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

/* Cert mini (sidebar version) */
.vd-cert-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vd-cert-mini > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* Stats list */
.vd-stats-list p {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    color: #495057;
}

.vd-stats-list p:last-child {
    margin-bottom: 0;
}

.vd-stats-list i {
    width: 18px;
    text-align: center;
    margin-right: 0.3rem;
    color: #6c757d;
}

/* ==================== DESKTOP LAYOUT (1024px+) ==================== */
@media (min-width: 1024px) {
    .vd-layout {
        flex-direction: row;
        gap: 2rem;
        padding: 1.5rem 0 3rem;
    }

    .vd-main {
        flex: 0 0 60%;
        max-width: 60%;
    }

    .vd-sidebar {
        flex: 0 0 38%;
        max-width: 38%;
        order: 0; /* Reset order on desktop */
    }

    .vd-sidebar-sticky {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }

    /* Desktop: hide mobile title, show sidebar title */
    .vd-title-mobile {
        display: none;
    }

    .vd-title-desktop {
        display: block;
    }

    /* Larger gallery hero on desktop */
    .vd-gallery-hero {
        aspect-ratio: 16 / 10;
    }

    .vd-thumb {
        flex: 0 0 80px;
        width: 80px;
        height: 60px;
    }

    /* Vehicle name bigger on desktop */
    .vd-vehicle-name {
        font-size: 1.5rem;
    }

    .vd-variant {
        display: inline;
        margin-left: 0.3rem;
    }

    /* 3-column highlights grid on desktop */
    .vd-highlights-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Section padding */
    .vd-section {
        padding: 1.5rem;
    }

    /* Price bigger on desktop */
    .vd-price {
        font-size: 1.8rem;
    }
}

/* ==================== SMALL MOBILE (< 480px) ==================== */
@media (max-width: 480px) {
    .vd-highlights-grid {
        grid-template-columns: 1fr;
    }

    .vd-cert-summary {
        flex-direction: column;
        align-items: center;
    }

    .vd-gallery-hero {
        aspect-ratio: 4 / 3;
    }

    .vd-thumb {
        flex: 0 0 60px;
        width: 60px;
        height: 45px;
    }

    .vd-vehicle-name {
        font-size: 1.15rem;
    }
}

/* ==================== BOOTSTRAP-COMPAT UTILITIES ==================== */

/* Button block */
.btn-block {
    display: block;
    width: 100%;
}

/* Table utilities */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-sm th,
.table-sm td {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

/* Input group */
.vd-input-group {
    display: flex;
    align-items: stretch;
}

.vd-input-addon {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: var(--radius-md, 6px) 0 0 var(--radius-md, 6px);
    font-weight: 600;
    color: #495057;
}

.vd-input-group .form-control {
    border-radius: 0 var(--radius-md, 6px) var(--radius-md, 6px) 0;
}

/* Badge colors (used in certification section) */
.badge-success { background-color: #28a745; color: #fff; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-info { background-color: #17a2b8; color: #fff; }
.badge-danger { background-color: #dc3545; color: #fff; }

/* Text color utilities */
.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }

/* Extra spacing utilities not in core */
.mt-5 { margin-top: 3rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }

/* Vehicle info in inquiry modal */
.vd-modal-vehicle-info {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

/* ==================== MODAL OVERLAY ==================== */
.vd-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.vd-modal-overlay.active {
    display: flex;
}

.vd-modal-dialog {
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.vd-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.vd-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.vd-modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.vd-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.vd-modal-close:hover {
    color: #212529;
}

.vd-modal-body {
    padding: 1.25rem;
}

.vd-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
}

/* ==================== CHECKLIST TABLE ==================== */
.vd-checklist {
    margin-top: 1rem;
}

.vd-checklist h5 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.vd-checklist .table {
    width: 100%;
    border-collapse: collapse;
}

.vd-checklist .table th,
.vd-checklist .table td {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
}

.vd-checklist .table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* ==================== ISSUES SECTION ==================== */
.vd-issues {
    margin-top: 1rem;
}
