/* CSS específico para a tela de Vendas (PDV) */

/* PDV Header */
.pdv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header-left h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
}

.sale-number {
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 5px;
}

.header-right {
    text-align: right;
}

.operator-info {
    color: #2c3e50;
    margin-bottom: 5px;
}

.operator-info i {
    margin-right: 5px;
}

.date-time {
    color: #7f8c8d;
    font-size: 14px;
}

/* PDV Layout */
.pdv-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Search Section */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group i {
    position: absolute;
    left: 12px;
    color: #7f8c8d;
    z-index: 1;
}

.search-input-group input {
    flex: 1;
    padding: 12px 12px 12px 35px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input-group input:focus {
    outline: none;
    border-color: #3498db;
}

.btn-barcode {
    margin-left: 10px;
    padding: 12px 15px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-barcode:hover {
    background-color: #7f8c8d;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

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

.suggestion-name {
    font-weight: 500;
    color: #2c3e50;
}

.suggestion-sku {
    font-size: 12px;
    color: #7f8c8d;
}

.suggestion-price {
    font-weight: bold;
    color: #27ae60;
}

/* Cart Section */
.cart-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ecf0f1;
}

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

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.item-details {
    font-size: 12px;
    color: #7f8c8d;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.qty-btn:hover {
    background-color: #f8f9fa;
}

.qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

.item-price {
    text-align: right;
    min-width: 80px;
}

.item-unit-price {
    font-size: 12px;
    color: #7f8c8d;
}

.item-total-price {
    font-weight: bold;
    color: #2c3e50;
}

.item-remove {
    margin-left: 10px;
    padding: 5px 8px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.item-remove:hover {
    background-color: #c0392b;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Customer Section */
.customer-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.customer-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.customer-input-group {
    display: flex;
    gap: 10px;
}

.customer-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.customer-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

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

/* Summary Section */
.summary-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.summary-line:last-child {
    border-bottom: none;
}

.summary-line .value {
    font-weight: 500;
    color: #2c3e50;
}

.discount-input {
    display: flex;
    gap: 5px;
}

.discount-input input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
}

.discount-input select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.total-line {
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid #3498db;
    margin-top: 10px;
    padding-top: 15px;
}

.total-line .total {
    color: #27ae60;
    font-size: 20px;
}

/* Payment Section */
.payment-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.payment-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-btn {
    padding: 15px 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.payment-btn:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.payment-btn.selected {
    border-color: #3498db;
    background-color: #e3f2fd;
    color: #3498db;
}

.payment-btn i {
    font-size: 20px;
}

.payment-btn span {
    font-size: 12px;
    font-weight: 500;
}

.payment-details {
    border-top: 1px solid #ecf0f1;
    padding-top: 15px;
}

.payment-info {
    margin-bottom: 15px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.change-info {
    background-color: #d4edda;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    color: #155724;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-lg {
    padding: 15px 25px;
    font-size: 16px;
    flex: 1;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

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

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Quantity Modal */
.product-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.quantity-input {
    margin-bottom: 20px;
}

.quantity-input label {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 500;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.btn-quantity {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-quantity:hover {
    background-color: #f8f9fa;
}

.quantity-controls input {
    width: 80px;
    text-align: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
}

.total-preview {
    text-align: center;
    padding: 15px;
    background-color: #e8f5e8;
    border-radius: 4px;
    color: #27ae60;
}

/* Finalization Modal */
.success-icon {
    text-align: center;
    margin-bottom: 20px;
}

.success-icon i {
    font-size: 64px;
    color: #27ae60;
}

.sale-summary {
    text-align: center;
    margin-bottom: 20px;
}

.sale-summary p {
    margin: 10px 0;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    .pdv-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
    
    .right-panel {
        order: -1;
    }
    
    .payment-methods {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .pdv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .payment-methods {
        grid-template-columns: 1fr 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}
