.pr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.pr-title {
    font-size: 28px;
    font-weight: 600;
    color: #ff3b30;
    margin: 0;
}

.pr-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pr-btn {
    border: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: #1f1f1f;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.pr-btn:hover {
    filter: brightness(1.1);
}

.pr-btn-primary {
    background: #ff3b30;
}

.pr-btn-danger {
    background: #111;
}





.pr-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.pr-card-title {
    font-size: 18px;
    font-weight: 800;
    color: #111;
}

.pr-pill {
    background: #111;
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
}

.pr-input,
.pr-select {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 8px 10px;
    outline: none;
    background: #fff;
}

.pr-input:disabled,
.pr-input.pr-disabled {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

.pr-input:focus,
.pr-select:focus {
    border-color: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, .12);
}

.pr-num {
    text-align: center;
}

.pr-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    /* REEMPLAZO */
    min-height: 0;
    /* NUEVO */
    overflow-y: auto;
    /* REEMPLAZO */
    padding-right: 6px;
}

.pr-item {
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pr-item-title {
    font-weight: 900;
    color: #111;
}

.pr-item-sub {
    font-size: 12px;
    color: #666;
}

.pr-mini-btn {
    border: 0;
    background: #ff3b30;
    color: #fff;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 900;
    font-size: 12px;
}

.pr-mini-btn:hover {
    filter: brightness(1.05);
}

.pr-empty {
    color: #666;
    font-size: 12px;
    border: 1px dashed #ddd;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
}

.pr-form {
    margin-top: 8px;
}

.pr-row {
    margin-top: 10px;
}

.pr-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #333;
    margin-bottom: 6px;
}

.pr-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pr-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: #111;
    height: 38px;
}

.pr-file {
    width: 100%;
    font-size: 12px;
}

.pr-muted {
    color: #666;
    font-size: 12px;
    margin-top: 6px;
}

.pr-hr {
    border: 0;
    height: 1px;
    background: #f0f0f0;
    margin: 14px 0;
}

.pr-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pr-mini {
    height: 34px;
}

.pr-checklist {
    margin-top: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    padding: 10px;
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pr-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 14px;
}

.pr-check span {
    font-weight: 900;
    color: #111;
}

.pr-check small {
    display: block;
    color: #666;
    font-weight: 700;
    margin-top: 2px;
}

.pr-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.pr-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #111;
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all .2s ease;
    z-index: 99999;
    max-width: 460px;
    font-weight: 800;
}

.pr-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.pr-toast.ok {
    background: #16a34a;
}

.pr-toast.bad {
    background: #dc2626;
}

@media (max-width: 1100px) {
    .pr-grid {
        grid-template-columns: 1fr;
    }

    .pr-2col {
        grid-template-columns: 1fr;
    }
}



/* =========================================
   INPUTS: vacío gris / con datos negro bold
========================================= */

/* estado vacío */
.pr-input:placeholder-shown {
    color: #9ca3af;
    /* gris */
    font-weight: 500;
}

/* cuando tiene valor */
.pr-input:not(:placeholder-shown) {
    color: #111;
    /* negro */
    font-weight: 800;
    /* negrita fuerte */
}

/* placeholder siempre gris */
.pr-input::placeholder {
    color: #c2c2c2;
    font-weight: 500;
}

input:placeholder-shown {
    color: #999;
}


/* ========= MODAL ========= */
.jm-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(0, 0, 0, .45);

    z-index: 999999 !important;
    /* más alto que voyager */

    opacity: 0;
    pointer-events: none;
    transition: .2s;
}

.jm-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.jm-modal-box {
    width: 420px;
    max-width: 90%;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    text-align: center;
    animation: pop .2s ease;
}

.jm-modal-box h3 {
    margin: 0 0 8px;
    color: #ff3b30;
    font-weight: 900;
}

.jm-modal-box p {
    color: #333;
    margin-bottom: 16px;
    font-weight: 600;
}

.jm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@keyframes pop {
    from {
        transform: scale(.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


.crop-container {
    width: 300px;
    height: 300px;
    margin-top: 10px;
}

.crop-container > img {
    max-width: 100%;
}

.pr-checkbox-box {
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}


#filtroCategoria {
    font-weight: 600;
}

#filtroCategoria option {
    font-weight: 600;
}


.img-editor {
    display: flex;
    gap: 30px;
}

.img-upload {
    width: 50%;
}

.img-crop {
    width: 50%;
}

.img-preview-wrapper {
    position: relative;
    margin-top: 10px;
}

#p_imagen_preview {
    display: none;
    width: 100%;
    height: 180px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 6px;
}

.crop-container > img {
    width: 100%;
    max-height: 300px;
}

.img-remove {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #ff4d4f;
    color: white;
    cursor: pointer;
    font-weight: bold;
}


.crop-container {
    width: 100%;
    height: 260px;
    /* ajusta a gusto */
    overflow: hidden;
    /* clave: que no se salga */
    border: 1px solid #ddd;
    border-radius: 10px;
}

/* Cropper mete su propio DOM, esto ayuda a que respete el alto */
.crop-container .cropper-container {
    width: 100% !important;
    height: 100% !important;
}


.pr-wrap {
    padding: 20px 24px;
    min-height: 100vh;
    /* REEMPLAZO */
    box-sizing: border-box;
    /* NUEVO */
}

.pr-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 14px;
    align-items: stretch;
    /* NUEVO */
    min-height: calc(100vh - 110px);
    /* NUEVO */
}

.pr-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    /* NUEVO */
    flex-direction: column;
    /* NUEVO */
    min-height: 0;
    /* NUEVO */
}


.pr-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 8px;
}

.pr-page-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}

.pr-page-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pr-page-info {
    font-size: 13px;
    font-weight: 600;
}


/* NUEVO: MODAL ELIMINAR PRODUCTO */
.pr-modal-hidden {
    display: none;
}

.pr-modal-show {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, .45);
    z-index: 2147483647;
}

.pr-delete-box {
    width: 420px;
    max-width: 92%;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    animation: prPop .2s ease;
}

.pr-delete-box h3 {
    margin: 0 0 8px;
    color: #ff3b30;
    font-weight: 900;
}

.pr-delete-box p {
    margin-bottom: 16px;
    color: #333;
    font-weight: 600;
}

.pr-delete-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

@keyframes prPop {
    from {
        transform: scale(.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pr-excel-box {
    /* NUEVO */
    width: 560px;
    max-width: 92%;
    max-height: 90vh;
    overflow-y: auto;
}

.pr-excel-actions {
    /* NUEVO */
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

#prExcelFileName {
    /* NUEVO */
    margin-top: 10px;
    text-align: center;
}


.pr-item-no-cat {
    background: #fff8c4;
    border-color: #facc15;
}

.pr-cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.pr-cat-chip-warn {
    background: #facc15;
    color: #713f12;
}

/* =========================================================
   EDITOR ÚNICO DE IMAGEN + RECORTE
   ========================================================= */
.img-editor.img-editor-single {
    display: block;
    width: 100%;
    padding: 14px;
    border: 1px solid #dbe3ea;
    border-radius: 14px;
    background: #f8fafc;
    box-sizing: border-box;
}

.img-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.img-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.img-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid #0f766e;
    border-radius: 11px;
    background: #ecfdf5;
    color: #0f766e;
    cursor: pointer;
    font-weight: 800;
}

.img-file-button:hover {
    background: #d1fae5;
}

.img-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.img-remove-button {
    border-color: #fecaca !important;
    background: #fff1f2 !important;
    color: #be123c !important;
}

.crop-container.img-unified-stage {
    position: relative;
    width: 100%;
    height: 390px;
    margin: 0;
    overflow: hidden;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
        #fff;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
    box-sizing: border-box;
}

.crop-container.img-unified-stage.has-image {
    border-style: solid;
    border-color: #99f6e4;
    background: #111827;
}

.crop-container.img-unified-stage > #cropImage {
    display: none;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.crop-container.img-unified-stage .cropper-container {
    width: 100% !important;
    height: 100% !important;
}

.img-stage-hint {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    color: #64748b;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
}

.img-unified-stage.has-image .img-stage-hint {
    display: none;
}

.img-editor-note {
    display: block;
    margin-top: 10px;
    color: #64748b;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .img-editor-toolbar,
    .img-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .img-file-button,
    .img-editor-actions .pr-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .crop-container.img-unified-stage {
        height: 300px;
    }
}

/* Mantener el recuadro unificado aun cuando cargue vase-modern-catalog.css después. */
.vase-modern-page .crop-container.img-unified-stage {
    border: 2px dashed #cbd5e1 !important;
    background:
        linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
        #fff !important;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0 !important;
    background-size: 20px 20px !important;
}

.vase-modern-page .crop-container.img-unified-stage.has-image {
    border-style: solid !important;
    border-color: #99f6e4 !important;
    background: #111827 !important;
}

/* =========================================================
   RECORTE CLARO: IMAGEN CENTRADA + MARCO ROJO MANIPULABLE
   ========================================================= */
.img-tool-button {
    min-width: 42px;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.img-tool-button:hover {
    border-color: #ef4444 !important;
    background: #fff7f7 !important;
}

.crop-container.img-unified-stage > #cropImage {
    margin: auto;
}

.crop-container.img-unified-stage .cropper-view-box {
    outline: 3px solid #ef1b1b !important;
    outline-color: #ef1b1b !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .95) inset;
}

.crop-container.img-unified-stage .cropper-face {
    background-color: transparent !important;
}

.crop-container.img-unified-stage .cropper-line {
    background-color: #ef1b1b !important;
    opacity: 1 !important;
}

.crop-container.img-unified-stage .cropper-point {
    width: 14px !important;
    height: 14px !important;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background-color: #ef1b1b !important;
    opacity: 1 !important;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .35);
}

.crop-container.img-unified-stage .cropper-point.point-e,
.crop-container.img-unified-stage .cropper-point.point-w {
    width: 12px !important;
    height: 32px !important;
    margin-top: -16px !important;
    border-radius: 8px;
}

.crop-container.img-unified-stage .cropper-point.point-n,
.crop-container.img-unified-stage .cropper-point.point-s {
    width: 32px !important;
    height: 12px !important;
    margin-left: -16px !important;
    border-radius: 8px;
}

.crop-container.img-unified-stage .cropper-dashed {
    border-color: rgba(255, 255, 255, .8) !important;
}



/* =========================================================
   ORDEN DE GRUPOS BA POR PRODUCTO
   ========================================================= */
.ba-section-head {
    align-items: flex-start;
}

.ba-section-head > div:first-child {
    min-width: 0;
}

.ba-help {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 650;
    line-height: 1.35;
}

.ba-order-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #99f6e4;
    border-radius: 14px;
    background: #f0fdfa;
}

.ba-panel-title,
.ba-available-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 900;
    color: #0f172a;
}

.ba-available-title {
    margin-top: 14px;
    font-size: 13px;
}

.ba-save-status {
    padding: 4px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.ba-save-status[data-tone="ok"] {
    background: #dcfce7;
    color: #166534;
}

.ba-save-status[data-tone="pending"] {
    background: #fef3c7;
    color: #92400e;
}

.ba-save-status[data-tone="bad"] {
    background: #fee2e2;
    color: #991b1b;
}

.ba-selected-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    min-height: 50px;
}

.ba-sort-item {
    display: grid;
    grid-template-columns: 36px 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #5eead4;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(15, 118, 110, .08);
}

.ba-drag-handle {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
    color: #0f766e;
    cursor: grab;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.ba-drag-handle:active {
    cursor: grabbing;
}

.ba-order-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.ba-selected-content {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    cursor: pointer;
}

.ba-selected-content > span,
.ba-available-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ba-selected-content strong,
.ba-available-content strong {
    color: #0f172a;
    line-height: 1.25;
}

.ba-selected-content small,
.ba-available-content small {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.ba-available-list {
    max-height: 240px;
}

.ba-available-item {
    align-items: center;
    cursor: pointer;
}

.ba-empty {
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, .65);
}

.ba-sort-ghost {
    opacity: .45;
    background: #ccfbf1;
}

.ba-sort-chosen {
    box-shadow: 0 8px 22px rgba(15, 118, 110, .2);
}

/* El sombreado oscuro debe verse alrededor del recorte por los cuatro lados. */
.crop-container.img-unified-stage .cropper-modal {
    background: #000000 !important;
    opacity: .62 !important;
}

.crop-container.img-unified-stage .cropper-face {
    cursor: default !important;
}

@media (max-width: 760px) {
    .ba-section-head {
        flex-direction: column;
    }

    .ba-section-head #buscarBA {
        width: 100%;
    }

    .ba-panel-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Inventario asociado y ayudas de campos */
.pr-check-info-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.pr-check-info-wrap .pr-check {
    flex: 1;
}

.pr-info-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    padding: 0;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    cursor: help;
}

