.ventas_container * {
    box-sizing: border-box;
    font-family: var(--monserrat);
}

.ventas_container {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ventas_header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.ventas_header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.862);
}

.ventas_add_btn {
    text-decoration: none;
    padding: 15px 20px;
    background-color: var(--red-border-strong);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.ventas_add_btn:hover {
    background-color: var(--red-border-default);
}

.ventas_header_subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
}

.ventas_filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ventas_search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.ventas_search-box input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.ventas_search-box input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.ventas_search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.ventas_status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ventas_filter-dates {
    padding: 10px 18px;
    background-color: #f0f3f8;
    border: none;
    border-radius: 8px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.ventas_filter-btn {
    padding: 10px 18px;
    background-color: #f0f3f8;
    border: none;
    border-radius: 8px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.ventas_filter-btn:hover {
    background-color: #e2e7f0;
}

.ventas_filter-btn.active {
    background-color: var(--red-border-default);
    color: white;
}

#ventas_clear{
    background-color: var(--red-border-strong);
    color: white;
}

#ventas_clear:hover{
    background-color: var(--red-border-default);
}

/* Orders Table */
.ventas_orders-container {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ventas_table-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.ventas_table-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
}

.ventas_table {
    width: 100%;
    border-collapse: collapse;
}

.ventas_table thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #eee;
}

.ventas_table th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 700;
    color: #555;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ventas_table td {
    padding: 18px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.ventas_order-id {
    font-weight: 700;
    color: #1e3c72;
}

.ventas_client-info {
    display: flex;
    flex-direction: column;
}

.ventas_client-address{
    max-height: 40px;
    max-width: 300px;
    overflow-x: auto;
    overflow-y: ellipsis;
}

.ventas_client-name {
    font-weight: 600;
    margin-bottom: 4px;
    max-width: 200px;
    white-space: nowrap;  
    overflow: hidden;
    text-overflow: ellipsis;
}

.ventas_client-location {
    font-size: 0.9rem;
    color: #777;
}

.ventas_status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ventas_status.paid {
    background-color: #d4edda;
    color: #155724;
}

.ventas_status.processing {
    background-color: #fff3cd;
    color: #856404;
}

.ventas_status.pending {
    background-color: #d1ecf1;
    color: #0c5460;
}

.ventas_status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.ventas_actions a {
    text-decoration: none;
    padding: 8px 15px;
    margin-right: 8px;
    border: none;
    border-radius: 6px;
    background-color: #f0f3f8;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ventas_actions a:last-child {
    background-color: #f8d7da;
    color: #721c24;
}

.ventas_actions a:hover {
    background-color: #e2e7f0;
}

