/**
 * Koinos Editor Wizard — Styles
 * Wizard de creación/edición de invitaciones (shortcode koinos_edit_event)
 */

/* ==========================================================================
   VARIABLES
   ========================================================================== */

:root {
    --ke-purple:        #7c3aed;
    --ke-purple-light:  #ede9fe;
    --ke-purple-ring:   rgba(124, 58, 237, 0.15);
    --ke-green:         #10b981;
    --ke-green-light:   #d1fae5;
    --ke-border:        #e5e7eb;
    --ke-bg:            #f3f4f6;
    --ke-white:         #fff;
    --ke-text:          #1f2937;
    --ke-text-medium:   #374151;
    --ke-muted:         #6b7280;
    --ke-muted-light:   #9ca3af;
    --ke-radius-sm:     8px;
    --ke-radius-md:     14px;
    --ke-radius-lg:     20px;
    --ke-radius-xl:     28px;
    --ke-shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
    --ke-shadow-md:     0 4px 16px rgba(0,0,0,0.10);
    --ke-shadow-lg:     0 12px 40px rgba(0,0,0,0.14);
}

/* ==========================================================================
   STEP 1 — WRAPPER CENTRADO
   ========================================================================== */

.ke-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 24px 64px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Header */
.ke-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
}

.ke-header__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ke-text);
    margin: 0;
    flex: 1;
    text-align: center;
}

.ke-back {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ke-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    min-width: 80px;
}

.ke-back:hover { color: var(--ke-text); }

/* Stepper */
.ke-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
}

.ke-stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ke-stepper__num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ke-bg);
    border: 2px solid var(--ke-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ke-muted);
    transition: all 0.3s;
}

.ke-stepper__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ke-muted-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.ke-stepper__line {
    flex: 1;
    height: 2px;
    background: var(--ke-border);
    margin: 0 12px;
    margin-bottom: 22px;
    max-width: 80px;
    transition: background 0.3s;
}

/* Step states */
.ke-stepper__step--active .ke-stepper__num {
    background: var(--ke-purple);
    border-color: var(--ke-purple);
    color: #fff;
    box-shadow: 0 0 0 4px var(--ke-purple-ring);
}

.ke-stepper__step--active .ke-stepper__label {
    color: var(--ke-purple);
}

.ke-stepper__step--done .ke-stepper__num {
    background: var(--ke-green);
    border-color: var(--ke-green);
    color: #fff;
}

.ke-stepper__step--done .ke-stepper__label {
    color: var(--ke-green);
}

.ke-stepper--done .ke-stepper__line {
    background: var(--ke-green);
}

/* Section label */
.ke-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--ke-muted-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 14px;
}

.ke-section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ke-text-medium);
    margin: 0 0 6px;
}

.ke-section-subtext {
    font-size: 0.875rem;
    color: var(--ke-muted);
    margin: 0 0 20px;
}

/* ==========================================================================
   TYPE CARDS (Step 1)
   ========================================================================== */

.ke-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

@media (min-width: 540px) {
    .ke-type-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ke-type-card {
    background: var(--ke-white);
    border: 2px solid var(--ke-border);
    border-radius: var(--ke-radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
    user-select: none;
}

.ke-type-card:hover {
    border-color: var(--ke-purple);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--ke-purple-ring);
}

.ke-type-card.active {
    border-color: var(--ke-purple);
    background: rgba(124, 58, 237, 0.04);
    box-shadow: 0 0 0 4px var(--ke-purple-ring);
    transform: translateY(-2px);
}

.ke-type-card__icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}

.ke-type-card__label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ke-text);
    display: block;
    margin-bottom: 4px;
}

.ke-type-card__desc {
    font-size: 0.73rem;
    color: var(--ke-muted-light);
    display: block;
    font-weight: 400;
    line-height: 1.4;
}

/* ==========================================================================
   TEMPLATE SECTION (Step 1 — aparece tras seleccionar tipo)
   ========================================================================== */

.ke-template-section {
    margin-top: 40px;
    animation: ke-fade-up 0.35s ease;
}