.pr-info-tooltip {
    position: absolute;
    z-index: 1000;
    right: 0;
    bottom: calc(100% + 9px);
    width: min(290px, 78vw);
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: .16s ease;
    pointer-events: none;
}

.pr-info-dot:hover .pr-info-tooltip,
.pr-info-dot:focus .pr-info-tooltip,
.pr-info-dot:focus-visible .pr-info-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pr-stock-method {
    padding: 14px;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    background: #f8fafc;
}

.pr-stock-method.is-disabled {
    opacity: .62;
}

.pr-stock-method-head {
    align-items: flex-start;
}

.pr-stock-method-head small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-weight: 600;
}

.pr-btn-inventory {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.pr-inventory-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.pr-inventory-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .7);
}

.pr-inventory-dialog {
    position: relative;
    width: min(1180px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
}

.pr-inventory-head,
.pr-inventory-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.pr-inventory-head h3 {
    margin: 3px 0 2px;
    color: #0f172a;
    font-size: 22px;
}

.pr-inventory-head p {
    margin: 0;
    color: #64748b;
}

.pr-inventory-footer {
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
    border-bottom: 0;
}

.pr-inventory-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #eef2f7;
    color: #334155;
    font-size: 25px;
    cursor: pointer;
}

.pr-inventory-body {
    overflow: auto;
    padding: 20px;
}

.pr-inventory-loading,
.pr-inventory-empty {
    padding: 30px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    text-align: center;
    background: #f8fafc;
}

.pr-inventory-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pr-inventory-summary > div {
    padding: 13px;
    border: 1px solid #dbe3ec;
    border-radius: 13px;
    background: #f8fafc;
}

.pr-inventory-summary span,
.pr-inventory-summary strong {
    display: block;
}

.pr-inventory-summary span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.pr-inventory-summary strong {
    margin-top: 4px;
    color: #0f172a;
    font-size: 18px;
}

.pr-inventory-warnings {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.pr-inventory-alert {
    padding: 11px 13px;
    border: 1px solid #f59e0b;
    border-radius: 11px;
    background: #fffbeb;
    color: #92400e;
    font-weight: 700;
}

.pr-inventory-alert.is-error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.pr-inventory-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0 12px;
}

.pr-inventory-section-head h4,
.pr-inventory-section-head p {
    margin: 0;
}

.pr-inventory-section-head h4 {
    color: #0f172a;
    font-size: 18px;
}

.pr-inventory-section-head p {
    margin-top: 3px;
    color: #64748b;
}

.pr-inventory-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.pr-inventory-table-wrap {
    overflow-x: auto;
    border: 1px solid #dbe3ec;
    border-radius: 13px;
}

.pr-inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.pr-inventory-table th,
.pr-inventory-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.pr-inventory-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pr-inventory-table td {
    color: #1e293b;
}

.pr-inventory-table td small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.pr-inventory-table details {
    margin-top: 6px;
    font-size: 12px;
}

.pr-inventory-table summary {
    color: #475569;
    cursor: pointer;
    font-weight: 700;
}

.pr-inventory-conversion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.pr-inventory-conversion span {
    color: #64748b;
    font-weight: 700;
}

.is-invalid {
    color: #b91c1c !important;
}

.pr-inventory-muted {
    color: #94a3b8;
}

