:root {
    --primary: #f08428;        /* naranja del logo */
    --primary-hover: #d46d12;
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text-dark: #1e2530;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif; 
    background: var(--bg); 
    color: var(--text-dark); 
    padding: 16px 12px;
    overflow-x: hidden;
    width: 100%;
}
.container { max-width: 1240px; margin: 0 auto; width: 100%; }

/* Cabecera con el logo y el lema */
.site-header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.site-logo { display: block; line-height: 0; }
.site-logo img { height: 68px; width: auto; }
.site-lema { color: var(--text-muted); font-size: 15px; font-weight: 600; padding-left: 18px; border-left: 2px solid var(--primary); }
.site-contacto { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* Botones de contacto (teléfono y WhatsApp) */
.btn-contacto { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; transition: background 0.2s; white-space: nowrap; }
.btn-telefono { background: #fff; color: var(--text-dark); border-color: var(--border); }
.btn-telefono:hover { background: #e5e7eb; }
.btn-whatsapp { background: #1a9e4b; color: #fff; }
.btn-whatsapp:hover { background: #158540; }
.btn-grande { font-size: 15px; padding: 13px 18px; flex: 1 1 220px; }
.contacto-ficha { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.contacto-ficha p { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.contacto-botones { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buscador del catálogo */
.buscador { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; }
.buscador-plegable { flex: 1 1 600px; min-width: 0; }
.buscador-plegable summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 6px 0; list-style-position: inside; }
.buscador-activo { color: var(--primary-hover); font-weight: 600; font-size: 13px; }
.buscador-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; margin-top: 10px; }
.buscador-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.buscador-campo label, .buscador-etiqueta, .buscador-orden label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.buscador-rango > div { display: flex; gap: 6px; }
.buscador-rango > div > * { flex: 1; min-width: 0; }
.buscador select, .buscador input { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-dark); }
.buscador select:disabled { background: #f3f4f6; color: var(--text-muted); }
.buscador input::placeholder { color: #a0a7b4; }
.buscador-acciones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn-buscar { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 9px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.btn-buscar:hover { background: var(--primary-hover); }
.btn-limpiar { color: var(--text-dark); font-weight: 600; font-size: 14px; }
.buscador-nota { color: var(--text-muted); font-size: 12px; }
.buscador-orden { display: flex; flex-direction: column; gap: 4px; margin-left: auto; min-width: 220px; }
.empty-box p + p { margin-top: 12px; }

/* Barra superior */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.top-bar h1 { font-size: 22px; font-weight: 700; line-height: 1.2; }
.top-bar-left { display: flex; flex-direction: column; gap: 4px; }
.sync-info { color: var(--text-muted); font-size: 13px; }
.badge-count { background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 99px; }
.btn-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-dark); background: #fff; border: 1px solid var(--border); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: background 0.2s; }
.btn-back:hover { background: #e5e7eb; }

/* Matrícula */
.plate { display: inline-flex; align-items: center; background: #fff; border: 2px solid #111; border-radius: 5px; font-weight: 800; font-size: 13px; letter-spacing: 1px; padding: 1px 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.plate::before { content: "E"; background: #003399; color: #ffcc00; font-size: 9px; font-weight: 900; padding: 2px 4px; border-radius: 2px; margin-right: 6px; }

/* Placeholder de imagen */
.img-placeholder { width: 100%; height: 100%; min-height: 220px; background: #0b0f19; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; font-weight: 500; border-radius: 12px; }
.img-placeholder svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.5; margin-bottom: 6px; }

/* ================= VISTA CATÁLOGO (GRID) ================= */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.moto-card { background: var(--card-bg); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 4px 10px rgba(0,0,0,0.03); transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.moto-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.moto-card-img { width: 100%; height: 200px; background: #0b0f19; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.moto-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.moto-card-body { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; }
.card-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; line-height: 1.25; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); }
.price-consultar { color: var(--primary); font-weight: 700; font-size: 15px; letter-spacing: 0.3px; text-transform: uppercase; }

/* ================= VISTA DETALLE ================= */
.detail-wrapper { 
    background: #fff; 
    border-radius: 16px; 
    border: 1px solid var(--border); 
    padding: 24px; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.04); 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    gap: 32px; 
    width: 100%;
}

/* Galería con mantenimiento de proporción vertical/horizontal */
.gallery { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    width: 100%; 
    min-width: 0; 
}
.main-img { 
    width: 100%; 
    height: 380px; 
    border-radius: 12px; 
    overflow: hidden; 
    background: #0b0f19; 
    position: relative; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-img img { 
    max-width: 100%; 
    max-height: 100%; 
    width: auto; 
    height: auto; 
    object-fit: contain; 
    display: block; 
    margin: auto;
}
.zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(11, 15, 25, 0.75);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Miniaturas inferiores */
.thumb-list { 
    display: flex; 
    gap: 8px; 
    overflow-x: auto; 
    padding: 4px 2px 8px 2px; 
    width: 100%; 
    -webkit-overflow-scrolling: touch;
}
.thumb-list::-webkit-scrollbar { height: 6px; }
.thumb-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.thumb-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.thumb-item { 
    width: 72px; 
    height: 72px; 
    border-radius: 8px; 
    overflow: hidden; 
    cursor: pointer; 
    border: 2px solid transparent; 
    flex-shrink: 0; 
    background: #0b0f19;
    transition: border-color 0.15s;
}
.thumb-item.active { border-color: var(--primary); }
.thumb-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
}

/* Ficha técnica */
.detail-info { width: 100%; min-width: 0; }
.detail-header { margin-bottom: 20px; }
.detail-header h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; word-break: break-word; }
.price-banner { background: #fff7ed; border-left: 4px solid var(--primary); padding: 12px 16px; font-size: 16px; font-weight: 700; color: #9a3412; margin-bottom: 20px; border-radius: 4px; }

.specs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.spec-box { background: #f8fafc; border: 1px solid var(--border); padding: 12px 14px; border-radius: 8px; }
.spec-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.spec-val { font-size: 15px; font-weight: 700; color: var(--text-dark); }

.section-box { margin-top: 16px; background: #fbfbfc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.section-box h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; color: var(--text-muted); }
.section-box p { font-size: 14px; line-height: 1.5; color: #374151; white-space: pre-wrap; word-break: break-word; }

/* ================= VÍDEOS ================= */
.badge-video { position: absolute; top: 10px; left: 10px; background: rgba(11, 15, 25, 0.78); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; backdrop-filter: blur(4px); }
.play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.play-overlay[hidden] { display: none; }
.play-overlay span { width: 76px; height: 76px; border-radius: 50%; background: rgba(11, 15, 25, 0.6); border: 2px solid rgba(255, 255, 255, 0.85); display: flex; align-items: center; justify-content: center; }
.play-overlay svg { width: 30px; height: 30px; fill: #fff; margin-left: 4px; }
.thumb-item { position: relative; }
.thumb-item.is-video::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 26px no-repeat; }
/* Vídeo dentro del visor a pantalla completa */
.pswp-video { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pswp-video iframe { width: min(92vw, 960px); height: 86vh; border: 0; background: #000; border-radius: 8px; }
/* Con vídeos no se puede deslizar sobre el reproductor: mostrar siempre las flechas */
.pswp__button--arrow { visibility: visible !important; }

/* Pantallas móviles */
@media (max-width: 860px) { 
    body { padding: 12px 8px; }
    .detail-wrapper { 
        grid-template-columns: 1fr; 
        padding: 16px 12px; 
        gap: 20px; 
        border-radius: 12px;
    }
    .main-img { 
        height: 280px; 
    }
    .thumb-item {
        width: 64px;
        height: 64px;
    }
    .specs-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px; 
    }
    .site-header { gap: 12px; }
    .site-logo img { height: 50px; }
    .site-lema { font-size: 13px; padding-left: 12px; }
    .site-contacto { margin-left: 0; width: 100%; }
    .buscador { padding: 10px 12px; }
    .buscador-orden { margin-left: 0; width: 100%; min-width: 0; }
    .buscador-campos { grid-template-columns: 1fr; }
    .site-contacto .btn-contacto { flex: 1; }
    .detail-header h1 { 
        font-size: 20px; 
    }
}

/* ================= Antes eran estilos en línea en el HTML ================= */
.empty-box { text-align: center; padding: 60px 20px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.empty-box p { color: var(--text-muted); font-size: 16px; }
.no-disponible { margin-bottom: 28px; }
.no-disponible h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.seccion-titulo { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.card-year { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.card-price-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.detail-sub { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
