.ea4v-create-post-live-preview {
    display: flex !Important;
    flex-direction: row !Important;
    gap: 10 !Important;
    width: 100%;
}

.ea4v-live-preview-create-post-form {
    padding: 28px;
}


.ea4v-live-preview-controllers {
    position: sticky;
    z-index: 9;
    background: #ffffffd6;
    padding: 9px 20px;
    border-bottom: 1px solid #0000001a;
    justify-content: space-between;
    top: 0;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    /* Enable horizontal scroll */
    scrollbar-width: thin;
    /* Firefox */
}

/* Custom Scrollbar for Controllers */
.ea4v-live-preview-controllers::-webkit-scrollbar {
    height: 4px;
}

.ea4v-live-preview-controllers::-webkit-scrollbar-track {
    background: transparent;
}

.ea4v-live-preview-controllers::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.ea4v-live-preview-controllers::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.ea4v-live-preview-controllers>.ts-form-group {
    flex-shrink: 1;
}

.ea4v-live-preview-controllers {
    flex-wrap: nowrap;
    gap: 8px;
}

/* UNIFIED CONTROLLER STYLES */

/* Shared Button Styles (Breakpoints, Fullscreen, Template Selector) */
.ea4v-live-preview-controllers .ea4v-lp-btn,
.ea4v-live-preview-controllers .ts-filter.ts-popup-target {
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    /* Consistent border */
    border-radius: 7px;
    padding: 8px 12px;
    /* Consistent padding */
    font-size: 0.95rem;
    gap: 8px;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s ease;
    height: 38px;
    /* Consistent height */
    box-sizing: border-box;
    font-weight: 500;
}

/* Hover State */
.ea4v-live-preview-controllers .ea4v-lp-btn:hover,
.ea4v-live-preview-controllers .ts-filter.ts-popup-target:hover {
    background: #f6f6f6;
    border-color: #0000000d;
}

/* Selected State */
.ea4v-live-preview-controllers .ea4v-lp-btn.ea4v-lp-btn-selected {
    background: rgb(30 41 59);
    color: white;
    border-color: transparent;
}

/* Icon Resizing */
.ea4v-live-preview-controllers .ea4v-lp-btn svg,
.ea4v-live-preview-controllers .ts-filter.ts-popup-target svg,
.ea4v-live-preview-controllers .ts-filter.ts-popup-target .ts-term-icon svg {
    width: 20px;
    height: 20px;
}

/* --- MOBILE SPECIFIC LOGIC (<= 1024px) --- */
@media (max-width: 1024px) {

    /* Hide Labels on Mobile -> Icon Only */
    .ea4v-live-preview-controllers .ea4v-lp-btn span:not(.ea4v-lp-icon),
    .ea4v-live-preview-controllers .ts-filter-text {
        display: none !important;
    }
}


.ea4v-live-preview-create-post-form {
    max-width: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    flex-shrink: 0;
    height: 100%;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.ea4v-live-preview-create-post-form::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}



@media (max-width:1024px) {
    .ea4v-create-post-live-preview {
        flex-direction: column !important;
    }


    .ea4v-live-preview-create-post-form {
        height: 45%;
        width: 100% !important;
        position: sticky;
        bottom: 0;
        z-index: 9;
        background: white;
        padding-top: 29px;
        order: 1;
        padding: 0;
        padding-top: 20px;
    }

    .ea4v-live-preview-wrapper {
        width: 100% !important;
    }



}



.ea4v-live-preview-wrapper .loader {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: 3px solid #ccc;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



.ts-no-posts.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #00000012;
    justify-content: flex-start;
    padding: 80px 20px;
}

/* Mobile Floating Controls */
.ea4v-lp-mobile-controls {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999999;
}

.ea4v-lp-pill {
    display: flex;
    background: #fff;
    padding: 6px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    gap: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ea4v-lp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0 16px;
    border-radius: 30px;
    cursor: pointer;
    color: #555;
    transition: all 0.25s ease;
    height: 40px;
    text-decoration: none !important;
    line-height: 1;
    font-size: 14px;
}