/* Summary Stats */
.ventas_stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ventas_stat-card {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.ventas_stat-title {
    font-size: 0.95rem;
    color: #777;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ventas_stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--red-border-strong);
    margin-bottom: 8px;
}

.ventas_stat-change {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.ventas_positive {
    color: #28a745;
}

.ventas_negative {
    color: #dc3545;
}

.ventas_stat-change i {
    margin-right: 5px;
}

.ventas_stat-note {
    font-size: 0.9rem;
    color: #777;
    margin-top: 8px;
}

/* Pagination */
.ventas_pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
}

.ventas_pagination-info {
    color: #777;
}

.ventas_pagination-controls {
    display: flex;
    gap: 10px;
}

.ventas_pagination-controls button {
    padding: 10px 16px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.ventas_pagination-controls button:hover:not(:disabled) {
    background-color: #f0f3f8;
    border-color: #bbb;
}

.ventas_pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ventas_page-numbers {
    display: flex;
    gap: 5px;
}

.ventas_page-numbers button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
}

.ventas_page-numbers button.active {
    background-color: var(--red-border-default);
    color: white;
    border-color: var(--red-border-default);
}

/* Modal */

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

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


/* Media Queries */
@media (max-width: 1366px) {

    .ventas_container {
        padding: 0 20px;
        gap: 20px;
    }

    .ventas_header h1 {
        font-size: 2rem;
    }

    .ventas_add_btn {
        font-size: 1.1rem;
        padding: 12px 18px;
    }

    .ventas_filters {
        padding: 18px;
        gap: 12px;
    }

    .ventas_search-box {
        min-width: 250px;
    }

    .ventas_table th,
    .ventas_table td {
        padding: 14px 12px;
    }

    .ventas_stat-value {
        font-size: 1.8rem;
    }
}


@media (max-width: 1200px) {

    .ventas_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .ventas_add_btn {
        align-self: flex-start;
    }

    .ventas_stats-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .ventas_table th {
        font-size: 0.85rem;
    }

    .ventas_table td {
        font-size: 0.9rem;
    }
}



@media (max-width: 1720px) and (min-width: 1024px) {

    .ventas_table td {
        height: 100px; /* o lo que necesites */
        vertical-align: middle; /* opcional: centra contenido */
    }

    .ventas_actions {
        display: flex;
        flex-wrap: wrap;      /* 🔥 permite que bajen */
        gap: 6px;
    }

    .ventas_actions a {
        flex: 1 1 auto; 
        min-width: 10px;    
        text-align: center;
        margin-right: 0;   
        padding: 6px 10px;   
        font-size: 0.85rem;
        height: fit-content;
    }

}

@media (max-width: 1143px) and (min-width: 769px) {

    .ventas_table td {
        height: 150px;
        vertical-align: middle; 
    }

}

@media (max-width: 1024px) {

    .ventas_filters {
        flex-direction: column;
        align-items: stretch;
    }

    .ventas_status-filters {
        justify-content: flex-start;
    }

    .ventas_stat-card {
        padding: 20px;
    }

    .ventas_table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .ventas_table th,
    .ventas_table td {
        height: auto; 
        min-width: 140px;
    }
}

@media (max-width: 768px) {

    .ventas_container {
        gap: 15px;
    }

    .ventas_header h1 {
        font-size: 1.6rem;
    }

    .ventas_add_btn {
        width: 100%;
        text-align: center;
    }

    .ventas_filters {
        padding: 15px;
    }

    .ventas_search-box input {
        padding: 12px 15px 12px 40px;
        font-size: 0.95rem;
    }

    .ventas_status-filters {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ventas_filter-btn,
    .ventas_filter-dates {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
        padding: 10px;
        font-size: 0.9rem;
    }

    .ventas_stats-container {
        grid-template-columns: 1fr;
    }

    .ventas_stat-value {
        font-size: 1.6rem;
    }

    .ventas_pagination {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .ventas_pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .ventas_header h1 {
        font-size: 1.4rem;
    }

    .ventas_filter-btn,
    .ventas_filter-dates {
        flex: 1 1 100%;
    }

    .ventas_table th,
    .ventas_table td {
        min-width: 120px;
        font-size: 0.8rem;
    }

    .ventas_actions button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .ventas_stat-value {
        font-size: 1.4rem;
    }

}




/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
                            /* IMPRESION */
/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
.imprimir *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.imprimir {
    display: none;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

.imprimir_contenedor {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    padding: 30px 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* ENCABEZADO */
.imprimir_encabezado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #000;
    margin-bottom: 15px;
}

.imprimir_logo {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: -1px;
}

.imprimir_fecha_folio {
    display: flex;
    gap: 15px;
}

/* CLIENTE EN 2 COLUMNAS */
.imprimir_info_cliente {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 40px;
    margin-bottom: 10px;
    font-size: 1rem;
}

.imprimir_fila_info {
    display: flex;
}

.imprimir_label {
    display: flex;
    align-items: center;
    font-weight: bold;
    width: fit-content;
}

.imprimir_valor {
    flex: 1;
    border-bottom: 1px solid #ccc;
    padding-left: 10px;
    font-size: 1.1rem;
    white-space: nowrap;  
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TABLA MÁS ANCHA */
.imprimir_tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    table-layout: fixed; 
}

.imprimir_tabla th {
    background-color: #000;
    color: white;
    padding: 12px;
    font-size: 12px;
}

.imprimir_tabla td {
    padding: 12px 0;
    font-size: 1.2rem;
}

.imprimir_tabla_cant {
    width: 60px;
    text-align: center;
}

.imprimir_tabla_prod {
    width: 200px;
    text-align: center;
}

.imprimir_tabla_desc {
    width: 400px;
    text-align: center;
}

.imprimir_tabla_precio,
.imprimir_tabla_importe {
    width: 140px;
    text-align: right;
}

.imprimir_tabla_importe {
    font-weight: bold;
}

/* TOTALES MÁS PRO */
.imprimir_totales {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 10px;
}

.imprimir_metodo_pago {
    width: 45%;
}

.imprimir_resumen {
    width: 40%;
}

.imprimir_resumen_fila {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid #ddd;
}

.imprimir_resumen_label {
    font-weight: bold;
}

.imprimir_resumen_fila:last-child {
    font-size: 18px;
    border-bottom: 2px solid #000;
}

/* PIE */
.imprimir_pie {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 2px solid #000;
    font-size: 10px;
    line-height: 1.4;
    color: #555;
}

/* Fuerza nueva hoja */
.page-break {
    page-break-before: always;
    break-before: page;
}

/* Grid de productos */
.product-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas */
    grid-template-rows: repeat(2, 1fr);    /* 2 filas */
    gap: 30px;
}

/* Tarjeta individual */
.product-card {
    aspect-ratio: 1 / 1;
    max-height: 300px;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    page-break-inside: avoid;
    align-items: center;
    justify-content: center;
}

/* contenedor de imagen */
.product-card .img-container {
    flex: 1;
    width: 100%;
    overflow: hidden;
}

/* imagen */
.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* texto */
.product-card h2 {
    font-size: 28px;
    text-align: center;
    margin: 10px 0 0 0;
}

.product-card p {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
}

.imprimir_detalle{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.imprimir_detalle{
    display: none;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* IMPRESIÓN */
@media print {

    /* VENTA COMPLETA */

    body * {
        visibility: hidden;
    }

    .imprimir_contenedor {
        visibility: visible;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        padding: 20px 30px;
    }

    .imprimir_contenedor * {
        visibility: visible;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-page {
        width: 100%;
        min-height: 100%;
        page-break-after: always;
    }

    .page-break {
        page-break-before: always;
        break-before: page;
    }

/*/////////////////////// DETALLE VENTA /////////////////////////////////////*/

    .imprimir_contenedor_detalle{
        width: 100%;
        visibility: visible;
        position: absolute;
        left: 0;
        top: 0;
        box-shadow: none;
        display: flex;
    }

    .imprimir_contenedor_detalle * {
        visibility: visible;
    }

    .print-detail-page {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1px;
    }

    .imprimir_detalle_img{
        width: 30%;
        object-fit: contain;
    }

    .imprimir_detalle_box {
        width: 90%;
        padding: 30px 40px;
        border: 3px solid #000;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    /* FILAS */
    .imprimir_detalle_row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* LABEL */
    .imprimir_detalle_label {
        font-size: 15px;
        font-weight: 600;
        letter-spacing: 1px;
        color: #555;
    }

    /* VALOR GRANDE */
    .imprimir_detalle_value {
        font-size: 28px;
        font-weight: 800;
        color: #000;
    }

    /* LINEA DIVISORA */
    .imprimir_detalle_divider {
        width: 100%;
        height: 2px;
        background: #000;
    }
}
