/*=============================================
ESTILOS PARA GENERADOR DE ETIQUETAS
=============================================*/

/* Fix para select de categorías */
#categorySelect {
    position: relative;
    z-index: 1;
    background-color: white !important;
    color: #333 !important;
}

#categorySelect option {
    background-color: white;
    color: #333;
    padding: 5px;
}

/* Contenedor de resultados de búsqueda */
.search-results-dropdown {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 0;
}

.search-result-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Lista de productos seleccionados */
.selected-products-list {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    background: #fafafa;
}

.selected-product-item {
    padding: 8px 10px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-product-item:last-child {
    margin-bottom: 0;
}

.selected-product-item span {
    flex: 1;
}

.selected-product-item button {
    margin-left: 10px;
}

/* Vista previa de etiqueta */
.label-preview-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
}

.label-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.label-preview-item {
    border: 2px solid #333;
    background: white;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-company {
    font-weight: bold;
    text-align: center;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.preview-barcode {
    width: 90%;
    height: 40px;
    margin: 5px 0;
    background: repeating-linear-gradient(
        90deg,
        #000,
        #000 2px,
        #fff 2px,
        #fff 4px
    );
}

.preview-code {
    font-family: monospace;
    text-align: center;
    margin: 2px 0;
}

.preview-name {
    text-align: center;
    margin: 2px 0;
    padding: 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.preview-price {
    font-weight: bold;
    text-align: center;
    margin-top: 2px;
    color: #d9534f;
}

.preview-info {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    min-width: 250px;
}

.preview-info p {
    margin: 5px 0;
}

/* Ajustes para checkboxes */
.checkbox {
    margin-top: 5px;
    margin-bottom: 5px;
}

.checkbox label {
    font-weight: normal;
}

/* Información de categoría */
#categoryProductsCount {
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .label-preview-wrapper {
        flex-direction: column;
    }
    
    .preview-info {
        width: 100%;
    }
    
    .selected-products-list {
        max-height: 200px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-dropdown {
    animation: fadeIn 0.2s ease-out;
}

/* Scrollbar personalizada para listas */
.selected-products-list::-webkit-scrollbar,
.search-results-dropdown::-webkit-scrollbar {
    width: 8px;
}

.selected-products-list::-webkit-scrollbar-track,
.search-results-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.selected-products-list::-webkit-scrollbar-thumb,
.search-results-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.selected-products-list::-webkit-scrollbar-thumb:hover,
.search-results-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}
