/* Estilos específicos para el módulo POS */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    height: calc(100vh - 200px);
}

/* Panel de productos */
.products-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
}

.products-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.category-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.category-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.product-card.selected {
    border-color: #27ae60;
    background: linear-gradient(135deg, #d5f4e6 0%, #a8e6cf 100%);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.product-image {
    width: 100%;
    height: 120px;
    background: #ecf0f1;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #7f8c8d;
}

.product-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.3;
}

.product-price {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.product-price-usd {
    color: #3498db;
    font-size: 0.9rem;
}

.product-stock {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.product-stock.low {
    color: #e74c3c;
    font-weight: bold;
    background: rgba(231, 76, 60, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.product-stock.out {
    color: #e74c3c;
    font-weight: bold;
    background: rgba(231, 76, 60, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Panel del carrito */
.cart-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
}

.cart-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.cart-count {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    max-height: 400px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cart-item-info {
    flex: 1;
    margin-right: 1rem;
    min-width: 0;
}

.cart-item-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    line-height: 1.3;
    word-wrap: break-word;
}

.cart-item-price {
    color: #27ae60;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price-usd {
    color: #3498db;
    font-size: 0.8rem;
    font-weight: 500;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.quantity-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 70px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.quantity-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

/* Totales del carrito */
.cart-totals {
    border-top: 2px solid #ecf0f1;
    padding-top: 1.5rem;
    margin-top: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.total-item.subtotal {
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.75rem;
}

.total-item.tax {
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.75rem;
}

.total-item.total {
    font-weight: bold;
    font-size: 1.4rem;
    color: #27ae60;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border: 2px solid #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.total-item.total span:first-child {
    font-size: 1.2rem;
}

.total-item.total span:last-child {
    font-size: 1.6rem;
    font-weight: 900;
}

/* Selector de moneda */
.currency-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.currency-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-align: center;
}

.currency-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.currency-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

/* Botones de acción */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

/* Modal de pago */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.payment-modal.show {
    display: flex;
}

.payment-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
}

.payment-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.payment-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.payment-close:hover {
    color: #e74c3c;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-method {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.payment-method:hover {
    border-color: #3498db;
}

.payment-method.active {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.payment-amounts {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.amount-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.amount-input label {
    font-weight: bold;
    color: #2c3e50;
    min-width: 80px;
}

.amount-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    text-align: right;
}

.amount-input input:focus {
    outline: none;
    border-color: #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .cart-panel {
        order: -1;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .search-box {
        width: 100%;
    }
    
    .category-filter {
        gap: 0.25rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: slideIn 0.3s ease;
}

.product-card {
    animation: slideIn 0.3s ease;
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para Pago Mixto */
.payment-totals {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
}

.total-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-item {
    text-align: center;
}

.total-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.total-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.mixed-payment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.currency-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.currency-section h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.payment-summary {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid #28a745;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(40, 167, 69, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #155724;
    border-top: 2px solid #28a745;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

#confirm-payment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive para pago mixto */
@media (max-width: 768px) {
    .mixed-payment {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .total-display {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .total-item {
        text-align: center;
    }
}