.ea4v-lp-btn:hover {
    background: #f7f7f7;
    color: #333;
}

.ea4v-lp-btn.active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

.ea4v-lp-btn .ea4v-lp-icon,
.ea4v-lp-btn .ea4v-lp-fallback-icon {
    display: flex;
    font-size: 18px;
    line-height: 1;


}

.ea4v-lp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ea4v-lp-btn .ea4v-lp-icon svg,
.ea4v-lp-btn .ea4v-lp-fallback-icon svg,
.ea4v-lp-btn .ea4v-lp-fallback-icon i {
    width: 18px;
    height: 18px;
    font-size: 18px;
    fill: currentColor;
    color: currentColor;
}

.ea4v-btn-text {
    margin-left: 8px;
    white-space: nowrap;
    font-size: 14px;
}

.ea4v-live-preview-header {

    margin-bottom: 24px;
    gap: 27px;
}



/* Error Display Styles */
.ea4v-live-preview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 10;
}

.ea4v-error-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.ea4v-error-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #dc3545;
}

.ea4v-error-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ea4v-error-message {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.5;
}

.ea4v-error-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    text-align: left;
}

.ea4v-error-list li {
    color: #dc3545;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 1px solid #f5c6cb;
}

.ea4v-error-list li:last-child {
    border-bottom: none;
}

/* Updating Progress Bar Styles */
.ea4v-updating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999999999999999;
    pointer-events: none;
}

.ea4v-progress-bar {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ea4v-progress-bar-inner {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% 100%;
    animation: ea4v-progress 1.5s ease-in-out infinite;
}

@keyframes ea4v-progress {
    0% {
        transform: translateX(-100%);
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        transform: translateX(400%);
        background-position: 0% 50%;
    }
}

/* Iframe Container & Stacking Context */
.ea4v-live-preview-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* Hide inactive frames if they shift */
    transition: all 0.3s ease;
    border: 1px solid #ebebeb;
    background: #f6f6f6;
    border-radius: 5px;
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Container for iframes - creates stacking context below controller */
.ea4v-iframe-container {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
    /* Allow flex shrink */
    padding: 20px;
    overflow: hidden;
    box-sizing: border-box;
    /* Critical for padding to work correctly */
}

.ea4v-iframe-inner {
    position: relative;
    width: 100%;
    height: 100%;
    /* Inner wrapper acts as the coordinate system for iframes */
}



/* Base Iframe Styles */
.ea4v-preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    border: none;
    background: #fff;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    max-width: unset !important;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(133, 133, 133, 0.15);
}

/* Active Frame (New Content) - Fades In Over Old */
.ea4v-preview-iframe.is-active {
    z-index: 10;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* Vertical Resize Handle (mobile split mode) */
.ea4v-resize-handle-vertical {
    display: none;
    position: absolute;
    /* Sits above the live-preview-wrapper; positioned relative to it */
    /* Actual positioning handled via CSS in split mode below */
    left: 0;
    right: 0;
    height: 24px;
    cursor: row-resize;
    z-index: 100;
    touch-action: none;
}

/* Visible grip line */
.ea4v-resize-handle-vertical::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--ts-shade-300, #d1d5db);
    opacity: 0.5;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.ea4v-resize-handle-vertical:hover::before,
.ea4v-resize-handle-vertical:active::before {
    opacity: 1;
    width: 56px;
    background-color: var(--ts-primary-500, #3b82f6);
}

/* Show only on mobile in split mode */
@media (max-width: 1024px) {
    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="split"] .ea4v-live-preview-wrapper {
        padding-bottom: 24px;
        /* carve out space for the drag handle */
    }

    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="split"] .ea4v-resize-handle-vertical {
        display: flex;
        align-items: center;
        justify-content: center;
        bottom: 0;
        top: auto;
        height: 24px;
        background: rgba(0, 0, 0, 0.03);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }
}

