/**
 * Estilos personalizados para módulo de órdenes
 * Solo incluir estilos que no están disponibles en Bootstrap 5
 */

/* Mejorar visualización de variantes en bundles */
.xoey-bundle-variants-border {
    border-left-width: 3px !important;
}

/* Efectos hover sutiles en botones de acción */
.xoey-btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hover effect en filas de items */
.xoey-order-items-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Filas clickeables en el modal de cambio de variantes */
.variant-row-selectable {
    transition: background-color 0.2s ease;
}

.variant-row-selectable:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.variant-row-selectable:active {
    background-color: rgba(13, 110, 253, 0.2) !important;
}

/* Mejorar visualización del input de cantidad en modal de bundle */
#modalBundleQuantityInput {
    min-width: 60px;
    width: auto;
    flex: 1 1 auto;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid #dee2e6;
    padding: 0.25rem 0.5rem !important;
    line-height: 1.5;
    -moz-appearance: textfield;
}

#modalBundleQuantityInput::-webkit-outer-spin-button,
#modalBundleQuantityInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#modalBundleQuantityInput:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

#modalBundleQuantityInput::placeholder {
    color: #6c757d;
    opacity: 0.5;
}

/* Ajustar el input-group para mejor visualización */
#modalChangeBundleVariants .input-group {
    min-width: 130px;
    width: auto;
    display: flex;
    align-items: stretch;
}

#modalChangeBundleVariants .input-group .btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalChangeBundleVariants .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* ===== ESTILOS DEL MODAL DE AGREGAR ITEMS ===== */
/* Hover effect en filas - solo lo necesario que Bootstrap no cubre */
.xoey-product-row:hover,
.xoey-bundle-row:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* ===== ESTILOS PARA TOMA DE PEDIDOS (NEW ORDER) ===== */
/* Tabla catálogo clickeable */
.xoey-tablet-catalog table.table-hover tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.xoey-tablet-catalog table.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Estilos para matrices de variaciones */
.xoey-table-variants {
    margin-bottom: 0;
}

.xoey-table-variants th,
.xoey-table-variants td {
    vertical-align: middle;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem !important;
    line-height: 1.4;
}

/* Reducir altura de filas */
.xoey-table-variants tbody tr {
    height: auto;
    min-height: 50px;
}

/* Estilos para celdas de color/atributo */
.xoey-table-variants td.text-start strong {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Contenedor de color */
.xoey-color-cell {
    display: flex;
    align-items: center;
}

/* Inputs de cantidad más compactos */
.xoey-table-variants .input-group-sm {
    width: 90px;
}

.xoey-table-variants .input-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.xoey-table-variants .input-group-sm .form-control {
    padding: 0.25rem 0.35rem;
    font-size: 0.875rem;
}

/* Stock más compacto */
.xoey-table-variants small {
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Contenedor de cantidad y stock más compacto */
.xoey-table-variants .d-flex.flex-column {
    gap: 0.25rem !important;
}

/* Header de tabla más compacto */
.xoey-table-variants thead th {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Celda de total de fila */
.xoey-table-variants .xoey-row-total {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Mejorar visualización de tallas en header */
.xoey-variant-sizes-header th {
    text-align: center;
    min-width: 80px;
}

/* Celda de producto más compacta */
.xoey-table-variants td.text-start.align-middle {
    padding: 0.75rem !important;
}

.xoey-table-variants td.text-start.align-middle strong {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.xoey-table-variants td.text-start.align-middle small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Control cantidad táctil */
.xoey-qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.xoey-qty-control .xoey-btn-qty {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all 0.15s ease;
}

.xoey-qty-control .xoey-btn-qty:hover {
    transform: scale(1.1);
}

.xoey-qty-control .xoey-qty-pill {
    min-width: 2.4rem;
    height: 2.2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background-color: #f1f5f9;
    font-size: 0.9rem;
}

/* Barra de resumen en footer de modal */
.xoey-modal-summary {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Chips de acción rápida */
.xoey-quick-chip {
    border-radius: 999px;
    font-size: 0.75rem;
}

/* Resumen de pedido destacado */
.xoey-order-summary-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #198754;
}

.xoey-order-items-count {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Badge de stock */
.xoey-stock-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Precio en catálogo */
.xoey-catalog-price {
    font-weight: 600;
    color: #198754;
    font-size: 0.9rem;
}

/* Item del pedido con hover */
.xoey-order-item {
    transition: background-color 0.15s ease;
}

.xoey-order-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Modal responsive */
@media (min-width: 992px) {
    .modal-lg {
        max-width: 980px;
    }
}

/* ===== ESTILOS PARA ESTAD��STICAS DE PEDIDOS ===== */
/* Prevenir desbordamiento en cards de estadísticas */
#orders-stats-container .card {
    overflow: hidden;
}

#orders-stats-container .card-body {
    overflow: hidden;
}

/* Asegurar que el contenido de los cards no se desborde */
#orders-stats-container .flex-grow-1 {
    min-width: 0;
    overflow: hidden;
}

#orders-stats-container .h5 {
    word-break: break-word;
    overflow-wrap: break-word;
}