.ke-template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 600px) {
    .ke-template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ke-template-card {
    background: var(--ke-white);
    border: 2px solid var(--ke-border);
    border-radius: var(--ke-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.ke-template-card:hover {
    border-color: var(--ke-purple);
    transform: translateY(-3px);
    box-shadow: var(--ke-shadow-md);
}

.ke-template-card.active {
    border-color: var(--ke-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.ke-template-card__thumb {
    height: 160px;
    background: linear-gradient(135deg, var(--ke-purple-light), var(--ke-green-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ke-muted-light);
    font-size: 1.8rem;
    overflow: hidden;
}

.ke-template-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.ke-template-card:hover .ke-template-card__thumb img {
    transform: scale(1.05);
}

.ke-template-card__name {
    padding: 11px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ke-text-medium);
    text-align: center;
}

.ke-template-card__check {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: var(--ke-green);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--ke-shadow-sm);
}

.ke-template-card.active .ke-template-card__check {
    display: flex;
}

/* Skeleton loader */
.ke-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: ke-shimmer 1.4s ease infinite;
    border-radius: 4px;
}

.ke-skeleton-card {
    background: var(--ke-white);
    border: 2px solid var(--ke-border);
    border-radius: var(--ke-radius-md);
    overflow: hidden;
}

.ke-skeleton-card .ke-skeleton-thumb {
    height: 160px;
}

.ke-skeleton-card .ke-skeleton-text {
    margin: 12px 14px;
    height: 14px;
    border-radius: 4px;
}

@keyframes ke-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   STEP 2 — LAYOUT EDITOR
   ========================================================================== */

.ke-editor {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    min-height: calc(100vh - 100px);
    padding: 0 0 40px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Sidebar */
.ke-sidebar {
    width: 440px;
    flex-shrink: 0;
    background: var(--ke-white);
    border-radius: var(--ke-radius-xl);
    box-shadow: var(--ke-shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ke-border);
    overflow: hidden;
}

.ke-sidebar-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--ke-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--ke-white);
    flex-shrink: 0;
}

.ke-sidebar-header__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ke-sidebar-header__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ke-text);
    margin: 0;
}

.ke-sidebar-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--ke-purple-light);
    color: var(--ke-purple);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.ke-sidebar-header__back {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ke-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    flex-shrink: 0;
}

.ke-sidebar-header__back:hover { color: var(--ke-text); }

/* Stepper inline en sidebar header */
.ke-sidebar-header .ke-stepper {
    margin-bottom: 0;
    gap: 4px;
}

.ke-sidebar-body {
    padding: 8px 24px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 230px);
    scroll-behavior: smooth;
}

.ke-sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.ke-sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.ke-sidebar-body::-webkit-scrollbar-thumb {
    background: var(--ke-border);
    border-radius: 4px;
}

.ke-sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--ke-border);
    background: var(--ke-white);
    flex-shrink: 0;
}

/* ==========================================================================
   ACF FORM — estilos override dentro del sidebar
   ========================================================================== */

/* Ocultar labels de grupos */
.ke-sidebar-body .acf-form > h3,
.ke-sidebar-body .acf-form > h2 {
    display: none;
}

/* Tab group — pill style */
.ke-sidebar-body .acf-tab-group {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none !important;
    margin: 12px 0 20px !important;
    padding: 5px !important;
    background: var(--ke-bg);
    border-radius: var(--ke-radius-sm);
    border: none !important;
}

.ke-sidebar-body .acf-tab-group li {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.ke-sidebar-body .acf-tab-group li a {
    display: block;
    padding: 6px 13px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ke-muted) !important;
    text-decoration: none !important;
    border: none !important;
    background: transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.ke-sidebar-body .acf-tab-group li a:hover {
    color: var(--ke-text-medium) !important;
    background: rgba(0,0,0,0.05);
}

.ke-sidebar-body .acf-tab-group li.active a,
.ke-sidebar-body .acf-tab-group li a.active {
    background: var(--ke-white) !important;
    color: var(--ke-purple) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10) !important;
}

