/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    --dm-c-bg:        #f8f8f6;
    --dm-c-surface:   #ffffff;
    --dm-c-text:      #1a1a1a;
    --dm-c-muted:     #6b7280;
    --dm-c-border:    #e5e7eb;
    --dm-c-primary:   #1d3461;
    --dm-c-primary-h: #16275a;
    --dm-c-accent:    #e63946;
    --dm-c-green:     #16a34a;
    --dm-c-yellow:    #b45309;
    --dm-c-wa:        #25d366;

    --dm-radius-lg:   14px;
    --dm-shadow-sm:   0 1px 3px rgb(0 0 0 / .08);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.dm-page {
    background: var(--dm-c-bg);
    min-height: 60vh;
}

.dm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Page Header ─────────────────────────────────────────────────────────── */
.dm-page__header {
    background: var(--dm-c-primary);
    color: #fff;
    padding: 40px 0 32px;
}

.dm-page__title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    margin: 0;
    color: #fff;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.dm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    color: var(--dm-c-muted);
    padding: 20px 0 0;
}
.dm-breadcrumb a { color: var(--dm-c-primary); text-decoration: none; }
.dm-breadcrumb a:hover { text-decoration: underline; }

/* ─── Archive layout ─────────────────────────────────────────────────────── */
.dm-inventory-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 48px;
    align-items: start;
}

@media (max-width: 767px) {
    .dm-inventory-wrap { grid-template-columns: 1fr; }
    .dm-filters { position: static !important; }
}

/* ─── Filters ────────────────────────────────────────────────────────────── */
.dm-filters {
    background: var(--dm-c-surface);
    border: 1px solid var(--dm-c-border);
    border-radius: var(--dm-radius-lg);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.dm-filters__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: .9375rem;
}

.dm-filters__clear {
    background: none;
    border: none;
    color: var(--dm-c-primary);
    font-size: .8125rem;
    cursor: pointer;
    padding: 0;
}
.dm-filters__clear:hover { text-decoration: underline; }

.dm-filters__group { margin-bottom: 14px; }

.dm-filters__label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--dm-c-muted);
    margin-bottom: 5px;
}

.dm-filters__input,
.dm-filters__select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--dm-c-border);
    border-radius: var(--dm-radius);
    font-size: .9rem;
    background: var(--dm-c-bg);
    color: var(--dm-c-text);
    outline: none;
    transition: border-color var(--dm-transition);
}
.dm-filters__input:focus,
.dm-filters__select:focus { border-color: var(--dm-c-primary); }

.dm-filters__btn { width: 100%; margin-top: 8px; }

/* ─── Results toolbar ────────────────────────────────────────────────────── */
.dm-results__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.dm-results__count { font-size: .875rem; color: var(--dm-c-muted); }

/* ─── Vehicle Grid ───────────────────────────────────────────────────────── */
.dm-vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* ─── Vehicle Card ───────────────────────────────────────────────────────── */
.dm-vehicle-card {
    background: var(--dm-c-surface);
    border: 1px solid var(--dm-c-border);
    border-radius: var(--dm-radius-lg);
    overflow: hidden;
    transition: transform var(--dm-transition), box-shadow var(--dm-transition);
}
.dm-vehicle-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--dm-shadow-md);
}
.dm-vehicle-card--unavailable { opacity: .75; }

.dm-vehicle-card__photo-link {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}
.dm-vehicle-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}
.dm-vehicle-card:hover .dm-vehicle-card__photo { transform: scale(1.04); }

.dm-vehicle-card__no-photo {
    width: 100%;
    height: 100%;
    background: var(--dm-c-border);
}

.dm-vehicle-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dm-vehicle-card__badge--sold { background: var(--dm-c-accent); color: #fff; }
.dm-vehicle-card__badge--reserved { background: #f59e0b; color: #fff; }

.dm-vehicle-card__body { padding: 16px; }

.dm-vehicle-card__title {
    font-size: .9375rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}
.dm-vehicle-card__title a {
    color: var(--dm-c-text);
    text-decoration: none;
}
.dm-vehicle-card__title a:hover { color: var(--dm-c-primary); }

.dm-vehicle-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: .8125rem;
    color: var(--dm-c-muted);
    margin-bottom: 12px;
}

.dm-vehicle-card__price-row { display: flex; align-items: baseline; gap: 8px; }

.dm-vehicle-card__price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dm-c-primary);
}
.dm-vehicle-card__price-old {
    font-size: .875rem;
    color: var(--dm-c-muted);
    text-decoration: line-through;
}

/* ─── Skeleton ───────────────────────────────────────────────────────────── */
.dm-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: dm-shimmer 1.2s infinite;
    min-height: 280px;
    border-radius: var(--dm-radius-lg);
}
@keyframes dm-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.dm-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--dm-c-muted);
    padding: 40px 0;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.dm-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
}
.dm-pagination__btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--dm-c-border);
    border-radius: var(--dm-radius);
    background: var(--dm-c-surface);
    cursor: pointer;
    font-size: .875rem;
    transition: background var(--dm-transition), color var(--dm-transition);
}
.dm-pagination__btn:hover,
.dm-pagination__btn.is-active {
    background: var(--dm-c-primary);
    color: #fff;
    border-color: var(--dm-c-primary);
}

