/* ==========================================================================
   Barra de proyecto compartida [wabi_barra_proyecto]
   ========================================================================== */
.wbp-barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    background: #ececfc;
    border-radius: 12px;
    padding: 12px 20px;
    margin: 0 0 20px;
    font-family: inherit;
}
.wbp-barra-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wbp-barra label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #5b5bd6;
    white-space: nowrap;
}
.wbp-barra .wbp-nombre {
    background: #fff;
    border: 1px solid #dcdcf0;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #173d32;
    width: 230px;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: none;
    margin: 0;
}
.wbp-barra .wbp-nombre:focus { outline: 2px solid #5b5bd6; outline-offset: 1px; }
.wbp-barra-acciones { display: flex; align-items: center; gap: 8px; }

.wbp-barra .wbp-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #dcdcf0;
    background: #fff;
    color: #173d32;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    transition: background-color .2s, color .2s;
}
.wbp-barra .wbp-btn:hover { background: #f5f5fd; color: #000; }
.wbp-barra .wbp-btn-primario { background: #187b62; border-color: #187b62; color: #fff; }
.wbp-barra .wbp-btn-primario:hover { background: #12654f; color: #fff; }
.wbp-barra .wbp-btn:focus-visible { outline: 2px solid #5b5bd6; outline-offset: 2px; }
.wbp-barra .wbp-btn[hidden] { display: none; }

/* Con barra compartida, la barra gris del editor (nombre, descargar planos, abrir, guardar) desaparece:
   «Descargar planos» pasa a la barra de arriba y solo se muestra mientras se ve el editor.
   En pantalla completa la barra compartida queda fuera de la vista, así que ahí el editor
   conserva sus botones (guardar y abrir usan igualmente las ventanas de la barra compartida). */
body.wbp-con-barra .wabi-editor-container .wabi-top-bar .project-info { display: none !important; }
body.wbp-con-barra .wabi-editor-container:not(.wabi-fullscreen) .wabi-top-bar { display: none !important; }
body.wbp-con-barra .wabi-editor-container.wabi-fullscreen .wabi-top-bar { justify-content: flex-end; }

/* ==========================================================================
   Ventanas (guardar / abrir) y aviso
   ========================================================================== */
body.wbp-modal-abierto { overflow: hidden; }
.wbp-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: rgba(23, 61, 50, .5);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}
.wbp-modal-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 100%;
    overflow: auto;
    box-sizing: border-box;
    background: #fffaf2;
    border-radius: 18px;
    padding: 28px 28px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
    color: #173d32;
    font-family: inherit;
}
.wbp-modal-card h3 { margin: 0 0 6px; font-size: 22px; color: #173d32; }
.wbp-modal-card p { margin: 0 0 14px; font-size: 14px; color: #4a544c; overflow-wrap: anywhere; }
.wbp-modal .wbp-cerrar {
    position: absolute; top: 10px; right: 12px;
    width: 32px; height: 32px; padding: 0;
    border: 0; background: transparent; color: #2b4736;
    font-size: 26px; line-height: 1; cursor: pointer; box-shadow: none;
}
.wbp-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wbp-modal .wbp-opcion {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    text-align: left; padding: 16px;
    background: #fff; color: #173d32;
    border: 1px solid #dfe3e6; border-radius: 14px;
    cursor: pointer; font: inherit; box-shadow: none; white-space: normal;
}
.wbp-modal .wbp-opcion:hover:not(:disabled) { border-color: #187b62; background: #f2faf7; }
.wbp-modal .wbp-opcion:disabled { opacity: .6; cursor: not-allowed; }
.wbp-opcion .wbp-ico { font-size: 22px; }
.wbp-opcion small { font-size: 12px; color: #5b6b63; font-weight: 400; line-height: 1.4; }
.wbp-pronto {
    font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    background: #ececfc; color: #5b5bd6; padding: 2px 8px; border-radius: 99px;
}
.wbp-subir {
    display: flex; align-items: center; justify-content: center;
    padding: 18px; border: 2px dashed #bfc6cb; border-radius: 14px;
    background: #fff; cursor: pointer; font-weight: 700; font-size: 14px; color: #173d32;
}
.wbp-subir:hover { border-color: #187b62; background: #f2faf7; }
.wbp-subir input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wbp-error { margin: 12px 0 0 !important; padding: 10px 12px; background: #fdecea; color: #a93226 !important; border-radius: 10px; font-size: 13px; font-weight: 700; }

.wbp-toast {
    position: fixed;
    left: 50%; bottom: 28px;
    transform: translate(-50%, 20px);
    z-index: 2147483001;
    max-width: calc(100vw - 32px);
    background: #173d32; color: #fff;
    padding: 12px 20px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.wbp-toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
    .wbp-barra { flex-direction: column; align-items: stretch; padding: 12px 14px; }
    .wbp-barra-info { flex-direction: column; align-items: stretch; gap: 6px; }
    .wbp-barra .wbp-nombre { width: 100%; }
    .wbp-barra-acciones { display: grid; grid-template-columns: 1fr 1fr; }
    .wbp-barra .wbp-btn { justify-content: center; }
    .wbp-opciones { grid-template-columns: 1fr; }
    .wbp-modal-card { padding: 22px 16px 18px; }
}

/* ==========================================================================
   Proyectos en la cuenta (ventanas Guardar / Abrir)
   ========================================================================== */
.wbp-estado {
    margin: 14px 0 0 !important;
    padding: 10px 12px;
    background: #ececfc;
    color: #173d32 !important;
    border-radius: 10px;
    font-size: 13px !important;
    font-weight: 600;
}
.wbp-estado[hidden] { display: none; }
.wbp-enlace, .wbp-modal .wbp-enlace {
    display: inline-block;
    margin-left: 4px;
    padding: 5px 12px;
    background: #187b62;
    color: #fff !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
}
.wbp-modal h4.wbp-sub {
    margin: 16px 0 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #5b5bd6;
}
.wbp-lista {
    padding: 12px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #dfe3e6;
    border-radius: 14px;
    font-size: 13.5px;
    color: #5b6b63;
    max-height: 260px;
    overflow: auto;
}
.wbp-lista .wbp-vacio { margin: 0 0 8px; font-size: 12.5px; color: #6b7770; text-align: center; }
.wbp-lista .wbp-vacio:last-child { margin-bottom: 0; }
.wbp-proy {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px;
    border-top: 1px solid #eef0f2;
}
.wbp-proy:first-of-type { border-top: 0; }
.wbp-proy-info { flex: 1; min-width: 0; }
.wbp-proy-info strong { display: block; color: #173d32; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbp-proy-info small { color: #6b7770; font-size: 11.5px; }
.wbp-modal .wbp-mini {
    padding: 6px 12px;
    border: 1px solid #dcdcf0;
    border-radius: 6px;
    background: #fff;
    color: #173d32;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    line-height: 1.2;
}
.wbp-modal .wbp-mini:hover { background: #f5f5fd; }
.wbp-modal .wbp-mini-primario { background: #187b62; border-color: #187b62; color: #fff; }
.wbp-modal .wbp-mini-primario:hover { background: #12654f; }

/* ==========================================================================
   Indicador junto al nombre, pregunta al guardar y oferta de subir medidas
   ========================================================================== */
.wbp-barra .wbp-indicador {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #cfe7df;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 700;
    color: #187b62;
}
.wbp-barra .wbp-indicador[hidden] { display: none; }
.wbp-decision[hidden], .wbp-enlace-btn[hidden] { display: none; }
.wbp-decision {
    margin-top: 14px;
    padding: 12px;
    background: #fff;
    border: 1px solid #dfe3e6;
    border-radius: 12px;
}
.wbp-decision p { margin: 0 0 10px !important; font-size: 13px !important; }
.wbp-decision-botones { display: flex; flex-wrap: wrap; gap: 8px; }
.wbp-modal .wbp-mini:disabled { opacity: .55; cursor: not-allowed; }
.wbp-modal .wbp-enlace-btn {
    display: block;
    margin: 14px auto 0;
    padding: 4px 8px;
    background: transparent;
    border: 0;
    color: #5b5bd6;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    box-shadow: none;
}
.wbp-oferta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: #ececfc;
    border-radius: 12px;
    font-size: 13px;
    color: #173d32;
}
.wbp-oferta span { flex: 1 1 260px; }
.wbp-oferta .wbp-mini {
    padding: 6px 12px;
    border: 1px solid #dcdcf0;
    border-radius: 6px;
    background: #fff;
    color: #173d32;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}
.wbp-oferta .wbp-mini-primario { background: #187b62; border-color: #187b62; color: #fff; }
.wbp-oferta .wbp-mini:disabled { opacity: .55; cursor: not-allowed; }
