/*
 * MPS WooCommerce Quote — CSS optimizado
 * Reemplaza el contenido completo de assets/quote.css.
 *
 * Los estilos del modal están aislados bajo .mps-quote-overlay
 * para evitar afectar botones, enlaces o widgets de Elementor.
 */

/* =========================================================
   1. Fondo y ventana modal
========================================================= */

.mps-quote-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    background: rgba(12, 39, 57, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.mps-quote-overlay.is-open {
    display: flex;
}

.mps-quote-overlay .mps-quote-modal {
    position: relative;
    width: min(600px, 100%);
    max-height: 90vh;
    max-height: min(90vh, 900px);
    overflow: auto;
    box-sizing: border-box;
    padding: 28px;
    border-radius: 15px;
    background: #fff;
    color: #263344;
    box-shadow: 0 18px 55px rgba(10, 35, 52, 0.18);
}

/* =========================================================
   2. Encabezado y botón cerrar
========================================================= */

.mps-quote-modal .mps-quote-kicker {
    margin: 0 48px 5px 0;
    color: #093e61;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.mps-quote-modal h2 {
    margin: 0 48px 18px 0;
    color: #263344;
    font-size: 27px !important;
    font-weight: 700;
    line-height: 1.2;
}

.mps-quote-modal .mps-quote-rule {
    height: 1px;
    margin: 0 0 8px;
    background: #dfe5ea;
}

.mps-quote-modal button.mps-quote-close {
    position: absolute;
    top: 22px;
    right: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid #e0e6eb;
    border-radius: 50%;
    background: #f7f9fa;
    color: #52606d;
    box-shadow: none;
    font: 300 23px/1 Arial, sans-serif;
    text-transform: none;
    cursor: pointer;
}

/* =========================================================
   3. Lista y filas de productos
========================================================= */

.mps-quote-modal .mps-quote-items {
    display: flex;
    flex-direction: column;
}

.mps-quote-modal .mps-quote-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid #dfe5ea;
    background: transparent;
}

.mps-quote-modal .mps-quote-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    background: transparent;
}

.mps-quote-modal .mps-quote-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mps-quote-modal .mps-quote-product-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.mps-quote-modal a.mps-quote-product-name {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    padding: 0;
    color: #263344;
    background: transparent;
    font-family: Outfit, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mps-quote-modal a.mps-quote-product-name:hover {
    color: #263344;
}

.mps-quote-modal .mps-quote-unit-price {
    margin: 0;
    padding: 0;
    color: #093e61;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
}

/* =========================================================
   4. Cantidad y quitar producto
========================================================= */

.mps-quote-modal .mps-quote-qty {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #263344;
    font-size: 13px;
    line-height: 1;
}

.mps-quote-modal button.mps-quote-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    min-width: 25px;
    height: 25px;
    min-height: 25px;
    margin: 0;
    padding: 0;
    border: 1px solid #dce3e9;
    border-radius: 5px;
    background: #fff;
    color: #173f5b;
    box-shadow: none;
    font: 400 17px/1 Arial, sans-serif;
    text-transform: none;
    cursor: pointer;
}

.mps-quote-modal button.mps-quote-qty-btn:hover {
    border-color: #093e61;
    background: #f7fafc;
    color: #104766;
}

.mps-quote-modal button.mps-quote-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 5px 0 5px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #718096;
    box-shadow: none;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
}

.mps-quote-modal button.mps-quote-remove:hover {
    background: transparent;
    color: #c0392b;
}

/* =========================================================
   5. Resumen, total y botón WhatsApp
========================================================= */

.mps-quote-modal .mps-quote-summary {
    padding-top: 20px;
}

.mps-quote-modal .mps-quote-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #263344;
    font-size: 14px;
    line-height: 1.35;
}

.mps-quote-modal .mps-quote-total-row > strong:first-child {
    color: #263344;
    font-size: 14px;
    font-weight: 600;
}

