.gd-editor-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 1200px; margin: 30px auto; border: 1px solid #dcdcde; border-radius: 8px; padding: 20px; background: #fff; }
#gd-live-editor { display: flex; flex-wrap: wrap; gap: 30px; }
#gd-editor-left { flex: 2; min-width: 300px; }
#gd-image-container { position: relative; border: 2px solid #ccc; background-color: #f0f0f1; background-size: cover; background-position: center; background-repeat: no-repeat; border-radius: 8px; overflow: hidden; width: 100%; user-select: none; height: 0; }

#gd-image-container.customer-mode::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-repeat: no-repeat; background-position: center; background-size: 100% auto; opacity: 0.25; pointer-events: none; z-index: 100; }

.gd-text-layer { display: flex; align-items: center; justify-content: center; position: absolute; cursor: move; padding: 0 10px; border: 2px dashed rgba(0, 0, 0, 0.4); border-radius: 4px; transform-origin: top left; box-sizing: border-box; z-index: 20; white-space: nowrap; transition: border-color 0.2s ease-in-out; }
.gd-text-layer.selected {
    border-style: solid;
    border-color: #2271b1;
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(34,113,177,0.15);
    padding: 6px 18px;
    background: rgba(34,113,177,0.06);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.gd-text-layer.editing { border-style: solid; border-color: #2271b1; cursor: default; }

/* --- FIX: Disable text selection by default to prevent dragging glitches --- */
.gd-text-inner { 
    outline: none; 
    line-height: 1.0; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none; 
    cursor: default; 
}
/* --- END FIX --- */

.gd-text-layer.selected .gd-text-inner { cursor: move; } /* Changed to move to indicate dragging */
.gd-text-inner:focus { outline: none; }

/* Only allow selection when actually editing */
.gd-text-layer.editing .gd-text-inner {
    -webkit-user-select: text !important;
    user-select: text !important;
    cursor: text !important;
}

.gd-photo-layer { position: absolute; cursor: move; border: 2px dashed rgba(0, 0, 0, 0.4); box-sizing: border-box; z-index: 10; }
.gd-photo-layer.selected { border: 2px solid #ffb900; }
.gd-photo-clipper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; background-color: rgba(0, 0, 0, 0.1); }
.gd-photo-layer[data-shape="circle"] .gd-photo-clipper { border-radius: 50%; }
.gd-photo-layer[data-shape="rectangle"] .gd-photo-clipper { border-radius: 0; }
.gd-photo-layer[data-type="image"] .gd-photo-clipper { background-color: transparent; }
.gd-photo-layer[data-type="image"] img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.gd-duplicate-btn {
    display: none; 
    position: absolute;
    top: -12px;     
    right: -12px;
    width: 24px;
    height: 24px;
    background: #2271b1; 
    color: white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    z-index: 101; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    font-family: sans-serif; 
}

.gd-duplicate-btn:hover {
    background: #1e639c;
}

.gd-text-layer.selected .gd-duplicate-btn,
.gd-photo-layer.selected .gd-duplicate-btn {
    display: block;
}

body.gce-studio-mode .gd-duplicate-btn {
    display: none !important;
}

.gd-text-layer .gd-duplicate-btn {
    top: -14px;
    right: -14px;
}

.gd-photo-layer .gd-resize-handle { position: absolute; width: 12px; height: 12px; background: #ffb900; border: 1px solid #fff; border-radius: 2px; z-index: 11; }
.gd-photo-layer .gd-resize-handle.br { bottom: -6px; right: -6px; cursor: se-resize; }

.gd-photo-upload-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); 
    color: white; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    cursor: pointer; 
    opacity: 0; 
    transition: opacity 0.2s; 
    z-index: 50; 
    line-height: 1.4;
    padding: 5%;
}
.gd-photo-clipper:hover .gd-photo-upload-overlay { opacity: 1; }
.gd-photo-upload-overlay input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.gd-photo-upload-overlay .gd-login-btn:hover { background: #703a6a !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important; }

.gd-photo-adjust-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5); 
    border-radius: 4px; 
    padding: 3px; 
    display: flex; 
    gap: 3px; 
    opacity: 0; 
    transition: opacity 0.2s; 
    z-index: 12; 
}

