.r24-product-editor {
    margin: 22px 0;
    padding: 18px;
    border: 1px solid #eeeeee;
    border-radius: 18px;
    background: #f7f7f7;
    box-shadow: 0 6px 22px rgba(0,0,0,.05);
}
.r24-editor-note {
    margin-bottom: 14px;
    color: #555;
}
.r24-open-editor,
.r24-add-another-design {
    width: 100%;
    max-width: 340px;
    min-height: 48px;
    font-weight: 800 !important;
    border-radius: 12px !important;
}
.r24-final-preview-wrap {
    margin-top: 18px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e9e9e9;
    border-radius: 18px;
    text-align: left;
}
.r24-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.r24-preview-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}
.r24-total-design-qty {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7dc;
    border: 1px solid #efd37a;
    color: #5c4812;
    font-weight: 700;
}
.r24-design-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}
.r24-design-card {
    padding: 12px;
    border: 1px solid #eeeeee;
    border-radius: 16px;
    background: #fafafa;
    text-align: center;
}
.r24-design-card-title {
    margin-bottom: 8px;
    font-weight: 800;
    color: #333;
}
.r24-final-preview {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0 auto 12px;
    border: 1px solid #dddddd;
    border-radius: 14px;
    background: #ffffff;
}
.r24-qty-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 10px;
    font-weight: 800;
}
.r24-qty-label input {
    width: 82px !important;
    min-height: 40px;
    text-align: center;
    border: 1px solid #dddddd;
    border-radius: 10px;
    font-weight: 800;
}
.r24-remove-design {
    min-height: 38px;
    border-radius: 10px !important;
}
.r24-preview-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}
.r24-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.62);
    padding: 14px;
}
.r24-editor-modal.is-open { display: flex; }
.r24-editor-dialog {
    width: min(980px, 100%);
    max-height: 94vh;
    overflow: auto;
    background: #f7f7f7;
    border-radius: 18px;
    box-shadow: 0 20px 70px rgba(0,0,0,.25);
}
.r24-editor-header,
.r24-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #eeeeee;
    background: #f7f7f7;
}
.r24-editor-title {
    font-size: 22px;
    font-weight: 900;
    color: #333;
}
.r24-editor-subtitle {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}
.r24-editor-footer {
    border-top: 1px solid #eeeeee;
    border-bottom: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.r24-close-editor {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #2f2f2f;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.r24-editor-body { padding: 18px 20px; }
.r24-editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: 14px;
    background: #ffffff;
}
.r24-editor-tools .button,
.r24-upload-label {
    border-radius: 10px !important;
    font-weight: 800 !important;
    cursor: pointer;
}
.r24-canvas-shell {
    overflow: auto;
    background: #ffffff;
    border: 2px dashed #d6d6d6;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}
.r24-editor-canvas {
    max-width: 100%;
    height: auto;
    background: #ffffff;
    box-shadow: 0 3px 20px rgba(0,0,0,.08);
    touch-action: none;
}
.r24-editor-help {
    margin-top: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: #5c4812;
    border: 1px solid #efd37a;
    border-radius: 12px;
    background: #fff7dc;
    text-align: center;
}
.r24-saving { opacity: .6; pointer-events: none; }
@media (max-width: 640px) {
    .r24-product-editor { padding: 14px; }
    .r24-preview-head { display: block; }
    .r24-preview-actions { justify-content: stretch; }
    .r24-add-another-design { max-width: none; }
    .r24-editor-modal { padding: 0; align-items: stretch; }
    .r24-editor-dialog { min-height: 100vh; max-height: 100vh; border-radius: 0; }
    .r24-editor-header,
    .r24-editor-footer { position: sticky; background: #f7f7f7; z-index: 2; }
    .r24-editor-header { top: 0; }
    .r24-editor-footer { bottom: 0; }
    .r24-editor-tools .button,
    .r24-upload-label { flex: 1 1 calc(50% - 8px); text-align: center; }
    .r24-editor-footer .button { width: 100%; }
}
.r24-editor-footer .r24-close-editor {
    width: auto;
    height: auto;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 10px;
    background: #e9e6ee;
    color: #333333;
    font-size: 15px;
    font-weight: 800;
}


:root {
    --r24-gold: #d7bf77;
    --r24-gold-dark: #b99f55;
    --r24-gold-soft: #f7efd1;
    --r24-text: #2f2f2f;
}
.r24-product-editor .button,
.r24-editor-modal .button,
.r24-upload-label,
.r24-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 18px;
    border: 2px solid var(--r24-gold) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: var(--r24-text) !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: all .2s ease;
}
.r24-product-editor .button:hover,
.r24-editor-modal .button:hover,
.r24-upload-label:hover,
.r24-btn:hover {
    border-color: var(--r24-gold-dark) !important;
    background: var(--r24-gold-soft) !important;
}
.r24-btn-solid,
.r24-editor-modal .button-primary,
.r24-finish-design {
    background: var(--r24-gold) !important;
    color: #ffffff !important;
}
.r24-btn-solid:hover,
.r24-editor-modal .button-primary:hover,
.r24-finish-design:hover {
    background: var(--r24-gold-dark) !important;
    color: #ffffff !important;
}
.r24-open-editor,
.r24-add-another-design {
    width: 100%;
    max-width: 340px;
}
.r24-final-preview-wrap {
    border-color: #ece6d2;
}
.r24-design-card {
    border-color: #ece6d2;
    background: #fffdfa;
}
.r24-qty-row {
    margin: 8px 0 12px;
}
.r24-qty-caption {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    color: #444;
}
.r24-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.r24-qty-btn {
    width: 46px;
    min-width: 46px;
    padding: 0 !important;
    font-size: 24px !important;
    line-height: 1 !important;
}
.r24-design-qty {
    width: 82px !important;
    min-height: 48px;
    padding: 8px 10px;
    text-align: center;
    border: 2px solid #eadfba !important;
    border-radius: 12px !important;
    font-weight: 800;
    background: #ffffff !important;
}
.r24-design-qty::-webkit-outer-spin-button,
.r24-design-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.r24-design-qty[type=number] {
    -moz-appearance: textfield;
}
.r24-editor-tools {
    border-color: #ece6d2;
    background: #fffdfa;
}
.r24-canvas-shell {
    border-color: #e4dcc3;
    background: #ffffff;
}
.r24-editor-help {
    border-color: var(--r24-gold);
    background: #faf2d8;
}
.r24-close-editor[aria-label="Cerrar"] {
    border-radius: 999px !important;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0 !important;
    background: #2f2f2f !important;
    border-color: #2f2f2f !important;
    color: #ffffff !important;
}
.r24-editor-footer .r24-close-editor {
    background: #ffffff !important;
    border-color: var(--r24-gold) !important;
    color: var(--r24-text) !important;
    width: auto;
    height: auto;
    padding: 10px 18px !important;
}
@media (max-width: 640px) {
    .r24-qty-control {
        gap: 6px;
    }
    .r24-qty-btn {
        width: 44px;
        min-width: 44px;
    }
    .r24-design-qty {
        width: 72px !important;
    }
}


/* v1.3: botón principal centrado, acciones de edición y cantidad WooCommerce bloqueada */
.r24-product-editor > .r24-open-editor {
    display: flex !important;
    margin: 0 auto !important;
}

.r24-design-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.r24-edit-design,
.r24-remove-design {
    flex: 1 1 130px;
    min-width: 120px;
}

body.single-product form.cart input.qty.r24-locked-qty {
    pointer-events: none;
    background: #f7f7f7 !important;
    color: #333333 !important;
    opacity: .75;
    cursor: not-allowed;
}

body.single-product form.cart input.qty.r24-locked-qty::-webkit-outer-spin-button,
body.single-product form.cart input.qty.r24-locked-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.single-product form.cart input.qty.r24-locked-qty[type=number] {
    -moz-appearance: textfield;
}


/* v1.4: centrado real del boton principal y proporcion exacta del editor */
.r24-product-editor {
    text-align: center;
}

.r24-product-editor > .r24-open-editor {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: min(340px, 100%) !important;
    max-width: 340px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.r24-final-preview-wrap {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.r24-canvas-shell {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.r24-editor-canvas {
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
}


/* v1.5: centrado reforzado del botón principal dentro de WooCommerce/Storefront */
.r24-open-editor-wrap {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    clear: both !important;
}

body.single-product .r24-product-editor .r24-open-editor-wrap > .r24-open-editor,
body.single-product form.cart .r24-product-editor .r24-open-editor-wrap > .r24-open-editor,
.r24-product-editor .r24-open-editor-wrap > .r24-open-editor {
    float: none !important;
    display: inline-flex !important;
    width: min(340px, 100%) !important;
    max-width: 340px !important;
    margin: 0 auto !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* v1.7: soporte 1 cara / 2 caras por variación */
.r24-sides-info {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7dc;
    border: 1px solid #efd37a;
    color: #5c4812;
    font-weight: 700;
    text-align: center;
}

.r24-pending-group-wrap {
    margin-top: 16px;
}

.r24-pending-box {
    padding: 16px;
    border: 1px solid #ece6d2;
    border-radius: 16px;
    background: #fffdfa;
    text-align: center;
}

.r24-pending-message {
    margin-bottom: 12px;
    font-weight: 800;
    color: #333;
}

.r24-pending-thumbs,
.r24-side-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.r24-pending-thumbs {
    margin-bottom: 12px;
}

.r24-side-thumb {
    padding: 10px;
    border: 1px solid #ece6d2;
    border-radius: 14px;
    background: #ffffff;
}

.r24-side-thumb .r24-final-preview {
    margin-bottom: 10px;
}

.r24-side-label {
    margin-bottom: 8px;
    font-weight: 800;
    color: #444;
}

.r24-group-qty {
    width: 82px !important;
    min-height: 48px;
    padding: 8px 10px;
    text-align: center;
    border: 2px solid #eadfba !important;
    border-radius: 12px !important;
    font-weight: 800;
    background: #ffffff !important;
}

.r24-group-qty::-webkit-outer-spin-button,
.r24-group-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.r24-group-qty[type=number] {
    -moz-appearance: textfield;
}

/* v1.8: paneles personalizables y editor de texto */
.r24-text-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #ece6d2;
    border-radius: 14px;
    background: #fffdfa;
}

.r24-text-tools input[type="text"],
.r24-text-tools input[type="number"],
.r24-text-tools select {
    min-height: 44px;
    padding: 8px 12px;
    border: 2px solid #eadfba;
    border-radius: 12px;
    background: #ffffff;
    font-weight: 700;
}

.r24-text-tools input[type="text"] {
    flex: 1 1 220px;
}

.r24-text-tools select {
    min-width: 170px;
}

.r24-text-tools input[type="number"] {
    width: 92px;
}

.r24-text-tools input[type="color"] {
    width: 56px;
    min-width: 56px;
    min-height: 44px;
    padding: 4px;
    border: 2px solid #eadfba;
    border-radius: 12px;
    background: #ffffff;
}

.r24-text-style.is-active {
    background: var(--r24-gold) !important;
    color: #ffffff !important;
}

.r24-side-thumb img {
    width: 100%;
    height: auto;
}

@media (max-width: 640px) {
    .r24-text-tools > * {
        flex: 1 1 calc(50% - 8px);
    }

    .r24-text-tools input[type="text"] {
        flex-basis: 100%;
    }
}


/* v1.10: se elimina el control numérico de tamaño de texto.
   El tamaño se cambia solo con los botones Aumentar / Reducir. */
.r24-text-tools .r24-text-size {
    display: none !important;
}

/* v1.11: selector visual de apartados antes de abrir el editor */
.r24-pending-selector {
    text-align: center;
}

.r24-pending-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.r24-pending-panel-card {
    padding: 12px;
    border: 1px solid #ece6d2;
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

.r24-pending-panel-card.is-complete {
    background: #fffdfa;
    border-color: var(--r24-gold);
}

.r24-pending-panel-card.is-pending {
    background: #ffffff;
}

.r24-pending-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin: 8px 0;
    border: 1px dashed #eadfba;
    border-radius: 14px;
    background: #fffdf7;
    overflow: hidden;
}

.r24-pending-thumb img {
    display: block;
    max-width: 100%;
    height: auto;
}

.r24-panel-placeholder {
    padding: 12px;
    color: #777;
    font-weight: 800;
}

.r24-panel-status {
    margin: 6px 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: #5c4812;
}

.r24-pending-panel-card.is-pending .r24-panel-status {
    color: #777;
}


/* v1.12: editor compacto, controles en una sola fila y selector centrado */
.r24-editor-modal {
    padding: 8px !important;
    align-items: center !important;
}

.r24-editor-dialog {
    width: min(1180px, calc(100vw - 16px)) !important;
    height: min(94vh, 900px) !important;
    max-height: 94vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.r24-editor-header,
.r24-editor-footer {
    flex: 0 0 auto !important;
    padding: 12px 18px !important;
}

.r24-editor-title {
    font-size: 20px !important;
    line-height: 1.15 !important;
}

.r24-editor-subtitle {
    font-size: 13px !important;
    margin-top: 4px !important;
}

.r24-editor-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 12px 18px !important;
}

.r24-editor-tools,
.r24-text-tools {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.r24-editor-tools .button,
.r24-text-tools .button,
.r24-upload-label,
.r24-text-tools input[type="text"],
.r24-text-tools select,
.r24-text-tools input[type="color"] {
    flex: 0 0 auto !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.r24-text-tools input[type="text"] {
    width: 240px !important;
    min-width: 220px !important;
}

.r24-text-tools select {
    width: 170px !important;
    min-width: 160px !important;
}

.r24-text-tools input[type="color"] {
    width: 52px !important;
    min-width: 52px !important;
    padding: 4px !important;
}

.r24-text-style {
    width: 44px !important;
    min-width: 44px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.r24-canvas-shell {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    padding: 10px !important;
}

.r24-editor-canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}

.r24-editor-help {
    flex: 0 0 auto !important;
    margin-top: 8px !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
}

.r24-pending-panel-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
    justify-items: center !important;
}

.r24-pending-panel-card {
    width: 100% !important;
    max-width: 170px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.r24-pending-panel-card .r24-edit-pending-panel {
    margin-left: auto !important;
    margin-right: auto !important;
    align-self: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.r24-pending-thumb {
    width: 100% !important;
    min-height: 104px !important;
}

form.cart .single_add_to_cart_button.r24-cart-blocked {
    opacity: .55 !important;
    cursor: not-allowed !important;
}

@media (max-width: 768px) {
    .r24-editor-modal {
        padding: 0 !important;
        align-items: stretch !important;
    }

    .r24-editor-dialog {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    .r24-editor-header,
    .r24-editor-footer {
        padding: 10px 12px !important;
    }

    .r24-editor-title {
        font-size: 17px !important;
    }

    .r24-editor-subtitle {
        font-size: 12px !important;
    }

    .r24-close-editor[aria-label="Cerrar"] {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
    }

    .r24-editor-body {
        padding: 10px 10px !important;
    }

    .r24-editor-tools,
    .r24-text-tools {
        gap: 6px !important;
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    .r24-editor-tools .button,
    .r24-text-tools .button,
    .r24-upload-label,
    .r24-text-tools input[type="text"],
    .r24-text-tools select,
    .r24-text-tools input[type="color"] {
        min-height: 40px !important;
        height: 40px !important;
        font-size: 13px !important;
        padding: 7px 10px !important;
    }

    .r24-text-tools input[type="text"] {
        width: 190px !important;
        min-width: 180px !important;
    }

    .r24-text-tools select {
        width: 142px !important;
        min-width: 142px !important;
    }

    .r24-text-style {
        width: 40px !important;
        min-width: 40px !important;
    }

    .r24-canvas-shell {
        padding: 8px !important;
    }

    .r24-pending-panel-grid {
        grid-template-columns: repeat(2, minmax(135px, 1fr)) !important;
        gap: 10px !important;
        justify-items: center !important;
    }

    .r24-pending-panel-card {
        max-width: 165px !important;
        padding: 10px !important;
    }

    .r24-pending-panel-card .button {
        min-height: 42px !important;
        width: 100% !important;
        max-width: 130px !important;
    }
}


/* v1.13: reducir el campo de escribir texto para que no ocupe media fila */
.r24-text-tools .r24-text-input,
.r24-text-tools input.r24-text-input,
.r24-text-tools input[type="text"].r24-text-input {
    flex: 0 0 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    box-sizing: border-box !important;
}

.r24-text-tools .r24-text-input:focus,
.r24-text-tools input.r24-text-input:focus,
.r24-text-tools input[type="text"].r24-text-input:focus {
    flex-basis: 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

@media (max-width: 768px) {
    .r24-text-tools .r24-text-input,
    .r24-text-tools input.r24-text-input,
    .r24-text-tools input[type="text"].r24-text-input,
    .r24-text-tools .r24-text-input:focus,
    .r24-text-tools input.r24-text-input:focus,
    .r24-text-tools input[type="text"].r24-text-input:focus {
        flex: 0 0 130px !important;
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
    }
}


/* v1.14: ajustes móviles del selector y footer visible del editor */
@media (max-width: 768px) {
    .r24-pending-box {
        padding: 10px 8px !important;
        border-radius: 14px !important;
    }

    .r24-pending-message {
        font-size: 13px !important;
        line-height: 1.35 !important;
        margin-bottom: 10px !important;
    }

    .r24-pending-panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .r24-pending-panel-card {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        padding: 7px !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }

    .r24-pending-panel-card .r24-design-card-title,
    .r24-pending-panel-card > strong,
    .r24-side-label {
        font-size: 12px !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
    }

    .r24-pending-thumb {
        min-height: 78px !important;
        height: 78px !important;
        margin: 6px 0 !important;
        border-radius: 12px !important;
    }

    .r24-panel-placeholder {
        padding: 6px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    .r24-panel-status {
        margin: 5px 0 7px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .r24-pending-panel-card .r24-edit-pending-panel,
    .r24-pending-panel-card .button {
        width: 100% !important;
        max-width: 108px !important;
        min-height: 38px !important;
        height: 38px !important;
        padding: 5px 7px !important;
        font-size: 11.5px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
        justify-content: center !important;
    }

    .r24-editor-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        align-items: center !important;
        justify-content: stretch !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 5 !important;
        background: #f7f7f7 !important;
        box-shadow: 0 -6px 18px rgba(0,0,0,.06) !important;
    }

    .r24-editor-footer .button,
    .r24-editor-footer .r24-close-editor,
    .r24-editor-footer .r24-finish-design {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 46px !important;
        height: 46px !important;
        padding: 8px 10px !important;
        font-size: 14px !important;
        line-height: 1.1 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .r24-editor-body {
        overflow: hidden !important;
    }

    .r24-canvas-shell {
        min-height: 260px !important;
        max-height: none !important;
    }
}

@media (max-width: 380px) {
    .r24-pending-panel-grid {
        gap: 6px !important;
    }
    .r24-pending-panel-card {
        padding: 6px !important;
    }
    .r24-pending-panel-card .r24-edit-pending-panel,
    .r24-pending-panel-card .button {
        max-width: 102px !important;
        font-size: 11px !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

/* v1.15 compact modal + selector inside popup */
.r24-open-editor-wrap { display:flex; justify-content:center; }
.r24-open-editor-wrap .r24-open-editor { margin:0 auto; }
.r24-final-preview-wrap { text-align:left; }
.r24-design-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.r24-design-card-summary { display:flex; flex-direction:column; align-items:center; }
.r24-summary-preview { max-width: 220px; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background:#fff; }
.r24-summary-meta { margin:0 0 10px; color:#666; font-weight:700; }
.r24-design-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; width:100%; }
.r24-design-actions .button { flex:1 1 140px; }

.r24-editor-dialog { width:min(1100px,100%); overflow:hidden; display:flex; flex-direction:column; }
.r24-editor-body { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; gap:12px; }
.r24-panel-selector-view, .r24-panel-editor-view { flex:1 1 auto; min-height:0; }
.r24-panel-selector-intro { margin-bottom:12px; }
.r24-panel-selector-box { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; background:#fff; border:1px solid #e8e0c6; border-radius:14px; font-weight:800; }
.r24-panel-selector-box span { color:#666; font-weight:700; }
.r24-panel-selector-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap:12px; max-height: calc(84vh - 220px); overflow:auto; padding-right:2px; }
.r24-pending-panel-card { background:#fff; border:1px solid #e8e0c6; border-radius:16px; padding:12px; display:flex; flex-direction:column; align-items:center; gap:10px; }
.r24-pending-thumb { width:100%; aspect-ratio:1/1; border:1px dashed #ead9a3; border-radius:14px; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#fafafa; }
.r24-pending-thumb img { width:100%; height:100%; object-fit:contain; background:#fff; }
.r24-panel-placeholder { font-weight:800; color:#777; text-align:center; padding:8px; }
.r24-panel-status { font-weight:800; color:#666; }
.r24-select-panel { align-self:center; min-width:130px; }
.r24-side-label { font-weight:900; text-transform:uppercase; text-align:center; }

.r24-editor-tools-compact { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:8px; padding-bottom:4px; }
.r24-editor-tools-compact .button, .r24-editor-tools-compact .r24-upload-label { flex:0 0 auto; min-height:44px; white-space:nowrap; }
.r24-canvas-shell { display:flex; align-items:center; justify-content:center; min-height:380px; max-height: calc(100vh - 330px); overflow:auto; }
.r24-editor-canvas { max-width:100%; max-height: min(64vh, 700px); width:auto; height:auto; }
.r24-editor-help { font-size:13px; }

.r24-selector-footer, .r24-panel-footer { justify-content:space-between; }
.r24-selector-footer .button, .r24-panel-footer .button { min-width:170px; }
.r24-finalize-group.is-disabled, .r24-finalize-group:disabled { opacity:.45; pointer-events:none; }

.r24-text-modal { position:absolute; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:5; }
.r24-text-modal-card { width:min(520px, 100%); background:#fff; border-radius:16px; padding:16px; box-shadow:0 16px 40px rgba(0,0,0,.2); }
.r24-text-modal-title { font-size:18px; font-weight:900; margin-bottom:10px; }
.r24-text-modal-card .r24-text-input { width:100%; min-height:46px; border:1px solid #ddd; border-radius:12px; padding:10px 12px; margin-bottom:12px; }
.r24-text-modal-grid { display:grid; grid-template-columns:minmax(180px,1fr) 52px 48px 48px 48px; gap:8px; align-items:center; }
.r24-text-modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.r24-font-family { width:100%; min-height:46px; border:1px solid #ddd; border-radius:12px; padding:8px 10px; }
.r24-font-family option[value="Roboto"]{font-family:Roboto;}
.r24-font-family option[value="Open Sans"]{font-family:'Open Sans';}
.r24-font-family option[value="Montserrat"]{font-family:Montserrat;}
.r24-font-family option[value="Poppins"]{font-family:Poppins;}
.r24-font-family option[value="Oswald"]{font-family:Oswald;}
.r24-font-family option[value="Playfair Display"]{font-family:'Playfair Display';}
.r24-font-family option[value="Lora"]{font-family:Lora;}
.r24-font-family option[value="Merriweather"]{font-family:Merriweather;}
.r24-font-family option[value="Pacifico"]{font-family:Pacifico;}
.r24-font-family option[value="Caveat"]{font-family:Caveat;}
.r24-text-color { width:52px; min-width:52px; height:46px; border:1px solid #ddd; border-radius:12px; padding:4px; }

.r24-upload-overlay { position:absolute; inset:0; background:rgba(255,255,255,.88); z-index:10; display:flex; align-items:center; justify-content:center; padding:20px; }
.r24-upload-card { width:min(420px,100%); background:#fff; border-radius:18px; padding:20px; box-shadow:0 18px 45px rgba(0,0,0,.18); text-align:center; }
.r24-upload-title { font-size:18px; font-weight:900; margin-bottom:12px; }
.r24-upload-bar { height:14px; border-radius:999px; background:#ece6d1; overflow:hidden; }
.r24-upload-bar span { display:block; height:100%; width:0; background:linear-gradient(90deg, #d7bf77, #b99f55); transition:width .25s ease; }
.r24-upload-status { margin-top:10px; font-weight:800; color:#555; }

.r24-qty-row { width:100%; }
.r24-qty-control { display:flex; align-items:center; justify-content:center; gap:8px; }
.r24-qty-control input { width:80px !important; text-align:center; }
.r24-qty-caption { display:block; text-align:center; font-weight:800; margin-bottom:6px; }

@media (max-width: 767px) {
    .r24-editor-dialog { width:100%; max-height:100vh; min-height:100vh; border-radius:0; }
    .r24-editor-body { padding:12px 14px; }
    .r24-editor-header { padding:14px; }
    .r24-editor-title { font-size:18px; }
    .r24-editor-subtitle { font-size:13px; }
    .r24-panel-selector-box { flex-direction:column; align-items:flex-start; }
    .r24-panel-selector-grid { grid-template-columns: repeat(2, minmax(0,1fr)); max-height: calc(100vh - 220px); }
    .r24-pending-panel-card { padding:10px; }
    .r24-select-panel { min-width:0; width:100%; }
    .r24-canvas-shell { min-height:290px; max-height: calc(100vh - 290px); padding:8px; }
    .r24-editor-canvas { max-height: min(50vh, 440px); }
    .r24-selector-footer, .r24-panel-footer { position:sticky; bottom:0; background:#f7f7f7; padding:12px 14px; gap:8px; }
    .r24-selector-footer .button, .r24-panel-footer .button { flex:1 1 0; min-width:0; min-height:46px; padding:8px 10px; font-size:14px; }
    .r24-text-modal-card { padding:14px; }
    .r24-text-modal-grid { grid-template-columns:1fr 52px 44px 44px 44px; }
    .r24-design-list { grid-template-columns:1fr; }
    .r24-design-actions .button { flex:1 1 100%; }
    .r24-open-editor, .r24-add-another-design { max-width:none; width:100%; }
}

/* v1.16: fit canvas better and avoid scroll */
.r24-panel-editor-view {
    display:flex;
    flex-direction:column;
    min-height:0;
    gap:10px;
}
.r24-editor-body {
    overflow:hidden;
}
.r24-editor-dialog {
    max-height:min(96vh, 980px);
}
.r24-editor-tools-compact {
    padding-bottom:2px;
}
.r24-editor-tools-compact .button,
.r24-editor-tools-compact .r24-upload-label {
    padding:10px 14px;
    min-height:42px;
    font-size:14px;
}
.r24-canvas-shell {
    flex:1 1 auto;
    min-height:220px;
    max-height:calc(100vh - 370px);
    overflow:hidden;
    padding:10px;
}
.r24-editor-canvas {
    display:block;
    max-width:100%;
    max-height:min(52vh, 520px);
    margin:0 auto;
}
.r24-editor-help {
    margin-top:0;
}
.r24-close-editor {
    flex:0 0 auto;
}

@media (max-width: 991px) {
    .r24-editor-dialog {
        max-height:98vh;
    }
    .r24-canvas-shell {
        max-height:calc(100vh - 360px);
    }
    .r24-editor-canvas {
        max-height:min(46vh, 430px);
    }
}

@media (max-width: 767px) {
    .r24-editor-dialog {
        max-height:100dvh;
        min-height:100dvh;
    }
    .r24-editor-tools-compact .button,
    .r24-editor-tools-compact .r24-upload-label {
        min-height:42px;
        padding:8px 12px;
        font-size:13px;
    }
    .r24-canvas-shell {
        min-height:210px;
        max-height:calc(100dvh - 330px);
        overflow:hidden;
    }
    .r24-editor-canvas {
        max-height:min(40dvh, 360px);
    }
    .r24-editor-help {
        font-size:12px;
        line-height:1.35;
    }
}


/* v1.17: limpieza visual final del editor en móvil/PC */
body.r24-modal-open {
    overflow: hidden !important;
    touch-action: none;
}

.r24-editor-modal.is-open {
    padding: 8px;
}

.r24-editor-dialog {
    background: #ffffff;
    border-radius: 18px;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.r24-editor-header {
    padding: 10px 14px !important;
    min-height: auto;
    background: #ffffff !important;
    border-bottom: 1px solid #eeeeee;
}

.r24-editor-title {
    font-size: 17px !important;
    line-height: 1.2 !important;
}

.r24-editor-subtitle {
    font-size: 12px !important;
    line-height: 1.25 !important;
    margin-top: 2px !important;
}

.r24-close-editor[aria-label="Cerrar"] {
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    font-size: 24px !important;
}

.r24-editor-body {
    padding: 10px 12px !important;
    background: #ffffff;
    gap: 8px !important;
    overflow: hidden !important;
}

.r24-editor-tools-compact {
    order: 2;
    margin: 0 !important;
    padding: 8px !important;
    border-radius: 14px !important;
    border: 1px solid #eadfba !important;
    background: #fffdfa !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.r24-editor-tools-compact .button,
.r24-editor-tools-compact .r24-upload-label,
.r24-editor-modal .r24-btn {
    min-height: 38px !important;
    padding: 7px 10px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

.r24-canvas-shell {
    order: 1;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    padding: 8px !important;
    margin: 0 !important;
    border: 1px solid #e2d7ad !important;
    border-radius: 16px !important;
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.r24-editor-canvas {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(96vh - 235px) !important;
    background: #ffffff !important;
    box-shadow: 0 2px 14px rgba(0,0,0,.12) !important;
    border: 1px solid #e6e6e6;
}

.r24-editor-help {
    order: 3;
    margin: 0 !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    border-radius: 12px !important;
}

.r24-panel-footer,
.r24-selector-footer {
    padding: 9px 12px !important;
    background: #ffffff !important;
    border-top: 1px solid #eeeeee !important;
    gap: 8px !important;
}

.r24-panel-footer .button,
.r24-selector-footer .button {
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
}

.r24-panel-selector-grid {
    gap: 8px !important;
    max-height: calc(96vh - 190px) !important;
}

.r24-pending-panel-card {
    padding: 8px !important;
    border-radius: 14px !important;
    gap: 7px !important;
}

.r24-pending-thumb {
    border-radius: 12px !important;
}

.r24-side-label {
    font-size: 12px !important;
    line-height: 1.1 !important;
}

.r24-panel-status {
    font-size: 11px !important;
}

.r24-select-panel {
    min-height: 36px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
    width: auto !important;
    min-width: 118px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.r24-text-modal-card {
    padding: 14px !important;
    border-radius: 16px !important;
}

.r24-text-modal-title {
    font-size: 16px !important;
}

.r24-text-modal-actions .button,
.r24-text-modal-grid .button {
    min-height: 40px !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
}

@media (min-width: 768px) {
    .r24-panel-editor-view {
        min-height: 0 !important;
    }

    .r24-canvas-shell {
        min-height: 420px !important;
    }

    .r24-editor-canvas {
        max-height: calc(96vh - 245px) !important;
    }
}

@media (max-width: 767px) {
    .r24-editor-modal.is-open {
        padding: 0 !important;
    }

    .r24-editor-dialog {
        width: 100% !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    .r24-editor-header {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .r24-editor-title {
        font-size: 16px !important;
    }

    .r24-editor-subtitle {
        font-size: 11px !important;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .r24-close-editor[aria-label="Cerrar"] {
        width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        font-size: 22px !important;
    }

    .r24-editor-body {
        padding: 7px 8px !important;
        gap: 6px !important;
    }

    .r24-panel-editor-view {
        height: calc(100dvh - 108px) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        overflow: hidden !important;
    }

    .r24-canvas-shell {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        padding: 6px !important;
        border-radius: 12px !important;
    }

    .r24-editor-canvas {
        max-width: 100% !important;
        max-height: calc(100dvh - 225px) !important;
    }

    .r24-editor-tools-compact {
        padding: 6px !important;
        gap: 5px !important;
        border-radius: 12px !important;
    }

    .r24-editor-tools-compact .button,
    .r24-editor-tools-compact .r24-upload-label,
    .r24-editor-modal .r24-btn {
        min-height: 36px !important;
        padding: 6px 9px !important;
        font-size: 11.5px !important;
    }

    .r24-editor-help {
        display: none !important;
    }

    .r24-panel-footer,
    .r24-selector-footer {
        padding: 7px 8px !important;
        position: sticky !important;
        bottom: 0 !important;
    }

    .r24-panel-footer .button,
    .r24-selector-footer .button {
        min-height: 40px !important;
        padding: 7px 8px !important;
        font-size: 12px !important;
    }

    .r24-panel-selector-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
        max-height: calc(100dvh - 178px) !important;
        overflow: auto !important;
    }

    .r24-panel-selector-box {
        padding: 8px 10px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
    }

    .r24-pending-panel-card {
        padding: 7px !important;
        gap: 6px !important;
    }

    .r24-select-panel {
        min-height: 34px !important;
        padding: 6px 8px !important;
        font-size: 11.5px !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .r24-text-modal {
        padding: 10px !important;
    }

    .r24-text-modal-grid {
        grid-template-columns: 1fr 46px 38px 38px 38px !important;
        gap: 6px !important;
    }

    .r24-text-color {
        width: 46px !important;
        min-width: 46px !important;
        height: 40px !important;
    }

    .r24-font-family {
        min-height: 40px !important;
        font-size: 12px !important;
    }
}


/* v1.18: corregir móvil y bloqueo de variación */
.r24-editor-modal .r24-panel-selector-view[style*="display: none"],
.r24-editor-modal .r24-panel-editor-view[style*="display: none"],
.r24-editor-modal .r24-selector-footer[style*="display: none"],
.r24-editor-modal .r24-panel-footer[style*="display: none"],
.r24-editor-modal .r24-text-modal[style*="display: none"],
.r24-editor-modal .r24-upload-overlay[style*="display: none"] {
    display: none !important;
}

form.cart.r24-variation-choice-locked .variations,
form.cart.r24-variation-choice-locked table.variations,
form.cart.r24-variation-choice-locked .variable-items-wrapper,
form.cart.r24-variation-choice-locked .variation-radios {
    pointer-events: none !important;
    opacity: .68;
}

form.cart.r24-variation-choice-locked .variations::after {
    content: "Tamaño bloqueado. Para cambiarlo, recarga la página.";
    display: block;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #e6d39a;
    border-radius: 12px;
    background: #fff8df;
    color: #6b5515;
    font-weight: 800;
    font-size: 12px;
}

/* Selector: solo selector, sin lienzo debajo */
.r24-editor-modal.is-open .r24-panel-selector-view {
    min-height: 0 !important;
}

.r24-editor-modal.is-open .r24-panel-editor-view[style*="display: block"],
.r24-editor-modal.is-open .r24-panel-editor-view[style*="display: flex"] {
    display: flex !important;
}

/* Móvil más limpio: selector ocupa bien la pantalla sin mezclar vistas */
@media (max-width: 767px) {
    .r24-editor-modal .r24-panel-selector-view[style*="display: none"],
    .r24-editor-modal .r24-panel-editor-view[style*="display: none"],
    .r24-editor-modal .r24-selector-footer[style*="display: none"],
    .r24-editor-modal .r24-panel-footer[style*="display: none"] {
        display: none !important;
    }

    .r24-editor-modal.is-open .r24-panel-selector-view:not([style*="display: none"]) {
        display: block !important;
        height: calc(100dvh - 104px) !important;
        overflow: hidden !important;
    }

    .r24-editor-modal.is-open .r24-panel-selector-grid {
        max-height: calc(100dvh - 205px) !important;
        overflow-y: auto !important;
        padding-right: 4px !important;
    }

    .r24-panel-selector-box {
        padding: 9px 11px !important;
        margin-bottom: 6px !important;
    }

    .r24-pending-thumb {
        aspect-ratio: 1.35 / 1 !important;
        min-height: 76px !important;
    }

    .r24-pending-panel-card {
        min-height: 210px !important;
    }

    .r24-selector-footer:not([style*="display: none"]) {
        display: flex !important;
    }

    .r24-panel-footer:not([style*="display: none"]) {
        display: flex !important;
    }

    .r24-panel-editor-view[style*="display: block"],
    .r24-panel-editor-view[style*="display: flex"] {
        display: flex !important;
    }

    .r24-canvas-shell {
        background:
            linear-gradient(45deg, #f1f1f1 25%, transparent 25%),
            linear-gradient(-45deg, #f1f1f1 25%, transparent 25%),
            linear-gradient(45deg, transparent 75%, #f1f1f1 75%),
            linear-gradient(-45deg, transparent 75%, #f1f1f1 75%) !important;
        background-size: 16px 16px !important;
        background-position: 0 0, 0 8px, 8px -8px, -8px 0 !important;
    }
}


/* v1.19: impedir que selector y editor aparezcan mezclados en móvil */
.r24-editor-modal.r24-selector-mode .r24-panel-editor-view,
.r24-editor-modal.r24-selector-mode .r24-canvas-shell,
.r24-editor-modal.r24-selector-mode .r24-editor-tools-compact,
.r24-editor-modal.r24-selector-mode .r24-editor-help,
.r24-editor-modal.r24-selector-mode .r24-panel-footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

.r24-editor-modal.r24-selector-mode .r24-panel-selector-view {
    display: block !important;
    visibility: visible !important;
}

.r24-editor-modal.r24-selector-mode .r24-selector-footer {
    display: flex !important;
    visibility: visible !important;
}

.r24-editor-modal.r24-editor-mode .r24-panel-selector-view,
.r24-editor-modal.r24-editor-mode .r24-selector-footer {
    display: none !important;
}

.r24-editor-modal.r24-editor-mode .r24-panel-editor-view {
    display: flex !important;
    visibility: visible !important;
}

.r24-editor-modal.r24-editor-mode .r24-canvas-shell,
.r24-editor-modal.r24-editor-mode .r24-editor-tools-compact {
    visibility: visible !important;
}

@media (max-width: 767px) {
    .r24-editor-modal.r24-selector-mode .r24-panel-selector-grid {
        max-height: calc(100dvh - 235px) !important;
        overflow-y: auto !important;
        padding-bottom: 8px !important;
    }

    .r24-editor-modal.r24-selector-mode .r24-editor-body {
        overflow: hidden !important;
    }

    .r24-editor-modal.r24-selector-mode .r24-pending-panel-card {
        min-height: 0 !important;
    }

    .r24-editor-modal.r24-selector-mode .r24-pending-thumb {
        aspect-ratio: 1.45 / 1 !important;
    }
}


/* v1.22: gestor de capas */
.r24-layers-modal {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 6;
}

.r24-layers-modal-card {
    width: min(520px, 100%);
    max-height: min(80vh, 620px);
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.r24-layers-modal-title {
    font-size: 18px;
    font-weight: 900;
}

.r24-layers-help {
    font-size: 13px;
    color: #666;
    line-height: 1.35;
}

.r24-layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
}

.r24-layer-row {
    width: 100%;
    border: 2px solid #eadfba;
    background: #fffdfa;
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
    align-items: center;
    text-align: left;
    font-weight: 800;
    cursor: pointer;
}

.r24-layer-row.is-selected {
    border-color: var(--r24-gold);
    background: var(--r24-gold-soft);
}

.r24-layer-order {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0e5c4;
    color: #4a3a10;
    font-size: 13px;
}

.r24-layer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.r24-layer-type {
    color: #777;
    font-size: 12px;
}

.r24-layers-empty {
    padding: 16px;
    border-radius: 12px;
    background: #fffdfa;
    border: 1px dashed #eadfba;
    color: #777;
    font-weight: 700;
    text-align: center;
}

.r24-layers-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.r24-layers-actions .button {
    min-width: 110px;
}

@media (max-width: 767px) {
    .r24-layers-modal {
        padding: 10px;
    }

    .r24-layers-modal-card {
        max-height: 82dvh;
        padding: 14px;
        border-radius: 14px;
    }

    .r24-layer-row {
        grid-template-columns: 30px 1fr;
        padding: 9px 10px;
    }

    .r24-layer-type {
        display: none;
    }

    .r24-layers-actions .button {
        flex: 1 1 0;
        min-width: 0;
    }
}


/* v1.24: control de tamaño táctil para móvil */
.r24-mobile-size-control {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eadfba;
    border-radius: 14px;
    background: #fffdfa;
    box-shadow: 0 8px 22px rgba(0,0,0,.06);
}

.r24-mobile-size-label,
.r24-mobile-size-value {
    font-weight: 900;
    color: #333;
    white-space: nowrap;
    font-size: 13px;
}

.r24-mobile-size-range {
    flex: 1 1 auto;
    width: 100%;
    accent-color: var(--r24-gold);
}

@media (min-width: 768px) {
    .r24-mobile-size-control {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .r24-editor-modal.r24-editor-mode .r24-mobile-size-control {
        display: flex;
    }

    .r24-mobile-size-control {
        position: sticky;
        bottom: 92px;
        z-index: 4;
        margin: 0 2px;
    }

    .r24-mobile-size-range {
        min-height: 34px;
    }

    .r24-mobile-size-range::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .r24-mobile-size-range::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
}


/* v1.25: ampliación móvil hasta 1000% */
.r24-mobile-size-range {
    max-width: 100%;
}
