/**
 * Estilos del Módulo de Productos
 * Vista tabla con filtros por columna (estilo Stock)
 */

/* Contenedor tabla productos */
#productos .productos-table-container {
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.productos-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    flex-wrap: wrap;
}

.productos-table-header .filters-bar {
    flex: 1;
    min-width: 200px;
}

.productos-table-header .filters-bar-search {
    max-width: 320px;
}

/* Botón y dropdown de gestión de columnas */
.productos-header-actions {
    flex-shrink: 0;
}

.productos-columns-dropdown-wrap {
    position: relative;
}

.productos-columns-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 180px;
    padding: 10px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.productos-columns-dropdown-title {
    padding: 6px 14px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 4px;
}

.productos-columns-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.productos-columns-dropdown-item:hover {
    background: #f9fafb;
}

.productos-columns-dropdown-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.productos-table-wrapper.entity-table-wrapper {
    min-width: 0;
    overflow: auto;
}

.productos-table-wrapper table.productos-table {
    min-width: 900px;
    width: 100%;
}

.productos-table-row {
    cursor: pointer;
    transition: background 0.15s;
}

.productos-table-row:hover {
    background: #f9fafb;
}

.productos-col-imagen {
    width: 52px;
    padding: 8px !important;
    vertical-align: middle;
}

.productos-item-imagen {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.productos-col-categoria .productos-categoria-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: color-mix(in srgb, var(--categoria-color, #6b7280) 18%, transparent);
    color: var(--categoria-color, #374151);
}

.productos-col-stock.in-stock {
    color: #059669;
}

.productos-col-stock.out-of-stock {
    color: #dc2626;
}

.productos-table .badge-visible {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #d1fae5;
    color: #065f46;
}

.productos-table .badge-hidden {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fee2e2;
    color: #991b1b;
}

/* Layout legacy (sidebar + grid) - mantener por si se usa en otros contextos */
.productos-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
    overflow: hidden;
    padding: 20px;
}

.productos-sidebar {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.productos-search-container {
    position: relative;
    padding: 16px;
}

.productos-search-input {
    width: calc(100% - 50px);
    padding: 10px 12px 10px 38px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #f9fafb;
}

.productos-search-input:focus {
    outline: none;
    border-color: #9ca3af;
    background-color: #ffffff;
}

.productos-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.productos-categorias-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Ítem de categoría */
.productos-categoria-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    user-select: none;
}

.productos-categoria-item:hover {
    background-color: #f3f4f6;
}

.productos-categoria-item.active {
    background-color: #f3f4f6;
    color: #111827;
    font-weight: 500;
}

.productos-categoria-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.productos-categoria-toggle {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #6b7280;
}

.productos-categoria-toggle.expanded {
    transform: rotate(90deg);
}

.productos-categoria-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.productos-categoria-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.productos-categoria-count {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    background-color: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

.productos-categoria-all {
    font-weight: 600;
    margin-bottom: 8px;
}

.productos-categoria-all svg {
    color: #6b7280;
}

.productos-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Panel derecho: Productos */
.productos-main {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.productos-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.productos-main-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.productos-count {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #6b7280;
}

/* Grid de productos */
.productos-grid {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-content: start;
}

/* Tarjeta de producto */
.producto-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    height: fit-content;
    flex-grow: 1;
    min-width: 200px;
    max-width: 350px;
}

.producto-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #9ca3af;
}

.producto-card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    max-height: 135px;
}

.producto-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.producto-card-content {
    padding: 16px;
}

.producto-card-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.producto-card-categoria {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.producto-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.producto-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.producto-card-stock {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.producto-card-stock.in-stock {
    background-color: #f3f4f6;
    color: #374151;
}

.producto-card-stock.out-of-stock {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Estado vacío */
.productos-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    padding: 40px 0 !important;
}

.productos-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.productos-empty-state p {
    margin: 0;
    font-size: 16px;
}

/* ==============================================
   MODAL ESTILO OPENAI - Simple y Minimalista
   ============================================== */

.productos-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.productos-modal.active {
    display: flex;
}

.productos-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.productos-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1;
    box-sizing: border-box;
}

.productos-modal-close, .btn-close-modal {
    width: 36px;
    height: 36px;
    border: none;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    border: 1px solid #e5e7eb;
}

.btn-close-modal{
    font-size: 23px;
}

.productos-modal-close:hover, .btn-close-modal:hover {
    background: #f9fafb;
}

.productos-modal-close svg, .btn-close-modal svg {
    color: #6b7280;
}

.productos-modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 90vh;
    width: 100%;
    box-sizing: border-box;
}

/* Container del modal */
.pm-container {
    display: flex;
    flex-direction: column;
}

/* Header del modal */
.pm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.pm-header-left {
    flex: 1;
}

.pm-categoria {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.pm-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.pm-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pm-price {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-right: 8px;
}

/* Body del modal */
.pm-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    padding: 32px 24px;
}

/* Imagen */
.pm-image-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-image-section img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.pm-image-actions {
    display: flex;
    gap: 8px;
}

/* Detalles */
.pm-details-section {
    flex: 1;
}

.pm-section {
    margin-bottom: 32px;
}

.pm-section:last-child {
    margin-bottom: 0;
}

.pm-section-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

/* Info grid */
.pm-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Stock por almacén en modal producto */
.pm-stock-section .pm-stock-almacenes {
    font-size: 14px;
}
.pm-stock-almacenes-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.pm-stock-almacen-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
}
.pm-stock-almacen-row:last-child {
    border-bottom: none;
}
.pm-stock-almacen-nombre {
    color: #374151;
}
.pm-stock-almacen-cantidad {
    font-weight: 500;
    color: #111827;
}
.pm-stock-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 15px;
}
.pm-stock-total-value {
    font-weight: 700;
    color: #111827;
}
.pm-stock-loading {
    color: #6b7280;
    font-size: 14px;
}