.gd-photo-layer:hover .gd-photo-adjust-controls,
.gd-photo-layer.selected .gd-photo-adjust-controls { 
    opacity: 1; 
}

.gd-photo-adjust-controls button { all: unset; color: white; width: 24px; height: 24px; text-align: center; font-size: 20px; line-height: 24px; cursor: pointer; font-weight: bold; }

.gce-change-photo-btn { color: white; font-size: 14px; font-weight: normal; padding: 0 8px; cursor: pointer; line-height: 24px; display: inline-flex; align-items: center; }

body.gce-studio-mode .gd-photo-adjust-controls {
    display: flex !important;
    flex-direction: column !important; 
    gap: 40px !important; 
    background: transparent !important;
    padding: 0 !important;
    position: absolute !important;
    top: 50% !important;
    left: 100% !important; 
    transform: translateY(-50%) !important;
    margin-left: 35px !important; 
    width: auto !important;
    height: auto !important;
    z-index: 99999 !important; 
    pointer-events: auto !important;
}

body.gce-studio-mode .gd-photo-adjust-controls button,
body.gce-studio-mode .gce-change-photo-btn {
    width: 160px !important; 
    height: 160px !important;
    background-color: rgba(255, 255, 255, 0.95) !important; 
    color: #333 !important; 
    border: 5px solid #8A4B83 !important; 
    border-radius: 50% !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 100px !important; 
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4) !important; 
}

body.gce-studio-mode .gce-change-photo-btn {
    font-size: 0 !important; 
}

body.gce-studio-mode .gce-change-photo-btn::after {
    content: '📷'; 
    font-size: 90px !important; 
    line-height: 1;
    display: block;
}

body.gce-studio-mode .gd-photo-adjust-controls button:active,
body.gce-studio-mode .gce-change-photo-btn:active {
    background-color: #f0f0f1 !important;
    transform: scale(0.95);
}

.gd-photo-layer .customer-image { position: absolute; width: 100%; height: auto; cursor: grab; transform-origin: 0 0; z-index: 1; }
.gd-photo-layer .customer-image:active { cursor: grabbing; }

#gd-editor-right { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 15px; }
#gd-editor-right .control-group { display: flex; flex-direction: column; gap: 5px; }
#gd-editor-right .control-group.horizontal { flex-direction: row; gap: 10px; align-items: center; }
#gd-editor-right label { font-weight: 600; color: #3c434a; }
#gd-editor-right .description { font-size: 13px; color: #50575e; margin: 5px 0 0; font-style: italic; }
#gd-editor-right .align-buttons { display: flex; gap: 5px; } #gd-editor-right .align-buttons button { flex: 1; }
#gd-editor-right .align-buttons button.active { background-color: #007cba; color: white; border-color: #007cba; }
#gd-editor-right input, #gd-editor-right select, #gd-editor-right button { padding: 10px; font-size: 16px; width: 100%; box-sizing: border-box; border: 1px solid #8c8f94; border-radius: 4px; }
#gd-editor-right button { cursor: pointer; background-color: #f6f7f7; color: #1d2327; } #gd-editor-right button:hover { background-color: #e9e9e9; }

#gd-editor-right button.gce-faded {
    opacity: 0.5;
    cursor: not-allowed;
}

.gce-primary-btn { 
    background-color: #8A4B83 !important; 
    color: white !important; 
    font-weight: 600; 
    border: none !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    transition: background-color 0.2s;
}
.gce-primary-btn:hover {
    background-color: #703a6a !important;
}

.gce-danger-btn { 
    background-color: #f6f7f7 !important; 
    color: #d63638 !important; 
    border: 1px solid #d63638 !important;
    font-weight: 600; 
    margin-top: 15px; 
    transition: background-color 0.2s;
}
.gce-danger-btn:hover {
    background-color: #fce8e8 !important; 
}

#gd-font-color { height: 40px; margin-top: 5px; }
.p.gce-control-heading { text-align:center;font-weight:bold;margin:0 0 10px; }

