/* ============================================================
   Markeintg360 — Frontend Capture Styles
   Los colores vienen de variables CSS generadas por MK360_ThemeAdapter
   que lee el tema activo (theme.json, Elementor, Customizer, etc.)
   ============================================================ */

/* Variables de fallback — se sobreescriben con los del tema */
:root {
    --mk-brand:       #e63946;
    --mk-brand-dark:  #c1121f;
    --mk-brand-light: #fdecea;
    --mk-wa:          #25D366;
    --mk-wa-dark:     #1da851;
    --mk-dark:        #1a1a2e;
    --mk-text:        #444444;
    --mk-bg:          #ffffff;
    --mk-radius:      12px;
    --mk-font-heading: inherit;
    --mk-font-body:    inherit;
    --mk-shadow:      0 24px 64px rgba(0,0,0,.18);
}

/* ── Reset ────────────────────────────────────────────────── */
.mk360-popup *,
.mk360-popup *::before,
.mk360-popup *::after,
.mk360-inline *,
.mk360-sticky-bar * { box-sizing: border-box; }

/* ================================================================
   1. MODAL CENTRADO (Variante A)
   ================================================================ */

.mk360-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mk360-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mk360-modal {
    position: relative;
    background: var(--mk-bg);
    border-radius: var(--mk-radius);
    overflow: hidden;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--mk-shadow);
    font-family: var(--mk-font-body);
    animation: mk360ModalIn .35s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes mk360ModalIn {
    from { opacity:0; transform: scale(.88) translateY(20px); }
    to   { opacity:1; transform: scale(1)   translateY(0); }
}

/* Header con color primario del tema */
.mk360-modal__header {
    background: var(--mk-brand);
    padding: 28px 28px 22px;
    text-align: center;
    position: relative;
}

.mk360-modal__badge {
    display: inline-block;
    background: rgba(255,255,255,.22);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.mk360-modal__icon   { font-size: 40px; line-height: 1; margin-bottom: 8px; display: block; }

.mk360-modal__title {
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 5px;
    line-height: 1.25;
    font-family: var(--mk-font-heading);
}

.mk360-modal__subtitle {
    color: rgba(255,255,255,.85);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.mk360-modal__body { padding: 22px 26px 26px; }

/* Bullets de beneficios */
.mk360-benefits {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.mk360-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--mk-text);
    line-height: 1.4;
}
.mk360-benefits li::before {
    content: '✓';
    background: var(--mk-brand-light);
    color: var(--mk-brand);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    margin-top: 1px;
}

/* ── Inputs ───────────────────────────────────────────────── */
.mk360-form { display: flex; flex-direction: column; gap: 9px; }

.mk360-input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #e0e0e0;
    border-radius: calc(var(--mk-radius) * 0.7);
    font-size: 14px;
    color: var(--mk-text);
    background: #fafafa;
    font-family: var(--mk-font-body);
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none;
}
.mk360-input::placeholder { color: #bbb; }
.mk360-input:focus {
    border-color: var(--mk-brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}

/* ── Botón CTA ────────────────────────────────────────────── */
.mk360-btn {
    width: 100%;
    padding: 14px;
    background: var(--mk-brand);
    color: #fff;
    border: none;
    border-radius: calc(var(--mk-radius) * 0.7);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--mk-font-heading);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s, transform .12s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(230,57,70,.35);
    letter-spacing: .01em;
}
.mk360-btn:hover  {
    background: var(--mk-brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(230,57,70,.45);
}
.mk360-btn:active  { transform: translateY(0); }
.mk360-btn:disabled { opacity: .62; cursor: not-allowed; transform: none; box-shadow: none; }

.mk360-btn__arrow { font-size: 17px; transition: transform .2s; }
.mk360-btn:hover .mk360-btn__arrow { transform: translateX(3px); }

/* Loading spinner */
.mk360-btn--loading .mk360-btn__arrow { display: none; }
.mk360-btn--loading::after {
    content: '';
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mk360Spin .6s linear infinite;
    margin-left: 8px;
}
@keyframes mk360Spin { to { transform: rotate(360deg); } }

/* Privacy */
.mk360-privacy {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    margin: 7px 0 0;
}
.mk360-privacy a { color: #bbb; text-decoration: underline; }

/* Botón cerrar */
.mk360-close {
    position: absolute;
    top: 11px; right: 13px;
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 27px; height: 27px;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    z-index: 2;
}
.mk360-close:hover { background: rgba(255,255,255,.38); }

/* ── Estado éxito ─────────────────────────────────────────── */
.mk360-success {
    text-align: center;
    padding: 6px 0 2px;
    animation: mk360FadeUp .3s ease;
}
.mk360-success__icon  { font-size: 50px; margin-bottom: 10px; display: block; }
.mk360-success__title {
    font-size: 19px;
    font-weight: 800;
    color: var(--mk-dark);
    margin: 0 0 7px;
    font-family: var(--mk-font-heading);
}
.mk360-success__text  { font-size: 14px; color: var(--mk-text); margin: 0; line-height: 1.5; }

@keyframes mk360FadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   2. SLIDE-IN — esquina inferior derecha (Variante B)
   ================================================================ */

.mk360-popup--slidein .mk360-overlay { display: none; }

.mk360-popup--slidein .mk360-modal {
    position: fixed;
    bottom: 24px; right: 24px;
    top: auto; left: auto;
    max-width: 340px;
    border-radius: calc(var(--mk-radius) * 1.2);
    box-shadow: 0 12px 48px rgba(0,0,0,.22);
    animation: mk360SlideIn .42s cubic-bezier(.34,1.4,.64,1) forwards;
}

@keyframes mk360SlideIn {
    from { opacity: 0; transform: translateX(110%) translateY(16px); }
    to   { opacity: 1; transform: translateX(0) translateY(0); }
}

.mk360-popup--slidein .mk360-modal__header { padding: 18px 18px 14px; }
.mk360-popup--slidein .mk360-modal__title  { font-size: 15px; }
.mk360-popup--slidein .mk360-modal__body   { padding: 14px 18px 18px; }
.mk360-popup--slidein .mk360-benefits      { display: none; }
.mk360-popup--slidein .mk360-modal__icon   { font-size: 30px; }

/* ================================================================
   3. STICKY BAR — barra fija inferior (Variante C)
   ================================================================ */

.mk360-sticky-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 999998;
    background: var(--mk-dark);
    padding: 13px 20px;
    box-shadow: 0 -3px 20px rgba(0,0,0,.18);
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.34,1.2,.64,1);
    font-family: var(--mk-font-body);
}
.mk360-sticky-bar.is-visible { transform: translateY(0); }

.mk360-sticky-bar__inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mk360-sticky-bar__title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px;
    font-family: var(--mk-font-heading);
}
.mk360-sticky-bar__sub {
    color: rgba(255,255,255,.55);
    font-size: 11px;
    margin: 0;
}
.mk360-sticky-bar__text { flex: 1; min-width: 180px; }

