/* =====================================================================
   Cuotas Sin Intereses — Frontend Styles
   Autor: Erick Pérez — bitsaturno.com
   ===================================================================== */

/* ── Variables por defecto (sobreescritas por inline CSS del admin) ── */
:root {
    --csi-color-amount:    #c0392b;
    --csi-color-secondary: #555555;
    --csi-font-size:       1em;
}

/* ── Loop / carrusel ──────────────────────────────────────────────── */
.csi-loop-text {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;          /* nunca romper en varias líneas */
    white-space: nowrap;        /* el texto no hace wrap */
    font-size: 1em;
    font-weight: 500;
    color: #fff;
    background: #111;
    border-radius: 999px;
    padding: 10px 20px 10px;
    margin: 6px 0 2px;
    line-height: 1.4;
    width: fit-content;
    max-width: 100%;            /* no desborda el card */
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.csi-loop-text strong {
    font-weight: 700;
    color: #fff;
    font-size: 1.05em;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ── Single product trigger ─────────────────────────────────────── */
.csi-single-trigger {
    margin: 4px 0 6px;
}

.csi-single-trigger a.csi-open-modal {
    font-size: 0.85em;
    color: var(--csi-color-amount);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    border-bottom: 1px dashed currentColor;
    padding-bottom: 1px;
}

.csi-single-trigger a.csi-open-modal:hover {
    opacity: 0.7;
}

/* ── Texto de cuota en página de producto (debajo del precio) ──── */
.csi-single-quota-text {
    font-size: var(--csi-font-size);
    color: var(--csi-color-secondary);
    margin: 2px 0 8px;
    display: flex;
    align-items: baseline;
    gap: 3px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.csi-single-quota-text strong {
    font-weight: 700;
    color: var(--csi-color-amount);
    font-size: 1.05em;
    letter-spacing: -0.01em;
}

/* ── Modal overlay ────────────────────────────────────────────────── */
.csi-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.csi-modal-overlay.csi-is-open {
    animation: csiOverlayIn 0.2s ease forwards;
}

@keyframes csiOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal box ────────────────────────────────────────────────────── */
.csi-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 20px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: csiBoxIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
}

@keyframes csiBoxIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Close button ─────────────────────────────────────────────────── */
.csi-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s;
    border-radius: 4px;
}
.csi-modal-close:hover { color: #222; background: #f0f0f0; }

/* ── Modal header ─────────────────────────────────────────────────── */
.csi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.csi-modal-payment-info { display: flex; flex-direction: column; gap: 2px; }

.csi-modal-payment-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    font-weight: 600;
}

.csi-modal-payment-name { font-size: 0.9em; font-weight: 700; color: #1a1a1a; }

.csi-modal-logo { max-height: 36px; max-width: 130px; object-fit: contain; flex-shrink: 0; }

/* ── Description ──────────────────────────────────────────────────── */
.csi-modal-description {
    font-size: 0.8em;
    color: #666;
    margin: 0 0 16px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    line-height: 1.5;
}

/* ── Quota box ────────────────────────────────────────────────────── */
.csi-modal-quota-box {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 16px 16px;
    text-align: center;
    margin-bottom: 14px;
}

.csi-quota-label { display: block; font-size: 0.82em; color: #666; margin-bottom: 6px; }

.csi-quota-amount {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: var(--csi-color-amount);
    margin-bottom: 10px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.csi-quota-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88em;
    color: #444;
    flex-wrap: wrap;
}

/* ── Installment select ───────────────────────────────────────────── */
.csi-installment-select {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px 28px 5px 10px;
    font-size: 0.9em;
    font-weight: 600;
    color: #222;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555'/%3E%3C/svg%3E") no-repeat right 9px center;
    background-size: 8px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.csi-installment-select:focus {
    outline: none;
    border-color: var(--csi-color-amount);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--csi-color-amount) 15%, transparent);
}

/* ── Disclaimer ───────────────────────────────────────────────────── */
.csi-modal-disclaimer {
    font-size: 0.72em;
    color: #aaa;
    text-align: center;
    line-height: 1.5;
    margin: 0 0 16px;
    padding: 0 4px;
}

/* ── Back button ──────────────────────────────────────────────────── */
.csi-modal-back-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    letter-spacing: 0.01em;
}
.csi-modal-back-btn:hover { background: #ececec; border-color: #ccc; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .csi-modal-box { padding: 22px 18px 18px; }
    .csi-quota-amount { font-size: 1.7em; }
}
