/* ═══════════════════════════════════════════════════════
   Simulator Plans Manager — Frontend v2.1
   ═══════════════════════════════════════════════════════ */

/* ── Wrapper y grid ───────────────────────────────────── */
.spm-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.spm-plans-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}
.spm-plan-col { min-width: 0; display: flex; }
.spm-plan-col .card { width: 100%; display: flex; flex-direction: column; }
.spm-plan-col .card-body {
    flex: 1; display: flex; flex-direction: column; padding: 20px;
}

/* ── Secciones de la tarjeta ───────────────────────────── */
.spm-card-header { text-align: center; margin-bottom: 4px; }
.spm-card-title  { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; color: #444; margin: 6px 0 4px; letter-spacing: .4px; }
.spm-card-note   { font-size: .85rem; color: #666; margin: 0 0 4px; font-style: italic; }

.spm-card-price  { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 14px 0 2px; line-height: 1; }
.spm-old-price   { text-decoration: line-through; color: #999; font-size: 1rem; line-height: 1; padding-bottom: 5px; }
.spm-new-price   { font-size: 3rem; font-weight: 800; color: #1d2327; line-height: 1; letter-spacing: -.5px; }
.spm-payment-note { text-align: center; color: #888; font-size: .78rem; margin: 4px 0 0; }

.spm-card-cta    { margin-top: 10px; }
.spm-urgency-badge {
    display: flex; align-items: center; justify-content: center;
    background: #e8f4fd; color: #1a6fa8; border: 1px solid #b8ddf5;
    font-size: .82rem; font-weight: 700; border-radius: 6px;
    height: 34px; margin-bottom: 10px; padding: 0 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px;
}
.spm-urgency-spacer { height: 34px; margin-bottom: 10px; }

/* Botones base */
.btn-abonar { display: block; width: 100%; padding: 12px; font-size: 1rem; font-weight: 700; letter-spacing: .5px; text-align: center; border: none; border-radius: 6px; cursor: pointer; transition: opacity .15s; }
.btn-abonar:hover { opacity: .88; text-decoration: none; }
.spm-btn-standard { background: #22c55e; color: #fff; }
.spm-btn-featured { background: #2271b1; color: #fff; }

/* Badge descuento esquina (tema default) */
.spm-discount-badge {
    position: absolute; top: -10px; right: -10px;
    background: #d91470; color: #fff;
    padding: 5px 10px; font-size: .78rem; font-weight: 700;
    border-radius: 5px; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Tarjeta destacada (default) */
.spm-card-highlighted { border: 2px solid #0d6efd !important; box-shadow: 0 6px 24px rgba(13,110,253,.18) !important; }

/* Features */
.spm-features-section { flex: 1; display: flex; flex-direction: column; }
.spm-includes-title {
    font-size: .8rem; color: #555; margin-bottom: 0; letter-spacing: .5px;
    border-bottom: 1px solid #999; padding: 30px 15px 30px;
}
.spm-plan-features { text-align: left; margin: 30px 0; }
.spm-plan-features li {
    display: flex; align-items: baseline; gap: 4px;
    margin-bottom: 8px; font-size: .9rem; line-height: 1.4;
    padding-bottom: 8px; border-bottom: 1px solid #f0f0f0;
}
.spm-plan-features li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Botón de ayuda ⓘ */
.spm-help-trigger {
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; padding: 0; margin-left: auto;
    font-weight: bold; font-size: .85rem; cursor: pointer;
    vertical-align: middle; line-height: 1; transition: color .15s; flex-shrink: 0;
}
.spm-help-trigger:hover { color: #2271b1; }

/* Countdown */
#spm-countdown strong { font-size: 1.1em; }
.spm-promo-headline   { font-size: 1.6rem; }

/* Modal */
.spm-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99999; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.spm-modal-overlay.spm-modal-visible { display: flex; animation: spmFadeIn .18s ease; }
@keyframes spmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.spm-modal-box { background: #fff; border-radius: 10px; padding: 32px 28px 24px; max-width: 520px; width: 100%; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: spmSlideUp .2s ease; }
@keyframes spmSlideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.spm-modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.5rem; line-height: 1; color: #888; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.spm-modal-close:hover { background: #f0f0f0; color: #333; }
.spm-modal-body { font-size: .95rem; line-height: 1.6; color: #333; }
.spm-modal-body strong { font-weight: 700; }
.spm-modal-body p { margin: 0 0 10px; }
.spm-modal-body hr { border: none; border-top: 1px solid #eee; margin: 14px 0; }
.spm-modal-body a  { color: #2271b1; }


/* ═══════════════════════════════════════════════════════
   TEMA: PODER JUDICIAL  (spm-theme-judicial)
   Acento: Azul (#2563eb)
   ═══════════════════════════════════════════════════════ */

/* Extra espacio superior para el badge superpuesto */
.spm-theme-judicial .spm-plan-col { padding-top: 22px; }

/* Tarjeta más redondeada */
.spm-theme-judicial .card {
    border-radius: 18px !important;
    border: 1.5px solid #e5e7eb !important;
    overflow: visible !important;   /* permite badge overflow */
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

/* Badge superpuesto al borde superior */
.spm-theme-judicial .spm-top-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    white-space: nowrap;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* Colores de badge por estado */
.spm-theme-judicial .spm-badge-green  { background: #22c55e; }
.spm-theme-judicial .spm-badge-accent { background: #2563eb; }
.spm-theme-judicial .spm-badge-promo  { background: #d97706; }

/* Ocultar badge de descuento de esquina (ya está en el pill del top) */
.spm-theme-judicial .spm-discount-badge { display: none !important; }

/* Tarjeta destacada: borde azul */
.spm-theme-judicial .spm-card-highlighted {
    border-color: #2563eb !important;
    box-shadow: 0 4px 24px rgba(37,99,235,.2) !important;
}

/* Eyebrow (campo nota usado como label superior) */
.spm-theme-judicial .spm-card-eyebrow {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #888;
    margin: 0 0 4px;
}
/* Título más grande en temas especiales */
.spm-theme-judicial .spm-card-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: -.3px;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.spm-theme-judicial .spm-card-header { text-align: left; }
.spm-theme-judicial .spm-card-price  { justify-content: flex-start; margin-top: 16px; }
.spm-theme-judicial .spm-payment-note { text-align: left; font-size: .8rem; color: #666; }
.spm-theme-judicial .spm-new-price { color: #1a1a2e; }

/* Botón azul para plan destacado */
.spm-theme-judicial .spm-card-highlighted .spm-btn-featured,
.spm-theme-judicial .spm-card-highlighted .spm-btn-standard {
    background: #2563eb;
    border-radius: 10px;
}

/* Check icon: círculo verde relleno */
.spm-theme-judicial .spm-plan-features .fa-li {
    width: 22px;
    height: 22px;
    margin-right: 8px;
}
.spm-theme-judicial .spm-plan-features .spm-check-icon {
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 9px;
    text-align: center;
    display: inline-block;
}

/* Separador más suave */
.spm-theme-judicial .spm-plan-features li {
    border-bottom-color: #f3f4f6;
    color: #374151;
}

/* Urgency badge personalizado */
.spm-theme-judicial .spm-urgency-badge {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}


/* ═══════════════════════════════════════════════════════
   TEMA: MINISTERIO PÚBLICO FISCAL (spm-theme-fiscal)
   Acento: Bordo (#8b1a35)
   ═══════════════════════════════════════════════════════ */

.spm-theme-fiscal .spm-plan-col { padding-top: 22px; }

.spm-theme-fiscal .card {
    border-radius: 18px !important;
    border: 1.5px solid #e5e7eb !important;
    overflow: visible !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.spm-theme-fiscal .spm-top-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    white-space: nowrap;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

.spm-theme-fiscal .spm-badge-green  { background: #22c55e; }
.spm-theme-fiscal .spm-badge-accent { background: #8b1a35; }
.spm-theme-fiscal .spm-badge-promo  { background: #1e3a5f; }

.spm-theme-fiscal .spm-discount-badge { display: none !important; }

.spm-theme-fiscal .spm-card-highlighted {
    border-color: #8b1a35 !important;
    box-shadow: 0 4px 24px rgba(139,26,53,.2) !important;
}

.spm-theme-fiscal .spm-card-eyebrow {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .8px; color: #888; margin: 0 0 4px;
}
.spm-theme-fiscal .spm-card-title {
    font-size: 1.4rem; font-weight: 800; text-transform: none;
    letter-spacing: -.3px; color: #1a1a2e; margin-bottom: 2px;
}
.spm-theme-fiscal .spm-card-header { text-align: left; }
.spm-theme-fiscal .spm-card-price  { justify-content: flex-start; margin-top: 16px; }
.spm-theme-fiscal .spm-payment-note { text-align: left; font-size: .8rem; color: #666; }
.spm-theme-fiscal .spm-new-price { color: #1a1a2e; }

/* Botón bordo para plan destacado */
.spm-theme-fiscal .spm-card-highlighted .spm-btn-featured,
.spm-theme-fiscal .spm-card-highlighted .spm-btn-standard {
    background: #8b1a35;
    border-radius: 10px;
}

.spm-theme-fiscal .spm-plan-features .fa-li { width: 22px; height: 22px; margin-right: 8px; }
.spm-theme-fiscal .spm-plan-features .spm-check-icon {
    background: #22c55e; color: #fff; border-radius: 50%;
    width: 18px; height: 18px; line-height: 18px; font-size: 9px;
    text-align: center; display: inline-block;
}
.spm-theme-fiscal .spm-plan-features li { border-bottom-color: #f3f4f6; color: #374151; }
.spm-theme-fiscal .spm-urgency-badge { background: #fff0f3; color: #8b1a35; border-color: #fcccd5; }


/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1023px) { .spm-plans-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 599px)  {
    .spm-plans-row { grid-template-columns: 1fr; }
    .spm-new-price { font-size: 2rem; }
    .spm-theme-judicial .spm-card-title,
    .spm-theme-fiscal   .spm-card-title { font-size: 1.2rem; }
    .spm-modal-box { padding: 24px 18px 20px; }
}