/* Fields */
.ke-sidebar-body .acf-field {
    padding: 12px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.ke-sidebar-body .acf-field:last-child {
    border-bottom: none !important;
}

.ke-sidebar-body .acf-field > .acf-label label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: var(--ke-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ke-sidebar-body .acf-field p.description {
    font-size: 0.72rem;
    color: var(--ke-muted-light);
    margin-top: 4px;
}

.ke-sidebar-body .acf-field input[type="text"],
.ke-sidebar-body .acf-field input[type="email"],
.ke-sidebar-body .acf-field input[type="number"],
.ke-sidebar-body .acf-field input[type="url"],
.ke-sidebar-body .acf-field input[type="time"],
.ke-sidebar-body .acf-field select,
.ke-sidebar-body .acf-field textarea {
    border: 1.5px solid var(--ke-border) !important;
    border-radius: var(--ke-radius-sm) !important;
    padding: 10px 13px !important;
    font-size: 0.875rem !important;
    color: var(--ke-text) !important;
    background: #fafafa !important;
    box-shadow: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.ke-sidebar-body .acf-field input:focus,
.ke-sidebar-body .acf-field select:focus,
.ke-sidebar-body .acf-field textarea:focus {
    border-color: var(--ke-purple) !important;
    background: var(--ke-white) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px var(--ke-purple-ring) !important;
}

.ke-sidebar-body .acf-field .acf-input-wrap {
    margin: 0;
}

/* True/false switch */
.ke-sidebar-body .acf-field-true-false .acf-switch {
    vertical-align: middle;
}

/* Submit button override — moved to footer via PHP */
.ke-sidebar-body .acf-form-submit {
    display: none !important;
}

/* Repeater */
.ke-sidebar-body .acf-repeater .acf-row {
    background: #f9fafb;
    border-radius: var(--ke-radius-sm);
    border: 1px solid var(--ke-border) !important;
    margin-bottom: 8px;
}

.ke-sidebar-body .acf-repeater .acf-row-handle {
    background: transparent !important;
    border-color: var(--ke-border) !important;
}

/* Date/Time pickers */
.ke-sidebar-body .acf-field input[type="text"].hasDatepicker {
    background-image: none !important;
    cursor: pointer;
}

/* ACF buttons — reducir tamaño */
.ke-sidebar-body .button,
.ke-sidebar-body .button-secondary,
.ke-sidebar-body .acf-button,
.ke-sidebar-body .acf-repeater .acf-repeater-add-row .button {
    font-size: 0.75rem !important;
    padding: 5px 12px !important;
    height: auto !important;
    line-height: 1.5 !important;
    border-radius: 6px !important;
}

/* Imagen / Archivo upload area */
.ke-sidebar-body .acf-image-uploader .acf-actions,
.ke-sidebar-body .acf-file-uploader .acf-actions {
    gap: 6px;
}

.ke-sidebar-body .acf-image-uploader .acf-actions a,
.ke-sidebar-body .acf-file-uploader .acf-actions a {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
}

/* Galería — botón Añadir */
.ke-sidebar-body .acf-gallery .acf-gallery-toolbar .acf-gallery-add {
    font-size: 0.75rem !important;
    padding: 5px 12px !important;
    height: auto !important;
}

/* Repeater — botón Agregar Fila */
.ke-sidebar-body .acf-repeater > table > tfoot .acf-repeater-add-row {
    padding: 8px 12px !important;
}

.ke-sidebar-body .acf-repeater > table > tfoot .acf-repeater-add-row .button {
    font-size: 0.75rem !important;
    padding: 5px 14px !important;
}

/* ==========================================================================
   SIDEBAR FOOTER — Botón guardar
   ========================================================================== */

.ke-save-btn {
    display: block;
    width: 100%;
    background: var(--ke-green);
    color: #fff !important;
    border: none;
    border-radius: var(--ke-radius-sm);
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.ke-save-btn:hover {
    background: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.ke-save-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ==========================================================================
   PREVIEW PANEL (Step 2)
   ========================================================================== */

.ke-preview-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    position: sticky;
    top: 24px;
    align-self: flex-start;
}

.ke-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 375px;
    margin-bottom: 10px;
}

.ke-preview-status {
    font-size: 0.78rem;
    color: var(--ke-muted-light);
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ke-preview-status--saving { color: #f59e0b; }
.ke-preview-status--saved  { color: var(--ke-green); }

.ke-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ke-white);
    border: 1px solid var(--ke-border);
    border-radius: var(--ke-radius-sm);
    padding: 6px 13px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ke-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ke-refresh-btn:hover {
    background: var(--ke-bg);
    color: var(--ke-text-medium);
    border-color: #d1d5db;
}

.ke-phone {
    width: 375px;
    height: 780px;
    background: #000;
    border: 10px solid #1c1c1e;
    border-radius: 44px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px #3a3a3c,
        0 24px 60px rgba(0,0,0,0.22),
        0 8px 20px rgba(0,0,0,0.15);
    position: relative;
}

.ke-phone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background: #1c1c1e;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.ke-phone iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ==========================================================================
   UPLOAD MODAL
   ========================================================================== */

.ke-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ke-modal[hidden] { display: none !important; }

.ke-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
}

.ke-modal__box {
    position: relative;
    z-index: 1;
    background: var(--ke-white);
    border-radius: var(--ke-radius-xl);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--ke-shadow-lg);
    overflow: hidden;
    animation: ke-fade-up 0.22s ease;
}

.ke-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--ke-border);
}