.gce-menu-group { flex-direction: row; justify-content: space-between; gap: 10px; }
.gce-menu-group button, .gce-menu-group .gce-dropdown { flex: 1; }
.gce-dropdown { position: relative; }
.gce-dropdown-toggle { width: 100%; }
.gce-dropdown-menu { display: none; position: absolute; background-color: #fff; border: 1px solid #dcdcde; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 100; min-width: 100%; padding: 5px 0; }
.gce-dropdown.active .gce-dropdown-menu { display: block; }
.gce-dropdown-menu a { display: block; padding: 8px 15px; color: #1d2327; text-decoration: none; font-size: 14px; }
.gce-dropdown-menu a:hover { background-color: #f0f0f1; }

.gd-loader { display: none; margin: 20px auto; border: 4px solid #f3f3f3; border-radius: 50%; border-top: 4px solid #3498db; width: 30px; height: 30px; animation: spin 1s linear infinite; position: absolute; top: 50%; left: 50%; margin-top: -15px; margin-left: -15px; z-index: 60; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#gd-progress-bar-container { width: 100%; background-color: #e0e0e0; border-radius: 4px; overflow: hidden; }
#gd-progress-bar { width: 100%; height: 12px; background-color: #3498db; border-radius: 4px; background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); background-size: 30px 30px; animation: gce_progress_bar_stripes 1s linear infinite; }
@keyframes gce_progress_bar_stripes { from { background-position: 30px 0; } to { background-position: 0 0; } }
#gd-image-container.customer-mode .gd-photo-layer {
    cursor: default;
    border: none;
}

#gd-image-container.customer-mode .gd-photo-layer[data-type="image"] {
    pointer-events: none;
}

#gce-asset-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    padding-top: 50px;
}
#gce-asset-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
#gce-asset-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
#gce-asset-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}
#gce-asset-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
#gce-asset-modal-close:hover { color: #000; }
#gce-asset-modal-body {
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: #f0f0f1;
    border-radius: 4px;
}
.gce-asset-modal-item {
    width: 120px;
    height: 120px;
    border: 2px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.gce-asset-modal-item:hover {
    border-color: #2271b1;
    transform: scale(1.05);
}
.gce-asset-modal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#gce-asset-modal-body .gd-loader {
    position: relative;
    top: 0; left: 0;
    margin-top: 0; margin-left: 0;
    display: block;
}

#gd-editor-right button#gd-export-image-btn:disabled {
    background-color: #0073aa !important;
    opacity: 0.7;
    cursor: not-allowed;
}
#gd-export-image-btn .gd-loader-inline {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top: 2px solid #fff;
    margin-right: 8px;
    margin-bottom: -2px; 
    vertical-align: middle;
    animation: spin 1s linear infinite;
    border-radius: 50%;
    display: inline-block;
}

#gce-template-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    padding-top: 50px;
}
#gce-template-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
#gce-template-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
#gce-template-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}
#gce-template-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
#gce-template-modal-close:hover { color: #000; }
#gce-template-modal-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: #f0f0f1;
    border-radius: 4px;
}
.gce-template-modal-owner-header {
    margin: 10px 0 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ccc;
    font-size: 16px;
    font-weight: 600;
    color: #3c434a;
}

.gce-template-modal-item {
    width: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gce-template-modal-item:hover {
    border-color: #2271b1;
    background: #f6faff;
}
.gce-delete-template-btn {
    font-size: 24px;
    font-weight: bold;
    color: #d63638;
    cursor: pointer;
    padding: 0 5px;
    border-radius: 3px;
    line-height: 1;
}
.gce-delete-template-btn:hover {
    background-color: #fce8e8;
}

#gce-template-modal-body .gd-loader {
    position: relative;
    top: 0; left: 0;
    margin-top: 0; margin-left: 0;
    display: block;
}

.gce-template-thumbnail,
.gce-template-thumbnail-fallback {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.gce-template-thumbnail {
    object-fit: contain;
    background: #f0f0f1;
}

.gce-template-thumbnail-fallback {
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
}

.gce-template-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gce-template-name {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}
.gce-similar-thumbnail img,
.gce-similar-thumbnail .gce-similar-thumbnail-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media screen and (min-width: 769px) {
    body.single-ecard .wp-post-image,       
    body.single-ecard .post-thumbnail,      
    body.single-ecard .entry-thumbnail,     
    body.single-ecard .featured-media,      
    body.single-ecard .featured-image,      
    body.single-ecard .page-header-image-single { 
        display: none !important;
    }
}

@media screen and (max-width: 768px) {
    body.single-ecard .wp-post-image {
        display: block !important;
        width: 92% !important; 
        max-width: 500px;      
        height: auto;
        margin: 10px auto 20px auto !important; 
        border-radius: 12px;   
        box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
    }
}

body.single-ecard .gce-similar-ecards .wp-post-image {
    display: block !important;
}

.gce-template-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 3px;
    margin-top: 5px;
    display: inline-block;
}