/* Prevent text selection & lock cursor during vertical drag */
body.ea4v-resizing-height,
body.ea4v-resizing-height * {
    user-select: none !important;
    cursor: row-resize !important;
}

body.ea4v-resizing-height iframe {
    pointer-events: none !important;
}

/* Resize Handle */
.ea4v-resize-handle {
    position: absolute;
    left: -15px;
    /* Center in the 30px gap */
    top: 0;
    bottom: 0;
    width: 30px;
    cursor: col-resize;
    z-index: 100;
    display: none;
    /* Transparent hit area */
}

@media (min-width: 1025px) {
    .ea4v-resize-handle {
        display: block;
    }

    /* Visible line indicator */
    .ea4v-resize-handle::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 1px;
        background-color: transparent;
        transition: background-color 0.2s ease;
    }

    /* Hover/Active state */
    .ea4v-resize-handle:hover::before,
    .ea4v-resize-handle:active::before {
        background-color: var(--ts-primary-500, #3b82f6);
        width: 2px;
        box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
    }

    /* Optional: Grip handle icon in center */
    .ea4v-resize-handle::after {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 4px;
        height: 20px;
        border-radius: 2px;
        background-color: var(--ts-shade-300, #d1d5db);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .ea4v-resize-handle:hover::after {
        opacity: 1;
    }

    /* Prevent selection during resize */
    /* Prevent selection during resize */
    body.ea4v-resizing,
    body.ea4v-resizing * {
        user-select: none !important;
        cursor: col-resize !important;
    }

    body.ea4v-resizing iframe {
        pointer-events: none !important;
        /* Prevent iframe stealing mouse events */
    }
}

/* =========================================
   MOBILE LAYOUT (Non-Fullscreen Only)
   ========================================= */
@media (max-width: 1024px) {
    .ea4v-lp-mobile-controls {
        display: block !important;
    }

    .ea4v-create-post-live-preview {
        display: flex;
        flex-direction: column;
    }




    /* 
       Apply Mobile Modes ONLY when NOT in Fullscreen
       This prevents conflicts and complex overrides.
    */

    /* EDIT MODE: Form 100%, Preview Hidden (But controls visible) */
    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="edit"] .ea4v-live-preview-wrapper {
        display: block !important;
        flex: 0 !important;
        height: 0 !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        overflow: visible !important;
        /* Allow fixed controls to show */
        min-width: 0 !important;
    }

    /* Hide everything in wrapper EXCEPT mobile controls */
    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="edit"] .ea4v-live-preview-wrapper>*:not(.ea4v-lp-mobile-controls) {
        display: none !important;
    }

    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="edit"] .ea4v-live-preview-create-post-form {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        flex: 1 !important;
    }

    /* PREVIEW MODE: Form Hidden, Preview 100% */
    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="preview"] .ea4v-live-preview-create-post-form {
        display: none !important;
    }

    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="preview"] .ea4v-live-preview-wrapper {
        display: flex !important;
        width: 100% !important;
        height: 100vh !important;
        /* Full viewport height for preview */
        background: #fff;
    }

    /* SPLIT MODE: Preview Top (50%), Form Bottom (50%) */
    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="split"] .ea4v-live-preview-wrapper {
        width: 100% !important;
        height: 50vh !important;
        display: flex !important;
        order: -1;
        /* Move to Top */
    }

    .ea4v-create-post-live-preview:not(.ea4v-is-fullscreen)[data-mobile-mode="split"] .ea4v-live-preview-create-post-form {
        width: 100% !important;
        height: 50vh;
        overflow-y: auto !important;
    }
}


/* =========================================
   FULLSCREEN MODE (Mobile & Desktop)
   - Ignores Mobile Modes (Split/Edit) completely
   - Hides Form
   - Hides Mobile Controls
   ========================================= */
