/* Nueva Venta - Estilos POS */
.sales-page .sales-header {
    background-color: #2c2c2c;
    padding: 1rem 2rem;
    margin: -2rem -2rem 0 -2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.sales-page .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sales-page .back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 0;
    cursor: pointer;
}

    .sales-page .back-btn:hover {
        color: #ccc;
    }

.sales-page .page-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.sales-page .sale-date {
    color: #888;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.sales-page .header-center {
    display: flex;
    align-items: center;
}

.sales-page .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    background-color: #444;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

    .sales-page .user-info:hover {
        background-color: #555;
    }

.sales-page .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sales-page .payment-info {
    display: flex;
    gap: 1.5rem;
}

.sales-page .payment-item {
    text-align: right;
}

.sales-page .payment-label {
    display: block;
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.sales-page .payment-amount {
    display: block;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

    .sales-page .payment-amount.balance {
        color: #28a745;
    }

.sales-page .btn-impreso {
    background-color: #28a745;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

    .sales-page .btn-impreso:hover {
        background-color: #218838;
    }

.sales-page .more-options {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
}

    .sales-page .more-options:hover {
        color: white;
    }

/* Container principal POS */
.pos-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    height: calc(100vh - 200px);
    min-height: 600px;
}

/* Panel de productos (lado izquierdo) */
.products-panel {
    flex: 2;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-section {
    margin-bottom: 1.5rem;
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-products {
    background-color: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 50px 12px 45px;
    width: 100%;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .search-input-products::placeholder {
        color: #6c757d;
    }

    .search-input-products:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

.search-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
}

.filter-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .filter-icon:hover {
        color: #007bff;
        background-color: #f8f9fa;
    }

.view-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
    font-size: 1rem;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .view-btn.active,
    .view-btn:hover {
        color: #333;
        background-color: #333;
        color: white;
        border-color: #333;
    }

.client-section {
    margin-bottom: 1rem;
}

.client-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
}

.client-input {
    background: none;
    border: none;
    outline: none;
    flex: 1;
    color: #333;
    font-size: 0.9rem;
}

    .client-input::placeholder {
        color: #6c757d;
    }

.client-selector i {
    color: #6c757d;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s ease;
}

    .client-selector i:hover {
        color: #007bff;
    }

.truck-icon,
.comment-icon,
.settings-icon {
    font-size: 0.9rem;
}

.close-icon {
    color: #dc3545 !important;
}

    .close-icon:hover {
        color: #c82333 !important;
    }

/* Grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    height: 180px;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        border-color: #007bff;
    }

    .product-card.empty {
        background: #f8f9fa;
        cursor: default;
        opacity: 0.5;
    }

        .product-card.empty:hover {
            transform: none;
            box-shadow: none;
            border-color: transparent;
        }

.product-image {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

    .product-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.empty-image {
    background: #e9ecef;
}

.stock-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #28a745;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #28a745;
    margin: 0;
}

.product-info-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px;
}

    .product-info-btn:hover {
        color: #007bff;
    }

.empty-text,
.empty-price {
    background: #e9ecef;
    height: 12px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.empty-text {
    width: 80%;
}

.empty-price {
    width: 60%;
}

/* Paginación */
.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .dot.active,
    .dot:hover {
        background-color: #007bff;
    }

/* Panel del carrito (lado derecho) */
.cart-panel {
    flex: 1;
    background-color: white;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.cart-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

    .cart-item:last-child {
        border-bottom: none;
    }

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}

.quantity-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #333;
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .quantity-btn:hover {
        background-color: #e9ecef;
        border-color: #adb5bd;
    }

.quantity {
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: center;
}

.item-price {
    color: #6c757d;
    font-size: 0.9rem;
}

.item-total {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .remove-item:hover {
        background-color: #f8d7da;
        color: #721c24;
    }

/* Resumen del carrito */
.cart-summary {
    background-color: #3a3a4d; /* mismo gris que el panel */
    padding: 1.5rem;
    border-top: 2px solid #5a5a6d;
    color: #f1f1f1; /* texto claro */
}

.summary-line span {
    color: #f1f1f1; /* asegura que Subtotal, IVA y Total sean visibles */
}

.tax-line {
    color: #bbb; /* IVA un poco más claro */
}

.total-line {
    color: #fff; /* resalta el total */
    font-weight: 700;
}


.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

    .summary-line:last-child {
        margin-bottom: 1.5rem;
    }

.tax-line {
    color: #6c757d;
    font-size: 0.9rem;
}

.total-line {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    padding-top: 0.75rem;
    border-top: 2px solid #dee2e6;
}

.subtotal-amount,
.tax-amount,
.total-amount {
    font-weight: 600;
}

.total-amount {
    color: #28a745;
    font-size: 1.2rem;
}

.pay-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

    .pay-button:hover {
        background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    }

.pay-amount {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 1200px) {
    .pos-container {
        flex-direction: column;
        height: auto;
    }

    .products-panel {
        min-height: 400px;
    }

    .cart-panel {
        min-height: 300px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .sales-page .sales-header {
        padding: 1rem;
        margin: -1rem -1rem 0 -1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .sales-page .header-left,
    .sales-page .header-center,
    .sales-page .header-right {
        justify-content: space-between;
    }

    .sales-page .payment-info {
        gap: 1rem;
    }

    .pos-container {
        gap: 1rem;
        margin-top: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .product-card {
        height: 140px;
        padding: 0.75rem;
    }

    .product-image {
        height: 60px;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .pos-container {
        margin-top: 1rem;
    }

    .products-panel,
    .cart-panel {
        padding: 1rem;
    }

    .search-input-products {
        padding: 10px 40px 10px 35px;
    }

    .client-selector {
        padding: 6px 8px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .product-card {
        height: 120px;
        padding: 0.5rem;
    }

    .cart-content {
        padding: 1rem;
    }

    .cart-summary {
        padding: 1rem;
    }
}


/* Contenedor principal */
.sales-page {
    background-color: #2c2c3d; /* mismo gris oscuro que el header */
    padding: 1rem 2rem;
}

/* Panel de productos */
.products-panel {
    background-color: #3a3a4d; /* gris apagado, contraste con header */
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Input de búsqueda */
.search-input-products {
    background-color: #4a4a5d; /* gris más claro que el panel */
    border: 1px solid #5a5a6d;
    color: #f1f1f1;
}

    .search-input-products::placeholder {
        color: #bbb;
    }

/* Grid de productos */
.product-card {
    background-color: #4a4a5d; /* gris apagado */
    color: #f1f1f1;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .product-card.empty {
        background-color: #3b3b55; /* más oscuro para las cards vacías */
        opacity: 0.5;
    }

/* Panel derecho - Carrito */
.cart-panel {
    background-color: #3a3a4d; /* mismo gris apagado que productos */
    border: 1px solid #5a5a6d;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-content, .cart-summary {
    color: #f1f1f1;
}

/* Botones dentro del carrito */
.quantity-btn, .remove-item {
    background-color: #4a4a5d;
    border: 1px solid #5a5a6d;
    color: #f1f1f1;
}

    .quantity-btn:hover, .remove-item:hover {
        background-color: #5a5a6d;
        border-color: #6a6a7d;
    }

/* Totales */
.total-amount, .pay-amount {
    color: #28a745; /* verde para resaltar el total */
}