.mk360-sticky-bar__form {
    display: flex;
    gap: 7px;
    flex: 2;
    min-width: 260px;
}
.mk360-sticky-bar__input {
    flex: 1;
    padding: 9px 13px;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    background: rgba(255,255,255,.13);
    color: #fff;
    outline: none;
    transition: background .2s;
    font-family: var(--mk-font-body);
}
.mk360-sticky-bar__input::placeholder { color: rgba(255,255,255,.4); }
.mk360-sticky-bar__input:focus { background: rgba(255,255,255,.22); }

.mk360-sticky-bar__btn {
    padding: 9px 18px;
    background: var(--mk-brand);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--mk-font-heading);
    transition: background .2s;
}
.mk360-sticky-bar__btn:hover { background: var(--mk-brand-dark); }

.mk360-sticky-bar__close {
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color .15s;
}
.mk360-sticky-bar__close:hover { color: #fff; }

/* ================================================================
   4. INLINE FORM — shortcode [mk360_form]
   ================================================================ */

.mk360-inline {
    background: var(--mk-brand-light);
    border: 1.5px solid rgba(230,57,70,.2);
    border-left: 5px solid var(--mk-brand);
    border-radius: var(--mk-radius);
    padding: 22px 26px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
    font-family: var(--mk-font-body);
}
.mk360-inline::before {
    content: '📘';
    position: absolute;
    top: -8px; right: 14px;
    font-size: 72px;
    opacity: .07;
    pointer-events: none;
}

.mk360-inline__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(230,57,70,.12);
    color: var(--mk-brand);
    border-radius: 20px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 9px;
}
.mk360-inline__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--mk-dark);
    margin: 0 0 5px;
    font-family: var(--mk-font-heading);
}
.mk360-inline__desc {
    font-size: 13px;
    color: var(--mk-text);
    margin: 0 0 16px;
    line-height: 1.5;
}
.mk360-inline__row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.mk360-inline__row .mk360-input { flex: 1; min-width: 130px; background: #fff; }
.mk360-inline__row .mk360-btn   { width: auto; padding: 12px 20px; flex-shrink: 0; }

/* ================================================================
   5. FLOATING BUTTON — reabre popup
   ================================================================ */

.mk360-float-btn {
    position: fixed;
    top: 120px; right: 0;
    z-index: 999997;
    background: var(--mk-brand);
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: -3px 4px 18px rgba(230,57,70,.35);
    transform: translateX(110%);
    opacity: 0;
    transition: transform .32s cubic-bezier(.34,1.4,.64,1), opacity .3s;
    font-family: var(--mk-font-body);
}
.mk360-float-btn.is-visible { transform: translateX(0); opacity: 1; }
.mk360-float-btn:hover       { box-shadow: -4px 6px 22px rgba(230,57,70,.5); transform: translateX(-3px); }

/* ================================================================
   6. RESPONSIVE
   ================================================================ */

@media (max-width: 600px) {
    /* Modal como sheet desde abajo en móvil */
    .mk360-popup { align-items: flex-end; padding: 0; }
    .mk360-modal {
        border-radius: calc(var(--mk-radius) * 1.3) calc(var(--mk-radius) * 1.3) 0 0;
        max-width: 100%;
        animation: mk360SheetIn .35s cubic-bezier(.34,1.2,.64,1) forwards;
    }
    @keyframes mk360SheetIn {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* Slide-in ocupa más ancho en móvil */
    .mk360-popup--slidein .mk360-modal {
        left: 10px; right: 10px; bottom: 10px; max-width: 100%;
    }

    .mk360-sticky-bar__form { flex-direction: column; }
    .mk360-sticky-bar__inner { gap: 10px; }

    .mk360-inline { padding: 16px 14px; }
    .mk360-inline__row { flex-direction: column; }
    .mk360-inline__row .mk360-btn { width: 100%; justify-content: center; }

    /* Float btn más pequeño, sigue pegado al borde derecho */
    .mk360-float-btn { padding: 9px 12px; font-size: 12px; top: 100px; }
}

/* ── Shake animation para validación ──────────────────────── */
@keyframes mk360Shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    60%      { transform: translateX(6px); }
}
.mk360-input--error {
    border-color: var(--mk-brand) !important;
    animation: mk360Shake .4s ease;
}
