.comercial-form-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.input-cantidad {
    color: #222 !important;
    background: #fff !important;
    width: 60px !important;
    font-size: 16px !important;
    border: 1px solid #ccc !important;
    opacity: 1 !important;
    padding: 8px !important;
}
.sin-stock-familia {
    color: #c00 !important;
    font-weight: bold;
    text-align: center;
    padding: 16px;
}
.carrito-temporal {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 16px;
}
.remove-item {
    background: #c00;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}

#finalizar-pedido {
    margin-top: 18px;
    color: #fff;
    cursor: pointer;
}


.pagina-btn{
    font-size: 13px;
    padding: 8px 14px;
    margin-right: 8px;
    margin-bottom: 4px;
    margin-top:4px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

/*select {*/
/*    border: 2px solid #0073aa; */
/*    border-radius: 4px;        */
/*    padding: 6px 12px;        */
/*    outline: none;           */
/*    background: #fff;         */
/*}*/
select:focus {
    border-color: #005177;
}

.comercial-label-title{
    font-size: 1rem;
    font-weight:700;
}

hr.custom-hr {
    height: 2px;
    border: none;
    color: #333;
    background-color: #333;
    margin: 24px 0;
}


#costumer-temporal-title{
    margin: 16px 0;

}

#modal-alert {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}


#modal-alert .modal-box {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#historico-compras-section {
    margin-top: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

#historico-compras-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5em;
}

.historico-compras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.historico-product-card {
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.historico-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.historico-product-card img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 4px;
}

.historico-product-card h4 {
    font-size: 14px;
    margin: 10px 0;
    color: #333;
    min-height: 40px;
}

.historico-product-card p {
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

.add-from-historico {
    background: #0073aa;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
    margin-top: 10px;
}

.add-from-historico:hover {
    background: #005a87;
}

.add-from-historico:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.rtable {
    width: 100%;
    border-collapse: collapse;
    box-sizing: border-box;
    font-family: inherit;
}

.rtable-row {
    display: table-row;
    width: 100%;
}

.rtable-header {
    font-weight: 600;
    background: #f6f6f6;
}

.rtable-cell {
    display: table-cell;
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #e6e6e6;
}

/* ancho de columnas (ajusta según necesidad) */
.rtable-cell--head:nth-child(1), .rtable-cell:nth-child(1) { width: 40%; }
.rtable-cell--head:nth-child(2), .rtable-cell:nth-child(2) { width: 15%; }
.rtable-cell--head:nth-child(3), .rtable-cell:nth-child(3) { width: 12%; text-align: center; }
.rtable-cell--head:nth-child(4), .rtable-cell:nth-child(4) { width: 15%; text-align: center; }
.rtable-cell--head:nth-child(5), .rtable-cell:nth-child(5) { width: 18%; text-align: right; }

/* estéticas */
.rtable-row:nth-child(odd):not(.rtable-header) { background: #fff; }
.rtable-row:nth-child(even):not(.rtable-header) { background: #fbfbfb; }

.product-name-link { color: #0073aa; text-decoration: none; }
.product-name-link:hover { text-decoration: underline; }

.input-cantidad { width: 80px; padding: 6px; }

/* Botón */
.add-to-temporal-cart {
    background: #2b8a3e; color: #fff; border: none; padding: 8px 12px;
    border-radius: 4px; cursor: pointer;
}
.add-to-temporal-cart:hover { opacity: 0.95; }

/* ===== Mobile / Tablet: convertir cada fila en "card" con labels visibles ===== */
@media (max-width: 768px) {
    .rtable, .rtable-row, .rtable-cell, .rtable-header { display: block; width: 100%; }
    .rtable-header { display: none; } /* ocultar cabecera en mobile */

    .rtable-row {
        border: 1px solid #e6e6e6;
        margin-bottom: 12px;
        padding: 10px;
        border-radius: 6px;
        background: #fff;
    }
    .rtable-cell {
        display: flex;
        justify-content: space-between;
        padding: 8px 6px;
        border-bottom: none;
    }
    .rtable-cell:last-child { margin-bottom: 0; }

    /* etiqueta (data-label) a la izquierda */
    .rtable-cell::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 12px;
        color: #444;
        width: 40%;
        flex: 0 0 40%;
        text-align: left;
    }
    .rtable-cell > * { flex: 1 1 auto; text-align: right; }

    .input-cantidad { width: 100%; max-width: 120px; }

    .add-to-temporal-cart {
        width: 100%;
        display: block;
        margin-top: 8px;
        text-align: center;
    }
}