.ke-modal__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ke-text);
}

.ke-modal__close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ke-bg);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--ke-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.ke-modal__close:hover { background: var(--ke-border); color: var(--ke-text); }

.ke-modal__body { padding: 18px 22px; }

/* Dropzone */
.ke-dropzone {
    border: 2px dashed var(--ke-border);
    border-radius: var(--ke-radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.ke-dropzone:hover,
.ke-dropzone--over {
    border-color: var(--ke-purple);
    background: var(--ke-purple-light);
}

.ke-dropzone__icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}

.ke-dropzone__text {
    font-size: 0.875rem;
    color: var(--ke-muted);
    margin: 0;
    line-height: 1.7;
}

.ke-dropzone__text span {
    font-size: 0.8rem;
    color: var(--ke-purple);
    font-weight: 600;
}

/* Preview grid */
.ke-upload-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.ke-upload-preview {
    border-radius: var(--ke-radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--ke-border);
    aspect-ratio: 1;
}

.ke-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Progress bar */
.ke-upload-progress {
    margin-top: 18px;
    text-align: center;
}

.ke-upload-progress__bar {
    background: var(--ke-bg);
    border-radius: 99px;
    height: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ke-upload-progress__fill {
    height: 100%;
    background: var(--ke-purple);
    border-radius: 99px;
    animation: ke-progress-slide 1.4s ease-in-out infinite;
}

@keyframes ke-progress-slide {
    0%   { width: 0%;   margin-left: 0; }
    50%  { width: 55%;  margin-left: 22%; }
    100% { width: 0%;   margin-left: 100%; }
}

.ke-upload-progress__text {
    font-size: 0.78rem;
    color: var(--ke-muted);
}

/* Modal footer */
.ke-modal__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 22px;
    border-top: 1px solid var(--ke-border);
    background: var(--ke-bg);
}

.ke-modal__cancel {
    padding: 8px 18px;
    border-radius: var(--ke-radius-sm);
    background: transparent;
    border: 1.5px solid var(--ke-border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ke-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    font-family: inherit;
}
.ke-modal__cancel:hover { border-color: #9ca3af; color: var(--ke-text-medium); }

.ke-modal__submit {
    padding: 8px 20px;
    border-radius: var(--ke-radius-sm);
    background: var(--ke-purple);
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
}
.ke-modal__submit:hover:not(:disabled) { background: #6d28d9; }
.ke-modal__submit:disabled { opacity: 0.45; cursor: default; }

/* Pending gallery items (injected after upload, before save) */
.ke-sidebar-body .acf-gallery-attachment.ke-gallery-pending {
    opacity: 0.75;
    outline: 2px dashed var(--ke-purple);
    outline-offset: 2px;
}

/* ── Deshabilitar editor de metadatos en galería ── */

/* Ocultar panel lateral de edición */
.ke-sidebar-body .acf-gallery-side {
    display: none !important;
}

/* Anular el encogimiento del listado cuando hay un ítem seleccionado */
.ke-sidebar-body .acf-gallery-main,
.ke-sidebar-body .acf-gallery-attachments {
    width: 100% !important;
    float: none !important;
}

/* Ocultar enlace "Editar" (se muestra sobre el thumb en hover) */
.ke-sidebar-body .acf-gallery-attachment .acf-gallery-edit,
.ke-sidebar-body .acf-gallery-attachment [data-name="edit"] {
    display: none !important;
}

/* Quitar cursor pointer de selección en ítems (solo "×" eliminar queda activo) */
.ke-sidebar-body .acf-gallery-attachment .thumbnail {
    cursor: default;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes ke-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes ke-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE — móvil
   ========================================================================== */

@media (max-width: 768px) {
    .ke-editor {
        flex-direction: column;
        padding: 0;
    }

    .ke-sidebar {
        width: 100%;
        border-radius: var(--ke-radius-md);
    }

    .ke-sidebar-body {
        max-height: none;
    }

    .ke-preview-wrap {
        display: none;
    }

    .ke-wrapper {
        padding: 24px 16px 48px;
    }

    .ke-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ke-template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   PASO 3 — ACTIVAR INVITACIÓN
   ========================================================================== */

.ke-paso3 {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 8px;
}

.ke-paso3__preview {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 24px;
}

.ke-phone--sm {
    width: 220px;
    height: 460px;
    background: #000;
    border: 8px solid #1c1c1e;
    border-radius: 36px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px #3a3a3c,
        0 20px 50px rgba(0,0,0,0.22);
    position: relative;
}

.ke-phone--sm::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 20px;
    background: #1c1c1e;
    border-radius: 0 0 14px 14px;
    z-index: 10;
}

.ke-phone--sm iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.ke-paso3__preview-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ke-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.ke-paso3__preview-link:hover { color: var(--ke-purple); }

.ke-paso3__card {
    flex: 1;
    background: var(--ke-white);
    border: 1px solid var(--ke-border);
    border-radius: var(--ke-radius-xl);
    padding: 36px 32px;
    box-shadow: var(--ke-shadow-sm);
}

.ke-paso3__success-icon {
    font-size: 3rem;
    line-height: 1;
    display: block;
    margin-bottom: 16px;
}

.ke-paso3__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ke-text);
    margin: 0 0 10px;
}

.ke-paso3__desc {
    font-size: 0.9rem;
    color: var(--ke-muted);
    line-height: 1.65;
    margin: 0 0 28px;
}

.ke-paso3__price-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ke-bg);
    border-radius: var(--ke-radius-md);
    padding: 18px 22px;
    margin-bottom: 24px;
}

.ke-paso3__price-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ke-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ke-paso3__price-amount {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--ke-text);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ke-paso3__price-currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ke-muted);
}

