﻿/* ====================
   VARIABLES DE COLOR (MODAL)
==================== */
:root {
    --mdl-color-background: #fff;
    --mdl-color-text: #333;
    --mdl-color-border: #ced4da;
    --mdl-color-header-background: #e9ecef;
    --mdl-color-footer-background: #f8f9fa;
    --mdl-color-button-close: #333;
}

[data-theme='dark'] {
    --mdl-color-background: #1e1e1e;
    /*--mdl-color-text: #e0e0e0;*/ /*blanco normal brillante*/
    --mdl-color-text: #d4d4d4;
    /* Opción 2: gris más apagado y no brillante */
    /* --mdl-color-text: #b0b0b0; */
    --mdl-color-border: #444;
    --mdl-color-header-background: #2a2a2a;
    --mdl-color-footer-background: #2a2a2a;
    --mdl-color-button-close: #f0f0f0;
}


/* ====================
   CONTENEDOR DEL MODAL
==================== */


#detalleModal.mp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 95vw;
    height: 80vh;
    background: var(--mdl-color-background);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    z-index: 1000;
}
/* texto claro en todas las secciones del modal en modo oscuro */
    [data-theme='dark'] #detalleModal.mp-modal,
    [data-theme='dark'] #detalleModal.mp-modal .mp-modal-info-strip,
    [data-theme='dark'] #detalleModal.mp-modal .mp-modal-body-custom,
    [data-theme='dark'] #detalleModal.mp-modal .mp-modal-footer-info {
        color: var(--mdl-color-text);
    }
/* ====================
   INTERIOR DEL MODAL
==================== */
.mp-modal-content {
    display: contents;
}

/* ====================
   ENCABEZADO DEL MODAL
==================== */
.mp-modal-info-strip {
    grid-row: 1;
    background: var(--mdl-color-header-background);
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--mdl-color-border);
}

.modal-info-header .mp-linea-arriba,
.modal-info-header .mp-linea-medio,
.modal-info-header .linea-abajo {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

    .modal-info-header .mp-linea-arriba > div,
    .modal-info-header .mp-linea-medio > div,
    .modal-info-header .linea-abajo > div {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.modal-info-header .mp-linea-arriba {
    font-weight: bold;
}

/* ====================
   CUERPO CON SCROLL
==================== */
.mp-modal-body-custom {
    grid-row: 2;
    overflow-y: auto;
    padding: 1rem 2rem;
    background: var(--mdl-color-background);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

    .mp-modal-body-custom::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }

/* ====================
   PIE DEL MODAL
==================== */
.mp-modal-footer-info {
    grid-row: 3;
    background: var(--mdl-color-footer-background);
    padding: 1rem 2rem;
    font-weight: 700;
    font-size: 1.15rem;
    border-top: 1px solid var(--mdl-color-border);
    text-align: right;
}

/* ====================
   BOTÓN CERRAR
==================== */
.mp-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mdl-color-button-close);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    user-select: none;
}

/* ====================
   DETALLE DE ITEMS
==================== */
.mp-detalle-factura {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 1.05rem;
}

.mp-linea-detalle {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.mp-col-cantidad {
    width: 60px;
    text-align: left;
}

.mp-col-nombre {
    flex: 1;
    padding-left: 12px;
}

.mp-col-precio {
    width: 80px;
    text-align: right;
}

/* ====================
   MEDIA QUERIES (MODAL)
==================== */
@media (max-width: 768px) {
    #detalleModal.mp-modal {
        width: 90vw;
    }

    .mp-modal-info-strip,
    .mp-modal-footer-info {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .modal-info-header .mp-linea-arriba,
    .modal-info-header .mp-linea-medio,
    .modal-info-header .linea-abajo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .mp-modal-body-custom {
        padding: 1rem;
    }

    .mp-close {
        top: 8px;
        right: 8px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    #detalleModal.mp-modal {
        width: 95vw;
        border-radius: 6px;
    }

    .mp-modal-info-strip,
    .mp-modal-footer-info {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .modal-info-header .mp-linea-arriba,
    .modal-info-header .mp-linea-medio,
    .modal-info-header .linea-abajo {
        gap: 0.25rem;
    }

    .mp-modal-body-custom {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .mp-close {
        font-size: 1.1rem;
    }
}
