/* ============================================================================
   Komfy Payments modal — modal compacto de "Medios de pago" en el PDP.
   Reemplaza el modal nativo de TN (component('payments/payments-details'))
   por un shell propio con estética Komfy. Ver snipplets/komfy-payments-modal.tpl
   ============================================================================ */

.kpay-root {
    position: fixed; inset: 0;
    z-index: 100200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    pointer-events: none;
}
.kpay-root[hidden] { display: none; }
.kpay-root.is-open { pointer-events: auto; }

.kpay-scrim {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .2s ease;
}
.kpay-root.is-open .kpay-scrim { opacity: 1; }

.kpay-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px 28px 24px;
    transform: scale(.92);
    opacity: 0;
    transition: transform .25s cubic-bezier(.2,.9,.4,1.2), opacity .2s ease;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.kpay-root.is-open .kpay-modal { transform: scale(1); opacity: 1; }

.kpay-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 0; background: transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--komfy-carbon, #1C1C1C);
    padding: 0;
    z-index: 1;
}
.kpay-close:hover { background: var(--komfy-tiza, #FAF0E6); }

.kpay-head { margin: 0 0 18px; padding-right: 32px; }
.kpay-title {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--komfy-carbon, #1C1C1C);
    margin: 0 0 4px;
    line-height: 1.15;
}
.kpay-subtitle {
    font-size: 13px;
    color: var(--komfy-muted, #6B6B6B);
    margin: 0;
    line-height: 1.4;
}

.kpay-section {
    padding: 16px 0;
    border-top: 1px solid var(--komfy-line, #E8E2D6);
}
.kpay-section:first-of-type { border-top: 0; padding-top: 6px; }

.kpay-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--komfy-carbon, #1C1C1C);
    margin: 0 0 8px;
    letter-spacing: .01em;
}

/* Línea de descuento de transferencia (verde Komfy) */
.kpay-discount {
    margin: 0;
    font-size: 14px;
    color: #1f8a4d;
    line-height: 1.4;
}
.kpay-discount strong { font-weight: 700; }

/* Línea de cuotas — TN inyecta "12 x $X sin interés" via component('installments') */
.kpay-installments { margin: 0 0 12px; font-size: 14px; }
.kpay-cuotas,
.kpay-cuotas * {
    margin: 0;
    color: var(--komfy-carbon, #1C1C1C);
    font-size: 14px;
    line-height: 1.4;
}
.kpay-cuotas strong,
.kpay-cuotas .js-installment-amount,
.kpay-cuotas .js-installment-price,
.kpay-cuotas .product-installment-amount,
.kpay-cuotas .product-installment-value { font-weight: 700; }

/* Logos de medios de pago — TN renderiza <img> de cada método. Compactamos. */
.kpay-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    margin-top: 4px;
}
.kpay-logos img {
    height: 24px;
    width: auto;
    display: block;
    border-radius: 4px;
}
.kpay-logos ul,
.kpay-logos ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}
.kpay-logos li { margin: 0; }

.kpay-foot {
    margin-top: 24px;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
    color: inherit !important;
    display: flex;
    justify-content: center;
}
.kpay-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--komfy-carbon, #1C1C1C);
    border-radius: 999px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--komfy-carbon, #1C1C1C);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.kpay-back:hover {
    background: var(--komfy-carbon, #1C1C1C);
    color: #fff;
}

[data-kpay-open] { cursor: pointer; }

@media (max-width: 480px) {
    .kpay-root { padding: 12px; align-items: flex-end; }
    .kpay-modal {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        padding: 24px 22px 20px;
    }
}
