/* ============================================================
   CAMIGLOBO — CSS COMPLETO
   ============================================================ */

html { max-width: 100%; }
body { overflow-x: hidden; max-width: 100%; }
.cg-container { margin-top: 15px; margin-bottom: 40px; padding-left: 10px; padding-right: 10px; box-sizing: border-box; max-width: 100%; }

/* En PC: usar casi todo el ancho disponible */
/* === FAB MENÚ FLOTANTE (solo móvil) === */
#fab-menu,
.fab-menu {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    flex-direction: column-reverse;
    gap: 10px;
}
.fab-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #3498db;
    color: #fff;
    border: none;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fab-btn.fab-main { background: #e74c3c; font-size: 24px; }
.fab-menu.open .fab-sub { opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (min-width: 1101px) {
    .cg-container {
        padding-left: 20px;
        padding-right: 20px;
        max-width: 100%;
    }
    .container.cg-container {
        max-width: 100% !important;
        width: 100% !important;
    }
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 18px;
    align-items: start;
}

/* En PC grande: más ancho el panel herramientas, canvas más compacto */
@media (min-width: 1400px) {
    .editor-grid {
        grid-template-columns: 1fr 380px;
        gap: 20px;
    }
}

.tools-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        "producto producto producto"
        "fotos    texto    plantillas-col"
        "compra   compra   compra";
    gap: 12px;
    align-items: stretch;
    min-width: 0;
}
.ptb-in-tools           { grid-area: producto; margin-bottom: 0; }
.card-fotos             { grid-area: fotos; }
.card-texto             { grid-area: texto; }
.plantillas-notas-col   { grid-area: plantillas-col; display: flex; flex-direction: column; gap: 12px; }
.buy-card               { grid-area: compra; }

.canvas-panel {
    background: #fff;
    padding: 10px;
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 70px;
    align-self: start;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.canvas-center-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
.canvas-wrapper {
    flex-shrink: 0;
    flex-grow: 0;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 0 0 / 12px 12px;
    /* el ancho lo pone escalarCanvas() via JS */
}
.canvas-wrapper canvas { border-radius: 16px; }
#tshirt-canvas  { display: block; }
/* NO forzar nada en .canvas-container — Fabric lo gestiona */

/* ── LAYOUT PARALELO (2 COLUMNAS) ───────────────────────────── */
.lienzo-paralelo-wrap {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}
.zonas-extra-col {
    display: flex;
    flex-direction: column;
    width: 320px;
    max-width: 100%;
    flex-shrink: 1;
    box-sizing: border-box;
}

.mini-section-title {
    font-size: 10px;
    color: #3498db;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f0f8ff;
    border: 1px solid #d6eaf8;
    border-radius: 10px;
    padding: 7px 10px;
}
.mini-section-label {
    font-size: 10px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-left: 4px;
}
/* ── MINI LIENZOS (Nuca + Mangas) ───────────────────────────── */
.mini-canvases-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.mini-canvas-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    padding: 8px 6px;
    min-width: 0;
    flex: 1;
    max-width: 155px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
    box-sizing: border-box;
}
.mini-canvas-block.mini-active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
    background: #f0f8ff;
}
.mini-canvas-label {
    font-size: 10px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.mini-canvas-inner {
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    width: 140px;
    height: 100px;
    flex-shrink: 0;
    /* Efecto cuadrícula para indicar que el fondo es transparente (Sin tinta) */
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 0 0 / 12px 12px;
}
.mini-canvas-inner canvas { display: block; border-radius: 8px; }
.mini-canvas-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}
.mini-btn-text, .mini-btn-upload, .mini-btn-color, .mini-btn-del {
    padding: 6px 6px;
    border-radius: 7px;
    border: none;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: 0.15s;
    text-transform: uppercase;
    white-space: nowrap;
    height: 28px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
}
.mini-btn-text   { background: #2c3e50; color: #fff; }
.mini-btn-text:hover { background: #34495e; }
.mini-btn-upload { background: #3498db; color: #fff; cursor: pointer; }
.mini-btn-upload:hover { background: #2980b9; }
.mini-btn-color  { background: #8e44ad; color: #fff; }
.mini-btn-color:hover { background: #6c3483; }
.mini-btn-del    { background: #e74c3c; color: #fff; }
.mini-btn-del:hover { background: #c0392b; }

/* ── WRAPPER + PICKER COLOR MINI (limpiado) ─────────────────── */
.mini-btn-color-wrap { display: none; } /* ya no se usa, queda por compatibilidad */

/* ── NOTAS DEL PEDIDO ────────────────────────────────────────── */
.notas-hints {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.notas-hint-title {
    font-size: 10px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.notas-hint-title i { color: #f1c40f; font-size: 12px; }
.notas-hint-lista { display: flex; flex-direction: column; gap: 2px; }
.notas-hint-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 10px;
    color: #555;
    line-height: 1.4;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}
.notas-hint-item:last-child { border-bottom: none; }
.notas-hint-item i { margin-top: 1px; flex-shrink: 0; width: 12px; text-align: center; }
.notas-hint-item strong { color: #2c3e50; }
.notas-textarea {
    height: 90px;
    resize: vertical;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    border: 2px dashed #f1c40f !important;
    background: #fffef0 !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    color: #2c3e50 !important;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: text;
}
.notas-textarea::placeholder {
    color: #b8a030;
    font-style: italic;
    font-size: 11px;
}
.notas-textarea:focus {
    border-color: #e6b800 !important;
    background: #fffde0 !important;
    box-shadow: 0 0 0 3px rgba(241,196,15,0.2) !important;
    outline: none;
}

.precio-live-wrap {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.precio-live-inner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.precio-live-label { font-size: 9px; font-weight: 900; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.precio-live-num { font-size: 22px; font-weight: 900; color: #2ecc71; letter-spacing: -0.5px; line-height: 1; transition: all 0.3s ease; }
.precio-live-desglose { display: none; flex-direction: column; gap: 3px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 6px; }
.plde-base { font-size: 10px; color: rgba(255,255,255,0.5); font-weight: 700; }
.plde-extra { font-size: 10px; color: #f39c12; font-weight: 700; }
.plde-extra strong { color: #f1c40f; }

/* ── TOOLBAR ─────────────────────────────────────────────── */
.pro-toolbar {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 10px 12px;
    margin-bottom: 14px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    align-self: stretch;
}

.toolbar-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 10px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Badge atajos de teclado — rediseñado limpio */
.toolbar-atajos-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
}
.toolbar-atajos-badge i {
    color: #3498db;
    font-size: 11px;
}
.atajos-sep {
    color: #ccc;
    font-weight: 400;
    margin: 0 1px;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    border: 1px solid #c8d6e5;
    border-bottom: 2px solid #b0c4d8;
    border-radius: 5px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 9.5px;
    font-weight: 900;
    color: #2c3e50;
    line-height: 1.4;
    min-width: 18px;
}

/* Botones toolbar — agrupados y centrados */
.toolbar-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-x: auto;
}

/* Grupos de botones con ligero fondo */
.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 4px 5px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #555;
    width: auto;
    min-width: 48px;
    height: auto;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    flex-shrink: 0;
    gap: 2px;
}
.tool-btn:hover {
    background: #2c3e50;
    color: #fff;
    transform: translateY(-1px);
}

/* Label pequeño dentro del botón (+ / −) */
.tool-btn-label {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

/* Texto debajo del icono */
.tool-btn-text {
    display: block;
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tool-undo { color: #2980b9; background: #eaf4ff !important; }
.tool-undo:hover { background: #2980b9 !important; color: #fff !important; }
.tool-redo { color: #27ae60; background: #eafaf1 !important; }
.tool-redo:hover { background: #27ae60 !important; color: #fff !important; }
.tool-rotate-l { color: #8e44ad; }
.tool-rotate-l:hover { background: #8e44ad !important; color: #fff !important; }
.tool-rotate-r { color: #8e44ad; }
.tool-rotate-r:hover { background: #8e44ad !important; color: #fff !important; }
.tool-duplicate { color: #16a085; }
.tool-duplicate:hover { background: #16a085 !important; color: #fff !important; }

.tool-del { color: #e74c3c !important; background: #fff0f0 !important; }
.tool-del:hover { background: #e74c3c !important; color: #fff !important; }

.tool-reset { color: #e67e22 !important; }
.tool-reset:hover { background: #e67e22 !important; color: #fff !important; }

/* Botón zona de impresión */
.tool-boundary { color: #e67e22 !important; }
.tool-boundary:hover { background: #e67e22 !important; color: #fff !important; }
.tool-boundary.active { background: #e74c3c !important; color: #fff !important; animation: pulse-boundary 1.5s infinite; }

@keyframes pulse-boundary {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.3); }
    50%       { box-shadow: 0 0 0 5px rgba(231,76,60,0); }
}

/* Parpadeo de control al navegar desde menú contextual */
@keyframes ctx-blink-anim {
    0%   { outline: 3px solid transparent; background: transparent; }
    15%  { outline: 3px solid #9b59b6; background: rgba(155,89,182,0.2); border-radius: 8px; }
    35%  { outline: 3px solid #9b59b6; background: rgba(155,89,182,0.35); border-radius: 8px; }
    50%  { outline: 3px solid #e74c3c; background: rgba(155,89,182,0.15); border-radius: 8px; }
    65%  { outline: 3px solid #9b59b6; background: rgba(155,89,182,0.35); border-radius: 8px; }
    80%  { outline: 3px solid #9b59b6; background: rgba(155,89,182,0.2); border-radius: 8px; }
    100% { outline: 3px solid transparent; background: transparent; }
}
.ctx-blink { animation: ctx-blink-anim 2.4s ease forwards; }

/* Separador entre grupos */
.tool-sep { width: 1px; height: 28px; background: #e8e8e8; margin: 0 2px; flex-shrink: 0; }

.tool-card { display: flex; flex-direction: column; background: #fff; padding: 14px; border-radius: 20px; box-shadow: 0 8px 25px rgba(0,0,0,0.03); border: 1px solid #f3f3f3; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: visible; }
.tool-card:nth-child(2) { padding: 12px 14px; }
.tool-title { margin-bottom: 10px; font-size: 13px; font-weight: 900; color: #2c3e50; text-transform: uppercase; border-bottom: 2px solid #f8f8f8; padding-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.tool-row-flex { display: flex; gap: 10px; margin-bottom: 12px; }

.buy-card { background: #2c3e50; color: #fff; padding: 22px 28px !important; border-radius: 25px; box-shadow: 0 15px 35px rgba(44,62,80,0.2); display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 20px; }
.precio-wrap  { display: flex; flex-direction: column; gap: 4px; }
.precio-label { font-weight: 800; font-size: 12px; opacity: 0.7; letter-spacing: 1px; text-transform: uppercase; }
.precio-num   { font-size: 30px; font-weight: 900; color: #2ecc71; line-height: 1; }
.buy-buttons  { display: flex; gap: 10px; }

.extra-posicion-bloque { margin-bottom: 10px; border: 1px solid #f0f0f0; border-radius: 12px; padding: 10px 12px; background: #fafafa; }
.extra-checkbox-label  { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.extra-checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: #f1c40f; cursor: pointer; flex-shrink: 0; }
.extra-checkbox-txt    { font-size: 11px; font-weight: 700; color: #2c3e50; }
.extra-checkbox-txt strong { color: #e67e22; }
.panel-extra-logo      { margin-top: 10px; animation: fadeInDown 0.2s; }
.btn-extra-upload      { background: #e67e22 !important; font-size: 10px !important; padding: 10px !important; margin-bottom: 8px; }
.preview-logo-box      { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px dashed #ccc; border-radius: 8px; padding: 6px 10px; }
.preview-logo-box img  { max-height: 35px; border-radius: 4px; }
.btn-borrar-logo       { background: #e74c3c; color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0; }

.desglose-box    { background: #f8f9fa; border: 1px solid #eee; border-radius: 12px; padding: 10px 14px; margin-top: 10px; font-size: 11px; }
.desglose-linea  { display: flex; justify-content: space-between; padding: 3px 0; color: #555; }
.desglose-linea.extra { color: #e67e22; font-weight: 700; }
.desglose-linea.total { border-top: 1px solid #ddd; margin-top: 5px; padding-top: 6px; font-weight: 900; color: #2c3e50; font-size: 12px; }

.label-sm { font-size: 10px; color: #aaa; text-transform: uppercase; margin-bottom: 8px; display: block; font-weight: 800; letter-spacing: 0.5px; }
.custom-select { width: 100%; padding: 11px; border-radius: 12px; border: 2px solid #f0f0f0; font-weight: 700; font-size: 13px; outline: none; background: #fff; box-sizing: border-box; }
.btn-upload-label { background: #2c3e50; color: #fff; padding: 13px; border-radius: 12px; font-weight: 800; font-size: 12px; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; line-height: 1; box-sizing: border-box; }
.btn-add-text { background: #e74c3c; color: #fff; border: none; padding: 13px; border-radius: 12px; font-weight: 800; font-size: 12px; text-transform: uppercase; width: 100%; margin-bottom: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; line-height: 1; box-sizing: border-box; }
.btn-guia-tallas { font-size: 11px; color: #3498db; cursor: pointer; font-weight: 800; background: #ebf5fb; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }

.palette-container   { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.color-circle        { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #eee; cursor: pointer; transition: 0.2s; flex-shrink: 0; position: relative; }
.color-circle:hover  { transform: scale(1.15); border-color: #bbb; }
.color-circle.active { border-color: #e74c3c !important; transform: scale(1.2); box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e74c3c; }
.color-nombre-display { font-size: 10px; font-weight: 800; color: #2c3e50; margin-top: 5px; display: block; min-height: 14px; letter-spacing: 0.3px; }
.color-nombre-prenda  { font-size: 10px; font-weight: 800; color: #2c3e50; margin-top: 5px; display: block; min-height: 14px; letter-spacing: 0.3px; }
.text-color-circle   { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #eee; cursor: pointer; flex-shrink: 0; transition: transform 0.15s, border-color 0.15s; }
.text-color-circle:hover { transform: scale(1.25); border-color: #2c3e50; }

/* Filtros modernos */
.filter-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.fbtn {
    padding: 4px 1px;
    font-size: clamp(6px, 0.75vw, 8px) !important;
    border-radius: 10px;
    border: 1.5px solid #eee;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    transition: all 0.15s;
    letter-spacing: 0px;
    text-align: center;
    color: #444;
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fbtn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.fbtn:active { transform: translateY(0); }
.fbtn-reset    { background: #ffeaea; color: #e74c3c; border-color: #ffc8c8; }
.fbtn-gray     { background: #f0f0f0; color: #555; border-color: #ddd; }
.fbtn-bw       { background: linear-gradient(135deg,#fff 50%,#222 50%); color: #333; border-color: #ccc; }
.fbtn-sepia    { background: #f5e6c8; color: #7a5c2e; border-color: #e8d0a0; }
.fbtn-brownie  { background: #e8d5b0; color: #5c3d1e; border-color: #d4b896; }
.fbtn-kodak    { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.fbtn-tech     { background: linear-gradient(135deg,#ff6b6b,#4ecdc4); color: #fff; border-color: transparent; }
.fbtn-polar    { background: #e8f4f8; color: #2980b9; border-color: #aed6f1; }
.fbtn-contrast { background: linear-gradient(135deg,#fff 40%,#000 60%); color: #333; border-color: #ccc; }
.fbtn-bright   { background: #fffde7; color: #f57f17; border-color: #fff176; }
.fbtn-blur     { background: #e3f2fd; color: #1565c0; border-color: #90caf9; filter: blur(0.4px); }
.fbtn-blur:hover { filter: none; }
.fbtn-sharp    { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.fbtn-pixel    { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.fbtn-tint     { background: #fce4ec; color: #c62828; border-color: #f48fb1; }
.fbtn-vib      { background: linear-gradient(135deg,#fd79a8,#fdcb6e); color: #fff; border-color: transparent; }
.fbtn-noise    { background: #eceff1; color: #455a64; border-color: #b0bec5; }
/* ── INPUT DE TEXTO ─────────────────────────────────────────── */
.text-input-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 14px;
    animation: textInputAppear 0.4s ease;
}
@keyframes textInputAppear {
    0% { opacity: 0; transform: translateY(-10px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.text-input-field {
    flex: 1;
    padding: 14px 16px;
    border: 3px solid #e74c3c;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.3s;
    min-width: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(231,76,60,0.15);
    animation: inputGlow 1.5s ease 2;
}
@keyframes inputGlow {
    0%, 100% { box-shadow: 0 0 0 4px rgba(231,76,60,0.15); }
    50% { box-shadow: 0 0 0 8px rgba(231,76,60,0.25), 0 0 20px rgba(231,76,60,0.1); }
}
.text-input-field:focus {
    border-color: #e74c3c;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(231,76,60,0.2), 0 0 15px rgba(231,76,60,0.15);
}
.text-input-field::placeholder {
    color: #aaa;
    font-weight: 600;
}
.btn-add-text-inline {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.btn-add-text-inline:hover { background: #c0392b; transform: translateY(-1px); }

.font-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 4px;
}
.font-option {
    padding: 7px 4px;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-size: 11px;
    color: #2c3e50;
    text-align: center;
    transition: 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.font-option:hover { border-color: #bdc3c7; background: #fff; transform: translateY(-1px); }
.font-option.active { border-color: #e74c3c; background: #fff5f5; color: #e74c3c; box-shadow: 0 3px 10px rgba(231,76,60,0.12); }

@media (max-width: 640px) {
    .font-picker { grid-template-columns: repeat(3, 1fr); }
    .font-option { font-size: 11px; padding: 9px 3px; }
    .text-input-wrap { flex-direction: column; }
    .btn-add-text-inline { width: 100%; justify-content: center; padding: 14px; font-size: 13px; }
}

.resource-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    overflow: visible;
}
.thumb-wrap {
    position: relative;
    flex-shrink: 0;
}
.thumb-img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #eee;
    cursor: pointer;
    display: block;
    transition: border-color 0.2s, transform 0.15s;
}
.thumb-img:hover { border-color: #3498db; transform: scale(1.05); }
.btn-del-rec {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}
.btn-del-rec   { position: absolute; top: -6px; right: -6px; background: #e74c3c; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.btn-view        { padding: 12px 24px; font-size: 12px; font-weight: 900; text-transform: uppercase; border-radius: 14px; border: 2px solid #ddd; background: #fff; color: #888; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 8px; letter-spacing: 1px; }
.btn-view:hover  { border-color: #e74c3c; color: #e74c3c; background: #fff5f5; }
.btn-view.active { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; border-color: #e74c3c; box-shadow: 0 4px 15px rgba(231,76,60,0.4); }

.btn-download       { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.3); border-radius: 12px; font-weight: 700; padding: 12px 16px; cursor: pointer; font-size: 11px; text-transform: uppercase; transition: 0.3s; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.btn-download:hover { background: rgba(255,255,255,0.2); }
.btn-finish         { background: #27ae60; color: #fff; border: none; padding: 12px 16px; border-radius: 12px; font-weight: 900; cursor: pointer; font-size: 12px; text-transform: uppercase; box-shadow: 0 8px 20px rgba(39,174,96,0.3); transition: 0.3s; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.btn-finish:hover   { background: #2ecc71; transform: translateY(-2px); }

/* ── BARRA SUPERIOR DE PRODUCTO ───────────────────────────── */
.product-top-bar {
    background: white;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    border-left: 6px solid #3498db;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    padding: 12px 18px;
    margin-bottom: 16px;
}

/* Cuando está dentro del tools-panel: sin margin-bottom extra */
.ptb-in-tools {
    margin-bottom: 0;
    padding: 8px 12px 10px;
    overflow: visible;
}

/* ── LAYOUT COMPACTO HORIZONTAL DE PRODUCTO ──────────────────── */
.ptb-compact-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    min-height: 90px;
    overflow: visible;
    box-sizing: border-box;
    padding-top: 4px;
}

.ptb-compact-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}
.ptb-compact-title {
    font-size: 9px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
    line-height: 1.3;
}

/* 4 tarjetas en fila horizontal, rediseño bonito */
.ptb-compact-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 100px));
    gap: 8px;
    flex-shrink: 0;
    max-width: 216px;
}
.ptb-compact-products .product-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 14px 8px 12px;
    border-radius: 14px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: #f4f6f9;
    border: 2px solid transparent;
    transition: all 0.2s;
    aspect-ratio: 1;
}
.ptb-compact-products .product-card:hover {
    background: #eaf4ff;
    border-color: #90cdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52,152,219,0.15);
}
.ptb-compact-products .product-card.active {
    background: linear-gradient(145deg, #e8f4fd, #d0eaf8);
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52,152,219,0.25);
    transform: translateY(-2px);
}
.ptb-compact-products .pc-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #94a3b8;
    margin-bottom: 7px;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ptb-compact-products .product-card:hover .pc-icon-wrap,
.ptb-compact-products .product-card.active .pc-icon-wrap {
    box-shadow: 0 2px 8px rgba(52,152,219,0.3);
}
.ptb-compact-products .pc-name {
    font-size: 9.5px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.2;
}
.ptb-compact-products .product-card.active .pc-name {
    color: #1e6fa8;
}
.ptb-compact-products .pc-price {
    font-size: 9px;
    font-weight: 700;
    color: #27ae60;
    margin-top: 3px;
}

/* Sección talla + colores */
.ptb-compact-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: center;
    min-height: 90px;
}
.ptb-compact-colores {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ptb-compact-options .label-sm {
    margin-bottom: 2px;
    font-size: 9px;
}

/* Paleta con scroll horizontal para que los círculos no se salgan */
.ptb-palette-scroll {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    padding-bottom: 3px;
    gap: 4px !important;
}
.ptb-palette-scroll::-webkit-scrollbar { height: 4px; }
.ptb-palette-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
/* Círculo transparente (ajedrez) */
.color-circle.transparent-circle {
    background: repeating-conic-gradient(#d0d0d0 0% 25%, #ffffff 0% 50%) 0 0 / 8px 8px !important;
    border: 2px solid #ccc !important;
}
.ptb-palette-scroll .color-circle {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
}

/* Selector de talla compacto dentro del tools */
.ptb-compact-options .custom-select,
.ptb-compact-options select {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 8px;
}
.ptb-compact-options .ptb-group {
    gap: 2px;
}

/* ── SEPARADOR HORIZONTAL Y FILA DESCRIPCIÓN ─────────────────── */
.ptb-hsep {
    height: 1px;
    background: #eef2f6;
    margin: 10px 0 8px;
}

/* Descripción en fila horizontal: 5 características en grid 2 cols + título */
.ptb-desc-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 3px 10px;
    align-items: start;
}
/* El título ocupa las 3 columnas */
.ptb-desc-row .pdesc-titulo {
    grid-column: 1 / -1;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-bottom: none;
}
/* Cada línea de característica */
.ptb-desc-row .pdesc-linea {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 10px;
    color: #555;
    font-weight: 600;
    padding: 3px 6px;
    border-bottom: none;
    background: #f8f9fa;
    border-radius: 7px;
    line-height: 1.35;
    border: 1px solid #eee;
}
.ptb-desc-row .pdesc-icon {
    color: #3498db;
    font-size: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}

/* ★ Título de sección con número ★ */
.ptb-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ptb-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3498db;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.product-top-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
/* Fila genérica */
.ptb-fila {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Fila de opciones: talla + color en horizontal */
.ptb-fila-opciones {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.ptb-vsep {
    width: 1px;
    height: 36px;
    background: #e0e0e0;
    flex-shrink: 0;
    align-self: center;
}
.ptb-vsep-main { height: 44px; }
.ptb-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.ptb-colores-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.ptb-select { min-width: 150px; padding: 9px 12px; }
.ptb-desc {
    flex: 1;
    min-width: 220px;
    margin-top: 0 !important;
    font-size: 10.5px;
}
@media (max-width: 900px) { .ptb-desc { display: none; } }

@media (max-width: 640px) {
    .product-top-bar { padding: 12px 14px; }
    .product-top-inner { gap: 12px; }
    .ptb-select { min-width: 0; width: 100%; }
    .ptb-group { width: 100%; }
}


.cg-header { margin-bottom: 16px; }
.cg-header-top { text-align: center; margin-bottom: 12px; }
.cg-titulo {
    color: #2c3e50; font-weight: 900; text-transform: uppercase;
    letter-spacing: -1.5px; font-size: 1.7rem; margin-bottom: 4px;
}
.cg-titulo i { color: #e74c3c; }
.cg-titulo span { color: #e74c3c; }
.cg-subtitulo { color: #888; font-size: 0.85rem; font-weight: 600; margin: 0; }

.guia-editor {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 10px 30px rgba(44,62,80,0.18);
    margin-bottom: 14px;
    overflow: hidden;
    box-sizing: border-box;
}
.guia-header {
    font-size: 11px; font-weight: 900; color: #f1c40f;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
#tour-start-btn {
    display: none; /* Se muestra solo en móvil o cuando se requiere */
}
.guia-pasos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}
.gp-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 10px;
    transition: background 0.2s;
}
.gp-item:hover { background: rgba(255,255,255,0.13); }
.gp-icono {
    width: 32px; height: 32px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.gp-texto { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.gp-texto strong { font-size: 11px; color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: 0.3px; }
.gp-texto span   { font-size: 10.5px; color: rgba(255,255,255,0.9); line-height: 1.5; font-weight: 500; }
.gp-texto em     { color: #f1c40f; font-style: normal; font-weight: 700; }
.gp-sep { display: none; }
.gp-num { display: none; }

.guia-tips {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.gt-tip {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 10px; color: rgba(255,255,255,0.85);
    line-height: 1.4; font-weight: 500; flex: 1; min-width: 180px;
}
.gt-tip i { font-size: 12px; margin-top: 1px; flex-shrink: 0; }
.gt-tip strong { color: #fff; font-weight: 800; }
.gt-sep { width: 1px; height: 32px; background: rgba(255,255,255,0.12); flex-shrink: 0; }

@media (max-width: 900px) {
    .gt-sep { display: none; }
    .guia-tips { flex-direction: column; gap: 10px; }
    .guia-pasos { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .guia-editor { padding: 14px; }
    .guia-pasos { grid-template-columns: 1fr; }
}

.custom-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(44,62,80,0.6); z-index: 10000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.custom-modal-box     { background: #fff; padding: 25px; border-radius: 20px; width: 90%; max-width: 480px; max-height: 85vh; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow-y: auto; overflow-x: hidden; }
.close-modal-btn      { position: absolute; top: 15px; right: 15px; background: #f8f9fa; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: #e74c3c; font-size: 16px; }
.size-table    { width: 100%; border-collapse: collapse; text-align: center; table-layout: fixed; min-width: 500px; }
.size-table th { background: #2c3e50; color: #fff; padding: 14px 6px; font-size: 11px; text-transform: uppercase; }
.size-table td { padding: 14px 6px; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #555; }
.size-table th:first-child, .size-table td:first-child { text-align: left; padding-left: 15px; width: 15%; }

.btn-preview {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: 0.2s;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.btn-preview:hover { filter: brightness(1.15); transform: translateY(-1px); }

@keyframes previewPulse {
    0%   { box-shadow: 0 4px 18px rgba(142,68,173,0.35); }
    50%  { box-shadow: 0 4px 28px rgba(142,68,173,0.7), 0 0 0 6px rgba(142,68,173,0.12); }
    100% { box-shadow: 0 4px 18px rgba(142,68,173,0.35); }
}
.btn-preview-pulse {
    animation: previewPulse 2.2s ease-in-out infinite;
}
.btn-preview-pulse:hover {
    animation: none;
}

@media (max-width: 1100px) {
    .editor-grid { grid-template-columns: 1fr; gap: 16px; }
    .canvas-panel { order: -1; position: static; width: 100%; }
    .tools-panel {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "producto producto"
            "fotos  texto"
            "plantillas-col plantillas-col"
            "compra compra";
    }
    .plantillas-notas-col { flex-direction: row; flex-wrap: wrap; }
    .plantillas-notas-col .card-plantillas { flex: 1; min-width: 260px; }
    .plantillas-notas-col .extras-card     { flex: 1; min-width: 260px; }
}

@media (max-width: 780px) {
    .tools-panel {
        grid-template-columns: 1fr;
        grid-template-areas: "producto" "fotos" "texto" "plantillas-col" "compra";
    }
    .plantillas-notas-col { flex-direction: column; }
}

@media (max-width: 640px) {
    .cg-container { padding-left: 10px; padding-right: 10px; max-width: 100vw; overflow-x: hidden; }
    .canvas-panel { order: 0; }
    .tools-panel {
        grid-template-columns: 1fr;
        grid-template-areas: "producto" "fotos" "texto" "plantillas-col" "compra";
        max-width: 100%;
        overflow: hidden;
    }
    .canvas-panel { padding: 8px; max-width: 100%; overflow: hidden; box-sizing: border-box; }
    .canvas-wrapper { width: 100% !important; aspect-ratio: 1/1.2; }
    #tshirt-canvas { width: 100% !important; height: auto !important; }
    .canvas-panel .canvas-container { width: 100% !important; max-width: 100%; margin: 0 auto; }
    .precio-live-num { font-size: 26px; }
    .precio-live-inner { flex-direction: row; gap: 10px; justify-content: center; }
    .precio-live-label { font-size: 9px; }
    .toolbar-hint-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .toolbar-atajos-badge { display: none; }
    .toolbar-buttons { gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 100%; overflow: hidden; }
    .toolbar-group { padding: 3px; flex-wrap: wrap; }
    .tool-sep { display: none; }
    .btn-view { padding: 12px 18px; font-size: 12px; }
    .cg-titulo { font-size: 1.3rem !important; letter-spacing: -0.5px; }
    .cg-subtitulo { font-size: 0.85rem; }
    .truco-pro-pasos { flex-wrap: wrap; gap: 8px; }
    .tp-paso { flex: 1 1 calc(50% - 8px); min-width: 130px; }
    .tp-flecha { display: none; }
    .tool-card { padding: 14px; max-width: 100%; box-sizing: border-box; overflow: visible; }
    .filter-grid-modern { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .fbtn { font-size: 7.5px; height: 40px; border-radius: 10px; }
    input[type="range"] { height: 28px; cursor: pointer; }
    .btn-upload-label { padding: 13px; font-size: 12px; }
    .btn-add-text { padding: 13px; font-size: 12px; }
    .buy-card { flex-direction: column !important; text-align: center; gap: 14px; }
    .buy-card > div:last-child { align-items: center !important; width: 100%; }
    .buy-buttons { flex-direction: column; width: 100%; gap: 10px; }
    .btn-download { width: 100%; justify-content: center; padding: 16px; font-size: 13px; }
    .btn-finish   { width: 100%; justify-content: center; padding: 16px; font-size: 14px; }
    .btn-preview  { width: 100%; justify-content: center; padding: 14px; font-size: 13px; }
    .custom-select { padding: 14px; font-size: 14px; }
    .ptb-compact-row { flex-wrap: wrap; gap: 8px; min-height: 0; }
    .ptb-compact-products {
        grid-template-columns: repeat(4, 1fr);
        max-width: 100%;
        width: 100%;
        flex-shrink: 1;
    }
    .ptb-compact-products .product-card { min-width: 0; width: 100%; box-sizing: border-box; padding: 8px 4px; }
    .ptb-compact-products .pc-icon-wrap { width: 28px; height: 28px; font-size: 13px; }
    .ptb-compact-products .pc-name { font-size: 8px; }
    .ptb-compact-products .pc-price { font-size: 7px; }
    .ptb-compact-label { flex-direction: row; gap: 8px; width: 100%; }
    .ptb-vsep { display: none; }
    .ptb-compact-options { min-height: 0; width: 100%; }
    .ptb-desc-row { grid-template-columns: 1fr 1fr; }
    .color-circle      { width: 34px; height: 34px; }
    .ptb-palette-scroll .color-circle { width: 28px !important; height: 28px !important; }
    .ptb-palette-scroll {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        padding-bottom: 6px !important;
    }
    .text-color-circle { width: 32px; height: 32px; }
    .extra-checkbox-label input[type="checkbox"] { width: 22px; height: 22px; }
    .extra-posicion-bloque { padding: 12px; }
    .thumb-img { width: 54px; height: 54px; }
    .custom-modal-box { padding: 18px; border-radius: 18px; max-height: 70vh; }
    .custom-modal-overlay { align-items: flex-start; padding-top: 80px; }
    .size-table td, .size-table th { padding: 10px 8px; font-size: 13px; }
    /* Mini lienzos en móvil */
    .mini-canvas-block { max-width: 100% !important; flex: 1 1 100%; }
    .mini-canvases-row { flex-direction: column; align-items: center; }
    .mini-canvas-block[id="mini-block-manga-izq"],
    .mini-canvas-block[id="mini-block-manga-der"] { max-width: 90% !important; }
    .mini-canvas-inner { width: 100% !important; height: auto !important; min-height: 80px; }
    .mini-canvas-tools { gap: 4px; }
    .mini-btn-text, .mini-btn-upload, .mini-btn-color, .mini-btn-del {
        font-size: 10px !important;
        height: 32px !important;
    }
    .mini-color-picker { grid-template-columns: repeat(6, 22px); }
    .mini-color-dot { width: 22px; height: 22px; }

    /* ── MEJORAS MÓVIL ────────────────────────────────────────── */
    #tshirt-canvas { max-width: 100% !important; height: auto !important; }
    .canvas-wrapper { width: 100% !important; overflow: visible; }
    .canvas-panel { padding: 8px !important; }

    /* Panel collapsible */
    .tool-card { padding: 10px !important; margin-bottom: 6px; }
    .tool-card-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    .tool-card-header::after { content: '▼'; font-size: 10px; transition: transform 0.2s; }
    .tool-card.collapsed .tool-card-body { display: none; }
    .tool-card.collapsed .tool-card-header::after { transform: rotate(-90deg); }
    .tool-card-body { display: block; }

    /* FAB — estilos collapsible móvil (el bloque principal está fuera del media query) */
    .fab-sub {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
        transition: all 0.2s;
        width: 46px;
        height: 46px;
        font-size: 16px;
        background: #2ecc71;
    }

    /* Guía en móvil */
    .guia-pasos { grid-template-columns: 1fr; }
    .guia-tips { flex-direction: column !important; gap: 8px !important; }
    .gt-tip { font-size: 11px !important; padding: 8px !important; }
    .gt-sep { display: none !important; }
}

@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ── PLANTILLAS ──────────────────────────────────────────── */
.plantillas-tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ptab {
    background: #f0f0f0;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.15s;
    white-space: nowrap;
}
.ptab:hover  { background: #e8f8f5; border-color: #1abc9c; color: #1abc9c; }
.ptab.active { background: #1abc9c; border-color: #1abc9c; color: #fff; }

.plantillas-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}
.plantilla-card {
    border-radius: 8px;
    border: 2px solid #eee;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.plantilla-card:hover {
    transform: translateY(-2px);
    border-color: #1abc9c;
    box-shadow: 0 4px 14px rgba(26,188,156,0.25);
}
.plantilla-preview {
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    overflow: hidden;
    position: relative;
}
.plantilla-nombre {
    font-size: 7px;
    font-weight: 800;
    text-align: center;
    color: #555;
    text-transform: uppercase;
    padding: 3px 2px;
    letter-spacing: 0.2px;
    line-height: 1.2;
    background: #fafafa;
    border-top: 1px solid #eee;
}

@media (max-width: 640px) {
    .plantillas-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
    .ptab { font-size: 9px; padding: 4px 8px; }
}


.sticker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.sticker-btn {
    background: #f8f9fa;
    border: 1.5px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 5px 2px;
    text-align: center;
    transition: transform 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}
.sticker-btn:hover { background: #e8f4fd; transform: scale(1.2); border-color: #3498db; }
.sticker-btn:active { transform: scale(1.05); }

/* ── DEGRADADO BOTONES DIRECCIÓN ─────────────────────────── */
.grad-dir-btn { font-size: 16px !important; font-weight: 900; }

@media (max-width: 640px) {
    .sticker-grid { grid-template-columns: repeat(6, 1fr); }
    .sticker-btn { font-size: 20px; }
}

/* Descripción de producto */
.product-desc-box {
    margin-top: 14px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px 14px;
    animation: fadeInDown 0.3s ease;
}
.pdesc-titulo {
    font-size: 11px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pdesc-icono { font-size: 14px; }
.pdesc-linea {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    color: #555;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}
.pdesc-linea:last-child { border-bottom: none; }
.pdesc-icon {
    color: #3498db;
    font-size: 11px;
    margin-top: 2px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

/* ── ICONO EN TÍTULOS DE TARJETAS ────────────────────────── */
.tool-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.tool-title-step {
    opacity: 0.45;
    font-size: 12px;
    margin-right: -2px;
}

/* ── BOTÓN RESTAURAR TAMAÑO ──────────────────────────────── */
.tool-restore { color: #8e44ad !important; }
.tool-restore:hover { background: #8e44ad !important; color: #fff !important; }

/* ── SELECTOR PRODUCTO/TALLA MEJORADO ────────────────────── */
.ptb-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}
.ptb-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ptb-select-header .label-sm {
    margin: 0;
}


/* ── TARJETAS DE PRODUCTO CLICABLES ─────────────────────── */
.product-cards-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #eee;
    border-radius: 14px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.product-card:hover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.15);
}
.product-card.active {
    border-color: #3498db;
    background: linear-gradient(135deg, #ebf5fb, #d6eaf8);
    box-shadow: 0 4px 14px rgba(52,152,219,0.25);
    transform: translateY(-2px);
}
.pc-icon {
    font-size: 20px;
    color: #bbb;
    transition: color 0.2s;
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.product-card:hover .pc-icon,
.product-card.active .pc-icon {
    color: #3498db;
}
.pc-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.pc-name {
    font-size: 11px;
    font-weight: 900;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.pc-price {
    font-size: 10px;
    font-weight: 700;
    color: #27ae60;
}

/* ── CONTROLES DE TEXTO ──────────────────────────────────── */
.text-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

/* ── BOTÓN +/- SLIDER ──────────────────────────────────────── */
.slider-btn {
    background: #f0f0f0; border: 1.5px solid #ddd; border-radius: 8px;
    width: 28px; height: 28px; cursor: pointer; font-size: 16px; font-weight: 900;
    color: #555; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: 0.15s; user-select: none; line-height: 1;
}
.slider-btn:hover { background: #e0e0e0; color: #222; border-color: #bbb; }
.slider-btn:active { transform: scale(0.9); background: #d0d0d0; }

/* ── BOTÓN FILTRO ────────────────────────────────────────── */
.filter-btn {
    background: #f8f9fa;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    color: #2c3e50;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.filter-btn:hover {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
    transform: translateY(-1px);
}

/* ── CANVAS PRINCIPAL ACTIVO ─────────────────────────────── */
.mini-active-main {
    box-shadow: 0 0 0 3px rgba(52,152,219,0.35) !important;
    border-radius: 16px;
}

/* Barra de "editando" encima de los botones del lienzo principal */
.zone-active-label {
    width: 100%;
    background: #ebf5fb;
    border: 1.5px solid #3498db;
    border-radius: 8px;
    color: #1a6f9a;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    padding: 5px 8px;
    box-sizing: border-box;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

/* Botones de zona activa con borde azul */
.main-canvas-tools.zone-active-bar .mini-btn-text,
.main-canvas-tools.zone-active-bar .mini-btn-upload,
.main-canvas-tools.zone-active-bar .mini-btn-color,
.main-canvas-tools.zone-active-bar .mini-btn-del {
    border-color: #3498db;
}

/* Label del mini-canvas activo */
.mini-canvas-label.mini-label-active {
    color: #1a6f9a;
}

/* Badge "✏️ ACTIVO" dentro del label */
.zone-badge {
    display: inline-block;
    background: #3498db;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 6px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    vertical-align: middle;
}


/* ══════════════════════════════════════════════════════════════
   CORRECCIÓN DEFINITIVA MÓVIL — evita desbordamiento en tarjetas
   ══════════════════════════════════════════════════════════════ */

/* Regla universal: ningún hijo del tools-panel puede ser más ancho que su contenedor */
@media (max-width: 1100px) {
    .editor-grid,
    .tools-panel,
    .tool-card,
    .product-top-bar {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .canvas-panel {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Zonas extra col: quitar ancho fijo */
    .zonas-extra-col {
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 1 !important;
    }

    /* Mini canvas inner: ancho flexible */
    .mini-canvas-inner {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 60px;
        flex-shrink: 1;
    }
    .mini-canvas-inner canvas {
        width: 100% !important;
        height: auto !important;
    }

    /* Palette container: wrap por defecto, pero scroll si tiene la clase ptb-palette-scroll */
    .palette-container {
        flex-wrap: wrap;
        max-width: 100%;
        overflow-x: hidden;
    }
    .palette-container.ptb-palette-scroll {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Filter grid */
    .filter-grid-modern {
        grid-template-columns: repeat(4, 1fr);
        max-width: 100%;
    }

    /* Font picker */
    .font-picker {
        grid-template-columns: repeat(4, 1fr);
        max-width: 100%;
    }

    /* Notas hints */
    .notas-hints {
        max-width: 100%;
        overflow: hidden;
    }

    /* Buy card */
    .buy-card {
        flex-direction: column !important;
        text-align: center;
        gap: 14px;
        max-width: 100%;
    }
    .buy-card > div:last-child { align-items: center !important; width: 100%; }
    .buy-buttons { flex-direction: column; width: 100%; gap: 10px; }
    .btn-download, .btn-finish, .btn-preview { width: 100%; justify-content: center; }
}

@media (max-width: 640px) {
    /* Canvas panel correctamente ajustado */
    .canvas-panel {
        padding: 8px !important;
    }

    /* Lienzo paralelo: apilado */
    .lienzo-paralelo-wrap {
        flex-direction: column;
        gap: 16px;
    }
    .zonas-extra-col {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Filter 2 columnas */
    .filter-grid-modern {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Font picker 3 columnas */
    .font-picker {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Mini botones: 2 filas de 2 */
    .mini-canvas-tools {
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    .mini-btn-text, .mini-btn-upload, .mini-btn-color, .mini-btn-del {
        flex: 0 1 calc(50% - 5px) !important;
        min-width: 0 !important;
        font-size: 10px !important;
        padding: 8px 4px !important;
        height: 34px !important;
    }

    /* Product cards: 4 en fila */
    .ptb-compact-products {
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .ptb-compact-products .product-card {
        min-width: 0 !important;
        width: 100% !important;
        padding: 8px 4px !important;
    }

    /* Guia editor padding mínimo */
    .guia-editor { padding: 12px 10px !important; }
}

/* ══════════════════════════════════════════════════════════════
   TIPOGRAFÍA MÓVIL — textos más legibles sin romper layout
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

    /* Etiquetas y labels pequeños */
    .label-sm                { font-size: 12px !important; }
    .mini-section-label      { font-size: 12px !important; }
    .mini-canvas-label       { font-size: 12px !important; }
    .mini-section-title      { font-size: 12px !important; }

    /* Guía de uso */
    .gp-texto strong         { font-size: 13px !important; }
    .gp-texto span           { font-size: 12px !important; }
    .guia-header             { font-size: 13px !important; }
    .gt-tip                  { font-size: 12px !important; }

    /* Tour guiada */
    #tour-start-btn          { display: inline-flex !important; }
    #tour-tooltip            { max-width:90vw !important; }
    #tour-hole               { border-radius:8px !important; }

    /* Tarjeta de texto y controles */
    .tool-title              { font-size: 15px !important; }
    .font-option             { font-size: 12px !important; padding: 10px 4px !important; }

    /* Filtros */
    .fbtn                    { font-size: 9px !important; }

    /* Notas */
    .notas-hint-title        { font-size: 13px !important; }
    .notas-hint-item span    { font-size: 12px !important; line-height: 1.5; }

    /* Precio desglose */
    .desglose-box            { font-size: 13px !important; }
    .plde-base, .plde-extra  { font-size: 12px !important; }
    .precio-live-label       { font-size: 11px !important; }

    /* Descripción de producto */
    .pdesc-linea             { font-size: 13px !important; }
    .pdesc-titulo            { font-size: 12px !important; }

    /* Tarjetas de producto (solo un poco) */
    .ptb-compact-products .pc-name  { font-size: 10px !important; }
    .ptb-compact-products .pc-price { font-size: 9px !important; }

    /* Botones mini canvas */
    .mini-btn-text, .mini-btn-upload,
    .mini-btn-color, .mini-btn-del   { font-size: 11px !important; }

    /* Precio final */
    .precio-label            { font-size: 13px !important; }
    .precio-num              { font-size: 30px !important; }

    /* Toolbar hints */
    .toolbar-hint            { font-size: 12px !important; }
    .toolbar-hint-badge      { font-size: 11px !important; }

    /* Texto area notas */
    .notas-textarea          { font-size: 14px !important; }

    /* Select / custom select */
    .custom-select           { font-size: 14px !important; }

    /* Extras checkboxes */
    .extra-checkbox-txt      { font-size: 13px !important; }

    /* Rotación labels */
    #scale-val, #rotation-val,
    #text-size-val, #text-rotation-val { font-size: 13px !important; }

    /* Nuevos controles de texto */
    #spacing-val, #lineheight-val, #opacity-val { font-size: 13px !important; }

    /* Stickers — menos columnas en móvil */
    .sticker-grid { grid-template-columns: repeat(6, 1fr) !important; }
    .sticker-btn  { font-size: 22px !important; padding: 6px 2px !important; }

    /* Degradado inline — wrap en móvil */
    #grad-preview { height: 18px !important; }

    /* Guía — pasos en columna única */
    .gp-texto span { font-size: 11px !important; line-height: 1.5 !important; }
}

/* ══════════════════════════════════════════════
   BIBLIOTECA DE FOTOS — MÓVIL
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
    #biblioteca-area {
        overflow: visible !important;
    }
    .resource-list {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        gap: 10px !important;
        /* scrollbar fino */
        scrollbar-width: thin;
        scrollbar-color: #ddd transparent;
    }
    .resource-list::-webkit-scrollbar { height: 4px; }
    .resource-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

    .thumb-wrap {
        flex-shrink: 0 !important;
    }
    .thumb-img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 12px !important;
        border-width: 3px !important;
    }
    .btn-del-rec {
        width: 22px !important;
        height: 22px !important;
        font-size: 10px !important;
        top: -6px !important;
        right: -6px !important;
    }
}

/* ── PARPADEO BIBLIOTECA ─────────────────────────────────── */
@keyframes bibliotecaFlash {
    0% { box-shadow: none; }
    25% { box-shadow: 0 0 0 4px rgba(231,76,60,0.4); }
    75% { box-shadow: 0 0 0 4px rgba(231,76,60,0.4); }
    100% { box-shadow: none; }
}
.biblioteca-flash {
    animation: bibliotecaFlash 1.8s ease forwards;
}

/* Flash del panel de texto al abrir desde botón Texto */
@keyframes panelFlash {
    0% { box-shadow: none; }
    25% { box-shadow: 0 0 0 4px rgba(231,76,60,0.35), 0 0 20px rgba(231,76,60,0.15); }
    75% { box-shadow: 0 0 0 4px rgba(231,76,60,0.35), 0 0 20px rgba(231,76,60,0.15); }
    100% { box-shadow: none; }
}
.panel-flash {
    animation: panelFlash 1.8s ease forwards;
}
.biblioteca-flash {
    animation: bibliotecaFlash 1.8s ease forwards;
    border-radius: 14px;
}

/* ══════════════════════════════════════════════════════════════
   BOTÓN FLOTANTE "VER LIENZO" — solo móvil
   ══════════════════════════════════════════════════════════════ */
#btn-ver-lienzo {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 24px;
    left: 20px;
    z-index: 9000;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 24px rgba(142,68,173,0.45);
    cursor: pointer;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s;
}
#btn-ver-lienzo:active { transform: scale(0.95); }
#btn-ver-lienzo i { font-size: 16px; }
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(142,68,173,0.45); transform: scale(1); }
    50% { box-shadow: 0 6px 30px rgba(142,68,173,0.8), 0 0 0 8px rgba(142,68,173,0.2); transform: scale(1.08); }
}
#btn-ver-lienzo.pulse { animation: btnPulse 0.6s ease 3; }

/* ══════════════════════════════════════════════════════════════
   BOTONES ACCIÓN LIENZO PRINCIPAL
   ══════════════════════════════════════════════════════════════ */
.canvas-principal-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-grow: 0;
}
.main-canvas-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}
.main-canvas-tools .mini-btn-text,
.main-canvas-tools .mini-btn-upload,
.main-canvas-tools .mini-btn-color,
.main-canvas-tools .mini-btn-del {
    height: 36px;
    font-size: 11px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   PAGINACIÓN PLANTILLAS
   ══════════════════════════════════════════════════════════════ */
.plantillas-paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}
.plantillas-arrow {
    background: #f0f0f0;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: all 0.15s;
    flex-shrink: 0;
}
.plantillas-arrow:hover:not(:disabled) {
    background: #1abc9c;
    border-color: #1abc9c;
    color: #fff;
}
.plantillas-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.plantillas-page-info {
    font-size: 10px;
    font-weight: 800;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 36px;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   COLUMNA PLANTILLAS-NOTAS: misma altura que las otras columnas
   ══════════════════════════════════════════════════════════════ */
.plantillas-notas-col {
    height: 100%;
    min-height: 0;
}
.plantillas-notas-col .card-plantillas {
    flex: 1 1 auto;
    min-height: 0;
}
.plantillas-notas-col .extras-card {
    /* Flex-grow para ocupar el espacio restante */
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
/* En la columna de 3 cols del tools-panel, las 3 tarjetas principales deben tener el mismo alto */
@media (min-width: 781px) {
    .card-fotos,
    .card-texto,
    .plantillas-notas-col {
        /* Cada columna ocupa todo el alto disponible en su celda de grid */
        align-self: stretch;
    }
    .plantillas-notas-col .extras-card .notas-hints {
        flex: 1 1 auto;
        overflow-y: auto;
    }
}

/* ══════════════════════════════════════════════════════════════
   BARRA STICKY NAVEGACIÓN MÓVIL
   ══════════════════════════════════════════════════════════════ */
.mobile-sticky-nav {
    display: none; /* solo en móvil */
}

@media (max-width: 1100px) {
    .mobile-sticky-nav {
        display: flex;
        position: sticky;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 100000;
        background: #fff;
        border-bottom: 2px solid #eee;
        box-shadow: 0 2px 12px rgba(0,0,0,0.10);
        gap: 0;
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }
    body {
        padding-top: 0;
    }
    .msn-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 10px 4px 8px;
        border: none;
        background: transparent;
        color: #555;
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        cursor: pointer;
        border-right: 1px solid #eee;
        transition: background 0.15s, color 0.15s;
    }
    .msn-btn:last-child { border-right: none; }
    .msn-btn i {
        font-size: 16px;
        margin-bottom: 1px;
    }
    .msn-btn:hover, .msn-btn:active {
        background: #f0f8ff;
        color: #3498db;
    }
    .msn-btn-canvas {
        background: linear-gradient(135deg, #8e44ad22, #9b59b622);
        color: #8e44ad;
    }
    .msn-btn-canvas:hover, .msn-btn-canvas:active {
        background: linear-gradient(135deg, #8e44ad, #9b59b6);
        color: #fff;
    }
    .msn-btn-undo { color: #2c3e50; }
    .msn-btn-undo:hover, .msn-btn-undo:active { background: #f0f4ff; color: #3498db; }
    /* En tablet: ocultar botones flotantes (ya tiene sticky nav) */
    .fab-menu { display: none !important; }
}

/* Móvil: botón ver lienzo siempre visible */

/* Mini canvas tap hint overlay */
.mini-canvas-inner { position: relative; }
.mini-tap-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(142,68,173,0.82);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 8px;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2;
}
.mini-canvas-block.mini-active .mini-tap-hint,
.mini-canvas-inner:has(canvas:not(:empty)) .mini-tap-hint { opacity: 0; }

/* Precio destello al cambiar */
@keyframes precio-flash-anim {
    0%   { color: inherit; transform: scale(1); }
    25%  { color: #27ae60; transform: scale(1.12); }
    60%  { color: #27ae60; transform: scale(1.08); }
    100% { color: inherit; transform: scale(1); }
}
.precio-flash { animation: precio-flash-anim 0.6s ease forwards; }

@media (max-width: 640px) {
    .msn-btn { font-size: 9px; padding: 8px 2px 6px; }
    .msn-btn i { font-size: 14px; }
    /* Dar espacio al body para la barra sticky */
    .cg-container { padding-top: 4px; }
}

/* ═══════════════════════════════════════════════════════
   MODAL DE CONFIRMACIÓN CUSTOM
═══════════════════════════════════════════════════════ */
#cg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 9, 8, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cgModalFadeIn 0.18s ease;
}
#cg-modal-overlay.active { display: flex; }

@keyframes cgModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#cg-modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 36px 36px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06);
    animation: cgModalSlideUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
@keyframes cgModalSlideUp {
    from { transform: translateY(18px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

#cg-modal-icon {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
}
#cg-modal-icon.warn  { background: rgba(231,76,60,0.1);  color: #e74c3c; }
#cg-modal-icon.info  { background: rgba(52,152,219,0.1); color: #3498db; }
#cg-modal-icon.trash { background: rgba(231,76,60,0.1);  color: #e74c3c; }

#cg-modal-title {
    font-family: 'Syne', 'Segoe UI', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.3;
}
#cg-modal-msg {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.65;
    margin-bottom: 28px;
}
#cg-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.cgm-btn {
    padding: 11px 22px;
    border-radius: 10px;
    border: none;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.2px;
}
.cgm-btn-cancel {
    background: #f2f2f2;
    color: #555;
}
.cgm-btn-cancel:hover { background: #e8e8e8; color: #222; }

.cgm-btn-confirm {
    background: #e74c3c;
    color: #fff;
    box-shadow: 0 4px 14px rgba(231,76,60,0.3);
}
.cgm-btn-confirm:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(231,76,60,0.35);
}
.cgm-btn-confirm.blue {
    background: #3498db;
    box-shadow: 0 4px 14px rgba(52,152,219,0.3);
}
.cgm-btn-confirm.blue:hover {
    background: #2980b9;
    box-shadow: 0 8px 20px rgba(52,152,219,0.35);
}

@media (max-width: 480px) {
    #cg-modal-box { padding: 28px 22px 22px; }
    #cg-modal-actions { flex-direction: column-reverse; }
    .cgm-btn { width: 100%; text-align: center; padding: 13px; }
}
