/* ==========================================================================
   SMP XML Viewer — Stylesheet
   ========================================================================== */

.smp-xv-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 16px 40px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.smp-xv-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.smp-xv-dealer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.smp-xv-count {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

/* ── Filters ──────────────────────────────────────────────────────────────── */

.smp-xv-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 28px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.smp-xv-input,
.smp-xv-select {
    padding: 9px 13px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fff;
    color: #374151;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    height: 40px;
}

.smp-xv-input {
    flex: 1;
    min-width: 180px;
}

.smp-xv-select {
    min-width: 160px;
    cursor: pointer;
}

.smp-xv-input:focus,
.smp-xv-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.smp-xv-btn-reset {
    padding: 9px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
    height: 40px;
    white-space: nowrap;
}

.smp-xv-btn-reset:hover {
    border-color: #9ca3af;
    color: #374151;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */

.smp-xv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

@media (max-width: 960px) {
    .smp-xv-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
    .smp-xv-grid { grid-template-columns: 1fr; }
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.smp-xv-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.18s;
    display: flex;
    flex-direction: column;
}

.smp-xv-card:hover,
.smp-xv-card:focus-visible {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11);
    transform: translateY(-3px);
    outline: none;
}

.smp-xv-card.smp-xv-hidden {
    display: none !important;
}

/* Thumbnail */
.smp-xv-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #f3f4f6;
    overflow: hidden;
    flex-shrink: 0;
}

.smp-xv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.smp-xv-card:hover .smp-xv-thumb img {
    transform: scale(1.05);
}

.smp-xv-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4c9d4;
}

.smp-xv-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Card body */
.smp-xv-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.smp-xv-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 3px;
    line-height: 1.25;
}

.smp-xv-make  { color: #2563eb; }
.smp-xv-model { margin-left: 5px; color: #111827; }

.smp-xv-version {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 0 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smp-xv-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.smp-xv-specs li {
    font-size: 0.8rem;
    color: #4b5563;
    background: #f3f4f6;
    padding: 3px 9px;
    border-radius: 999px;
}

.smp-xv-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.smp-xv-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
}

.smp-xv-btn-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2563eb;
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.15s;
    white-space: nowrap;
}

.smp-xv-card:hover .smp-xv-btn-cta {
    border-bottom-color: #2563eb;
}

/* ── No results ───────────────────────────────────────────────────────────── */

.smp-xv-no-results {
    text-align: center;
    padding: 56px 16px;
    color: #9ca3af;
    font-size: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed #e5e7eb;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.smp-xv-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.smp-xv-pg-btn {
    padding: 8px 14px;
    min-width: 40px;
    text-align: center;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1;
}

.smp-xv-pg-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.smp-xv-pg-btn.smp-xv-pg-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    font-weight: 600;
}

.smp-xv-pg-ellipsis {
    padding: 8px 4px;
    color: #9ca3af;
    font-size: 0.88rem;
    line-height: 1;
    align-self: center;
}

/* ── Modal overlay ────────────────────────────────────────────────────────── */

.smp-xv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: smpXvFadeIn 0.18s ease;
    backdrop-filter: blur(2px);
}

@keyframes smpXvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.smp-xv-modal {
    background: #fff;
    border-radius: 18px;
    max-width: 780px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.22);
    animation: smpXvSlideUp 0.2s ease;
}

@keyframes smpXvSlideUp {
    from { transform: translateY(22px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.smp-xv-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #374151;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 5;
    line-height: 1;
}

.smp-xv-modal-close:hover { background: rgba(0, 0, 0, 0.15); }

/* Modal gallery */
.smp-xv-gallery {
    position: relative;
    background: #111;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    height: 320px;
}

.smp-xv-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.smp-xv-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    background: #f3f4f6;
}

.smp-xv-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.15s;
    z-index: 4;
}

.smp-xv-gallery-nav:hover { background: #fff; }
.smp-xv-gallery-nav.prev  { left: 12px; }
.smp-xv-gallery-nav.next  { right: 12px; }

.smp-xv-gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 999px;
}

/* Modal content */
.smp-xv-modal-content {
    padding: 22px 24px 28px;
}

.smp-xv-modal-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 3px;
    line-height: 1.2;
    padding-right: 40px; /* space for close btn */
}

.smp-xv-modal-make  { color: #2563eb; }
.smp-xv-modal-model { color: #111827; margin-left: 6px; }

.smp-xv-modal-version {
    font-size: 0.88rem;
    color: #6b7280;
    margin: 0 0 16px;
}

.smp-xv-modal-price-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 22px;
}

.smp-xv-modal-price {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
}

.smp-xv-modal-list-price {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Specs grid */
.smp-xv-modal-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

@media (max-width: 540px) {
    .smp-xv-modal-specs { grid-template-columns: repeat(2, 1fr); }
    .smp-xv-gallery     { height: 220px; }
}

.smp-xv-spec {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 11px 14px;
}

.smp-xv-spec-label {
    font-size: 0.68rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 3px;
}

.smp-xv-spec-value {
    font-size: 0.93rem;
    font-weight: 600;
    color: #111827;
}

/* Equipments */
.smp-xv-eq-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    margin: 0 0 10px;
}

.smp-xv-eq-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.smp-xv-eq-tag {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 500;
}

/* CTA link */
.smp-xv-modal-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 13px 28px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.18s;
}

.smp-xv-modal-cta:hover { background: #1d4ed8; }

/* ── Error ────────────────────────────────────────────────────────────────── */

.smp-xv-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
}

/* ── Mobile overrides ─────────────────────────────────────────────────────── */

@media (max-width: 540px) {
    .smp-xv-filters  { flex-direction: column; }
    .smp-xv-input,
    .smp-xv-select,
    .smp-xv-btn-reset { width: 100%; min-width: 0; }
    .smp-xv-header    { flex-direction: column; gap: 4px; }
    .smp-xv-modal     { border-radius: 14px; }
    .smp-xv-modal-content { padding: 16px 16px 22px; }
    .smp-xv-modal-price   { font-size: 1.5rem; }
    .smp-xv-modal-title   { font-size: 1.25rem; }
}
