/* Flat Pattern mode (v6.9.4.1) — vista limpia para patrones de 1 capa
   (conversiones foto→patrón). Prefijo .fp-. Beads/bricks + número, zoom/pan,
   navegación de placas, paneles info/ayuda, carrito. */

.fp-root {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: none;            /* JS lo pone a flex al activar */
    flex-direction: column;
    background: #ffffff;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

/* Barra superior: info del patrón */
.fp-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-wrap: wrap;
}
.fp-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex: 1; min-width: 0; }
.fp-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 0.95rem; color: #0f172a; }
.fp-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #9333ea);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.fp-meta { font-size: 0.82rem; color: #64748b; font-weight: 600; }

/* Lienzo */
.fp-stage { flex: 1; min-height: 0; position: relative; background: #ffffff; }
.fp-canvas { display: block; position: absolute; inset: 0; touch-action: none; cursor: grab; }
.fp-canvas:active { cursor: grabbing; }

/* Barra inferior */
.fp-bottombar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-wrap: wrap;
}
.fp-spacer { flex: 1; }
.fp-pos { min-width: 210px; text-align: center; font-weight: 700; font-size: 0.84rem; color: #0f172a; }
.fp-btn {
    border: 1.5px solid #cbd5e1; background: #fff; color: #0f172a;
    border-radius: 10px; padding: 8px 13px; font: 700 0.85rem/1 inherit; cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.fp-btn:hover { background: #eef2ff; border-color: #93c5fd; }
.fp-nav { font-size: 1.05rem; min-width: 46px; }

/* Modal (info / ayuda) */
.fp-modal {
    position: absolute; inset: 0; z-index: 60;
    display: none; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.45); padding: 16px;
}
.fp-card {
    width: min(420px, 100%); max-height: 80%;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.fp-card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
    font-weight: 800; color: #0f172a;
}
.fp-card-close { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: #64748b; cursor: pointer; }
.fp-card-body { padding: 12px 16px; overflow-y: auto; }
.fp-panel-sub { font-size: 0.84rem; color: #64748b; font-weight: 600; margin-bottom: 10px; }

.fp-rows { display: flex; flex-direction: column; }
.fp-row {
    display: grid; grid-template-columns: 22px 38px 1fr auto; align-items: center; gap: 9px;
    padding: 6px 2px; font: 500 0.84rem/1.2 system-ui, sans-serif; color: #0f172a;
}
.fp-row:nth-child(odd) { background: #fafbfc; }
.fp-sw { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.18); }
.fp-rn { font-weight: 800; text-align: center; }
.fp-rc { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-rcount { color: #64748b; font-size: 0.78rem; white-space: nowrap; }

.fp-help { margin: 0; padding-left: 18px; color: #334155; font-size: 0.9rem; line-height: 1.6; }
.fp-help li { margin-bottom: 5px; }
.fp-help b { color: #0f172a; }

@media (max-width: 640px) {
    .fp-pos { min-width: 0; flex: 1 0 100%; order: -1; font-size: 0.78rem; }
    .fp-meta { font-size: 0.74rem; }
    .fp-btn { padding: 7px 10px; }
}

body.dark-mode .fp-root { background: #0f172a; }
body.dark-mode .fp-topbar,
body.dark-mode .fp-bottombar { background: #1e293b; border-color: #334155; }
body.dark-mode .fp-brand, body.dark-mode .fp-pos { color: #e2e8f0; }
body.dark-mode .fp-stage { background: #0f172a; }
body.dark-mode .fp-btn { background: #1e293b; color: #e2e8f0; border-color: #334155; }
body.dark-mode .fp-btn:hover { background: #243244; }
body.dark-mode .fp-card { background: #1e293b; }
body.dark-mode .fp-card-head { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-mode .fp-row { color: #e2e8f0; }
body.dark-mode .fp-row:nth-child(odd) { background: #243244; }
body.dark-mode .fp-help { color: #cbd5e1; }