.pm-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pm-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.pm-value {
    font-size: 14px;
    color: #111827;
}

.pm-color-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid #e5e7eb;
}

.pm-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

/* Opciones */
.pm-opciones-group {
    margin-bottom: 20px;
}

.pm-opciones-group:last-child {
    margin-bottom: 0;
}

.pm-opciones-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pm-opciones-list {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.pm-opcion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #111827;
}

.pm-opcion-item:last-child {
    border-bottom: none;
}

.pm-opcion-price {
    font-weight: 600;
    color: #111827;
}

/* ==============================================
   MODO EDICIÓN
   ============================================== */

.pm-edit-mode .pm-body {
    grid-template-columns: 240px 1fr;
}

/* Formularios */
.pm-form-group {
    margin-bottom: 16px;
}

.pm-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.pm-form-row .pm-form-group {
    margin-bottom: 0;
}

.pm-input {
    width: calc(100% - 24px);
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: #111827;
}

.pm-input:focus {
    outline: none;
    border-color: #9ca3af;
    background-color: #ffffff;
}

.pm-input-sm {
    padding: 8px 10px;
    font-size: 13px;
}

.pm-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Color picker */
.pm-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #111827;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #111827;
}

/* Zona EAN (código de barras) en edición */
.pm-ean-box {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.pm-ean-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.pm-ean-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.pm-ean-hint {
    font-size: 12px;
    color: #64748b;
}

.pm-ean-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-ean-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pm-input-ean {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace !important;
    font-size: 15px !important;
    letter-spacing: 0.05em;
    max-width: 280px;
}

.pm-ean-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pm-ean-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pm-ean-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.pm-ean-btn svg {
    flex-shrink: 0;
}

.pm-ean-btn-print:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* EAN en modo vista (ficha) */
.pm-value-ean {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace !important;
    font-size: 14px !important;
    letter-spacing: 0.04em;
}

/* Opciones en modo edición */
.pm-opciones-edit-group {
    margin-bottom: 24px;
}

.pm-opciones-edit-group .btn {
    margin-bottom: 12px;
}

.pm-opciones-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-opcion-edit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.pm-opcion-edit-item .pm-input {
    flex: 1;
    margin-bottom: 0;
}

.pm-opcion-edit-item .btn-icon {
    flex-shrink: 0;
}

/* Checkboxes */
.pm-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.pm-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pm-checkbox span {
    font-size: 14px;
    color: #111827;
}

/* Botones estándar (del styles.css) */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: #111827;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1f2937;
}

