
    #wclp-panel { display: none !important; }
    #wclp-btn   { display: block !important; }

    /* ── Cuando el personalizador está abierto, forzar WhatsApp debajo del backdrop ── */
    body.wclp-modal-open #wa,
    body.wclp-modal-open .wa__widget_container,
    body.wclp-modal-open .wa__btn_popup,
    body.wclp-modal-open .wa__btn_popup_txt,
    body.wclp-modal-open [class*="whatsapp"],
    body.wclp-modal-open [id*="whatsapp"],
    body.wclp-modal-open [class*="wp-whatsapp"],
    body.wclp-modal-open [id*="wp-whatsapp"],
    body.wclp-modal-open .wpadm-btn-widget,
    body.wclp-modal-open #wpadm-widget-wrap,
    body.wclp-modal-open .wpa-btn-widget,
    body.wclp-modal-open #wpa-widget-container,
    body.wclp-modal-open [class*="wchat"],
    body.wclp-modal-open [id*="wchat"],
    body.wclp-modal-open [id*="tidio"],
    body.wclp-modal-open [class*="tidio"],
    body.wclp-modal-open #crisp-chatbox,
    body.wclp-modal-open .crisp-client,
    body.wclp-modal-open [id*="intercom"],
    body.wclp-modal-open [class*="intercom-lightweight"],
    body.wclp-modal-open #drift-widget,
    body.wclp-modal-open [class*="drift-widget"],
    body.wclp-modal-open [class*="trust-pulse"],
    body.wclp-modal-open [id*="trust-pulse"],
    body.wclp-modal-open [class*="fomo-"],
    body.wclp-modal-open [id*="fomo"],
    body.wclp-modal-open [class*="sales-pop"],
    body.wclp-modal-open [id*="sales-pop"],
    body.wclp-modal-open [class*="notification-pop"],
    body.wclp-modal-open [class*="woo-notification"],
    body.wclp-modal-open .back-to-top,
    body.wclp-modal-open #back-to-top,
    body.wclp-modal-open [id*="back-to-top"],
    body.wclp-modal-open .scroll-to-top,
    body.wclp-modal-open [class*="scroll-top"],
    body.wclp-modal-open .floating-bar,
    body.wclp-modal-open [class*="sticky-bar"],
    body.wclp-modal-open .woocommerce-notices-wrapper,
    body.wclp-modal-open .woocommerce-message,
    body.wclp-modal-open .woocommerce-error {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    #ajcust-backdrop {
        display: none !important; position: fixed; inset: 0;
        background: rgba(0,0,0,0.65); isolation: isolate;
        z-index: 999999; align-items: center; justify-content: center;
        padding: 12px; box-sizing: border-box; backdrop-filter: blur(3px);
    }
    #ajcust-backdrop.open { display: flex !important; }

    #ajcust-modal {
        background: #fff; border-radius: 16px; width: 100%;
        max-width: 860px; max-height: 92vh; max-height: 92dvh;
        overflow: hidden; display: flex; flex-direction: column;
        box-shadow: 0 30px 80px rgba(0,0,0,0.35); animation: ajcustIn .22s ease;
        position: relative; /* necesario para que crop overlay se posicione dentro */
    }
    @keyframes ajcustIn {
        from { opacity:0; transform:translateY(20px) scale(0.98); }
        to   { opacity:1; transform:translateY(0) scale(1); }
    }

    #ajcust-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 16px 22px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
    }
    #ajcust-header h3 {
        margin: 0; font-size: 18px; font-weight: 800; color: #1a1a2e;
        display: flex; align-items: center; gap: 8px;
    }
    #ajcust-close {
        background: #f5f5f5; border: none; width: 34px; height: 34px;
        border-radius: 50%; font-size: 20px; cursor: pointer; color: #555;
        display: flex; align-items: center; justify-content: center;
        transition: background .15s; line-height: 1;
    }
    #ajcust-close:hover { background: #ffe0ef; color: #e8357a; }

    #ajcust-instructions {
        background: linear-gradient(135deg, #fff0f6, #fce4f0);
        border-bottom: 1px solid #f9cfe0; padding: 10px 22px;
        font-size: 12px; color: #7a1a42; flex-shrink: 0;
        display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
    }
    #ajcust-instructions .inst-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
    #ajcust-instructions .inst-text strong { display: block; font-size: 13px; margin-bottom: 2px; color: #5a0e2e; }

    #ajcust-tabs {
        display: flex; border-bottom: 2px solid #f0f0f0;
        padding: 0 22px; flex-shrink: 0;
    }
    .ajcust-tab {
        padding: 11px 18px; font-size: 13px; font-weight: 700; color: #aaa;
        cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
        transition: color .2s, border-color .2s; user-select: none;
        display: flex; align-items: center; gap: 6px;
    }
    .ajcust-tab.active { color: #1a1a2e; border-bottom-color: #e8357a; }
    .ajcust-tab:hover  { color: #1a1a2e; }

    #ajcust-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

    #ajcust-preview-col {
        flex: 0 0 52%; background: #f7f7f7; display: flex;
        flex-direction: column; align-items: center; justify-content: center;
        padding: 18px 14px; position: relative; border-right: 1px solid #f0f0f0;
    }
    #ajcust-canvas-wrap {
        position: relative; width: 340px; height: 430px;
        display: flex; align-items: center; justify-content: center;
    }
    #ajcust-product-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
    #ajcust-text-overlay {
        position: absolute; top: 52%; left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: auto; cursor: grab;
        font-size: 22px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.15);
        white-space: nowrap; text-align: center; max-width: 85%;
        overflow: hidden; text-overflow: ellipsis; display: none; z-index: 12; line-height: 1.2;
        transition: transform .2s ease;
    }
    #ajcust-t2b-overlay, #ajcust-s2t2b-overlay {
        position: absolute !important; top: 65%; left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: auto !important; cursor: grab !important;
        font-size: 18px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.15);
        white-space: nowrap; text-align: center; max-width: 85%;
        overflow: hidden; text-overflow: ellipsis; display: none; z-index: 13 !important; line-height: 1.2;
    }
    /* ── Botones de capa texto/imagen ── */
    .ajcust-layer-btn {
        flex:1; padding:8px 12px; border:2px solid #e5e5e5; border-radius:10px;
        background:#fff; cursor:pointer; font-size:12px; font-weight:700;
        color:#555; transition:all .15s; white-space:nowrap;
    }
    .ajcust-layer-btn:hover { border-color:#e8357a; background:#fff8fb; }
    .ajcust-layer-btn.active { border-color:#e8357a; background:#fff0f6; color:#e8357a; }

    /* Orientación del texto */
    .ajcust-orient-group {
        display: flex; gap: 8px; margin-top: 4px;
    }
    .ajcust-orient-btn {
        flex: 1; display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 5px; padding: 10px 8px;
        border: 2px solid #e5e5e5; border-radius: 10px; background: #fff;
        cursor: pointer; transition: all .15s; color: #1a1a2e;
    }
    .ajcust-orient-btn .orient-letter {
        font-size: 20px; font-weight: 900; line-height: 1;
        display: inline-block; transition: transform .2s;
    }
    .ajcust-orient-btn small {
        font-size: 10px; font-weight: 700; color: #aaa;
        text-transform: uppercase; letter-spacing: .04em;
    }
    .ajcust-orient-btn:hover { border-color: #e8357a; background: #fff8fb; }
    .ajcust-orient-btn.active {
        border-color: #e8357a; background: #fff0f6; color: #e8357a;
    }
    .ajcust-orient-btn.active small { color: #e8357a; }
    #ajcust-img-overlay {
        position: absolute; top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: auto; cursor: grab;
        max-width: 55%; max-height: 55%;
        object-fit: contain; display: none; z-index: 11;
        border: 2px dashed rgba(232,53,122,0.4); border-radius: 4px;
    }
    #ajcust-preview-label {
        font-size: 11px; color: #bbb; margin-top: 14px;
        text-align: center; letter-spacing: 0.05em;
    }

    #ajcust-form-col { flex: 1; overflow-y: auto; padding: 20px 22px; box-sizing: border-box; min-height: 0; }

    .ajcust-tab-tip {
        display: flex; align-items: flex-start; gap: 10px;
        background: #f8f9ff; border: 1px solid #e0e5ff; border-radius: 10px;
        padding: 12px 14px; margin-bottom: 18px; font-size: 12px; color: #3a4080; line-height: 1.5;
    }
    .ajcust-tab-tip .tip-icon { font-size: 18px; flex-shrink: 0; }
    .ajcust-tab-tip strong { display: block; font-size: 13px; color: #1a2070; margin-bottom: 3px; }

    .ajcust-panel { display: none; }
    .ajcust-panel.active { display: block; }

    .ajcust-label {
        display: block; font-size: 11px; font-weight: 800;
        text-transform: uppercase; letter-spacing: .06em; color: #555; margin: 0 0 7px;
    }
    .ajcust-row { margin-bottom: 18px; }
    .ajcust-input {
        width: 100%; padding: 10px 13px; border: 2px solid #e5e5e5;
        border-radius: 8px; font-size: 15px; box-sizing: border-box;
        transition: border-color .2s; color: #1a1a2e;
    }
    .ajcust-input:focus { border-color: #e8357a; outline: none; }
    .ajcust-char { text-align: right; font-size: 11px; color: #bbb; margin-top: 4px; }

    #ajcust-font-select {
        width: 100%; padding: 10px 13px; border: 2px solid #e5e5e5;
        border-radius: 8px; font-size: 15px; cursor: pointer;
        box-sizing: border-box; transition: border-color .2s; color: #1a1a2e; background: #fff;
    }
    #ajcust-font-select:focus { border-color: #e8357a; outline: none; }
    #ajcust-font-preview {
        margin-top: 8px; padding: 10px 14px; background: #f8f8f8;
        border-radius: 8px; font-size: 20px; color: #1a1a2e; text-align: center;
        min-height: 44px; transition: font-family .2s; border: 1px solid #eee;
    }

    .ajcust-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .ajcust-swatch {
        width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent;
        cursor: pointer; transition: transform .15s, border-color .15s; flex-shrink: 0;
    }
    .ajcust-swatch:hover, .ajcust-swatch.active { transform: scale(1.2); border-color: #555; }
    .ajcust-swatch-white { box-shadow: inset 0 0 0 1px #ddd; }
    #ajcust-custom-color {
        width: 30px; height: 30px; padding: 2px; border: 2px solid #ddd;
        border-radius: 50%; cursor: pointer; box-sizing: border-box;
    }

    .ajcust-size-row { display: flex; align-items: center; gap: 10px; }
    .ajcust-size-row input[type=range] { flex: 1; accent-color: #e8357a; }
    .ajcust-size-val { font-size: 12px; color: #888; min-width: 32px; text-align: right; }

    #ajcust-drop-zone {
        border: 2px dashed #e0e0e0; border-radius: 12px; padding: 28px 20px;
        text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
        background: #fafafa; margin-bottom: 16px;
    }
    #ajcust-drop-zone:hover, #ajcust-drop-zone.drag-over { border-color: #e8357a; background: #fff0f6; }
    #ajcust-drop-zone .dz-icon { font-size: 36px; margin-bottom: 8px; }
    #ajcust-drop-zone p { margin: 4px 0; font-size: 13px; color: #888; }
    #ajcust-drop-zone strong { color: #e8357a; }
    #ajcust-file-input { display: none; }

    .ajcust-img-thumb-row {
        display: flex; align-items: center; gap: 12px; padding: 12px;
        background: #f8f8f8; border-radius: 8px; margin-bottom: 16px;
    }
    .ajcust-img-thumb-row img { width: 60px; height: 60px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid #eee; }
    .ajcust-img-thumb-row .ajcust-img-name { font-size: 12px; color: #555; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ajcust-remove-img { background: none; border: none; color: #e8357a; cursor: pointer; font-size: 18px; padding: 4px; flex-shrink: 0; }

    .ajcust-img-size-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
    .ajcust-img-size-row label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #888; min-width: 50px; }
    .ajcust-img-size-row input[type=range] { flex: 1; accent-color: #e8357a; }
    .ajcust-img-size-row span { font-size: 11px; color: #aaa; min-width: 34px; text-align: right; }

    #ajcust-footer {
        padding: 16px 22px; border-top: 1px solid #f0f0f0;
        display: flex; gap: 10px; flex-shrink: 0; background: #fff;
    }
    #ajcust-add-btn {
        flex: 1; padding: 14px;
        background: linear-gradient(135deg, #e8357a, #c0166a);
        color: #fff; border: none; border-radius: 10px; font-size: 15px;
        font-weight: 800; cursor: pointer; transition: opacity .2s, transform .15s;
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    #ajcust-add-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
    #ajcust-add-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
    #ajcust-cancel-btn {
        padding: 14px 22px; background: none; border: 2px solid #e5e5e5;
        border-radius: 10px; font-size: 14px; color: #888; cursor: pointer;
        font-weight: 600; transition: border-color .2s, color .2s;
    }
    #ajcust-cancel-btn:hover { border-color: #aaa; color: #555; }

    #ajcust-toast {
        display: none; position: fixed; top: 24px; right: 24px; z-index: 9999999;
        background: #1db954; color: #fff; padding: 14px 22px; border-radius: 12px;
        font-size: 14px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.2);
        animation: toastIn .3s ease;
    }
    @keyframes toastIn {
        from { opacity:0; transform:translateY(-12px); }
        to   { opacity:1; transform:translateY(0); }
    }

    @media (max-width: 860px) and (min-width: 641px) {
        #ajcust-canvas-wrap { width: 260px; height: 330px; }
        #ajcust-preview-col { flex: 0 0 48%; padding: 14px 10px; }
    }
    @media (max-width: 640px) {
        #ajcust-modal {
            border-radius: 0 !important;
            max-width: 100vw !important;
            width: 100vw !important;
            height: 100vh !important;
            max-height: 100vh !important;
        }
        #ajcust-body {
            flex-direction: column;
            overflow: hidden;
        }
        #ajcust-preview-col {
            flex: 0 0 auto;
            border-right: none;
            border-bottom: 1px solid #f0f0f0;
            padding: 8px 10px;
            min-height: 0;
        }
        #ajcust-canvas-wrap {
            width: calc(100vw - 20px);
            max-width: 380px;
            height: 220px;
            margin: 0 auto;
        }
        #ajcust-preview-label { font-size: 10px; margin-top: 4px; }
        #ajcust-form-col {
            flex: 1 1 auto;
            max-height: none;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 12px 14px 16px;
        }
        .ajcust-row { margin-bottom: 10px; }
        .ajcust-label { font-size: 10px; margin-bottom: 4px; }
        #ajcust-text-input { font-size: 14px; padding: 8px 10px; }
        .ajcust-swatch { width: 26px; height: 26px; }
        .ajcust-orient-btn { padding: 7px 6px; min-width: 60px; }
        .ajcust-orient-btn .orient-letter { font-size: 16px; }
        .ajcust-orient-btn small { font-size: 9px; }
        .ajcust-layer-btn { padding: 6px 8px; font-size: 11px; }
        .ajcust-size-row { gap: 6px; }
        .ajcust-size-val { font-size: 11px; min-width: 32px; }
        #ajcust-font-select { font-size: 13px; padding: 7px 8px; }
        #ajcust-font-preview { font-size: 14px; padding: 8px; }
        .ajcust-tab-tip { padding: 10px 12px; font-size: 12px; }
        .ajcust-tab { font-size: 12px; padding: 10px 12px; }
        #ajcust-text-overlay { font-size: 14px; }
        #ajcust-instructions { font-size: 10px; padding: 6px 12px; }
        #wclp-variation-hint { font-size: 12px; padding: 8px 10px; }
        #wclp-cro-bar { flex-direction: column; gap: 4px; padding: 6px 12px; }
        #ajcust-steps { padding: 8px 14px; gap: 6px; }
        .ajcust-step { font-size: 11px; padding: 4px 10px; }
        .ajcust-step-sep { font-size: 10px; }
        /* Footer buttons — más grandes para touch */
        #ajcust-footer { padding: 12px 14px; gap: 8px; }
        #ajcust-add-btn { padding: 15px; font-size: 15px; min-height: 52px; }
        #ajcust-cancel-btn { padding: 15px 16px; font-size: 13px; min-height: 52px; }
    }
    
    /* Force pointer-events on all overlay spans in canvas */
    #ajcust-canvas-wrap > span,
    .ajcust-canvas-wrap2 > span {
        pointer-events: auto !important;
    }