.gce-status-crafting .gce-template-status {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.gce-status-submitted .gce-template-status {
    background-color: #fef5e7;
    color: #e67e22;
}

.gce-status-approved .gce-template-status {
    background-color: #e8f8f5;
    color: #27ae60;
}

#gce-template-modal-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 15px;
    padding: 15px;
}

.gce-template-modal-item {
    width: auto; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: stretch; 
    padding: 0; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative; 
}

.gce-template-thumbnail,
.gce-template-thumbnail-fallback {
    width: 100%;
    height: 160px; 
    margin-right: 0; 
    flex-shrink: 0;
    border: none; 
    border-bottom: 1px solid #eee; 
    border-radius: 4px 4px 0 0; 
}

.gce-template-thumbnail-fallback {
    font-size: 16px;
    font-weight: bold;
}

.gce-template-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px; 
    text-align: left;
}

.gce-template-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    color: #2271b1;
}

.gce-template-info .gce-template-owner-name {
    font-size: 12px;
    color: #50575e;
    margin-top: 4px;
    font-weight: 500;
}

.gce-delete-template-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 20px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(2px);
    z-index: 2;
    line-height: 1;
    padding: 3px 6px;
}
.gce-delete-template-btn:hover {
    background: #d63638;
    color: white;
}

.gce-template-status {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    margin-top: 0;
    font-size: 10px;
    padding: 3px 5px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.gce-template-modal-item.gce-status-system .gce-template-status {
    background-color: #34495e; 
    color: #ffffff;
}

.gce-modal-search-container {
    padding: 0 20px 15px 20px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    background: #fdfdfd;
}
.gce-modal-search-bar {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}
.gce-modal-search-bar:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.gd-snap-line-x,
.gd-snap-line-y {
    display: none; 
    position: absolute;
    z-index: 9999; 
    pointer-events: none; 
}
.gd-snap-line-x {
    left: 0;
    width: 100%;
    height: 0px; 
    top: 50%; 
    border-top: 1px dashed rgba(214, 54, 56, 0.9);
}
.gd-snap-line-y {
    top: 0;
    height: 100%;
    width: 0px; 
    left: 50%; 
    border-left: 1px dashed rgba(214, 54, 56, 0.9);
}

#gce-asset-modal-footer {
    padding: 15px 20px 10px;
    border-top: 1px solid #ddd;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    gap: 15px;
}
#gce-asset-modal-footer label.gce-primary-btn {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    display: inline-block;
    color: white !important; 
}
#gce-modal-asset-upload-input,
#gce-my-gallery-upload-input {
    display: none;
}
#gce-modal-upload-status {
    font-size: 13px;
    font-weight: 600;
}
#gce-modal-upload-status.gce-success {
    color: #27ae60;
}
#gce-modal-upload-status.gce-error {
    color: #d63638;
}

#gce-my-gallery-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    padding-top: 50px;
}
#gce-my-gallery-modal-body {
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: #f0f0f1;
    border-radius: 4px;
    min-height: 200px;
}
#gce-my-gallery-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
#gce-my-gallery-modal-close:hover { color: #000; }
#gce-my-gallery-upload-status {
    font-size: 13px;
    font-weight: 600;
}
#gce-my-gallery-upload-status.gce-success {
    color: #27ae60;
}
#gce-my-gallery-upload-status.gce-error {
    color: #d63638;
}

.gce-asset-modal-item {
    position: relative; 
}

.gce-my-gallery-delete-btn {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: rgba(214, 54, 56, 0.9); 
    color: white;
    font-size: 20px;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    border-bottom-left-radius: 4px;
    font-family: sans-serif;
}
.gce-my-gallery-delete-btn:hover {
    background: #d63638; 
}
.gce-asset-modal-item:hover .gce-my-gallery-delete-btn {
    display: block;
}

.gce-template-modal-item.gce-template-is-live {
    border-color: #27ae60;
    background: #f0fff8;
}

.gce-template-is-live .gce-template-name {
    color: #27ae60;
}

