/* [2026-10-22 PS 1.1.0] CSS global de las páginas de despiece: copia de arranque.php (wp_head, #jgare-styles) de oemonepro-despieces 1.2.15 */
/* ── Reset base ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Variables ── */
:root {
    --accent:    #ff6500;
    --accent-dk: #d95200;
    --dark:      #0f1117;
    --mid:       #1e2130;
    --card-bg:   #ffffff;
    --border:    #e8ecf0;
    --txt:       #1a1a2e;
    --txt-muted: #6b7280;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.07);
    --shadow-hover: 0 6px 24px rgba(255,101,0,.18);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Layout ── */
.jg-wrap { max-width: 1500px; margin: 0 auto; padding: 0 20px 80px; font-family: var(--font); color: var(--txt); }

/* ── Breadcrumb ── */
.jg-bc { padding: 18px 0 28px; font-size: 13px; }
.jg-bc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.jg-bc li { display: flex; align-items: center; }
.jg-bc a { color: var(--accent); text-decoration: none; font-weight: 500; }
.jg-bc a:hover { text-decoration: underline; }
.jg-bc .sep { color: #bbb; margin: 0 5px; }

/* ── Page header ── */
.jg-header { border-bottom: 3px solid var(--accent); padding-bottom: 18px; margin-bottom: 36px; }
.jg-header h1 { font-size: clamp(22px, 3vw, 34px); font-weight: 900; margin: 0 0 6px; line-height: 1.15; letter-spacing: -.02em; }
.jg-header .sub { color: var(--txt-muted); font-size: 16px; margin: 0; }

/* ── Navigation pills (volver atrás) ── */
.jg-nav-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.jg-pill { display: inline-flex; align-items: center; gap: 7px; background: #f4f6f9; border: 1px solid var(--border); border-radius: 50px; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--txt); text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.jg-pill:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.jg-pill svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Despiece navigator (prev/next) ── */
.jg-dp-nav { display: flex; gap: 12px; margin: 28px 0 8px; flex-wrap: wrap; }
.jg-dp-nav-btn { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 18px; text-decoration: none; color: var(--txt); transition: border-color .15s, box-shadow .15s; }
.jg-dp-nav-btn:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); color: var(--accent); }
.jg-dp-nav-btn.prev { flex-direction: row; max-width: 50%; }
.jg-dp-nav-btn.next { flex-direction: row-reverse; text-align: right; max-width: 50%; }
.jg-dp-nav-btn .arrow { font-size: 20px; flex-shrink: 0; color: var(--accent); }
.jg-dp-nav-btn .label { font-size: 11px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: .06em; display: block; }
.jg-dp-nav-btn .name { font-size: 14px; font-weight: 700; line-height: 1.3; display: block; }

/* ── Grid de tarjetas ── */
.jg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.jg-card { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px 16px; text-decoration: none; color: var(--txt); display: flex; align-items: center; gap: 14px; transition: box-shadow .2s, border-color .2s, color .2s; box-shadow: var(--shadow); }
.jg-card:hover { box-shadow: var(--shadow-hover); border-color: var(--accent); color: var(--accent); }
.jg-card__icon { font-size: 26px; flex-shrink: 0; }
.jg-card__text { font-size: 15px; font-weight: 700; line-height: 1.3; }

/* ── Tarjeta moto (foto) ── */
.jg-grid--motos { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.jg-card--moto { flex-direction: column; align-items: center; padding: 18px 14px; text-align: center; gap: 12px; }
.jg-card__foto { width: 100%; max-height: 120px; object-fit: contain; border-radius: 6px; }

/* ── Tarjeta despiece ── */
.jg-card--despiece { position: relative; flex-direction: column; align-items: center; padding: 14px 10px 12px; text-align: center; gap: 8px; }
.jg-card__numimg { width: 100px; height: 100px; object-fit: contain; border-radius: 6px; flex-shrink: 0; transition: transform .2s; }
.jg-card--despiece:hover .jg-card__numimg { transform: scale(1.07); }
.jg-card--despiece .jg-card__text { font-size: 12px; }
.jg-card__preview-hint { position: absolute; top: 6px; right: 6px; color: #cbd5e1; font-size: 13px; transition: color .2s; pointer-events: none; }
.jg-card--despiece:hover .jg-card__preview-hint { color: var(--accent); }

/* ── Familia ── */
.jg-familia { margin-bottom: 40px; }
.jg-familia__tit { font-size: 16px; font-weight: 900; color: var(--txt); border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .05em; }
.jg-familia__badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 20px; letter-spacing: 0; text-transform: none; flex-shrink: 0; }

/* ── Sección despiece ── */
.jg-seccion { margin-bottom: 40px; }
.jg-seccion__tit { font-size: 18px; font-weight: 900; color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Tabla despiece (vista A) ── */
.jg-flex { display: flex; gap: 36px; flex-wrap: wrap; margin-top: 24px; align-items: flex-start; }
.jg-col-img { flex: 1; min-width: 280px; position: sticky; top: 20px; }
.jg-col-img img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1.5px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,.09); }
.jg-col-tabla { flex: 1.4; min-width: 320px; }

/* LDJ tabla */
.ldj-container { width: 100%; }
.ldj-row { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; display: table-row; align-items: flex-start; box-shadow: var(--shadow); transition: border-color .15s; }
.ldj-row:hover { border-color: var(--accent); }
.ldj-td-num { width: 48px; flex-shrink: 0; text-align: center; }
.ldj-num-img { width: 40px; height: 40px; object-fit: contain; }
.ldj-td-info { flex: 1; min-width: 200px; }
.ldj-nombre { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.ldj-ref { font-family: monospace; background: #f4f4f4; padding: 3px 8px; border-radius: 5px; font-size: 12px; letter-spacing: .02em; }
.ldj-status-box { font-size: 13px; margin-top: 8px; line-height: 1.5; }
.ldj-td-action { flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ldj-qty-control { display: flex; align-items: center; gap: 4px; }
.ldj-minus, .ldj-plus { background: #f0f0f0; border: none; width: 28px; height: 28px; border-radius: 6px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.ldj-minus:hover, .ldj-plus:hover { background: var(--accent); color: #fff; }
.ldj-q-input { width: 40px; text-align: center; border: 1.5px solid var(--border); border-radius: 6px; padding: 4px; font-size: 14px; font-weight: 700; }
.ldj-btn-add { background: var(--accent); color: #fff !important; padding: 9px 16px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; white-space: nowrap; border: none; cursor: pointer; }
.ldj-btn-add:hover { background: var(--accent-dk); }
.ldj-descatalogado { opacity: .7; }

/* ── Aviso ── */
.jg-aviso { background: #fff8f0; border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 28px; font-size: 14px; color: #555; }

/* ── SEO text ── */
.jg-seo { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--border);}
.jg-seo h2 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.jg-seo p { color: #555; line-height: 1.8; margin-bottom: 12px; font-size: 15px; }

/* ── Tooltip preview ── */
.jg-preview-tooltip { position: fixed; width: 240px; height: 180px; background: #fff; border: 2px solid var(--accent); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 9999; pointer-events: none; overflow: hidden; display: none; padding: 6px; }
.jg-preview-tooltip img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
    /* Wrap: menos padding lateral en móvil */
    .jg-wrap { padding: 0 14px 48px; }

    /* Breadcrumb: más compacto */
    .jg-bc { padding: 12px 0 16px; font-size: 12px; }
    .jg-bc .sep { margin: 0 3px; }

    /* Pills de navegación: scroll horizontal si no caben */
    .jg-nav-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
                    padding-bottom: 4px; margin-bottom: 18px; gap: 8px; }
    .jg-nav-pills::-webkit-scrollbar { display: none; }
    .jg-pill { white-space: nowrap; padding: 7px 12px; font-size: 12px; flex-shrink: 0; }

    /* Header: más compacto */
    .jg-header { padding-bottom: 12px; margin-bottom: 20px; }
    .jg-header h1 { font-size: clamp(18px, 5vw, 26px); }
    .jg-header .sub { font-size: 13px; }

    /* Aviso */
    .jg-aviso { padding: 10px 14px; font-size: 13px; margin-bottom: 18px; }

    /* Prev/Next despieces: stack vertical en pantallas muy pequeñas */
    .jg-dp-nav { gap: 8px; margin: 16px 0 6px; }
    .jg-dp-nav-btn { min-width: 0; flex: 1 1 calc(50% - 4px); padding: 10px 12px; gap: 7px; }
    .jg-dp-nav-btn .label { font-size: 10px; }
    .jg-dp-nav-btn .name { font-size: 12px; }
    .jg-dp-nav-btn .arrow { font-size: 16px; }

    /* Grid tarjetas despiece (Vista B) */
    .jg-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
    .jg-card--despiece { padding: 10px 8px 9px; gap: 6px; }
    .jg-card__numimg { width: 80px; height: 80px; }
    .jg-card__text { font-size: 11px; }
    .jg-card__preview-hint { pointer-events: auto; font-size: 16px; top: 4px; right: 4px;
                              padding: 5px; color: #94a3b8; background: rgba(255,255,255,.9);
                              border-radius: 6px; line-height: 1; }

    /* Grid motos (Vista C) */
    .jg-grid--motos { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .jg-card--moto { padding: 12px 10px 10px; gap: 8px; }
    .jg-card__foto { max-height: 90px; }
    .jg-card__text { font-size: 12px; }

    /* Familias */
    .jg-familia { margin-bottom: 28px; }
    .jg-familia__tit { font-size: 13px; padding-bottom: 8px; margin-bottom: 12px; }
    .jg-seccion { margin-bottom: 28px; }
    .jg-seccion__tit { font-size: 14px; padding-bottom: 7px; margin-bottom: 12px; }

    /* Vista A: imagen arriba, tabla abajo */
    .mr-flex { flex-direction: column; gap: 16px; }
    .mr-col-img { position: static !important; }
    .mr-col-img img { max-height: 450px; object-fit: contain; width: 100%; }
    .mr-col-tabla { min-width: 0; }

    /* Tabla móvil: tarjetas apiladas */
    .ldj-table, .ldj-table thead, .ldj-table tbody,
    .ldj-table tr, .ldj-table td { display: block !important; }
    .ldj-table thead { display: none !important; }
    .ldj-row { position: relative; padding: 12px 12px 12px 52px !important;
                border-bottom: 6px solid #f4f6f9 !important;
                border-left: none !important; border-right: none !important;
                border-top: none !important; background: #fff; }
    .ldj-row:last-child { border-bottom: none !important; }
    .ldj-td-num { position: absolute; left: 10px; top: 12px; width: auto !important;
                   padding: 0 !important; }
    .ldj-td-img { position: absolute; left: 7px; top: 46px; width: 40px !important;
                   padding: 0 !important; }
    .ldj-thumb { width: 36px !important; height: 36px !important; }
    .ldj-td-ref { padding: 0 0 6px !important; border: none !important; }
    .ldj-td-info { padding: 0 0 8px !important; border: none !important;
                    border-top: 1px solid #f0f0f0 !important; padding-top: 8px !important; }
    .ldj-td-action { padding: 0 !important; border: none !important;
                      border-top: 1px solid #f0f0f0 !important; padding-top: 10px !important;
                      min-width: 0 !important; }
    .ldj-action-row { flex-wrap: nowrap; }
    .ldj-btn-add { flex: 1; justify-content: center; }
    .ldj-price-line { font-size: 16px; margin-bottom: 6px; }

    /* SEO text */
    .jg-seo { margin-top: 36px; padding-top: 24px; }
    .jg-seo h2 { font-size: 17px; }
    .jg-seo p { font-size: 14px; line-height: 1.7; }
}

@media (max-width: 400px) {
    .jg-wrap { padding: 0 10px 40px; }
    .jg-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .jg-grid--motos { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    /*.jg-dp-nav-btn .name { display: none; }  solo icono en muy pequeño */
    .jg-dp-nav-btn { flex: 0 0 auto; padding: 10px 16px; }
}

/* Aviso de catálogo inactivo / no encontrado (PrestaShop) */
.oem-aviso { max-width: 640px; margin: 3rem auto; text-align: center; font-size: 1.1rem; }
.oem-pie { font-size: .75rem; color: #999; }

/* [2026-10-22 PS 1.1.0] En WordPress estas páginas iban a todo el ancho (hasta 1500px). El contenedor del tema de
   PrestaShop es más estrecho (≈1110px) y la tabla cortaba el botón "Añadir": se ensancha hasta 1500px, centrado. */
@media (min-width: 1200px) {
  .oem-ps { width: min(1500px, calc(100vw - 48px)); margin-left: calc(50% - min(750px, calc(50vw - 24px))); }
}
/* La caja blanca del tema se queda estrecha: el fondo blanco lo pone la página del catálogo */
.oem-ps { background: #fff; border-radius: 4px; padding-top: 4px; }
#content:has(.oem-ps), .page-content:has(.oem-ps) { background: transparent; box-shadow: none; }

/* [2026-10-22 PS 1.2.0] Botón "Consultar" (WhatsApp o contacto) para piezas sin stock o que no están en la tienda */
.ldj-btn-add.oem-consultar { display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; background: #1a1a2e; }
.ldj-btn-add.oem-consultar:hover { background: #25d366; }