@media (max-width: 760px) {
    .pr-inventory-modal {
        padding: 8px;
    }

    .pr-inventory-dialog {
        width: 100%;
        max-height: 96vh;
        border-radius: 13px;
    }

    .pr-inventory-summary {
        grid-template-columns: 1fr;
    }

    .pr-inventory-section-head,
    .pr-inventory-conversion {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   PRODUCTOS · ESTADO Y ACCESO DIRECTO A RECETA 2026-08-06
========================================================= */
.pr-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.pr-mini-recipe {
    background: #7c3aed !important;
    color: #fff !important;
    border-color: #7c3aed !important;
}

.pr-list-recipe-state {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.pr-list-recipe-state.is-ready {
    background: #dcfce7;
    color: #166534;
}

.pr-list-recipe-state.is-missing {
    background: #fef3c7;
    color: #92400e;
}

.pr-recipe-link-card {
    padding: 15px;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 65%);
}

.pr-recipe-link-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.pr-recipe-link-head > div:first-child {
    min-width: 0;
}

.pr-recipe-link-head h3 {
    margin: 7px 0 4px;
    color: #111827;
    font-size: 16px;
    font-weight: 900;
}

.pr-recipe-link-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.pr-recipe-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.pr-recipe-badge.is-ready {
    background: #dcfce7;
    color: #166534;
}

.pr-recipe-badge.is-missing {
    background: #fef3c7;
    color: #92400e;
}

.pr-btn-recipe {
    flex: 0 0 auto;
    background: #7c3aed !important;
    color: #fff !important;
}

.pr-recipe-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 13px;
}

.pr-recipe-metrics[hidden] {
    display: none !important;
}

.pr-recipe-metrics > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.pr-recipe-metrics span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.pr-recipe-metrics strong {
    overflow: hidden;
    color: #111827;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .pr-item-actions,
    .pr-recipe-link-head {
        align-items: stretch;
        flex-direction: column;
    }

    .pr-item-actions .pr-mini-btn,
    .pr-recipe-link-head .pr-btn {
        width: 100%;
    }

    .pr-recipe-metrics {
        grid-template-columns: 1fr;
    }
}

/* Inventario por receta integrado en el formulario del producto */
.pr-recipe-inventory {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.pr-recipe-inventory[hidden] {
    display: none !important;
}

.pr-recipe-inventory-copy {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #c7d7fe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
}

.pr-recipe-inventory-copy strong {
    font-size: 13px;
    font-weight: 900;
}

.pr-recipe-inventory-copy span {
    font-size: 12px;
    line-height: 1.5;
}

.pr-recipe-inventory .pr-recipe-link-card {
    margin: 0;
}

/* =========================================================
   PRODUCTOS · MÉTODO DE INVENTARIO ORDENADO COMO TARJETAS
   ========================================================= */
.pr-stock-method {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #d8e3f0;
    border-radius: 15px;
    background: #f8fafc;
}

.pr-stock-method[hidden] {
    display: none !important;
}

.pr-stock-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pr-stock-title > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pr-stock-title .pr-label {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
}

.pr-stock-title small {
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.pr-stock-title .pr-btn-inventory {
    width: auto;
    max-width: 360px;
    flex: 0 0 auto;
    justify-content: center;
    margin: 0;
    white-space: normal;
}

.pr-stock-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.pr-stock-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid #d9e2ed;
    border-radius: 13px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.pr-stock-option:hover {
    border-color: #a5b4fc;
}

.pr-stock-option:has(input:checked) {
    border-color: #7c3aed;
    background: #f5f3ff;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, .08);
}

.pr-stock-option > input {
    margin: 3px 0 0;
    accent-color: #7c3aed;
}

.pr-stock-option > span:nth-child(2) {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pr-stock-option strong {
    color: #111827;
    font-size: 13px;
    font-weight: 900;
}

.pr-stock-option small {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

.pr-stock-option .pr-info-dot {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
}

.pr-direct-inventory,
.pr-recipe-inventory {
    margin-top: 0;
    padding: 15px;
    border: 1px solid #dce5ef;
    border-radius: 13px;
    background: #ffffff;
}

.pr-direct-inventory[hidden],
.pr-recipe-inventory[hidden] {
    display: none !important;
}

.pr-direct-inventory .pr-row:last-child,
.pr-recipe-inventory .pr-row:last-child {
    margin-bottom: 0;
}

.pr-purchase-reference {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid #d8e2ed;
    border-radius: 12px;
    background: #f8fafc;
}

.pr-purchase-reference span,
.pr-purchase-reference small {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.pr-purchase-reference strong {
    color: #111827;
    font-size: 18px;
    font-weight: 900;
}

@media (max-width: 900px) {
    .pr-stock-title {
        align-items: stretch;
        flex-direction: column;
    }

    .pr-stock-title .pr-btn-inventory {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 720px) {
    .pr-stock-options {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PRODUCTOS · MAPA DE RECETAS, EXTRAS E INVENTARIO 2026-08-06
========================================================= */
.pr-mini-map {
    background: #0f766e !important;
    border-color: #0f766e !important;
    color: #fff !important;
}

.pr-mini-map:hover,
.pr-mini-map:focus-visible {
    background: #115e59 !important;
}

.pr-inventory-dialog {
    width: min(1380px, 97vw);
}

.pr-inventory-body {
    background: #f8fafc;
}

.pr-map-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pr-map-summary > div:first-child {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.pr-map-summary > div:first-child strong {
    color: #115e59;
    font-size: 15px;
}

.pr-map-warning-panel {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #f59e0b;
    border-radius: 13px;
    background: #fff;
}

.pr-map-warning-panel > summary {
    padding: 12px 14px;
    color: #92400e;
    background: #fffbeb;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
}

.pr-map-warning-panel .pr-inventory-warnings {
    margin: 0;
    padding: 12px;
    border-top: 1px solid #fde68a;
}

.pr-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    background: #fff;
}

.pr-map-toolbar > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.pr-map-toolbar strong {
    color: #0f172a;
    font-size: 15px;
}

.pr-map-toolbar > div:first-child span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.pr-map-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.pr-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid #dbe3ec;
    border-radius: 999px;
    color: #334155;
    background: #fff;
    font-size: 11px;
    font-weight: 900;
}

.pr-map-legend span::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    content: "";
}

.pr-map-legend .is-product::before {
    background: #2563eb;
}

.pr-map-legend .is-recipe::before {
    background: #7c3aed;
}

.pr-map-legend .is-extra::before {
    background: #0f766e;
}

.pr-map-legend .is-input::before {
    background: #d97706;
}

.pr-map-canvas {
    min-width: 0;
    overflow: auto;
    padding: 18px;
    border: 1px solid #dbe3ec;
    border-radius: 16px;
    background-color: #fff;
    background-image:
        linear-gradient(rgba(148, 163, 184, .09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .09) 1px, transparent 1px);
    background-size: 24px 24px;
}

.pr-map-node {
    position: relative;
    min-width: 0;
}

.pr-map-node.is-root {
    max-width: 100%;
}

.pr-map-children {
    position: relative;
    display: grid;
    gap: 15px;
    margin: 14px 0 0 34px;
    padding-left: 30px;
    border-left: 2px solid #cbd5e1;
}

.pr-map-child {
    position: relative;
    min-width: 0;
}

.pr-map-child::before {
    position: absolute;
    top: 31px;
    left: -30px;
    width: 30px;
    border-top: 2px solid #cbd5e1;
    content: "";
}

.pr-map-child:last-child::after {
    position: absolute;
    top: 33px;
    bottom: -16px;
    left: -32px;
    width: 4px;
    background: #fff;
    content: "";
}

.pr-map-card {
    --map-accent: #64748b;
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-left: 5px solid var(--map-accent);
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}

.pr-map-card--producto {
    --map-accent: #2563eb;
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 52%);
}

.pr-map-card--receta {
    --map-accent: #7c3aed;
    border-color: #ddd6fe;
    background: linear-gradient(135deg, #faf5ff 0%, #fff 52%);
}

.pr-map-card--extras,
.pr-map-card--categoria_extra,
.pr-map-card--extra {
    --map-accent: #0f766e;
    border-color: #99f6e4;
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 52%);
}

.pr-map-card--insumo,
.pr-map-card--item_receta {
    --map-accent: #d97706;
    border-color: #fde68a;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 52%);
}

.pr-map-card--alerta {
    --map-accent: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.pr-map-card--sin_control,
.pr-map-card--info {
    --map-accent: #64748b;
    background: #f8fafc;
}

.pr-map-card.is-reference {
    border-style: dashed;
    opacity: .92;
}

.pr-map-card-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px 10px;
}

.pr-map-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    color: #fff;
    background: var(--map-accent);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: -.02em;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
}

.pr-map-title-wrap {
    min-width: 0;
    flex: 1;
}

.pr-map-type {
    display: block;
    margin-bottom: 2px;
    color: var(--map-accent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pr-map-title-wrap h4 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.25;
}

.pr-map-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    max-width: 190px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #475569;
    background: #e2e8f0;
    font-size: 10px;
    font-weight: 950;
    text-align: center;
    text-transform: uppercase;
}

.pr-map-state.is-ready {
    color: #166534;
    background: #dcfce7;
}

.pr-map-state.is-warning {
    color: #991b1b;
    background: #fee2e2;
}

.pr-map-state.is-reference {
    color: #5b21b6;
    background: #ede9fe;
}

.pr-map-description {
    margin: 0;
    padding: 0 14px 12px 63px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.pr-map-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    padding: 11px 14px 14px;
    border-top: 1px solid rgba(203, 213, 225, .7);
    background: rgba(248, 250, 252, .72);
}

.pr-map-meta-item {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
}

.pr-map-meta-item.is-wide {
    grid-column: 1 / -1;
}

.pr-map-meta-item span,
.pr-map-meta-item strong {
    display: block;
}

.pr-map-meta-item span {
    margin-bottom: 3px;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pr-map-meta-item strong {
    overflow-wrap: anywhere;
    color: #1e293b;
    font-size: 12px;
    line-height: 1.4;
}

.pr-map-meta-item.is-invalid {
    border-color: #fecaca;
    background: #fef2f2;
}

.pr-map-stock-details {
    margin: 0 14px 14px;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 11px;
    background: #fff;
}

.pr-map-stock-details > summary {
    padding: 9px 11px;
    color: #334155;
    background: #f8fafc;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
}

.pr-map-stock-list {
    display: grid;
    gap: 7px;
    padding: 9px;
    border-top: 1px solid #e2e8f0;
}

.pr-map-stock-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.5fr) repeat(3, minmax(90px, .7fr));
    gap: 8px;
    align-items: center;
    padding: 8px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
}

.pr-map-stock-row.is-main {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.pr-map-stock-row > div {
    min-width: 0;
}

.pr-map-stock-row > div:first-child strong,
.pr-map-stock-row > div:first-child small,
.pr-map-stock-row > div:not(:first-child) span,
.pr-map-stock-row > div:not(:first-child) strong {
    display: block;
}

.pr-map-stock-row > div:first-child strong {
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 11px;
}

.pr-map-stock-row > div:first-child small,
.pr-map-stock-row > div:not(:first-child) span {
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
}

.pr-map-stock-row > div:not(:first-child) strong {
    margin-top: 2px;
    color: #1e293b;
    font-size: 10px;
}

@media (max-width: 1100px) {
    .pr-map-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pr-map-stock-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pr-map-summary {
        grid-template-columns: 1fr;
    }

    .pr-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .pr-map-legend {
        justify-content: flex-start;
    }

    .pr-map-canvas {
        padding: 10px;
    }

    .pr-map-children {
        margin-left: 12px;
        padding-left: 17px;
    }

    .pr-map-child::before {
        left: -17px;
        width: 17px;
    }

    .pr-map-child:last-child::after {
        left: -19px;
    }

    .pr-map-card-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .pr-map-state {
        max-width: 100%;
        margin-left: 49px;
    }

    .pr-map-description {
        padding-left: 14px;
    }

    .pr-map-meta {
        grid-template-columns: 1fr;
    }

    .pr-map-stock-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PRODUCTOS · MAPA INTERACTIVO PLEGABLE Y CON ZOOM 2026-08-06
========================================================= */
.pr-map-toolbar-copy {
    display: grid;
    gap: 3px;
    min-width: 260px;
    flex: 1 1 340px;
}

.pr-map-toolbar-side {
    display: grid;
    justify-items: end;
    gap: 9px;
    min-width: min(100%, 440px);
}

.pr-map-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.pr-map-controls button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: #334155;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.pr-map-controls button:hover,
.pr-map-controls button:focus-visible {
    border-color: #0f766e;
    color: #115e59;
    background: #f0fdfa;
}

.pr-map-controls button:active {
    transform: translateY(1px);
}

.pr-map-controls button.is-icon {
    width: 34px;
    padding: 0;
    font-size: 19px;
}

.pr-map-controls .pr-map-zoom-value {
    min-width: 58px;
    color: #0f172a;
    background: #f8fafc;
}

.pr-map-control-separator {
    width: 1px;
    height: 25px;
    margin: 0 2px;
    background: #dbe3ec;
}

.pr-map-navigation-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 10px;
    padding: 9px 12px;
    border: 1px solid #bae6fd;
    border-radius: 11px;
    color: #0c4a6e;
    background: #f0f9ff;
    font-size: 11px;
    line-height: 1.45;
}

.pr-map-navigation-help kbd {
    padding: 1px 5px;
    border: 1px solid #94a3b8;
    border-bottom-width: 2px;
    border-radius: 5px;
    color: #334155;
    background: #fff;
    font: inherit;
    font-weight: 900;
}

.pr-map-viewport {
    position: relative;
    min-height: 390px;
    max-height: min(66vh, 760px);
    overflow: auto;
    overscroll-behavior: contain;
    cursor: grab;
    touch-action: pan-x pan-y;
    scrollbar-gutter: stable both-edges;
}

.pr-map-viewport.is-panning {
    cursor: grabbing;
    user-select: none;
}

.pr-map-stage {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.pr-map-tree {
    width: clamp(760px, 76vw, 1060px);
    padding: 2px 2px 24px;
    transform-origin: top left;
    will-change: transform;
}

.pr-map-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--map-accent) 45%, white);
    border-radius: 10px;
    color: #fff;
    background: var(--map-accent);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.pr-map-toggle:hover,
.pr-map-toggle:focus-visible {
    filter: brightness(.92);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .18);
    transform: translateY(-1px);
}

.pr-map-toggle[aria-expanded="true"] {
    color: var(--map-accent);
    background: #fff;
}

.pr-map-children[hidden] {
    display: none !important;
}

.pr-map-node.has-children > .pr-map-card {
    box-shadow: 0 9px 24px rgba(15, 23, 42, .09);
}

.pr-map-node.has-children.is-expanded > .pr-map-card {
    box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
}

@media (max-width: 900px) {
    .pr-map-toolbar-side {
        width: 100%;
        justify-items: start;
    }

    .pr-map-controls,
    .pr-map-legend {
        justify-content: flex-start;
    }

    .pr-map-navigation-help {
        align-items: flex-start;
        flex-direction: column;
    }

    .pr-map-tree {
        width: 760px;
    }
}

@media (max-width: 760px) {
    .pr-map-controls {
        width: 100%;
    }

    .pr-map-controls button:not(.is-icon):not(.pr-map-zoom-value) {
        flex: 1 1 auto;
    }

    .pr-map-control-separator {
        display: none;
    }

    .pr-map-viewport {
        min-height: 360px;
        max-height: 62vh;
    }

    .pr-map-tree {
        width: 680px;
    }

    .pr-map-state {
        margin-left: 0;
    }
}

/* =========================================================
   PRODUCTOS · MAPA ESTABLE, COMPACTO Y DE NAVEGACIÓN SIMPLE 2026-08-06
========================================================= */
.pr-map-quick-stats {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pr-map-quick-stats > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #dbe3ec;
    border-radius: 999px;
    color: #475569;
    background: #fff;
    font-size: 11px;
    font-weight: 750;
}

.pr-map-quick-stats strong {
    color: #0f172a;
    font-weight: 950;
}

.pr-map-toolbar {
    position: sticky;
    top: -20px;
    z-index: 12;
    margin-bottom: 10px;
    padding: 11px 13px;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .07);
}

.pr-map-toolbar-copy {
    min-width: 220px;
}

.pr-map-toolbar-side {
    min-width: min(100%, 520px);
}

.pr-map-controls {
    row-gap: 7px;
}

.pr-map-zoom-slider {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: #475569;
    background: #fff;
    font-size: 10px;
    font-weight: 900;
}

.pr-map-zoom-slider input[type="range"] {
    width: 105px;
    accent-color: #0f766e;
    cursor: pointer;
}

.pr-map-navigation-help {
    margin-bottom: 8px;
    padding: 7px 10px;
}

.pr-map-viewport {
    min-height: 430px;
    max-height: min(70vh, 790px);
}

.pr-map-tree {
    width: clamp(700px, 72vw, 980px);
    padding-bottom: 36px;
}

.pr-map-card-head {
    padding: 11px 12px 9px;
}

.pr-map-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 9px;
}

.pr-map-title-wrap h4 {
    font-size: 15px;
}

.pr-map-relation-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 5px;
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, var(--map-accent) 25%, #dbe3ec);
    border-radius: 999px;
    color: color-mix(in srgb, var(--map-accent) 84%, #0f172a);
    background: color-mix(in srgb, var(--map-accent) 7%, #fff);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.25;
}

.pr-map-description {
    padding: 0 12px 9px 57px;
}

.pr-map-meta {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    padding: 9px 12px 12px;
}

.pr-map-meta-item {
    padding: 7px 8px;
}

.pr-map-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
    font-size: 24px;
}

.pr-map-viewport:not(.is-panning) .pr-map-card,
.pr-map-viewport:not(.is-panning) .pr-map-canvas {
    cursor: grab;
}

.pr-map-viewport.is-panning,
.pr-map-viewport.is-panning * {
    cursor: grabbing !important;
    user-select: none !important;
}

@media (max-width: 900px) {
    .pr-map-toolbar {
        top: -12px;
    }

    .pr-map-toolbar-side {
        min-width: 0;
    }

    .pr-map-zoom-slider {
        flex: 1 1 180px;
    }

    .pr-map-zoom-slider input[type="range"] {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .pr-map-quick-stats > span {
        flex: 1 1 calc(50% - 7px);
        justify-content: center;
        border-radius: 10px;
    }

    .pr-map-toolbar {
        position: static;
    }

    .pr-map-tree {
        width: 650px;
    }
}



/* =========================================================
   PRODUCTOS · MAPA HORIZONTAL CON TARJETAS DE ESTADO 2026-08-06
========================================================= */
.pr-map-tree {
    display: inline-block;
    width: max-content;
    min-width: 100%;
    padding: 18px 34px 44px 18px;
}

.pr-map-node {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: 0;
}

.pr-map-node.is-root {
    max-width: none;
}

.pr-map-node-main {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex: 0 0 auto;
}

.pr-map-node.has-children > .pr-map-node-main::after {
    position: absolute;
    top: 50%;
    right: -48px;
    width: 48px;
    border-top: 2px solid #cbd5e1;
    content: "";
}

.pr-map-card {
    width: 350px;
    flex: 0 0 350px;
}

.pr-map-node.is-root > .pr-map-node-main > .pr-map-card {
    width: 430px;
    flex-basis: 430px;
}

.pr-map-card-head {
    min-height: 64px;
}

.pr-map-description {
    padding: 0 12px 9px 57px;
    font-size: 11px;
}

.pr-map-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pr-map-meta-item.is-wide {
    grid-column: 1 / -1;
}

.pr-map-children {
    position: relative;
    display: grid;
    align-content: center;
    gap: 16px;
    margin: 0 0 0 48px;
    padding: 14px 0 14px 28px;
    border-left: 2px solid #cbd5e1;
}

.pr-map-child {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.pr-map-child::before {
    position: absolute;
    top: 50%;
    left: -28px;
    width: 28px;
    border-top: 2px solid #cbd5e1;
    content: "";
}

.pr-map-child:last-child::after {
    display: none;
}

.pr-map-status-card {
    --status-accent: #64748b;
    position: relative;
    display: flex;
    width: 196px;
    min-height: 100%;
    flex: 0 0 196px;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--status-accent) 28%, #dbe3ec);
    border-top: 4px solid var(--status-accent);
    border-radius: 13px;
    background: color-mix(in srgb, var(--status-accent) 5%, #fff);
    box-shadow: 0 7px 18px rgba(15, 23, 42, .07);
}

.pr-map-status-card.is-recipe-method {
    --status-accent: #7c3aed;
}

.pr-map-status-card.is-direct-method {
    --status-accent: #d97706;
}

.pr-map-status-card.is-extra-method {
    --status-accent: #0f766e;
}

.pr-map-status-card.is-no-control-method,
.pr-map-status-card.is-info,
.pr-map-status-card.is-sin-control {
    --status-accent: #64748b;
}

.pr-map-status-card.is-alert-method {
    --status-accent: #dc2626;
}

.pr-map-status-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 7px;
}

.pr-map-status-head > span:first-child {
    color: var(--status-accent);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .05em;
    line-height: 1.25;
    text-transform: uppercase;
}

.pr-map-status-card .pr-map-state {
    max-width: 88px;
    padding: 4px 6px;
    font-size: 8px;
}

.pr-map-status-title {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
}

.pr-map-status-card > p {
    margin: 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.42;
}

.pr-map-status-facts {
    display: grid;
    gap: 5px;
}

.pr-map-status-facts > div {
    display: grid;
    grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
    gap: 6px;
    align-items: start;
    padding-top: 5px;
    border-top: 1px solid color-mix(in srgb, var(--status-accent) 18%, #e2e8f0);
}

.pr-map-status-facts span,
.pr-map-status-facts strong {
    overflow-wrap: anywhere;
    font-size: 9px;
    line-height: 1.3;
}

.pr-map-status-facts span {
    color: #64748b;
    font-weight: 800;
}

.pr-map-status-facts strong {
    color: #1e293b;
    font-weight: 950;
    text-align: right;
}

.pr-map-status-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 7px;
    border-top: 1px solid color-mix(in srgb, var(--status-accent) 20%, #e2e8f0);
}

.pr-map-status-footer > span {
    color: #475569;
    font-size: 9px;
    font-weight: 900;
}

.pr-map-status-card .pr-map-toggle {
    --map-accent: var(--status-accent);
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 9px;
    font-size: 20px;
}

.pr-map-node.has-children > .pr-map-card,
.pr-map-node.has-children.is-expanded > .pr-map-card {
    box-shadow: none;
}

.pr-map-viewport {
    min-height: 470px;
}

@media (max-width: 900px) {
    .pr-map-tree {
        width: max-content;
        min-width: 100%;
    }

    .pr-map-card {
        width: 320px;
        flex-basis: 320px;
    }

    .pr-map-node.is-root > .pr-map-node-main > .pr-map-card {
        width: 370px;
        flex-basis: 370px;
    }

    .pr-map-status-card {
        width: 180px;
        flex-basis: 180px;
    }
}

@media (max-width: 760px) {
    .pr-map-tree {
        width: max-content;
        min-width: 100%;
        padding: 12px 24px 34px 10px;
    }

    .pr-map-card,
    .pr-map-node.is-root > .pr-map-node-main > .pr-map-card {
        width: 285px;
        flex-basis: 285px;
    }

    .pr-map-status-card {
        width: 166px;
        flex-basis: 166px;
    }

    .pr-map-node-main {
        gap: 7px;
    }

    .pr-map-children {
        margin-left: 38px;
        padding-left: 22px;
    }

    .pr-map-node.has-children > .pr-map-node-main::after {
        right: -38px;
        width: 38px;
    }

    .pr-map-child::before {
        left: -22px;
        width: 22px;
    }

    .pr-map-meta {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PRODUCTOS · MAPA VISUAL POR TIPO Y CONECTORES ANIMADOS 2026-08-06
========================================================= */
.pr-map-node {
    --node-accent: #64748b;
    --node-accent-soft: #f1f5f9;
    --node-accent-border: #cbd5e1;
}

.pr-map-node--producto {
    --node-accent: #2563eb;
    --node-accent-soft: #eff6ff;
    --node-accent-border: #93c5fd;
}

.pr-map-node--receta {
    --node-accent: #7c3aed;
    --node-accent-soft: #f5f3ff;
    --node-accent-border: #c4b5fd;
}

.pr-map-node--insumo {
    --node-accent: #ea580c;
    --node-accent-soft: #fff7ed;
    --node-accent-border: #fdba74;
}

.pr-map-node--item_receta {
    --node-accent: #b45309;
    --node-accent-soft: #fffbeb;
    --node-accent-border: #fbbf24;
}

.pr-map-node--extras {
    --node-accent: #0f766e;
    --node-accent-soft: #f0fdfa;
    --node-accent-border: #5eead4;
}

.pr-map-node--categoria_extra {
    --node-accent: #0284c7;
    --node-accent-soft: #f0f9ff;
    --node-accent-border: #7dd3fc;
}

.pr-map-node--extra {
    --node-accent: #16a34a;
    --node-accent-soft: #f0fdf4;
    --node-accent-border: #86efac;
}

.pr-map-node--alerta {
    --node-accent: #dc2626;
    --node-accent-soft: #fef2f2;
    --node-accent-border: #fca5a5;
}

.pr-map-node--sin_control,
.pr-map-node--info {
    --node-accent: #64748b;
    --node-accent-soft: #f8fafc;
    --node-accent-border: #cbd5e1;
}

.pr-map-card {
    width: 420px;
    flex: 0 0 420px;
    border-color: var(--node-accent-border);
    border-left-color: var(--node-accent);
    background: linear-gradient(135deg, var(--node-accent-soft) 0%, #fff 58%);
}

.pr-map-node.is-root > .pr-map-node-main > .pr-map-card {
    width: 510px;
    flex-basis: 510px;
}

.pr-map-card--producto,
.pr-map-card--receta,
.pr-map-card--insumo,
.pr-map-card--item_receta,
.pr-map-card--extras,
.pr-map-card--categoria_extra,
.pr-map-card--extra,
.pr-map-card--alerta,
.pr-map-card--sin_control,
.pr-map-card--info {
    --map-accent: var(--node-accent);
    border-color: var(--node-accent-border);
    border-left-color: var(--node-accent);
    background: linear-gradient(135deg, var(--node-accent-soft) 0%, #fff 58%);
}

.pr-map-card-head {
    min-height: 78px;
    gap: 14px;
    padding: 16px 17px 12px;
}

.pr-map-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 13px;
    background: var(--node-accent);
}

.pr-map-icon svg,
.pr-map-status-kind-icon svg,
.pr-map-belongs-icon svg,
.pr-map-legend svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pr-map-type {
    margin-bottom: 4px;
    color: var(--node-accent);
    font-size: 11px;
}

.pr-map-title-wrap h4 {
    font-size: 18px;
    line-height: 1.3;
}

.pr-map-belongs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin-top: 7px;
    padding: 5px 8px;
    border: 1px solid color-mix(in srgb, var(--node-accent) 24%, #dbe3ec);
    border-radius: 999px;
    color: color-mix(in srgb, var(--node-accent) 84%, #0f172a);
    background: color-mix(in srgb, var(--node-accent) 7%, #fff);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.25;
}

.pr-map-belongs-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.pr-map-belongs-icon svg {
    width: 15px;
    height: 15px;
}

.pr-map-description {
    padding: 0 17px 12px 77px;
    font-size: 12px;
    line-height: 1.55;
}

.pr-map-meta {
    gap: 9px;
    padding: 12px 16px 16px;
}

.pr-map-meta-item {
    min-height: 58px;
    padding: 10px 11px;
}

.pr-map-meta-item span {
    font-size: 10px;
}

.pr-map-meta-item strong {
    font-size: 13px;
}

.pr-map-status-card {
    width: 240px;
    min-height: 100%;
    flex: 0 0 240px;
    gap: 10px;
    padding: 14px;
    border-color: var(--node-accent-border);
    border-top-color: var(--node-accent);
    background: linear-gradient(160deg, var(--node-accent-soft) 0%, #fff 72%);
}

.pr-map-status-card.pr-map-status-card--producto,
.pr-map-status-card.pr-map-status-card--receta,
.pr-map-status-card.pr-map-status-card--insumo,
.pr-map-status-card.pr-map-status-card--item_receta,
.pr-map-status-card.pr-map-status-card--extras,
.pr-map-status-card.pr-map-status-card--categoria_extra,
.pr-map-status-card.pr-map-status-card--extra,
.pr-map-status-card.pr-map-status-card--alerta,
.pr-map-status-card.pr-map-status-card--sin_control,
.pr-map-status-card.pr-map-status-card--info {
    --status-accent: var(--node-accent);
}

.pr-map-status-kind {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--node-accent) !important;
    font-size: 9px !important;
    font-weight: 950 !important;
    letter-spacing: .05em !important;
    line-height: 1.25 !important;
    text-transform: uppercase !important;
}

.pr-map-status-kind-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 7px;
    color: #fff;
    background: var(--node-accent);
}

.pr-map-status-kind-icon svg {
    width: 15px;
    height: 15px;
}

.pr-map-status-title {
    font-size: 16px;
}

.pr-map-status-card > p {
    font-size: 11px;
    line-height: 1.5;
}

.pr-map-status-facts {
    gap: 7px;
}

.pr-map-status-facts > div {
    gap: 8px;
    padding-top: 7px;
    border-top-color: color-mix(in srgb, var(--node-accent) 22%, #e2e8f0);
}

.pr-map-status-facts span,
.pr-map-status-facts strong {
    font-size: 10px;
    line-height: 1.35;
}

.pr-map-status-footer {
    padding-top: 9px;
    border-top-color: color-mix(in srgb, var(--node-accent) 24%, #e2e8f0);
}

.pr-map-status-footer > span {
    font-size: 10px;
}

.pr-map-status-card .pr-map-toggle {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-color: color-mix(in srgb, var(--node-accent) 38%, #cbd5e1);
    color: var(--node-accent);
    background: #fff;
}

.pr-map-node-main {
    gap: 13px;
}

.pr-map-children {
    gap: 22px;
    margin-left: 64px;
    padding: 18px 0 18px 34px;
    border-left: 0;
}

.pr-map-node.has-children > .pr-map-node-main::after,
.pr-map-child::before {
    height: 4px;
    border: 0;
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--node-accent) 18%, #cbd5e1) 0%,
            color-mix(in srgb, var(--node-accent) 42%, #fff) 26%,
            var(--node-accent) 50%,
            color-mix(in srgb, var(--node-accent) 42%, #fff) 74%,
            color-mix(in srgb, var(--node-accent) 18%, #cbd5e1) 100%);
    background-size: 220% 100%;
    box-shadow: 0 0 8px color-mix(in srgb, var(--node-accent) 26%, transparent);
    animation: prMapConnectorFlow 1.8s linear infinite;
}

.pr-map-node.has-children > .pr-map-node-main::after {
    right: -64px;
    width: 64px;
}

.pr-map-child::before {
    left: -34px;
    width: 34px;
}

.pr-map-children::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -2px;
    width: 4px;
    border-radius: 999px;
    background:
        repeating-linear-gradient(180deg,
            color-mix(in srgb, var(--node-accent) 22%, #cbd5e1) 0 10px,
            var(--node-accent) 10px 18px,
            color-mix(in srgb, var(--node-accent) 22%, #cbd5e1) 18px 28px);
    background-size: 100% 56px;
    box-shadow: 0 0 8px color-mix(in srgb, var(--node-accent) 22%, transparent);
    content: "";
    animation: prMapConnectorFlowVertical 1.8s linear infinite;
}

.pr-map-child:last-child::after {
    display: none;
}

.pr-map-legend span {
    gap: 7px;
    padding: 7px 10px;
}

.pr-map-legend span::before {
    display: none;
}

.pr-map-legend svg {
    width: 16px;
    height: 16px;
}

.pr-map-legend .is-product {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.pr-map-legend .is-recipe {
    color: #6d28d9;
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.pr-map-legend .is-input {
    color: #c2410c;
    border-color: #fed7aa;
    background: #fff7ed;
}

.pr-map-legend .is-extra-group {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.pr-map-legend .is-extra-category {
    color: #0369a1;
    border-color: #bae6fd;
    background: #f0f9ff;
}

.pr-map-legend .is-extra {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

@keyframes prMapConnectorFlow {
    from { background-position: 100% 0; }
    to { background-position: -120% 0; }
}

@keyframes prMapConnectorFlowVertical {
    from { background-position: 0 0; }
    to { background-position: 0 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .pr-map-node.has-children > .pr-map-node-main::after,
    .pr-map-child::before,
    .pr-map-children::before {
        animation: none;
    }
}

@media (max-width: 900px) {
    .pr-map-card {
        width: 380px;
        flex-basis: 380px;
    }

    .pr-map-node.is-root > .pr-map-node-main > .pr-map-card {
        width: 450px;
        flex-basis: 450px;
    }

    .pr-map-status-card {
        width: 220px;
        flex-basis: 220px;
    }
}

@media (max-width: 760px) {
    .pr-map-card,
    .pr-map-node.is-root > .pr-map-node-main > .pr-map-card {
        width: 330px;
        flex-basis: 330px;
    }

    .pr-map-status-card {
        width: 205px;
        flex-basis: 205px;
    }

    .pr-map-node-main {
        gap: 9px;
    }

    .pr-map-children {
        margin-left: 46px;
        padding-left: 25px;
    }

    .pr-map-node.has-children > .pr-map-node-main::after {
        right: -46px;
        width: 46px;
    }

    .pr-map-child::before {
        left: -25px;
        width: 25px;
    }

    .pr-map-card-head {
        min-height: 72px;
    }

    .pr-map-description {
        padding-left: 17px;
    }
}


/* =========================================================
   PRODUCTOS · MAPA COMO ESPACIO PRINCIPAL Y AVISO TIPO TOAST 2026-08-06
========================================================= */
.pr-inventory-dialog.is-map-mode {
    width: min(1580px, 99vw);
    height: min(980px, 97vh);
    max-height: 97vh;
    border-radius: 16px;
}

.pr-inventory-dialog.is-map-mode .pr-inventory-head {
    flex: 0 0 auto;
    min-height: 70px;
    padding: 11px 16px;
}

.pr-inventory-dialog.is-map-mode .pr-inventory-head .vase-modern-kicker {
    font-size: 10px;
    line-height: 1.15;
}

.pr-inventory-dialog.is-map-mode .pr-inventory-head h3 {
    margin: 2px 0 1px;
    font-size: 19px;
    line-height: 1.2;
}

.pr-inventory-dialog.is-map-mode .pr-inventory-head p {
    max-width: 850px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-inventory-dialog.is-map-mode .pr-inventory-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 22px;
}

.pr-inventory-dialog.is-map-mode .pr-inventory-footer {
    display: none;
}

.pr-inventory-body.is-map-mode {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 8px 10px 10px;
}

.pr-inventory-body.is-map-mode .pr-map-toolbar {
    position: relative;
    top: auto;
    z-index: 18;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin: 0 0 7px;
    padding: 6px 8px;
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .05);
}

.pr-inventory-body.is-map-mode .pr-map-toolbar-copy {
    display: flex;
    flex: 0 1 auto;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.pr-inventory-body.is-map-mode .pr-map-toolbar-copy strong {
    flex: 0 0 auto;
    font-size: 13px;
    white-space: nowrap;
}

.pr-inventory-body.is-map-mode .pr-map-toolbar-copy span {
    overflow: hidden;
    max-width: 240px;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-inventory-body.is-map-mode .pr-map-quick-stats {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.pr-inventory-body.is-map-mode .pr-map-quick-stats > span {
    min-height: 28px;
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
}

.pr-inventory-body.is-map-mode .pr-map-quick-stats svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pr-inventory-body.is-map-mode .pr-map-toolbar-side {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.pr-map-legend-menu {
    position: relative;
    flex: 0 0 auto;
}

.pr-map-legend-menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    background: #fff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
    list-style: none;
    white-space: nowrap;
}

.pr-map-legend-menu > summary::-webkit-details-marker {
    display: none;
}

.pr-map-legend-menu > summary:hover,
.pr-map-legend-menu > summary:focus-visible,
.pr-map-legend-menu[open] > summary {
    border-color: #0f766e;
    color: #115e59;
    background: #f0fdfa;
}

.pr-map-legend-menu > summary svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pr-map-legend-menu .pr-map-legend {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 330px;
    padding: 9px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
}

.pr-map-legend-menu:not([open]) .pr-map-legend {
    display: none;
}

.pr-map-legend-menu .pr-map-legend span {
    justify-content: flex-start;
    min-width: 0;
    padding: 6px 8px;
    font-size: 10px;
}

.pr-inventory-body.is-map-mode .pr-map-controls {
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
}

.pr-inventory-body.is-map-mode .pr-map-controls button {
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 10px;
    white-space: nowrap;
}

.pr-inventory-body.is-map-mode .pr-map-controls button.is-icon {
    width: 30px;
    padding: 0;
    font-size: 17px;
}

.pr-inventory-body.is-map-mode .pr-map-controls .pr-map-zoom-value {
    min-width: 48px;
}

.pr-inventory-body.is-map-mode .pr-map-control-separator {
    height: 22px;
    margin: 0 1px;
}

.pr-inventory-body.is-map-mode .pr-map-zoom-slider {
    min-height: 30px;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 9px;
}

.pr-inventory-body.is-map-mode .pr-map-zoom-slider input[type="range"] {
    width: 80px;
}

.pr-inventory-body.is-map-mode .pr-map-viewport {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 16px;
    border-radius: 13px;
    scrollbar-gutter: stable;
}

.pr-inventory-body.is-map-mode .pr-map-stage {
    min-height: 100%;
}

.pr-map-warning-toast {
    position: absolute;
    top: 76px;
    right: 16px;
    z-index: 80;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: min(430px, calc(100% - 32px));
    padding: 10px 10px 10px 11px;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    color: #78350f;
    background: rgba(255, 251, 235, .98);
    box-shadow: 0 16px 38px rgba(120, 53, 15, .2);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}

.pr-map-warning-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pr-map-warning-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: #fff;
    background: #d97706;
}

.pr-map-warning-toast-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pr-map-warning-toast-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.pr-map-warning-toast-copy strong {
    color: #92400e;
    font-size: 11px;
    line-height: 1.2;
}

.pr-map-warning-toast-copy > span {
    overflow: hidden;
    color: #78350f;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-map-warning-toast-copy small {
    margin-left: 3px;
    color: #b45309;
    font-size: 10px;
    font-weight: 900;
}

.pr-map-warning-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #92400e;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.pr-map-warning-toast-close:hover,
.pr-map-warning-toast-close:focus-visible {
    background: #fef3c7;
}

@media (max-width: 1180px) {
    .pr-inventory-body.is-map-mode .pr-map-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .pr-inventory-body.is-map-mode .pr-map-toolbar-copy {
        flex: 1 1 260px;
    }

    .pr-inventory-body.is-map-mode .pr-map-toolbar-side {
        flex: 1 1 100%;
    }
}

@media (max-width: 900px) {
    .pr-inventory-modal {
        padding: 5px;
    }

    .pr-inventory-dialog.is-map-mode {
        width: 100%;
        height: 98vh;
        max-height: 98vh;
        border-radius: 12px;
    }

    .pr-inventory-body.is-map-mode .pr-map-toolbar-copy span {
        display: none;
    }

    .pr-inventory-body.is-map-mode .pr-map-quick-stats {
        flex: 1 1 auto;
    }

    .pr-inventory-body.is-map-mode .pr-map-toolbar-side {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .pr-map-warning-toast {
        top: 70px;
        right: 10px;
        width: min(410px, calc(100% - 20px));
    }
}

@media (max-width: 760px) {
    .pr-inventory-dialog.is-map-mode .pr-inventory-head {
        min-height: 62px;
        padding: 9px 11px;
    }

    .pr-inventory-dialog.is-map-mode .pr-inventory-head p {
        max-width: 72vw;
    }

    .pr-inventory-body.is-map-mode {
        padding: 6px;
    }

    .pr-inventory-body.is-map-mode .pr-map-toolbar {
        gap: 6px;
        padding: 6px;
    }

    .pr-inventory-body.is-map-mode .pr-map-toolbar-copy {
        display: none;
    }

    .pr-inventory-body.is-map-mode .pr-map-quick-stats > span {
        flex: 0 0 auto;
        min-height: 26px;
        border-radius: 999px;
    }

    .pr-inventory-body.is-map-mode .pr-map-controls {
        width: max-content;
    }

    .pr-inventory-body.is-map-mode .pr-map-controls button:not(.is-icon):not(.pr-map-zoom-value) {
        flex: 0 0 auto;
    }

    .pr-inventory-body.is-map-mode .pr-map-zoom-slider {
        display: none;
    }

    .pr-inventory-body.is-map-mode .pr-map-viewport {
        padding: 9px;
    }

    .pr-map-legend-menu .pr-map-legend {
        right: auto;
        left: 0;
        width: min(300px, 82vw);
    }

    .pr-map-warning-toast-copy > span {
        white-space: normal;
    }
}

/* Formulario de producto: consumo compacto y unidad automática */
.pr-inventory-consumption-row {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(220px, 1fr);
    gap: 12px;
    align-items: stretch;
}
.pr-inventory-consumption-fields {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(90px, .7fr);
    gap: 8px;
    align-items: end;
}
.pr-inventory-consumption-fields .pr-input { min-height: 40px; }
.pr-inventory-unit-lock[readonly] {
    background: #f2f5f8;
    cursor: not-allowed;
    font-weight: 800;
    text-align: center;
}
@media (max-width: 760px) {
    .pr-inventory-consumption-row { grid-template-columns: 1fr; }
}

/* Imagen opcional de combos */
.combo-optional { color: #7c8797; font-weight: 500; }
.combo-image-editor {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    background: rgba(248, 250, 252, .75);
}
.combo-image-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.combo-crop-stage {
    position: relative;
    min-height: 230px;
    max-height: 430px;
    overflow: hidden;
    border-radius: 12px;
    background: #10151c;
    display: grid;
    place-items: center;
}
.combo-crop-stage > span { color: #9eabb9; padding: 24px; text-align: center; }
.combo-crop-stage img { display: none; max-width: 100%; }
.combo-crop-stage.has-image > span { display: none; }
.combo-crop-stage.has-image img { display: block; }
.combo-crop-result { display: grid; gap: 5px; }
.combo-crop-result span { color: #64748b; font-size: 12px; font-weight: 700; }
.combo-crop-result img { max-height: 170px; max-width: 100%; border-radius: 10px; object-fit: contain; }

/* =========================================================
   2026-08-06 · Catálogo tabulado + editor en modal
   ========================================================= */
.pr-products-table-layout {
    display: block !important;
}

.pr-products-table-card {
    width: 100%;
    overflow: hidden;
}

.pr-list-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(220px, .8fr);
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}

.pr-search-field,
.pr-filter-field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.pr-search-field > span,
.pr-filter-field > span {
    color: #5f6d7d;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pr-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -5px -7px;
    padding: 5px 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.pr-sort-btn:hover,
.pr-sort-btn:focus-visible,
.pr-sort-btn.is-active {
    background: #eaf1f8;
    color: #324a65;
    outline: none;
}

.pr-sort-icon {
    display: inline-flex;
    min-width: 12px;
    justify-content: center;
    color: #53708f;
    font-size: 13px;
    line-height: 1;
}

@media (max-width: 760px) {
    .pr-list-toolbar {
        grid-template-columns: 1fr;
    }
}

.pr-products-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 16px;
    background: #fff;
}

.pr-products-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.pr-products-table thead th {
    padding: 13px 14px;
    border-bottom: 1px solid #e7edf3;
    background: #f7f9fc;
    color: #617083;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.pr-products-table tbody td {
    padding: 14px;
    border-bottom: 1px solid #edf1f5;
    color: #263342;
    vertical-align: middle;
}

.pr-products-table tbody tr:last-child td { border-bottom: 0; }
.pr-products-table tbody tr { transition: background .16s ease, transform .16s ease; }
.pr-products-table tbody tr:hover { background: #f8fbff; }
.pr-products-table tbody tr.pr-row-warning { background: #fffaf2; }

.pr-table-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 9px;
    border-radius: 9px;
    background: #eef3f8;
    color: #405065;
    font-size: 12px;
    font-weight: 900;
}

.pr-table-product,
.pr-table-inventory {
    display: grid;
    gap: 4px;
}

.pr-table-product > strong {
    color: #172233;
    font-size: 14px;
}

.pr-table-product > small,
.pr-table-inventory > small {
    display: block;
    max-width: 320px;
    overflow: hidden;
    color: #7a8796;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-table-category,
.pr-inventory-mode,
.pr-status-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.pr-table-category { background: #edf4ff; color: #3667a6; }
.pr-table-category.is-warning { background: #fff0d8; color: #9a6100; }
.pr-inventory-mode.is-item { background: #eaf8f0; color: #23744b; }
.pr-inventory-mode.is-recipe { background: #edf1ff; color: #4c5fb7; }
.pr-inventory-mode.is-warning { background: #fff0df; color: #a15c13; }
.pr-inventory-mode.is-free { background: #f1f3f5; color: #697480; }
.pr-inventory-mode.is-combo { background: #f4efff; color: #7046a5; }
.pr-status-pill.is-active { background: #e9f8ef; color: #23744b; }
.pr-status-pill.is-inactive { background: #f0f2f4; color: #69727d; }
.pr-table-price { color: #18283a; white-space: nowrap; }

.pr-table-actions-head,
.pr-table-actions-cell { text-align: right !important; }
.pr-table-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.pr-mini-btn {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #d8e0e8;
    border-radius: 9px;
    background: #fff;
    color: #3a4858;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pr-mini-btn:hover { border-color: #aebdce; box-shadow: 0 5px 14px rgba(31, 49, 68, .08); transform: translateY(-1px); }
.pr-mini-edit { background: #eef5ff; border-color: #d3e3fa; color: #285d9c; }
.pr-mini-map { background: #f6f8fa; }
.pr-table-empty { padding: 32px 12px; text-align: center; }

body.pr-editor-open { overflow: hidden; }
.pr-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.pr-editor-modal.is-open { display: flex !important; }
.pr-editor-modal.pr-modal-hidden { display: none !important; }
.pr-editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 26, 36, .66);
    backdrop-filter: blur(4px);
}
.pr-editor-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1120px, 96vw);
    height: min(900px, 94vh);
    max-height: 94vh;
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(7, 20, 35, .3);
}
.pr-editor-dialog .pr-editor-head {
    position: sticky;
    flex: 0 0 auto;
    top: 0;
    z-index: 8;
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid #e7edf3;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
}
.pr-editor-dialog .pr-form {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 20px 24px;
}
.pr-editor-subtitle {
    margin: 4px 0 0;
    color: #768397;
    font-size: 12px;
}
.pr-editor-close {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #dfe5eb;
    border-radius: 11px;
    background: #f7f9fb;
    color: #4a5766;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
.pr-editor-close:hover { background: #eef3f7; }
.pr-editor-dialog .pr-footer {
    position: relative;
    z-index: 9;
    flex: 0 0 auto;
    margin: 0;
    padding: 14px 20px;
    border-top: 1px solid #e6ebf0;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(8px);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
}
.pr-footer-spacer { flex: 1 1 auto; }

@media (max-width: 760px) {
    .pr-editor-modal { padding: 0; align-items: stretch; }
    .pr-editor-dialog { width: 100%; max-height: 100vh; border-radius: 0; }
    .pr-editor-dialog .pr-form { max-height: none; }
    .pr-editor-dialog .pr-footer { flex-wrap: wrap; }
    .pr-footer-spacer { display: none; }
    .pr-editor-dialog .pr-footer .pr-btn { flex: 1 1 46%; }
}

/* =========================================================
   PRODUCTOS · IMAGEN COLAPSADA + PREVIEW POS REAL
   2026-08-09 · v11
   ========================================================= */
.pr-image-row .img-editor.img-editor-single {
    padding: 0;
    border: 0;
    background: transparent;
}

.img-select-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.img-selection-status {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.img-selection-status[data-tone="ready"] { color: #047857; }
.img-selection-status[data-tone="remove"] { color: #be123c; }

.img-editor-panel {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dbe3ea;
    border-radius: 14px;
    background: #f8fafc;
}

.img-editor-panel[hidden] { display: none !important; }
.img-editor.is-collapsed .img-file-button { min-height: 38px; }
.img-editor.is-collapsed .img-selection-status { display: none; }

.crop-result-preview {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
}

.crop-result-preview > span {
    display: block;
    margin-bottom: 7px;
    color: #1e40af;
    font-size: 12px;
    font-weight: 800;
}

.crop-result-preview > img {
    display: block;
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    object-fit: contain;
}

.pr-pos-preview-section { padding-top: 4px; }

.pr-pos-preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pr-pos-preview-heading small {
    display: block;
    max-width: 720px;
    margin-top: 3px;
    color: #64748b;
    line-height: 1.4;
}

.pr-pos-preview-sync {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 11px;
    font-weight: 800;
}

.pr-pos-preview-shell {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 14px;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.pr-pos-preview-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
}

/* Tarjeta: mismas proporciones, estructura y comportamiento visual del POS en vista grid. */
.pr-pos-preview-stage .producto.pr-pos-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 210px !important;
    height: 276px !important;
    min-height: 276px !important;
    max-height: 276px !important;
    padding: 6px !important;
    gap: 4px !important;
    overflow: hidden !important;
    border: 2px solid rgba(53, 184, 199, .25);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
    box-sizing: border-box;
    cursor: pointer;
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.pr-pos-preview-stage .producto.pr-pos-product-card:hover,
.pr-pos-preview-stage .producto.pr-pos-product-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(53, 184, 199, .75);
    outline: none;
    box-shadow: 0 0 0 2px rgba(53, 184, 199, .20), 0 8px 18px rgba(0, 0, 0, .10);
}

.pr-pos-preview-stage .producto.pr-pos-product-card::before { display: none !important; }

.pr-pos-preview-stage .producto .prod-media {
    flex: 0 0 178px !important;
    width: 100% !important;
    height: 178px !important;
    min-height: 178px !important;
    max-height: 178px !important;
    overflow: hidden !important;
    border-radius: 12px;
}

.pr-pos-preview-stage .producto img.prod-imagen,
.pr-pos-preview-stage .producto .prod-media img {
    display: block;
    width: 100% !important;
    height: 178px !important;
    min-height: 178px !important;
    max-height: 178px !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    object-fit: cover !important;
    transform: scale(1.04);
    transform-origin: center;
    transition: transform .2s ease;
}

.pr-pos-preview-stage .producto:hover img.prod-imagen { transform: scale(1.075); }

.pr-pos-preview-stage .producto .prod-info {
    display: grid !important;
    grid-template-rows: 38px 20px 20px !important;
    row-gap: 2px !important;
    flex: 1 1 auto !important;
    align-content: start !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    text-align: center !important;
}

.pr-pos-preview-stage .producto .prod-nombre {
    display: -webkit-box !important;
    align-self: center !important;
    min-height: 0 !important;
    max-height: 38px !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    color: #111;
    overflow-wrap: anywhere;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.05 !important;
}

.pr-pos-preview-stage .producto .prod-precio {
    align-self: center !important;
    margin: 0 !important;
    color: #111;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
}

.pr-pos-preview-stage .producto .prod-stock-status,
.pr-pos-preview-stage .producto .prod-stock-status:empty {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    width: 100% !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pr-pos-preview-stage .producto .prod-stock-status:empty { visibility: hidden !important; }

.pr-pos-preview-open {
    width: 210px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.pr-pos-preview-open:hover { background: #dbeafe; }

/* Burbujas copiadas del lenguaje visual del POS. */
.pr-pos-preview-section .pos-stock-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    box-sizing: border-box;
    white-space: nowrap;
}

.pr-pos-preview-section .pos-stock-bubble.pos-stock-ok,
.pr-pos-preview-section .pos-stock-bubble.pos-stock-directo {
    border-color: #6ee7b7 !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
}

.pr-pos-preview-section .pos-stock-bubble.pos-stock-low {
    border-color: #fcd34d !important;
    background: #fffbeb !important;
    color: #92400e !important;
}

.pr-pos-preview-section .pos-stock-bubble.pos-stock-loading {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.pr-pos-preview-section .pos-stock-bubble.pos-stock-out {
    border-color: #dc2626 !important;
    background: #ef4444 !important;
    color: #fff !important;
}

.pr-pos-preview-section .pos-stock-bubble.pos-stock-nolink {
    border-color: #fda4af !important;
    background: #fff1f2 !important;
    color: #9f1239 !important;
}

.pr-pos-preview-stage .producto .prod-stock-status > .pos-stock-bubble.pos-stock-producto {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 3px 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 8px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.pr-pos-preview-stage .producto .prod-stock-status > .pos-stock-bubble.pos-stock-agotado {
    min-width: 116px !important;
    padding-right: 9px !important;
    padding-left: 9px !important;
    overflow: visible !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, .20) !important;
}

.pr-pos-preview-stage .producto .prod-stock-status > .pos-stock-bubble.pos-stock-agotado::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    margin-right: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .23);
    color: #fff;
    font-size: 9px;
    font-weight: 1000;
}

.pr-pos-preview-stage .producto.pos-stock-no-seleccionable { opacity: .82; }
.pr-pos-product-card[data-active="0"] { filter: grayscale(.22); opacity: .62 !important; }

.pr-pos-preview-rules {
    display: grid;
    gap: 9px;
    align-content: start;
}

.pr-pos-preview-rules > div {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fff;
}

.pr-pos-preview-rules span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.pr-pos-preview-rules strong {
    min-width: 0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pr-pos-preview-rules > small {
    padding: 0 4px;
    color: #64748b;
    line-height: 1.45;
}

/* Simulación de lo que abre el POS al seleccionar la tarjeta. */
.pr-pos-selection-preview {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.pr-pos-selection-preview[hidden] { display: none !important; }

.pr-pos-selection-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f5;
}

.pr-pos-selection-head h3 {
    margin: 4px 0 3px;
    color: #111827;
    font-size: 19px;
    font-weight: 900;
}

.pr-pos-selection-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.pr-pos-selection-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 23px;
    cursor: pointer;
}

.pr-pos-extras-host { padding-top: 12px; }

.pr-pos-extras-loading,
.pr-pos-extras-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    text-align: center;
}

.pr-pos-extras-empty.is-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.pr-pos-selection-preview .grupo {
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.pr-pos-selection-preview .grupo:last-child { margin-bottom: 0; }

.pr-pos-selection-preview .grupo-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.pr-pos-selection-preview .grupo h4 { margin: 0; color: #111; }
.pr-pos-selection-preview .grupo-items { display: flex; flex-direction: column; gap: 8px; }

.pr-pos-selection-preview .grupo-regla {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.pr-pos-selection-preview .grupo-regla span {
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.pr-pos-selection-preview .grupo-regla.is-required {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.pr-pos-selection-preview .grupo-regla.is-optional {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
}

.pr-pos-selection-preview .check,
.pr-pos-selection-preview .qty-row {
    position: relative;
    min-height: 48px;
    box-sizing: border-box;
}

.pr-pos-selection-preview .check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #fff;
}

.pr-pos-selection-preview .check > input { flex: 0 0 auto; }
.pr-pos-selection-preview .check > span:not(.pos-stock-bubble) { padding-right: 145px; color: #111; }

.pr-pos-selection-preview .qty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    padding-right: 150px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #fff;
}

.pr-pos-selection-preview .qty-left {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pr-pos-selection-preview .qty-name { color: #111; font-weight: 900; }
.pr-pos-selection-preview .qty-price { font-size: 12px; }
.pr-pos-selection-preview .muted { color: #6b7280; }

.pr-pos-selection-preview .qty-right {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.pr-pos-selection-preview .qty-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 18px;
}

.pr-pos-selection-preview .qty-btn:disabled {
    border-color: #e5e7eb;
    background: #f1f3f5;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: .6;
}

.pr-pos-selection-preview .qty-num {
    min-width: 26px;
    color: #111;
    text-align: center;
    font-weight: 1000;
}

.pr-pos-selection-preview .extra-row > .pos-stock-bubble.pos-stock-extra {
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 138px !important;
    height: 20px !important;
    padding: 0 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-radius: 999px !important;
    font-size: 8px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    z-index: 2;
}

.pr-pos-selection-preview .extra-row.pos-stock-no-seleccionable { opacity: .76; }

@media (max-width: 760px) {
    .pr-editor-dialog { height: 100vh; max-height: 100vh; }

    .img-select-line,
    .pr-pos-preview-heading,
    .pr-pos-selection-head {
        align-items: stretch;
        flex-direction: column;
    }

    .pr-pos-preview-shell { grid-template-columns: 1fr; }
    .pr-pos-preview-stage { justify-self: center; }
    .pr-pos-preview-rules > div { grid-template-columns: 1fr; gap: 3px; }
    .pr-pos-selection-preview .grupo-head { align-items: flex-start; flex-direction: column; }
    .pr-pos-selection-preview .grupo-regla { white-space: normal; }
    .pr-pos-selection-preview .check > span:not(.pos-stock-bubble) { padding-right: 118px; }
    .pr-pos-selection-preview .qty-row { align-items: flex-start; flex-direction: column-reverse; padding-right: 125px; }
}

/* =========================================================
   PRODUCTOS · PREVIEW DE EXTRAS = MODAL POS · v11
   Réplica acotada de las reglas finales usadas por #modal en pos.css.
========================================================= */
.pr-pos-selection-preview .grupo {
    position: relative !important;
    margin: 0 !important;
    padding: 17px 4px !important;
    border: 0 !important;
    border-bottom: 1px solid #e8edf3 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pr-pos-selection-preview .grupo:first-child { padding-top: 4px !important; }
.pr-pos-selection-preview .grupo:last-child { border-bottom: 0 !important; }

/* Igual que el POS: una categoría obligatoria nace destacada hasta completar el mínimo. */
.pr-pos-selection-preview .grupo.min-bad {
    margin-bottom: 10px !important;
    padding: 14px !important;
    border: 2px solid #f59e0b !important;
    border-radius: 14px !important;
    background: #fffbeb !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .11) !important;
}

.pr-pos-selection-preview .grupo.min-ok {
    padding-left: 13px !important;
    border-left: 4px solid #22c55e !important;
    background: linear-gradient(90deg, rgba(34, 197, 94, .055), transparent 45%) !important;
}

.pr-pos-selection-preview .grupo-head {
    align-items: center !important;
    margin-bottom: 8px !important;
}

.pr-pos-selection-preview .grupo h4 {
    margin: 0 !important;
    color: #111 !important;
    font-size: 21px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
}

.pr-pos-selection-preview .grupo-items { gap: 0 !important; }

/* Igual que el modal real: extras como líneas, no tarjetas separadas. */
.pr-pos-selection-preview .check,
.pr-pos-selection-preview .qty-row {
    position: relative !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 12px 5px !important;
    border: 0 !important;
    border-bottom: 1px solid #eef2f6 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pr-pos-selection-preview .grupo-items > .check:last-child,
.pr-pos-selection-preview .grupo-items > .qty-row:last-child { border-bottom: 0 !important; }

.pr-pos-selection-preview .check:hover,
.pr-pos-selection-preview .qty-row:hover { background: #f8fafc !important; }

.pr-pos-selection-preview .check input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
}

.pr-pos-selection-preview .check > span:not(.pos-stock-bubble),
.pr-pos-selection-preview .qty-name {
    color: #111 !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}

.pr-pos-selection-preview .check small,
.pr-pos-selection-preview .qty-price {
    color: #000 !important;
    font-size: 13px !important;
    font-weight: 550 !important;
}

.pr-pos-selection-preview .qty-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding-right: 150px !important;
}

.pr-pos-selection-preview .check > span:not(.pos-stock-bubble),
.pr-pos-selection-preview .qty-row .qty-name,
.pr-pos-selection-preview .extra-row .qty-name { padding-right: 145px !important; }

.pr-pos-selection-preview .grupo.min-bad .grupo-regla.is-required {
    border-color: #d97706 !important;
    background: #f59e0b !important;
    color: #fff !important;
}

.pr-pos-selection-preview .extra-row > .pos-stock-bubble.pos-stock-extra {
    right: 10px !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
    font-family: inherit !important;
    font-size: 8px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-transform: none !important;
    text-shadow: none !important;
}

.pr-pos-selection-preview .extra-row.is-selected { background: #f8fafc !important; }

@media (max-width: 760px) {
    .pr-pos-selection-preview .grupo-head { align-items: flex-start !important; flex-direction: column !important; }
    .pr-pos-selection-preview .grupo-regla { white-space: normal !important; }
    .pr-pos-selection-preview .check > span:not(.pos-stock-bubble),
    .pr-pos-selection-preview .qty-row .qty-name,
    .pr-pos-selection-preview .extra-row .qty-name { padding-right: 125px !important; }
    .pr-pos-selection-preview .extra-row > .pos-stock-bubble.pos-stock-extra {
        right: 7px !important;
        height: 18px !important;
        padding: 0 5px !important;
        font-size: 7px !important;
        line-height: 18px !important;
    }
}

/* =========================================================
   PRODUCTOS · MODAL UNIFICADO + CATEGORÍAS DE EXTRAS
   2026-08-13 · v13
========================================================= */
.pr-editor-dialog {
    width: min(1180px, calc(100vw - 32px)) !important;
    height: calc(100dvh - 32px) !important;
    max-height: 900px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.pr-editor-dialog .pr-form {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 20px 22px 30px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
}

.pr-editor-dialog .pr-editor-head,
.pr-editor-dialog .pr-editor-footer {
    width: 100%;
    box-sizing: border-box;
}

.pr-editor-dialog.is-saving {
    cursor: progress;
}

.pr-editor-dialog.is-saving .pr-form {
    opacity: .88;
}

.pr-editor-dialog #btnGuardar:disabled {
    cursor: wait;
    opacity: .72;
}

.pr-extra-category-section {
    margin-top: 18px !important;
    padding: 16px;
    border: 1px solid #d8e4f0;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fbff 0%, #ffffff 54%, #f3fbf8 100%);
    box-shadow: 0 8px 24px rgba(30, 64, 95, .06);
}

.pr-extra-category-section .ba-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.ba-section-heading-copy {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
}

.ba-section-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 17px;
    font-weight: 1000;
}

.ba-section-title {
    margin: 0 !important;
    color: #172033;
    font-size: 15px;
    font-weight: 950;
}

.pr-extra-category-section .ba-help {
    max-width: 650px;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.ba-search-box {
    display: grid;
    flex: 0 1 330px;
    gap: 5px;
    margin: 0;
}

.ba-search-box > span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ba-search-box .pr-input {
    min-width: 240px;
    border-color: #cfd9e5;
    background: #fff;
}

.pr-extra-category-section .ba-order-panel {
    margin-top: 14px;
    padding: 14px;
    border-color: #c9e8df;
    background: #f3fbf8;
}

.pr-extra-category-section .ba-panel-title > div,
.pr-extra-category-section .ba-available-title > div {
    display: grid;
    gap: 2px;
}

.pr-extra-category-section .ba-panel-title small,
.pr-extra-category-section .ba-available-title small {
    color: #64748b;
    font-size: 10px;
    font-weight: 650;
}

.pr-extra-category-section .ba-available-title {
    margin: 14px 2px 0;
}

.pr-extra-category-section .ba-available-list {
    margin-top: 8px;
    padding: 8px;
    border-color: #dbe4ee;
    background: rgba(255, 255, 255, .8);
}

.pr-extra-category-section .ba-sort-item {
    border-color: #bfe4d9;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .06);
}

.img-edit-current-button {
    min-height: 38px;
    padding: 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 12px;
    font-weight: 850;
    box-shadow: none !important;
}

.img-edit-current-button:hover {
    border-color: #8b5cf6 !important;
    color: #6d28d9 !important;
    background: #faf7ff !important;
}

.img-unified-stage.has-image .cropper-canvas,
.img-unified-stage.has-image .cropper-face {
    cursor: move !important;
}

@media (max-width: 760px) {
    .pr-editor-dialog {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    .pr-extra-category-section .ba-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .ba-search-box,
    .ba-search-box .pr-input {
        width: 100%;
        min-width: 0;
    }
}


/* =========================================================
   PRODUCTOS · APERTURA ROBUSTA DEL MODAL
   2026-08-13 · v14
========================================================= */
#prEditorModal.pr-editor-modal.is-open:not([hidden]) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-backdrop {
    pointer-events: auto;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* =========================================================
   PRODUCTOS · BLINDAJE FINAL DEL EDITOR
   2026-08-13 · v15
   Evita que reglas globales de .pr-card/form colapsen el cuerpo del modal.
========================================================= */
#prEditorModal.pr-editor-modal.is-open:not([hidden]) {
    inset: 0 !important;
    padding: 16px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
    display: flex !important;
    flex: 0 1 1180px !important;
    flex-direction: column !important;
    width: min(1180px, calc(100vw - 32px)) !important;
    height: calc(100vh - 32px) !important;
    min-height: min(620px, calc(100vh - 32px)) !important;
    max-height: 900px !important;
    margin: 0 !important;
    overflow: hidden !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-head,
#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-footer {
    flex: 0 0 auto !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
    display: block !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

@media (max-height: 650px) and (min-width: 761px) {
    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
        min-height: 0 !important;
        height: calc(100vh - 20px) !important;
        max-height: calc(100vh - 20px) !important;
    }
    #prEditorModal.pr-editor-modal.is-open:not([hidden]) { padding: 10px !important; }
}

@media (max-width: 760px) {
    #prEditorModal.pr-editor-modal.is-open:not([hidden]) { padding: 0 !important; }
    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 0 !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
}

/* =========================================================
   PRODUCTOS · IMAGEN EN MODAL INDEPENDIENTE
   2026-08-13 · v16
   El recorte ya no participa en el layout del modal Crear/Editar.
========================================================= */
.pr-image-summary {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #dce5ef;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 65%, #f5f3ff 100%);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
}

.pr-image-summary-thumb {
    width: 72px;
    height: 58px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%),
        #fff;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    color: #94a3b8;
    font-size: 25px;
}

.pr-image-summary-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.pr-image-summary-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.pr-image-summary-copy strong {
    color: #1e293b;
    font-size: 13px;
    font-weight: 900;
}

.pr-image-summary-copy .img-selection-status {
    display: block !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-image-summary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.pr-image-row-help {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

body.pr-editor-open .pr-image-modal {
    font-family: inherit;
}

.pr-image-modal {
    position: fixed;
    inset: 0;
    z-index: 1095;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.pr-image-modal.is-open:not([hidden]) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.pr-image-modal.pr-modal-hidden {
    display: none !important;
}

.pr-image-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .76);
    backdrop-filter: blur(5px);
}

.pr-image-dialog {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(2, 6, 23, .38);
}

.pr-image-modal-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    border-bottom: 1px solid #e6edf5;
    background: #fff;
}

.pr-image-modal-head h3 {
    margin: 3px 0 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.pr-image-modal-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
}

.pr-image-modal-body {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr);
    gap: 16px;
    padding: 16px 18px;
    overflow: auto;
    background: #f8fafc;
}

.pr-image-workspace,
.pr-image-preview-pane {
    min-width: 0;
    padding: 13px;
    border: 1px solid #dce5ef;
    border-radius: 15px;
    background: #fff;
}

.pr-image-workspace {
    display: flex;
    flex-direction: column;
}

.pr-image-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pr-image-change-button {
    min-height: 38px;
}

.pr-image-crop-stage {
    height: min(540px, 58vh) !important;
    min-height: 360px;
    flex: 1 1 auto;
}

.pr-image-preview-pane {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pr-image-preview-head {
    display: grid;
    gap: 3px;
}

.pr-image-preview-head strong {
    color: #1e293b;
    font-size: 15px;
    font-weight: 900;
}

.pr-image-preview-head small {
    color: #64748b;
    line-height: 1.4;
}

.pr-image-live-preview {
    min-height: 245px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #d8e1eb;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%),
        #fff;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.pr-image-live-preview > img {
    width: 100%;
    max-height: 360px;
    display: block;
    object-fit: contain;
}

.pr-image-preview-empty {
    display: grid;
    place-items: center;
    gap: 5px;
    padding: 28px 16px;
    color: #64748b;
    text-align: center;
}

.pr-image-preview-empty > span {
    font-size: 34px;
}

.pr-image-preview-empty strong {
    color: #334155;
}

.pr-image-preview-empty small {
    font-size: 11px;
}

.pr-image-preview-pane .crop-result-preview {
    margin-top: 0;
}

.pr-image-preview-pane .crop-result-preview > img {
    max-height: 190px;
    margin: 0 auto;
}

.pr-image-modal-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-top: 1px solid #e6edf5;
    background: #fff;
}

/* El modal principal ahora puede medir solo lo que necesita. La zona de imagen
   pesada vive en #prImageModal y no vuelve a estirar Crear/Editar producto. */
#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 32px) !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
    flex: 0 1 auto !important;
    max-height: calc(100vh - 190px) !important;
}

@media (max-width: 900px) {
    .pr-image-modal-body {
        grid-template-columns: 1fr;
    }
    .pr-image-preview-pane {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }
    .pr-image-preview-head {
        grid-column: 1 / -1;
    }
    .pr-image-live-preview {
        min-height: 200px;
    }
}

@media (max-width: 760px) {
    .pr-image-summary {
        grid-template-columns: 58px minmax(0, 1fr);
    }
    .pr-image-summary-thumb {
        width: 58px;
        height: 52px;
    }
    .pr-image-summary-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }
    .pr-image-summary-actions .img-file-button,
    .pr-image-summary-actions .pr-btn {
        flex: 1 1 150px;
        width: auto;
    }
    .pr-image-summary-copy .img-selection-status {
        white-space: normal;
    }
    .pr-image-modal {
        padding: 0;
    }
    .pr-image-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .pr-image-modal-body {
        padding: 10px;
    }
    .pr-image-preview-pane {
        display: flex;
    }
    .pr-image-crop-stage {
        height: 340px !important;
        min-height: 300px;
    }
    .pr-image-modal-footer {
        flex-wrap: wrap;
    }
    .pr-image-modal-footer .pr-footer-spacer {
        display: none;
    }
    .pr-image-modal-footer .pr-btn {
        flex: 1 1 44%;
    }
}


/* =========================================================
   PRODUCTOS · MODAL CREAR/EDITAR ESTABLE
   2026-08-13 · v17
   Corrige el colapso del cuerpo del editor. El dialogo usa una grilla
   de 3 filas (cabecera / formulario / pie), por lo que el formulario
   siempre recibe una altura real y desplaza su propio contenido.
========================================================= */
#prEditorModal.pr-editor-modal.is-open:not([hidden]) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    overflow: hidden !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(1180px, calc(100vw - 32px)) !important;
    height: min(880px, calc(100dvh - 32px)) !important;
    min-height: min(560px, calc(100dvh - 32px)) !important;
    max-height: calc(100dvh - 32px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-head,
#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-footer {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 20px 22px 30px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    box-sizing: border-box !important;
    scrollbar-gutter: stable;
}

@media (max-height: 650px) and (min-width: 761px) {
    #prEditorModal.pr-editor-modal.is-open:not([hidden]) {
        padding: 10px !important;
    }

    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
        width: min(1180px, calc(100vw - 20px)) !important;
        height: calc(100dvh - 20px) !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 20px) !important;
    }
}

@media (max-width: 760px) {
    #prEditorModal.pr-editor-modal.is-open:not([hidden]) {
        padding: 0 !important;
        align-items: stretch !important;
    }

    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 0 !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
        padding: 16px 14px 24px !important;
    }
}


/* =========================================================
   PRODUCTOS · GUARDADO DIRECTO DE IMAGEN
   2026-08-13 · v18
========================================================= */
.pr-btn-image-save {
    border-color: #079455 !important;
    background: #12b76a !important;
    color: #fff !important;
    font-weight: 900 !important;
    box-shadow: 0 8px 20px rgba(18, 183, 106, .20);
}
.pr-btn-image-save:hover:not(:disabled) { background: #039855 !important; }
.pr-btn-image-save:disabled {
    border-color: #d0d5dd !important;
    background: #eaecf0 !important;
    color: #98a2b3 !important;
    box-shadow: none !important;
}
.pr-image-modal.is-open .pr-image-dialog { min-height: min(640px, calc(100dvh - 36px)); }

/* =========================================================
   PRODUCTOS · MODAL CREAR/EDITAR RECONSTRUIDO · v21
   2026-08-13
   La distribución ya NO depende de flex ni grid: cabecera y footer quedan
   anclados al diálogo y el formulario ocupa exactamente el espacio intermedio.
   Esto impide que el editor se encoja o deje un bloque blanco tras editar imagen.
========================================================= */
#prEditorModal.pr-editor-modal.is-open:not([hidden]) {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
    position: relative !important;
    display: block !important;
    width: min(1180px, calc(100vw - 32px)) !important;
    height: min(880px, calc(100dvh - 32px)) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 32px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    --pr-editor-head-height: 96px;
    --pr-editor-footer-height: 72px;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-head {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    z-index: 20 !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-footer {
    position: absolute !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 20 !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
    position: absolute !important;
    top: var(--pr-editor-head-height, 96px) !important;
    right: 0 !important;
    bottom: var(--pr-editor-footer-height, 72px) !important;
    left: 0 !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 20px 22px 30px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    box-sizing: border-box !important;
    scrollbar-gutter: stable;
}

@media (max-height: 650px) and (min-width: 761px) {
    #prEditorModal.pr-editor-modal.is-open:not([hidden]) {
        padding: 10px !important;
    }
    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
        width: min(1180px, calc(100vw - 20px)) !important;
        height: calc(100dvh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
    }
}

@media (max-width: 760px) {
    #prEditorModal.pr-editor-modal.is-open:not([hidden]) {
        padding: 0 !important;
        align-items: stretch !important;
    }
    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }
    #prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
        padding: 16px 14px 24px !important;
    }
}


/* =========================================================
   2026-10-07 · Productos como plantilla maestra de Vase
   ========================================================= */
.pr-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.vase-modern-page .pr-actions {
    flex: 0 1 auto;
}

.vase-modern-page .pr-btn-primary {
    border-color: var(--liud-save-button) !important;
    background: var(--liud-save-button) !important;
    color: var(--liud-save-button-text) !important;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--liud-save-button) 24%, transparent) !important;
}

.vase-modern-page .pr-btn-primary:hover,
.vase-modern-page .pr-btn-primary:focus-visible {
    border-color: color-mix(in srgb, var(--liud-save-button) 84%, #000) !important;
    background: color-mix(in srgb, var(--liud-save-button) 88%, #000) !important;
    color: var(--liud-save-button-text) !important;
}

.vase-modern-page .pr-btn-combo {
    border-color: #d8e1ec !important;
    background: #ffffff !important;
    color: #334155 !important;
    box-shadow: none !important;
}

.pr-actions-menu {
    position: relative;
    margin: 0;
}

.pr-actions-menu > summary {
    list-style: none;
    user-select: none;
}

.pr-actions-menu > summary::-webkit-details-marker { display: none; }
.pr-actions-menu[open] .pr-actions-chevron { transform: rotate(180deg); }
.pr-actions-chevron { transition: transform .15s ease; }

.pr-actions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    width: 210px;
    padding: 7px;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

.pr-actions-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.pr-actions-item:hover,
.pr-actions-item:focus-visible {
    background: #f1f5f9;
    color: #0f172a;
    outline: none;
}

.pr-products-card-head .pr-card-subtitle {
    margin: 5px 0 0;
    color: #6b7788;
    font-size: 12px;
    line-height: 1.4;
}

.pr-products-count {
    min-width: auto !important;
    padding-inline: 12px !important;
    white-space: nowrap;
}

.vase-modern-page .pr-list-toolbar {
    grid-template-columns: minmax(320px, 1fr) minmax(210px, 280px);
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    background: #fbfcfe;
}

.pr-search-field {
    position: relative;
}

.pr-search-field .pr-field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    color: #77859a;
    pointer-events: none;
}

.vase-modern-page .pr-search-field .pr-input {
    padding-left: 38px !important;
}

.vase-modern-page .pr-list-toolbar .pr-input,
.vase-modern-page .pr-list-toolbar .pr-select {
    min-height: 42px;
    margin: 0 !important;
}

.vase-modern-page .pr-products-table-wrap {
    margin: 0 20px 14px;
    width: calc(100% - 40px);
    border-radius: 14px;
}

.vase-modern-page .pr-products-table-card > .vase-table-customizer-toolbar {
    margin: 0 20px 10px;
}

.vase-modern-page .pr-mini-edit {
    border-color: color-mix(in srgb, var(--liud-search-button) 28%, #dbe5f0) !important;
    background: color-mix(in srgb, var(--liud-search-button) 9%, #ffffff) !important;
    color: color-mix(in srgb, var(--liud-search-button) 78%, #15324d) !important;
}

.vase-modern-page .pr-mini-edit:hover,
.vase-modern-page .pr-mini-edit:focus-visible {
    border-color: var(--liud-search-button) !important;
    background: color-mix(in srgb, var(--liud-search-button) 14%, #ffffff) !important;
}

.vase-modern-page .pr-status-pill.is-active {
    background: color-mix(in srgb, var(--liud-save-button) 12%, #ffffff) !important;
    color: color-mix(in srgb, var(--liud-save-button) 82%, #123d2a) !important;
}

.vase-modern-page .pr-table-category.is-warning,
.vase-modern-page .pr-inventory-mode.is-warning {
    background: color-mix(in srgb, var(--liud-edit-button) 14%, #ffffff) !important;
    color: color-mix(in srgb, var(--liud-edit-button) 74%, #5a3800) !important;
}

@media (max-width: 860px) {
    .vase-modern-page .pr-actions {
        flex-basis: 100%;
    }

    .pr-actions-menu {
        flex: 1 1 calc(50% - 6px);
    }

    .pr-actions-menu > summary {
        width: 100%;
    }

    .pr-actions-dropdown {
        left: 0;
        right: auto;
        width: min(260px, 86vw);
    }

    .vase-modern-page .pr-list-toolbar {
        grid-template-columns: 1fr;
        padding: 14px 16px;
    }

    .vase-modern-page .pr-products-table-wrap {
        margin-left: 16px;
        margin-right: 16px;
        width: calc(100% - 32px);
    }

    .vase-modern-page .pr-products-table-card > .vase-table-customizer-toolbar {
        margin-left: 16px;
        margin-right: 16px;
    }
}

/* =========================================================
   VASE · MODAL COMPACTO GENERAL / PRODUCTOS
   2026-10-07
   ========================================================= */
#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-head {
    padding: 12px 18px !important;
}
#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-form {
    padding: 10px 18px 14px !important;
}
#prEditorModal.pr-editor-modal.is-open .pr-editor-dialog > .pr-editor-footer {
    padding: 10px 18px !important;
}
#prEditorModal .pr-card-title {
    font-size: 20px;
    line-height: 1.15;
}
#prEditorModal .pr-editor-subtitle {
    margin-top: 3px;
    line-height: 1.25;
}
#prEditorModal .pr-row {
    margin-top: 8px;
}
#prEditorModal .pr-label {
    margin-bottom: 4px;
}
#prEditorModal .pr-input,
#prEditorModal .pr-select {
    min-height: 40px;
}
#prEditorModal #p_nombre {
    min-height: 44px;
    font-size: 16px;
}
#prEditorModal .pr-textarea {
    height: auto;
    min-height: 62px;
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 1.35;
    resize: vertical;
}
#prEditorModal .pr-checkgrid {
    margin-top: 8px;
}
#prEditorModal .pr-check-pill {
    min-height: 40px;
}
#prEditorModal .pr-image-summary {
    padding: 10px 12px;
}
#prEditorModal .pr-image-summary-thumb {
    width: 54px;
    height: 54px;
}
#prEditorModal .pr-editor-status:empty {
    display: none;
}

.pr-product-mainline {
    display: grid;
    grid-template-columns: minmax(150px, .32fr) minmax(420px, 1fr);
    gap: 12px;
    align-items: end;
}
.pr-category-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.pr-category-add {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #d8e1eb;
    border-radius: 10px;
    background: #f7f9fb;
    color: #334155;
    white-space: nowrap;
}
.pr-category-add:hover {
    border-color: #b8c5d4;
    background: #eef3f7;
}

/* Selección de imagen: deshabilitada hasta tener nombre + categoría. */
.img-file-button.is-disabled {
    position: relative;
    border-color: #d8dee6 !important;
    background: #eef1f4 !important;
    color: #8b96a5 !important;
    cursor: not-allowed !important;
    filter: none !important;
}
.img-file-button.is-disabled:hover {
    background: #eef1f4 !important;
    color: #8b96a5 !important;
}
.img-file-button.is-disabled[data-disabled-hint]:hover::after {
    content: attr(data-disabled-hint);
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 40;
    width: max-content;
    max-width: 300px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}

/* Vista previa POS plegable para no ocupar espacio hasta que se necesite. */
.pr-pos-preview-section {
    padding-top: 0 !important;
}
.pr-pos-preview-toggle {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #dbe4ee;
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}
.pr-pos-preview-toggle:hover {
    background: #f1f5f9;
}
.pr-pos-preview-toggle-meta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.pr-pos-preview-chevron {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    transition: transform .18s ease;
}
.pr-pos-preview-toggle[aria-expanded="true"] .pr-pos-preview-chevron {
    transform: rotate(180deg);
}
.pr-pos-preview-content {
    padding-top: 10px;
}
.pr-pos-preview-content[hidden] {
    display: none !important;
}

/* Modal secundario reusable dentro de formularios Vase. */
.pr-child-modal {
    position: fixed;
    inset: 0;
    z-index: 1095;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.pr-child-modal.is-open:not([hidden]) {
    display: flex !important;
}
.pr-child-modal.pr-modal-hidden,
.pr-child-modal[hidden] {
    display: none !important;
}
.pr-child-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
}
.pr-child-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 36px));
    overflow: hidden;
    border: 1px solid #dfe6ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.pr-child-head,
.pr-child-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
}
.pr-child-head {
    border-bottom: 1px solid #e8edf3;
}
.pr-child-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    font-weight: 900;
}
.pr-child-head p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 12px;
}
.pr-child-body {
    padding: 8px 16px 14px;
}
.pr-child-footer {
    justify-content: flex-end;
    border-top: 1px solid #e8edf3;
    background: #fbfcfd;
}
.pr-category-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 760px) {
    .pr-product-mainline,
    .pr-category-control,
    .pr-category-options {
        grid-template-columns: 1fr;
    }
    .pr-category-add {
        width: 100%;
    }
    .pr-pos-preview-toggle-meta .pr-pos-preview-sync {
        display: none;
    }
    .pr-child-modal {
        padding: 10px;
    }
}