.gce-live-label {
    display: inline-block;
    background: #27ae60;
    color: #fff !important; 
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 4px 0 0 0;
    line-height: 1.2;
}

.gce-mobile-launch-container {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    margin: 20px 0 30px;
}

.gce-mobile-launch-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    color: #333;
}

.gce-mobile-launch-container p {
    margin-bottom: 20px;
    color: #666;
    font-size: 15px;
}

.gce-mobile-launch-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    background-color: #8A4B83;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(138, 75, 131, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gce-mobile-launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(138, 75, 131, 0.4);
    background-color: #7a3e74;
}

.gce-mobile-launch-btn:active {
    transform: translateY(0);
}

@media screen and (max-width: 768px) {
    .gd-editor-container {
        display: none; 
    }
    
    body.gce-studio-mode {
        position: fixed; 
        width: 100%;
        height: 100%;
    }
}

body.gce-studio-mode .gd-editor-container,
body.gce-studio-mode #gd-image-container {
    display: block !important;
}

/* --- FIX: Mobile Canvas Scaling & Clipping --- */
body.gce-studio-mode #gd-image-container {
    border: none;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    position: relative;
    flex-shrink: 0;
    transform-origin: top left; 
    overflow: hidden !important; /* FIX: Ensure images outside canvas are hidden */
}

body.gce-studio-mode #gce-zoom-surface {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

#gce-mobile-canvas-area {
    flex-direction: column; 
}

#gce-pagination-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    margin-bottom: 15px; 
    margin-top: 0;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: 4px; 
}

body.gce-studio-mode #gce-pagination-bar {
    background: transparent; 
    border: none;
    margin: 0;
    padding: 0;
    width: auto;
    flex-shrink: 0; 
}

.gce-pages-list {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gce-page-thumb {
    width: 60px;
    height: 80px; 
    background: #f0f0f1;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gce-page-thumb.active {
    border-color: #8A4B83; 
    box-shadow: 0 0 0 2px rgba(138, 75, 131, 0.2);
    transform: translateY(-2px);
    color: #8A4B83;
    background: #fff;
}

.gce-page-number {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    pointer-events: none;
}

.gce-page-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #d63638;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 16px;
    text-align: center;
    display: none;
    z-index: 10;
}

.gce-page-thumb:hover .gce-page-delete {
    display: block;
}

.gce-add-page-btn {
    width: 60px;
    height: 80px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ccc;
    cursor: pointer;
    flex-shrink: 0;
}

.gce-add-page-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
    background: #f6f7f7;
}

#gce-mobile-edit-panel { 
    height: 50px; 
    background: #f4f4f4; 
    border-bottom: 1px solid #ddd; 
    display: none; 
    align-items: center; 
    padding: 0 10px; 
    gap: 15px;
    width: 100%; 
    overflow-x: auto;
}

#gce-mobile-edit-panel.active { 
    display: flex; 
}

.gce-mobile-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gce-input-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
}

#gd-font-size { 
    width: 50px; 
    height: 30px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    padding: 0 5px; 
    text-align: center; 
}

#gd-font-color { 
    width: 30px; 
    height: 30px; 
    border: none; 
    background: none; 
    padding: 0; 
}

.gce-icon-btn { 
    width: 30px; 
    height: 30px; 
    border-radius: 4px; 
    border: none; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    background: #2271b1; 
    color: white;
    margin-left: auto; 
}

.gce-icon-btn .gce-svg-icon { 
    fill: #fff; 
    width: 18px; 
    height: 18px; 
}

#gd-mobile-text-input {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 60px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 14px;
}

#gce-mobile-bottom-bar { 
    background: #fff; 
    border-top: 1px solid #eee; 
    z-index: 20; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0;
    padding: 10px; 
    gap: 10px; 
    height: auto; 
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.gce-bottom-row-input {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: center;
}

/* Desktop: larger, rectangular bottom buttons for readability (customer editor) */
@media (min-width: 768px) {
    #gce-mobile-bottom-bar .gce-bottom-row-input {
        gap: 12px;
        align-items: stretch;
        justify-content: center;
    }
    #gce-mobile-bottom-bar .gce-mobile-action-btn {
        min-width: 72px;
        width: auto;
        height: 44px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 13px;
        line-height: 1.25;
        font-weight: 600;
    }
    #gce-mobile-bottom-bar .gce-mobile-action-btn br {
        display: none; /* single line on desktop for cleaner look */
    }
}