/* ─── Vehicle Detail ─────────────────────────────────────────────────────── */
.dm-vehicle-detail {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    padding: 32px 0;
    align-items: start;
}

@media (max-width: 900px) {
    .dm-vehicle-detail { grid-template-columns: 1fr; }
}

/* Gallery */
.dm-gallery__main {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--dm-radius-lg);
    overflow: hidden;
    background: var(--dm-c-border);
}
.dm-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dm-gallery__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: .8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dm-gallery__badge--sold     { background: var(--dm-c-accent); color: #fff; }
.dm-gallery__badge--reserved { background: #f59e0b; color: #fff; }

.dm-gallery__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.dm-gallery__thumb {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color var(--dm-transition);
}
.dm-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.dm-gallery__thumb.is-active { border-color: var(--dm-c-primary); }
.dm-gallery__no-photo { width: 100%; height: 100%; background: var(--dm-c-border); }

/* Info panel */
.dm-vehicle-detail__info {
    position: sticky;
    top: 20px;
}

.dm-vehicle-detail__title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.dm-vehicle-detail__subtitle {
    color: var(--dm-c-muted);
    font-size: .9375rem;
    margin: 0 0 20px;
}

.dm-vehicle-detail__price-block {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 24px;
}
.dm-vehicle-detail__price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dm-c-primary);
}
.dm-vehicle-detail__price-old {
    font-size: 1.1rem;
    color: var(--dm-c-muted);
    text-decoration: line-through;
}

.dm-vehicle-detail__specs {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    border: 1px solid var(--dm-c-border);
    border-radius: var(--dm-radius-lg);
    overflow: hidden;
}
.dm-vehicle-detail__specs li {
    display: flex;
    justify-content: space-between;
    padding: 11px 16px;
    font-size: .9rem;
    border-bottom: 1px solid var(--dm-c-border);
}
.dm-vehicle-detail__specs li:last-child { border-bottom: none; }
.dm-vehicle-detail__specs span { color: var(--dm-c-muted); }
.dm-vehicle-detail__specs strong { font-weight: 600; }

.dm-vehicle-detail__cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ─── Description ────────────────────────────────────────────────────────── */
.dm-vehicle-description {
    padding: 32px 0 48px;
    border-top: 1px solid var(--dm-c-border);
    max-width: 760px;
}
.dm-vehicle-description h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 16px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.dm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--dm-radius);
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background var(--dm-transition), color var(--dm-transition), border-color var(--dm-transition), transform var(--dm-transition);
}
.dm-btn:active { transform: scale(.98); }

.dm-btn--primary {
    background: var(--dm-c-primary);
    color: #fff;
    border-color: var(--dm-c-primary);
}
.dm-btn--primary:hover { background: var(--dm-c-primary-h); border-color: var(--dm-c-primary-h); }

.dm-btn--whatsapp {
    background: var(--dm-c-wa);
    color: #fff;
    border-color: var(--dm-c-wa);
}
.dm-btn--whatsapp:hover { background: #22c55e; border-color: #22c55e; }

.dm-btn--lg { padding: 15px 28px; font-size: 1rem; }
.dm-btn--full { width: 100%; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.dm-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dm-modal[hidden] { display: none; }

.dm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / .55);
}

.dm-modal__box {
    position: relative;
    background: var(--dm-c-surface);
    border-radius: var(--dm-radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--dm-shadow-md);
}

.dm-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dm-c-muted);
    line-height: 1;
    padding: 4px;
}
.dm-modal__close:hover { color: var(--dm-c-text); }

.dm-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px;
}
.dm-modal__subtitle {
    font-size: .875rem;
    color: var(--dm-c-muted);
    margin: 0 0 20px;
}

/* ─── Lead Form ──────────────────────────────────────────────────────────── */
.dm-lead-form__group { margin-bottom: 14px; }

.dm-lead-form__label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--dm-c-muted);
    margin-bottom: 5px;
}
.dm-lead-form__label span { color: var(--dm-c-accent); }

.dm-lead-form__input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--dm-c-border);
    border-radius: var(--dm-radius);
    font-size: .9375rem;
    background: var(--dm-c-bg);
    color: var(--dm-c-text);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--dm-transition);
}
.dm-lead-form__input:focus { border-color: var(--dm-c-primary); }
.dm-lead-form__textarea { resize: vertical; min-height: 80px; }

.dm-lead-form__consent {
    margin: 8px 0 16px;
}

.dm-lead-form__consent-label {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .8rem;
    color: var(--dm-c-muted);
    line-height: 1.5;
    cursor: pointer;
}

.dm-lead-form__consent-label input[type="checkbox"] {
    margin-top: .2rem;
    flex-shrink: 0;
    accent-color: var(--dm-c-primary);
}

.dm-lead-form__consent-label a {
    color: var(--dm-c-primary);
    text-decoration: underline;
}

.dm-lead-form__feedback {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--dm-radius);
    font-size: .875rem;
    font-weight: 500;
}
.dm-lead-form__feedback--success { background: #d1fae5; color: #065f46; }
.dm-lead-form__feedback--error   { background: #fee2e2; color: #991b1b; }