.btn-secondary {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    width: max-content;
}

.btn-secondary:hover {
    background: #f9fafb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    min-width: auto;
}

/* Scrollbar personalizado */
.productos-categorias-tree::-webkit-scrollbar,
.productos-grid::-webkit-scrollbar,
.productos-modal-body::-webkit-scrollbar {
    width: 8px;
}

.productos-categorias-tree::-webkit-scrollbar-track,
.productos-grid::-webkit-scrollbar-track,
.productos-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.productos-categorias-tree::-webkit-scrollbar-thumb,
.productos-grid::-webkit-scrollbar-thumb,
.productos-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.productos-categorias-tree::-webkit-scrollbar-thumb:hover,
.productos-grid::-webkit-scrollbar-thumb:hover,
.productos-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Utility */
.d-none {
    display: none !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .pm-body {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 1024px) {
    .productos-layout {
        grid-template-columns: 240px 1fr;
    }

    .pm-body {
        grid-template-columns: 1fr;
    }

    .pm-image-section {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .productos-layout {
        grid-template-columns: 1fr;
        height: auto;
        padding: 16px;
        gap: 16px;
    }

    .productos-sidebar {
        max-height: 300px;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }

    .productos-main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: calc(100% - 48px);
    }

    /* Mejorar contenedor de búsqueda en móvil */
    .productos-search-container {
        width: 100%;
        padding: 0;
        position: relative;
    }

    .productos-search-input:focus {
        outline: none;
        border-color: #6366f1;
        background-color: #ffffff;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .productos-search-icon {
        left: 16px;
        width: 20px;
        height: 20px;
    }

    /* Botones en móvil */
    .productos-main-header .btn {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
        padding: 14px 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    /* Modal mejorado para móvil */
    .productos-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .productos-modal-body {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pm-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        position: relative;
    }

    .pm-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pm-header-right .btn {
        flex: 1;
        min-width: 0;
    }

    /* Body del modal - cambiar de grid a flex column en móvil */
    .pm-body {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Imagen arriba en móvil */
    .pm-image-section {
        width: 100%;
        max-width: 100%;
        order: 1;
        margin: 0 auto;
    }

    .pm-image-section img {
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .pm-image-actions {
        flex-direction: column;
        width: 100%;
    }

    .pm-image-actions .btn {
        width: 100%;
    }

    /* Detalles/formularios abajo en móvil */
    .pm-details-section {
        width: 100%;
        max-width: 100%;
        order: 2;
        box-sizing: border-box;
    }

    .pm-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pm-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pm-section {
        margin-bottom: 24px;
    }

    /* Asegurar que todos los inputs dentro del modal no se desborden */
    .pm-details-section input,
    .pm-details-section textarea,
    .pm-details-section select,
    .pm-details-section .input-field {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Modo edición también en columna */
    .pm-edit-mode .pm-body {
        display: flex;
        flex-direction: column;
    }
}

/* ---- Proveedor searchable (estilo Select2, búsqueda en BD) ---- */
.productos-proveedor-searchable {
    position: relative;
    width: 100%;
}


.productos-proveedor-searchable #edit-proveedor-display.dropdown-open {
    border-color: #9ca3af;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.productos-proveedor-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow: hidden;
}

.productos-proveedor-dropdown.show {
    display: block;
}

.productos-proveedor-dropdown-hint {
    padding: 10px 12px;
    font-size: 13px;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.productos-proveedor-dropdown-list {
    max-height: 180px;
    overflow-y: auto;
}

.productos-proveedor-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f4f6;
}

.productos-proveedor-item:last-child {
    border-bottom: none;
}

.productos-proveedor-item:hover {
    background: #f3f4f6;
}

.productos-proveedor-item.productos-proveedor-no-results {
    color: #9ca3af;
    cursor: default;
}

.productos-proveedor-item.productos-proveedor-no-results:hover {
    background: #fff;
}
