﻿
.sale-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.filters{
    display:flex;
    gap:1rem;
    margin-bottom:1.5rem;
    flex-wrap:wrap;
}

.filter-group {
    position: relative;
    min-width: 200px;
}

.filter-group.end{
    align-content : end
}

.filter-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}


.filter-input, .filter-select {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
}

.date-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-completed {
    background-color: rgba(0, 184, 148, 0.1);
    color: var(--success);
}

.status-pending {
    background-color: rgba(253, 203, 110, 0.1);
    color: var(--warning);
}

.status-cancelled {
    background-color: rgba(214, 48, 49, 0.1);
    color: var(--danger);
}

.stock-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-low {
    background-color: rgba(214, 48, 49, 0.1);
    color: var(--danger);
}

.stock-medium {
    background-color: rgba(253, 203, 110, 0.1);
    color: var(--warning);
}

.stock-high {
    background-color: rgba(0, 184, 148, 0.1);
    color: var(--success);
}

.view-details {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

    .view-details:hover {
        text-decoration: underline;
    }

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    color: white;
}

    .action-btn:hover {
        transform: scale(1.1);
    }


.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    font-size: 0.9rem;
}

.totals {
    margin-top: 1.5rem;
    text-align: right;
}

.total-row {
    display: inline-flex;
    justify-content: space-between;
    min-width: 250px;
    margin-bottom: 0.5rem;
}

.total-label {
    margin-right: 1rem;
}

.grand-total {
    font-weight: 700;
    font-size: 1.2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

    .modal.active {
        opacity: 1;
        pointer-events: all;
    }

.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: all 0.3s;
    overflow-y:auto;
    max-height:90vh;
}

    .modal-content.inventario {
        max-width: 70%;
        height: 70%
    }

    .modal-content::-webkit-scrollbar {
        width: 8px;
    }

    .modal-content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .modal-content::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 10px;
    }

        .modal-content::-webkit-scrollbar-thumb:hover {
            background: var(--secondary);
        }

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 15px;
}


    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
        color: var(--gray);
    }

    .form-group input,
    .form-group select {
        width: 100%;
        padding: 10px;
        border: 1px solid var(--light);
        border-radius: 5px;
        font-size: 14px;
    }

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
    }

        .form-control:focus.warning-input {
            outline: none;
            border-color: var(--danger);
            box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
        }



.input-disabled {
    background-color: #f0f0f0; /* color gris claro */
    color: #888888; /* texto gris */
    cursor: not-allowed; /* cursor cruzado */
    opacity: 1; /* evita que se vea demasiado apagado */
    pointer-events: none; /* evita que se interactúe */
}


.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Botones */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    }

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

    .btn-warning:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    }

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

    .btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    }

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

    .btn-outline:hover {
        background: var(--primary);
        color: white;
    }

.pagination-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.pagination {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 500;
}

    .page-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

.input-group {
    max-width: auto;
}


.m {
    margin-top: 10px;
}

.sale-products {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.sale-summary {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.summary-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--primary);
    text-align: center;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--light);
}

.summary-total {
    font-weight: bold;
    font-size: 18px;
    padding-top: 10px;
    border-top: 2px solid var(--primary);
}

.button-group {
    display: flex;
    gap: 0.2rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.ticket-info {
    margin-bottom: 20px;
}

    .ticket-info h3 {
        margin-bottom: 10px;
        color: var(--dark);
    }

.sale-control {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.spinner {
    position: absolute;
    left: 1rem;
    top: 25%;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.row-icon {
    display: flex;
    gap: 0.2rem;
}

.icon-blink {
    animation: fade-blink 1s infinite;
}

.icon-color {
    color: var(--warning);
}

@keyframes fade-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg)
    }
}

.header-spinner {
    position: absolute;
    left: 14rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: hspin 1s linear infinite;
}

@keyframes hspin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg)
    }
}

.sale-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .sale-details-grid {
        grid-template-columns: 1fr;
    }
}

.detail-group {
    margin-bottom: 1.5rem;
}

.detail-label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 500;
}



/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-buttons {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

        .nav-buttons.active {
            display: flex;
        }

    .back-link {
        margin-left: auto;
    }

    .container {
        padding: 1.5rem;
    }

    .table {
        display: block;
        overflow-x: auto;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }
}

@media (max-width: 1200px) {
    .sale-container {
        grid-template-columns: 1fr;
    }
}

@media (max-height : 1080px) {
    .modal-content.inventario {
        height: 90%;
    }
}

.alertlog {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
}

.alertlog-danger {
    background-color: #fde8e8;
    border-color: #f5c6cb;
    color: #721c24;
}

.alertlog-success {
    background-color: #e8fdf1;
    border-color: #c6f5d5;
    color: #1c7237;
}

/* Opcional: icono para cada tipo de mensaje */
.alertlog-danger:before {
    content: "⚠";
    margin-right: 10px;
    font-size: 16px;
}

.alertlog-success:before {
    content: "✓";
    margin-right: 10px;
    font-size: 16px;
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alertlog {
    animation: fadeIn 0.3s ease-out;
}