:root {
      --dark: #0d0d0d;
      --mid: #1a1a1a;
      --accent: #d73925;
      --accent-hover: #c42e1e;
      --light: #f5f3ef;
      --muted: #6b6b6b;
      --border: #e0ddd8;
      --card-bg: #ffffff;
      --sidebar-bg: #ffffff;
      --wa-green: #25D366;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
      background: var(--light);
      color: var(--dark);
      font-weight: 300;
      font-size: 15px;
    }

    h1,h2,h3,h4 {  font-weight: 300; }

    /* ─── NAV ─────────────────────────────────── */
    .topnav {
      background: var(--dark);
      padding: 1rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 1000;
    }
    .brand {
      
      font-size: 1.5rem;
      font-weight: 600;
      color: var(--accent);
      text-decoration: none;
      letter-spacing: 0.06em;
    }
    .nav-links a {
      color: #bbb;
      font-size: 0.78rem;
      font-weight: 400;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      text-decoration: none;
      margin-left: 1.75rem;
      transition: color 0.2s;
    }
    .nav-links a:hover, .nav-links a.active { color: var(--accent); }

    /* ─── HERO STRIP ──────────────────────────── */
    .catalog-hero {
      background: var(--dark);
      padding: 2rem 2rem 2.5rem;
      border-bottom: 1px solid #222;
    }
    .catalog-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: #fff; line-height: 1.1; }
    .catalog-hero h1 em { color: var(--accent); font-style: italic; }
    .catalog-hero p { color: #888; font-size: 0.88rem; margin-top: 0.5rem; }

    /* ─── LAYOUT ──────────────────────────────── */
    .main-layout {
      display: grid;
      grid-template-columns: 260px 1fr;
      gap: 0;
      min-height: calc(100vh - 60px);
    }

    /* ─── SIDEBAR ─────────────────────────────── */
    .sidebar {
      background: var(--sidebar-bg);
      border-right: 1px solid var(--border);
      padding: 1.75rem 1.5rem;
      position: sticky;
      top: 61px;
      height: calc(100vh - 61px);
      overflow-y: auto;
    }
    .sidebar-title {
      font-size: 0.65rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 1.5rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border);
    }
    .filter-group { margin-bottom: 1.75rem; }
    .filter-label {
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--dark);
      font-weight: 500;
      margin-bottom: 0.85rem;
      display: block;
    }
    .check-item {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      margin-bottom: 0.55rem;
      cursor: pointer;
    }
    .check-item input[type="checkbox"] {
      width: 14px; height: 14px;
      accent-color: var(--accent);
      cursor: pointer;
    }
    .check-item label {
      font-size: 0.85rem;
      color: #444;
      cursor: pointer;
      user-select: none;
    }
    .check-item label span {
      font-size: 0.72rem;
      color: var(--muted);
      margin-left: 4px;
    }

    .range-group { padding: 0 2px; }
    .range-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 0.5rem;
    }
    input[type="range"] {
      width: 100%;
      accent-color: var(--accent);
      height: 3px;
      margin: 0.5rem 0;
    }
    .year-inputs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .year-input {
      border: 1px solid var(--border);
      padding: 0.4rem 0.6rem;
      font-size: 0.82rem;
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
      color: var(--dark);
      width: 100%;
      background: #fff;
    }
    .year-input:focus { outline: none; border-color: var(--accent); }

    .btn-filter-reset {
      width: 100%;
      border: 1px solid var(--border);
      background: transparent;
      padding: 0.5rem;
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted);
      cursor: pointer;
      margin-top: 0.5rem;
      transition: all 0.2s;
    }
    .btn-filter-reset:hover { border-color: var(--accent); color: var(--accent); }

    /* ─── CATALOG AREA ────────────────────────── */
    .catalog-area { padding: 2rem; }

    .toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
      gap: 1rem;
    }
    .result-count {
      font-size: 0.82rem;
      color: var(--muted);
    }
    .result-count strong { color: var(--dark); font-weight: 500; }

    .sort-select {
      border: 1px solid var(--border);
      background: #fff;
      padding: 0.4rem 0.8rem;
      font-size: 0.8rem;
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
      color: var(--dark);
      cursor: pointer;
    }
    .sort-select:focus { outline: none; border-color: var(--accent); }

    /* ─── VEHICLE CARDS ───────────────────────── */
    .vehicles-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 1.25rem;
    }

    .vcard {
      background: var(--card-bg);
      border: 1px solid var(--border);
      cursor: pointer;
      transition: box-shadow 0.25s, transform 0.2s;
      position: relative;
      overflow: hidden;
      border-radius: 5px;
    }
    .vcard:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.1); transform: translateY(-2px); }

    .vcard-img {
      width: 100%;
      height: 185px;
      object-fit: cover;
      display: block;
      background: #e8e5e0;
      position: relative;
      overflow: hidden;
    }
    .vcard-img-ph {
      width: 100%; height: 185px;
      background: linear-gradient(135deg, #e8e5e0, #d8d4ce);
      display: flex; align-items: center; justify-content: center;
    }
    .vcard-img-ph svg { width: 52px; height: 52px; stroke: #b8b4ae; fill: none; }

    .vcard-badge {
      position: absolute;
      top: 12px; left: 12px;
      background: var(--dark);
      color: var(--accent);
      font-size: 0.6rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 3px 8px;
    }
    .vcard-badge.nuevo { background: var(--accent); color: var(--dark); }

    .vcard-body { padding: 1.25rem; }
    .vcard-brand {
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 0.25rem;
    }
    .vcard-name {
      
      font-size: 1.3rem;
      font-weight: 400;
      line-height: 1.2;
      margin-bottom: 0.35rem;
    }
    .vcard-specs {
      font-size: 0.78rem;
      color: var(--muted);
      margin-bottom: 0.9rem;
    }
    .vcard-specs span { margin-right: 10px; }
    .vcard-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 0.9rem;
      border-top: 1px solid var(--border);
    }
    .vcard-price {
      
      font-size: 1.4rem;
      font-weight: 400;
      color: var(--dark);
    }
    .vcard-price small {
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
      font-size: 0.65rem;
      color: var(--muted);
      display: block;
      font-weight: 300;
    }
    .btn-ver {
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--dark);
      border: 1px solid var(--border);
      background: transparent;
      padding: 0.4rem 0.9rem;
      cursor: pointer;
      transition: all 0.2s;
      text-decoration: none;
    }
    .btn-ver:hover { border-color: var(--accent); color: var(--accent); }

    /* ─── DETAIL PAGE ─────────────────────────── */
    .detail-page { display: none; padding: 2rem; }

    .back-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted);
      cursor: pointer;
      border: none;
      background: none;
      margin-bottom: 1.75rem;
      transition: color 0.2s;
    }
    .back-btn:hover { color: var(--accent); }
    .back-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
    .back-btn i { font-size: 0.9rem; }

    .detail-grid {
      display: grid;
      grid-template-columns: 1.1fr 0.9fr;
      gap: 2.5rem;
      align-items: start;
    }

    /* Gallery */
    .gallery-main {
      width: 100%;
      aspect-ratio: 4/3;
      background: #e8e5e0;
      overflow: hidden;
      margin-bottom: 0.75rem;
      position: relative;
    }
    .gallery-main img,
    .gallery-main-img {
      width: 100%; height: 100%;
      object-fit: cover;
      display: block;
    }
    .gallery-main-ph {
      width: 100%; height: 100%;
      background: linear-gradient(135deg, #e0ddd8, #ccc9c3);
      display: flex; align-items: center; justify-content: center;
    }
    .gallery-main-ph svg { width: 80px; height: 80px; stroke: #b0ada8; fill: none; }

    .gallery-thumbs {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
    }
    .gallery-thumb {
      aspect-ratio: 4/3;
      background: #e0ddd8;
      cursor: pointer;
      overflow: hidden;
      border: 2px solid transparent;
      transition: border-color 0.15s;
    }
    .gallery-thumb.active { border-color: var(--accent); }
    .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .gallery-thumb-ph {
      width: 100%; height: 100%;
      background: linear-gradient(135deg, #e8e5e0, #d8d4ce);
      display: flex; align-items: center; justify-content: center;
    }
    .gallery-thumb-ph svg { width: 22px; height: 22px; stroke: #b8b4ae; fill: none; }

    /* Detail info panel */
    .detail-brand {
      font-size: 0.7rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 0.35rem;
    }
    .detail-title {
      font-size: clamp(1.8rem, 3.5vw, 2.8rem);
      line-height: 1.1;
      margin-bottom: 0.4rem;
    }
    .detail-year-badge {
      display: inline-block;
      border: 1px solid var(--border);
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      padding: 2px 10px;
      color: var(--muted);
      margin-bottom: 1.25rem;
    }
    .detail-price-box {
      background: var(--dark);
      padding: 1.25rem 1.5rem;
      margin-bottom: 1.5rem;
    }
    .detail-price-label {
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: #888;
      margin-bottom: 0.25rem;
    }
    .detail-price-val {
      
      font-size: 2.4rem;
      color: var(--accent);
      line-height: 1;
    }
    .detail-price-note {
      font-size: 0.72rem;
      color: #666;
      margin-top: 0.3rem;
    }

    .specs-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1px;
      border: 1px solid var(--border);
      background: var(--border);
      margin-bottom: 1.5rem;
    }
    .spec-item {
      background: #fff;
      padding: 0.85rem 1rem;
    }
    .spec-key {
      font-size: 0.65rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 0.2rem;
    }
    .spec-val {
      font-size: 0.92rem;
      font-weight: 400;
      color: var(--dark);
    }

    .detail-desc {
      font-size: 0.88rem;
      color: var(--muted);
      line-height: 1.85;
      margin-bottom: 1.75rem;
    }

    /* WhatsApp button */
    .btn-wa {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      background: var(--wa-green);
      color: #fff;
      border: none;
      padding: 1rem;
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
      font-size: 0.85rem;
      font-weight: 500;
      letter-spacing: 0.04em;
      cursor: pointer;
      text-decoration: none;
      transition: background 0.2s;
      margin-bottom: 0.75rem;
    }
    .btn-wa:hover { background: #1da851; color: #fff; }
    .btn-wa svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
    .btn-wa i { font-size: 1.2rem; }

    .btn-wa-outline {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      background: transparent;
      color: var(--dark);
      border: 1px solid var(--border);
      padding: 0.75rem;
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
      font-size: 0.78rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      cursor: pointer;
      transition: all 0.2s;
      text-decoration: none;
    }
    .btn-wa-outline:hover { border-color: var(--accent); color: var(--accent); }

    .contact-note {
      font-size: 0.75rem;
      color: var(--muted);
      text-align: center;
      margin-top: 0.75rem;
      line-height: 1.6;
    }

    /* ─── EMPTY STATE ─────────────────────────── */
    .empty-state {
      padding: 4rem 2rem;
      text-align: center;
      display: none;
    }
    .empty-state svg { width: 52px; height: 52px; stroke: #ccc; fill: none; margin-bottom: 1rem; }
    .empty-state i { font-size: 2.5rem; color: #ccc; margin-bottom: 1rem; display: inline-block; }
    .empty-state h3 { font-size: 1.4rem; color: #aaa; margin-bottom: 0.5rem; }
    .empty-state p { font-size: 0.85rem; color: #bbb; }

    /* ─── MOBILE SIDEBAR TOGGLE ───────────────── */
    .sidebar-toggle {
      display: none;
      align-items: center;
      gap: 6px;
      background: #fff;
      border: 1px solid var(--border);
      padding: 0.5rem 0.9rem;
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      cursor: pointer;
      color: var(--dark);
    }
    .sidebar-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
    .sidebar-toggle i { font-size: 0.9rem; }

    @media (max-width: 900px) {
      .main-layout { grid-template-columns: 1fr; }
      .sidebar {
        position: fixed;
        left: -280px;
        top: 0; bottom: 0;
        width: 270px;
        z-index: 1100;
        transition: left 0.3s;
        height: 100vh;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
      }
      .sidebar.open { left: 0; }
      .sidebar-toggle { display: flex; }
      .detail-grid { grid-template-columns: 1fr; }
      .nav-links { display: none; }
    }

    @media (max-width: 600px) {
      .catalog-area, .detail-page { padding: 1rem; }
      .vehicles-grid { grid-template-columns: 1fr; }
      .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
    }

    /* Overlay */
    .overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.4);
      z-index: 1050;
    }
    .overlay.show { display: block; }

    /* ─── PHOTO MODAL (LIGHTBOX) ─────────────────── */
    .modal {
      display: none;
      position: fixed;
      z-index: 2000;
      inset: 0;
      background: rgba(0, 0, 0, 0.88);
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    .modal.open {
      display: flex;
    }

    .modal-content {
      position: relative;
      max-width: 90vw;
      max-height: 90vh;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: default;
    }
    .modal-content img {
      max-width: 90vw;
      max-height: 85vh;
      object-fit: contain;
      display: block;
      border-radius: 3px;
      box-shadow: 0 4px 40px rgba(0,0,0,0.5);
    }

    /* Botón cerrar */
    .modal-close {
      position: fixed;
      top: 15px;
      right: 25px;
      font-size: 2.4rem;
      color: #fff;
      cursor: pointer;
      z-index: 2001;
      line-height: 1;
      opacity: 0.7;
      transition: opacity 0.2s;
      user-select: none;
    }
    .modal-close:hover { opacity: 1; }

    /* Flechas de navegación */
    .modal-prev,
    .modal-next {
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      font-size: 2.8rem;
      color: #fff;
      cursor: pointer;
      z-index: 2001;
      padding: 1rem 1.2rem;
      opacity: 0.5;
      transition: opacity 0.2s, background 0.2s;
      user-select: none;
      border-radius: 4px;
      line-height: 1;
    }
    .modal-prev:hover,
    .modal-next:hover { opacity: 1; background: rgba(255,255,255,0.08); }
    .modal-prev { left: 10px; }
    .modal-next { right: 10px; }

    /* Contador (ej: "3 / 8") */
    .modal-counter {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      color: rgba(255,255,255,0.55);
      font-size: 0.82rem;
      letter-spacing: 0.1em;
      z-index: 2001;
      user-select: none;
      background: rgba(0,0,0,0.4);
      padding: 4px 14px;
      border-radius: 12px;
    }

    @media (max-width: 600px) {
      .modal-prev { left: 4px; font-size: 2rem; }
      .modal-next { right: 4px; font-size: 2rem; }
      .modal-close { top: 10px; right: 14px; font-size: 2rem; }
    }