.ea4v-create-post-live-preview.ea4v-is-fullscreen,
.ea4v-create-post-live-preview:fullscreen,
.ea4v-create-post-live-preview:-webkit-full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999;
    background: #f6f6f6;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

/* Hide Form & Mobile Controls in Fullscreen */
.ea4v-create-post-live-preview.ea4v-is-fullscreen .ea4v-live-preview-create-post-form,
.ea4v-create-post-live-preview:fullscreen .ea4v-live-preview-create-post-form,
.ea4v-create-post-live-preview:-webkit-full-screen .ea4v-live-preview-create-post-form,
.ea4v-create-post-live-preview.ea4v-is-fullscreen .ea4v-lp-mobile-controls,
.ea4v-create-post-live-preview:fullscreen .ea4v-lp-mobile-controls,
.ea4v-create-post-live-preview:-webkit-full-screen .ea4v-lp-mobile-controls {
    display: none !important;
}

/* Force Wrapper to 100% */
.ea4v-create-post-live-preview.ea4v-is-fullscreen .ea4v-live-preview-wrapper,
.ea4v-create-post-live-preview:fullscreen .ea4v-live-preview-wrapper,
.ea4v-create-post-live-preview:-webkit-full-screen .ea4v-live-preview-wrapper {
    height: 100% !important;
    width: 100% !important;
    flex: 1 !important;
    display: flex !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Ensure Iframe Container fills Wrapper */
.ea4v-create-post-live-preview.ea4v-is-fullscreen .ea4v-iframe-container,
.ea4v-create-post-live-preview:fullscreen .ea4v-iframe-container,
.ea4v-create-post-live-preview:-webkit-full-screen .ea4v-iframe-container {
    height: 100% !important;
    flex: 1 !important;
    min-height: 0;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Clean up controllers in fullscreen */
.ea4v-create-post-live-preview.ea4v-is-fullscreen .ea4v-live-preview-controllers,
.ea4v-create-post-live-preview:fullscreen .ea4v-live-preview-controllers,
.ea4v-create-post-live-preview:-webkit-full-screen .ea4v-live-preview-controllers {
    width: 100%;
    flex-shrink: 0;
    border-radius: 0;
}

/* Hide Resize Handle in Fullscreen */
.ea4v-create-post-live-preview.ea4v-is-fullscreen .ea4v-resize-handle,
.ea4v-create-post-live-preview:fullscreen .ea4v-resize-handle,
.ea4v-create-post-live-preview:-webkit-full-screen .ea4v-resize-handle {
    display: none !important;
}

/* Selected Template Styles */
.ea4v-template-list li {
    border: none;
    transition: all 0.2s ease;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
}

.ea4v-template-list li svg,
.ea4v-template-list li i {
    font-size: 16px;
    width: 16px;
    height: 16px;
    fill: #aeaeae;
    color: #aeaeae;

}

.ea4v-template-list li:hover a {
    color: var(--e-global-color-accent);
}

.ea4v-template-list li.vx-selected {
    /* Light green/accent background matching Voxel vibe */
    border-color: #d8d8d8;
}

.ea4v-template-list li.vx-selected .cart-item-details a {
    color: var(--e-global-color-accent);
    /* Darker accent text */
    font-weight: 600;
}


ul.ea4v-template-list {
    gap: 15px !Important;
}

/* Thumbnail Layout */
.ea4v-template-list li.has-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    gap: 10px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.ea4v-template-list li.has-thumbnail .ea4v-template-thumbnail {
    width: 100%;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.ea4v-template-list li.has-thumbnail .ea4v-lightbox-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.2s ease-in-out;
    z-index: 5;
}

.ea4v-template-list li.has-thumbnail .ea4v-lightbox-overlay svg {
    width: 20px;
    height: 20px;
}

.ea4v-template-list li.has-thumbnail:hover .ea4v-lightbox-overlay {
    opacity: 1;
}

.ea4v-template-list li.has-thumbnail .cart-stepper {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #fff;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}