.gce-mobile-reset-btn {
    width: 100%;
    background-color: #fff !important;
    color: #d63638 !important; 
    border: 1px solid #d63638 !important;
    padding: 8px 0;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
}

/* --- FIX: Ensure Photo Controls are visible on Mobile (Fixed to Viewport) --- */
body.gce-studio-mode .gd-photo-layer.selected .gd-photo-adjust-controls {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* ============================================
   PRODUCT PAGE LAYOUT (NEW TWO-COLUMN STYLE)
   ============================================ */

.gce-product-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gce-product-layout {
    margin-bottom: 40px;
}

.gce-product-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.gce-product-left {
    position: sticky;
    top: 20px;
}

.gce-product-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #dcdcde;
}

.gce-product-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gce-product-price {
    font-size: 2.5em;
    font-weight: 700;
    color: #8A4B83;
}

.gce-personalize-btn,
.gce-mobile-launch-btn {
    display: block;
    width: 100%;
    padding: 18px 40px;
    background: linear-gradient(135deg, #8A4B83 0%, #A05893 100%);
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(138, 75, 131, 0.2);
}

.gce-personalize-btn:hover,
.gce-mobile-launch-btn:hover {
    background: linear-gradient(135deg, #9A5B93 0%, #B068A3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(138, 75, 131, 0.3);
    color: #fff !important;
}

.gce-personalize-btn:active,
.gce-mobile-launch-btn:active {
    transform: translateY(0);
}

.gce-product-instructions {
    padding: 0;
    line-height: 1.6;
    margin-top: 20px;
}

.gce-product-instructions h2,
.gce-product-instructions h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-size: 1.3em;
}

.gce-product-instructions h2:first-child,
.gce-product-instructions h3:first-child {
    margin-top: 0;
}

.gce-product-description {
    padding: 0;
    line-height: 1.6;
    margin-bottom: 30px;
}

.gce-product-description h2,
.gce-product-description h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.gce-product-description h2:first-child,
.gce-product-description h3:first-child {
    margin-top: 0;
}

/* Mobile launch container (deprecated) */
.gce-mobile-launch-container {
    display: none !important;
}

/* Responsive: Stack columns on mobile/tablet */
@media (max-width: 968px) {
    .gce-product-split {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .gce-product-left {
        position: static;
    }
    
    .gce-product-price {
        font-size: 2em;
    }
    
    .gce-personalize-btn,
    .gce-mobile-launch-btn {
        font-size: 1.1em;
        padding: 15px 30px;
    }
}

@media (max-width: 768px) {
    .gce-product-wrapper {
        padding: 15px;
    }
    
    .gce-product-split {
        gap: 20px;
    }
    
    .gce-product-price {
        font-size: 1.8em;
    }
    
    .gce-personalize-btn,
    .gce-mobile-launch-btn {
        font-size: 1em;
        padding: 12px 24px;
    }
    
    .gce-product-instructions,
    .gce-product-description {
        padding: 0;
    }
}

/* Zoom Slider for Mobile Canvas */
#gce-zoom-slider-container {
    position: absolute;
    bottom: 15px;
    left: 25px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gce-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #8A4B83;
    background: white;
    color: #8A4B83;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.gce-zoom-btn:active {
    background: #8A4B83;
    color: white;
    transform: scale(0.95);
}

#gce-zoom-track {
    width: 120px;
    height: 4px;
    background: linear-gradient(to right, #ddd 0%, #8A4B83 100%);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

#gce-zoom-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #8A4B83;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    transition: transform 0.1s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#gce-zoom-thumb:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Hide zoom slider on desktop */
body:not(.gce-studio-mode) #gce-zoom-slider-container {
    display: none;
}

/* Editor Room Mode - Make editor fullscreen on mobile */
@media (max-width: 768px) {
    body:has(.gd-editor-container) {
        margin: 0;
        padding: 0;
    }
    
    .gd-editor-container {
        margin: 0;
        border: none;
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
        padding: 10px;
    }
    
    #gd-live-editor {
        flex-direction: column;
        gap: 15px;
    }
    
    #gd-editor-left,
    #gd-editor-right {
        min-width: 100%;
    }
}