/* ============================================================
   CF7 Modal Popup — Frontend Styles
   ============================================================ */

/* Overlay */
.cf7mp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cf7mp-overlay-bg, rgba(0, 0, 0, 0.6));
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Position variants */
.cf7mp-pos-top    { align-items: flex-start; padding-top: 40px; }
.cf7mp-pos-bottom { align-items: flex-end;   padding-bottom: 40px; }
.cf7mp-pos-center { align-items: center; }

/* Container (the modal box) */
.cf7mp-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Header */
.cf7mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 12px 12px 0 0;
}

.cf7mp-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

/* Close button */
.cf7mp-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    margin-left: 12px;
}
.cf7mp-close:hover {
    background: #f5f5f5;
    color: #111;
}

/* Body */
.cf7mp-body {
    padding: 24px;
}

/* Header-only (no title) — collapse header */
.cf7mp-header:only-child,
.cf7mp-header:has(.cf7mp-close:only-child) {
    border-bottom: none;
    padding-bottom: 0;
    justify-content: flex-end;
}

/* ============================================================
   Animations
   ============================================================ */

/* Fade */
.cf7mp-anim-fade {
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cf7mp-anim-fade.cf7mp-visible {
    opacity: 1;
}
.cf7mp-anim-fade .cf7mp-container {
    transform: none;
}

/* Slide Up */
.cf7mp-anim-slide-up {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cf7mp-anim-slide-up .cf7mp-container {
    transform: translateY(40px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cf7mp-anim-slide-up.cf7mp-visible {
    opacity: 1;
}
.cf7mp-anim-slide-up.cf7mp-visible .cf7mp-container {
    transform: translateY(0);
}

/* Zoom */
.cf7mp-anim-zoom {
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cf7mp-anim-zoom .cf7mp-container {
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cf7mp-anim-zoom.cf7mp-visible {
    opacity: 1;
}
.cf7mp-anim-zoom.cf7mp-visible .cf7mp-container {
    transform: scale(1);
}

/* Bounce */
.cf7mp-anim-bounce {
    opacity: 0;
    transition: opacity 0.2s ease;
}
.cf7mp-anim-bounce .cf7mp-container {
    transform: scale(0.5) translateY(-80px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cf7mp-anim-bounce.cf7mp-visible {
    opacity: 1;
}
.cf7mp-anim-bounce.cf7mp-visible .cf7mp-container {
    transform: scale(1) translateY(0);
}

/* Closing state */
.cf7mp-closing {
    opacity: 0 !important;
    pointer-events: none;
}
.cf7mp-closing .cf7mp-container {
    transform: scale(0.95) !important;
    transition: transform 0.2s ease !important;
}

/* ============================================================
   FAB Trigger Button
   ============================================================ */
.cf7mp-fab-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999989;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.cf7mp-fab-trigger:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.55);
}
.cf7mp-fab-trigger:active {
    transform: translateY(0);
}

/* ============================================================
   Accessibility
   ============================================================ */
.cf7mp-overlay:focus-within .cf7mp-container {
    outline: none;
}

/* Body lock when modal is open */
body.cf7mp-open {
    overflow: hidden;
}

/* ============================================================
   CF7 Form Overrides (inside modal)
   ============================================================ */
.cf7mp-body .wpcf7 {
    width: 100%;
}
.cf7mp-body .wpcf7 p {
    margin-bottom: 14px;
}
.cf7mp-body .wpcf7 input[type="text"],
.cf7mp-body .wpcf7 input[type="email"],
.cf7mp-body .wpcf7 input[type="tel"],
.cf7mp-body .wpcf7 textarea,
.cf7mp-body .wpcf7 select {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}
.cf7mp-body .wpcf7 input:focus,
.cf7mp-body .wpcf7 textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
    background: #fff;
}
.cf7mp-body .wpcf7 input[type="submit"] {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    width: auto;
}
.cf7mp-body .wpcf7 input[type="submit"]:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}
.cf7mp-body .wpcf7 .wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}
.cf7mp-body .wpcf7 .wpcf7-response-output {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 12px;
}
.cf7mp-body .wpcf7 .wpcf7-mail-sent-ok {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #15803d;
}
.cf7mp-body .wpcf7 .wpcf7-validation-errors,
.cf7mp-body .wpcf7 .wpcf7-spam-blocked {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    .cf7mp-container {
        border-radius: 8px;
        max-height: 95vh;
    }
    .cf7mp-header {
        padding: 16px 16px 12px;
    }
    .cf7mp-body {
        padding: 16px;
    }
    .cf7mp-fab-trigger {
        bottom: 16px;
        right: 16px;
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* ============================================================
   FAB — posiciones configurables
   ============================================================ */
.cf7mp-fab {
    position: fixed;
    z-index: 999989;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.cf7mp-fab:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.55);
}
.cf7mp-fab:active { transform: translateY(0); }

.cf7mp-fab-bottom-right { bottom: 28px; right: 28px; }
.cf7mp-fab-bottom-left  { bottom: 28px; left:  28px; }
.cf7mp-fab-top-right    { top:    28px; right: 28px; }
.cf7mp-fab-top-left     { top:    28px; left:  28px; }

@media (max-width: 480px) {
    .cf7mp-fab { padding: 12px 18px; font-size: 14px; }
    .cf7mp-fab-bottom-right { bottom: 16px; right: 16px; }
    .cf7mp-fab-bottom-left  { bottom: 16px; left:  16px; }
    .cf7mp-fab-top-right    { top:    16px; right: 16px; }
    .cf7mp-fab-top-left     { top:    16px; left:  16px; }
}

/* ============================================================
   Shortcode inline button (hereda clases del tema)
   ============================================================ */
.cf7mp-shortcode-btn {
    cursor: pointer;
    display: inline-block;
}
