/* Contenedor General Recibos */
.wcfm-recibo-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 0;
}

.wcfm-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wcfm_submit_button,
.wcfm_mini_button {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.wcfm_submit_button:hover {
    background-color: #138496;
}

.wcfm_icon_button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin: 0 5px;
    color: #555;
}

/* Tabla del Dashboard */
.wcfm_table_simple_responsive {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wcfm_table_simple_responsive th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 12px;
}

.wcfm_table_simple_responsive td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* Etiquetas de estado */
.recibo-deuda-tag {
    display: inline-block;
    background-color: #dc3545;
    color: white;
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: bold;
}

.recibo-pagado-tag {
    display: inline-block;
    background-color: #28a745;
    color: white;
    font-size: 0.8em;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 5px;
}

/* --- POPUP Y FORMULARIO --- */
.wcfm-recibo-popup-container {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.wcfm-recibo-popup-content {
    background-color: #fff;
    margin: 0 auto;
    padding: 25px;
    width: 100%;
    max-width: 600px;
    /* Volvemos a un ancho contenido para que se vea elegante */
    position: relative;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.wcfm-recibo-popup-close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

.wcfm_input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* --- ESTILOS DE FILAS DE PRODUCTOS --- */
.producto-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

.producto-nombre {
    flex: 3;
    margin-bottom: 0 !important;
}

.producto-cantidad {
    flex: 1;
    margin-bottom: 0 !important;
}

.producto-precio {
    flex: 2;
    margin-bottom: 0 !important;
}


/* --- ESTILOS DE FILAS DE PAGOS (PC y GENERAL) --- */
/* AQUÍ HACEMOS EL CAMBIO: Forzamos estructura de bloque (2 filas) */

.pago-row {
    display: flex;
    flex-direction: column;
    /* Apila los bloques verticalmente */
    gap: 8px;
    background-color: #f7faff;
    /* Color de fondo suave para diferenciar cada pago */
    border: 1px solid #dcebfb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

/* Fila Superior: Fecha y Referencia */
.pago-bloque-fecha {
    display: flex;
    width: 100%;
    gap: 10px;
    padding-right: 25px;
    /* Dejamos espacio para la X de cerrar */
}

/* Fila Inferior: Montos */
.pago-bloque-montos {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: center;
}

/* Ajustes de Inputs dentro de los bloques */
.pago-bloque-fecha .wcfm_input,
.pago-bloque-montos .wcfm_input {
    margin-bottom: 0;
    /* Quitamos el margen inferior por defecto */
    flex: 1;
    /* Hacemos que se distribuyan equitativamente */
}

/* Estilo especial para el input de Dólares */
.input-wrapper {
    position: relative;
    flex: 1;
}

.input-symbol {
    position: absolute;
    left: 8px;
    top: 8px;
    color: #555;
    font-size: 14px;
}

.input-wrapper input {
    padding-left: 20px;
    color: green;
    font-weight: bold;
}

/* Botón de eliminar (X) */
.remove-row-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    color: #d9534f;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
}

.remove-row-btn:hover {
    color: #c9302c;
}


/* --- RESPONSIVE (MÓVIL) --- */
@media (max-width: 768px) {
    .wcfm-recibo-popup-container {
        align-items: flex-start;
        padding-top: 40px;
    }

    .wcfm_table_simple_responsive thead {
        display: none;
    }

    .wcfm_table_simple_responsive tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }

    .wcfm_table_simple_responsive td {
        display: block;
        text-align: right;
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }

    .wcfm_table_simple_responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
    }

    /* Productos apilados en móvil */
    .producto-row {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        background: #fdfdfd;
        padding: 10px;
        border: 1px solid #eee;
        border-radius: 5px;
    }

    .producto-nombre,
    .producto-cantidad,
    .producto-precio {
        width: 100%;
    }

    /* Pagos en móvil: Ajustamos la fila de montos si es muy estrecha */
    .pago-bloque-fecha {
        flex-direction: row;
        /* Mantenemos fecha y ref juntos si caben */
    }

    /* Si la pantalla es muy pequeña, bajamos los montos a 2 líneas */
    .pago-bloque-montos {
        flex-wrap: wrap;
    }

    .input-wrapper {
        flex: 1 1 100%;
        /* El monto en $ ocupa toda la línea en móviles muy pequeños */
        margin-bottom: 5px;
    }
}

/* New Payment Method Styles */
.pago-metodo {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    font-size: 14px;
}

/* Mobile Responsiveness for Payment Row */
@media (max-width: 600px) {
    .pago-bloque-montos {
        flex-wrap: wrap;
    }

    .pago-bloque-montos .input-wrapper,
    .pago-bloque-montos .pago-metodo {
        flex: 1 1 100%;
        /* Full width on small screens */
        min-width: 100%;
        margin-bottom: 5px;
    }

    .pago-tasa,
    .pago-bs {
        flex: 1;
        min-width: 45% !important;
    }
}