.mps-quote-modal .mps-quote-total {
    color: #093e61;
    font-family: Outfit, sans-serif;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.mps-quote-modal .mps-quote-summary p {
    margin: 12px 0 20px;
    color: #758294;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.6;
}

.mps-quote-modal a.mps-quote-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 18px;
    border: 0;
    border-radius: 6px;
    background: #ffca00;
    color: #123c56;
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    text-transform: none;
}

.mps-quote-modal a.mps-quote-whatsapp:hover {
    background: #f2bd00;
    color: #123c56;
}

.mps-quote-modal .mps-quote-whatsapp svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mps-quote-modal .mps-quote-whatsapp.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================================
   6. Estado vacío
========================================================= */

.mps-quote-modal .mps-quote-summary.is-empty {
    display: none;
}

.mps-quote-modal .mps-quote-items:has(.mps-quote-empty-state) {
    min-height: 245px;
}

.mps-quote-modal .mps-quote-empty-state {
    display: flex;
    min-height: 245px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px 28px;
    text-align: center;
}

.mps-quote-modal .mps-quote-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 0 16px;
    color: #104766;
}

.mps-quote-modal .mps-quote-empty-icon svg {
    display: block;
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
    fill: none;
    stroke: #104766;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mps-quote-modal .mps-quote-empty-icon svg path {
    fill: none;
    stroke: currentColor;
}

.mps-quote-modal .mps-quote-empty-state h3 {
    display: block;
    margin: 0 0 12px;
    padding: 0;
    color: #263344;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
}

.mps-quote-modal .mps-quote-empty-state p {
    margin: 0 0 16px;
    color: #758294;
    font-size: 14px;
    line-height: 1.5;
}

.mps-quote-modal a.mps-quote-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    background: #104766;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mps-quote-modal a.mps-quote-explore:hover {
    background: #0b354e;
    color: #fff;
}

/* =========================================================
   7. Mensajes toast
========================================================= */

.mps-quote-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1000000;
    transform: translate(-50%, 20px);
    padding: 13px 20px;
    border-radius: 7px;
    background: #104766;
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transition: opacity 0.2s, transform 0.2s;
}

.mps-quote-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.mps-quote-toast.is-error {
    background: #a93226;
}

body.mps-quote-modal-open {
    overflow: hidden;
}

/* =========================================================
   8. Adaptación móvil
   Modal centrado; contenido con scroll si no cabe en pantalla.
========================================================= */

@media (max-width: 600px) {
    .mps-quote-overlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .mps-quote-overlay .mps-quote-modal {
        width: 100%;
        max-width: 600px;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        margin: auto;
        padding: 23px 18px;
        border-radius: 15px;
    }

    .mps-quote-modal h2 {
        font-size: 24px;
    }

    .mps-quote-modal .mps-quote-item {
        grid-template-columns: 50px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 14px 0;
    }

    .mps-quote-modal .mps-quote-thumb {
        width: 50px;
        height: 50px;
    }

    .mps-quote-modal a.mps-quote-product-name {
        font-size: 12px;
    }

    .mps-quote-modal .mps-quote-unit-price {
        font-size: 14px;
    }

    .mps-quote-modal button.mps-quote-remove {
        font-size: 10px;
    }

    .mps-quote-modal .mps-quote-total {
        font-size: 21px;
    }

    .mps-quote-modal .mps-quote-items:has(.mps-quote-empty-state),
    .mps-quote-modal .mps-quote-empty-state {
        min-height: 235px;
    }

    .mps-quote-modal .mps-quote-empty-state {
        padding: 22px 8px;
    }

    .mps-quote-modal .mps-quote-empty-state h3 {
        font-size: 18px;
    }

    .mps-quote-modal .mps-quote-empty-state p {
        font-size: 13px;
    }

    .mps-quote-toast {
        width: calc(100% - 30px);
        box-sizing: border-box;
        text-align: center;
    }
}

/* Mantener los botones flotantes de chat detrás del popup abierto.
   Se limita a los selectores habituales de widgets de WhatsApp. */
body.mps-quote-modal-open .joinchat,
body.mps-quote-modal-open .ht-ctc-chat,
body.mps-quote-modal-open .wa__btn_popup,
body.mps-quote-modal-open .floating-whatsapp {
    z-index: 999 !important;
}