.ke-paso3__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.ke-paso3__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: var(--ke-radius-md);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: center;
}

.ke-paso3__btn--mp {
    background: #009ee3;
    color: #fff !important;
}
.ke-paso3__btn--mp:hover {
    background: #0084c1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,158,227,0.30);
}

.ke-paso3__btn--wa {
    background: #25d366;
    color: #fff !important;
}
.ke-paso3__btn--wa:hover {
    background: #1ebe5c;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.30);
}

.ke-paso3__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--ke-border);
    flex-wrap: wrap;
    gap: 8px;
}

.ke-paso3__edit-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ke-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.ke-paso3__edit-link:hover { color: var(--ke-text); }

/* Feedback de retorno desde MercadoPago */
.ke-paso3-feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--ke-radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.ke-paso3-feedback--ok {
    background: var(--ke-green-light);
    color: #065f46;
}

.ke-paso3-feedback--error {
    background: #fee2e2;
    color: #991b1b;
}

.ke-paso3-feedback--pending {
    background: #fef3c7;
    color: #92400e;
}

/* Stepper line done en paso 3 */
.ke-stepper--done.ke-stepper__line {
    background: var(--ke-green);
}

@media (max-width: 768px) {
    .ke-paso3 {
        flex-direction: column-reverse;
    }

    .ke-paso3__preview {
        position: static;
        width: 100%;
    }

    .ke-phone--sm {
        width: 100%;
        max-width: 280px;
        height: 520px;
        margin: 0 auto;
    }

    .ke-paso3__card {
        padding: 24px 20px;
    }
}
