/* ===== IestEditor · editor visual de estampado ===== */
.iest-ed{font-family:inherit;}
.iest-ed-vtabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px;}
.iest-ed-vtab{border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:999px;
    padding:7px 16px;font-size:14px;font-weight:600;cursor:pointer;transition:.15s;}
.iest-ed-vtab:hover{border-color:#cbd5e1;}
.iest-ed-vtab.sel{background:#111827;border-color:#111827;color:#fff;}

.iest-ed-stage{display:block;}
.iest-editor-mount,.iest-ed{display:block !important;visibility:visible !important;}

.iest-ed-canvas-wrap{position:relative;width:100%;max-width:520px;margin:0 auto 16px;overflow:hidden;
    background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:10px;box-sizing:border-box;transition:.15s;}
.iest-ed-canvas-wrap.iest-ed-dropping{outline:2px dashed #2563eb;outline-offset:-5px;background:#eff6ff;border-color:#2563eb;}
.iest-ed-canvas{border-radius:8px;touch-action:none;max-width:100%;}
/* Input de archivo: visualmente oculto pero NO display:none (iOS exige esto para
   que el label nativo / .click() abran el selector en móvil). */
.iest-ed-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0);border:0;padding:0;margin:-1px;pointer-events:none;}
/* Capa de toque sobre la zona vacía: el tap nativo (label→input) abre el selector
   en todo móvil. Se apaga cuando hay arte, para que Fabric maneje arrastrar. */
.iest-ed-tap{position:absolute;inset:0;z-index:6;cursor:pointer;display:block;background:transparent;}
.iest-ed-tap.iest-ed-tap-off{display:none;}

.iest-ed-medida{position:absolute;top:16px;left:50%;transform:translateX(-50%);
    background:#111827;color:#fff;font-size:12.5px;font-weight:700;padding:4px 11px;border-radius:8px;
    opacity:0;transition:.15s;pointer-events:none;white-space:nowrap;box-shadow:0 4px 12px rgba(0,0,0,.18);}
.iest-ed-medida.show{opacity:1;}
.iest-ed-medida.err{background:#dc2626;}

.iest-ed-side{width:100%;max-width:560px;margin:0 auto;}
.iest-ed-pos-label{font-size:13px;font-weight:700;color:#0f172a;margin-bottom:8px;}
.iest-ed-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;}
.iest-ed-chip{border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:9px;
    padding:8px 13px;font-size:13px;font-weight:600;cursor:pointer;transition:.15s;line-height:1.1;}
.iest-ed-chip:hover{border-color:#cbd5e1;}
.iest-ed-chip.sel{border-color:#2563eb;box-shadow:0 0 0 1px #2563eb inset;color:#1d4ed8;}
.iest-ed-chip.done{background:#ecfdf5;border-color:#a7f3d0;color:#047857;}
.iest-ed-chip.done.sel{box-shadow:0 0 0 1px #10b981 inset;}
.iest-ed-chip.dis{opacity:.4;cursor:not-allowed;}
@media(max-width:600px){
    .iest-ed-pos-label{font-size:15px;margin-bottom:10px;}
    .iest-ed-chips{gap:10px;margin-bottom:18px;}
    .iest-ed-chip{flex:1 1 44%;padding:13px 12px;font-size:14px;text-align:center;line-height:1.2;}
    .iest-ed-canvas-wrap{max-width:100%;}
}
/* Lado a lado SOLO en escritorio: en móvil/tablet se queda apilado (a prueba de overflow). */
@media(min-width:900px){
    .iest-ed-stage{display:flex;flex-wrap:wrap;gap:22px;align-items:flex-start;justify-content:center;}
    .iest-ed-canvas-wrap{flex:1 1 340px;max-width:600px;margin:0;min-width:0;}
    .iest-ed-side{flex:1 1 220px;max-width:260px;margin:0;min-width:0;}
    .iest-ed-side button{white-space:normal;line-height:1.25;}
}

.iest-ed-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
    border:2px dashed #cbd5e1;border-radius:12px;padding:22px 14px;text-align:center;cursor:pointer;
    color:#64748b;transition:.15s;background:#fafbfc;}
.iest-ed-drop:hover,.iest-ed-drop.over{border-color:#2563eb;background:#eff6ff;color:#1d4ed8;}
.iest-ed-drop-ico{font-size:26px;line-height:1;}
.iest-ed-drop-txt{font-size:13.5px;font-weight:600;}
.iest-ed-quitar{margin-top:10px;width:100%;border:1px solid #fecaca;background:#fef2f2;color:#b91c1c;
    border-radius:9px;padding:8px;font-size:12.5px;font-weight:600;cursor:pointer;transition:.15s;}
.iest-ed-quitar:hover{background:#fee2e2;}
.iest-ed-cambiar{width:100%;border:1px solid #cbd5e1;background:#fff;color:#334155;
    border-radius:9px;padding:10px;font-size:13px;font-weight:600;cursor:pointer;transition:.15s;}
.iest-ed-cambiar:hover{background:#f8fafc;border-color:#94a3b8;}
.iest-ed-recortar{width:100%;margin-top:8px;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;
    border-radius:9px;padding:10px;font-size:13px;font-weight:700;cursor:pointer;transition:.15s;}
.iest-ed-recortar:hover{background:#dbeafe;}
.iest-ed-recortar.hot{background:#2563eb;border-color:#2563eb;color:#fff;font-weight:700;box-shadow:0 2px 8px rgba(37,99,235,.3);}
.iest-ed-recortar.hot:hover{background:#1d4ed8;}
.iest-crop-ov{position:fixed;inset:0;z-index:2147483005;background:rgba(15,23,42,.72);
    display:flex;align-items:center;justify-content:center;padding:2vh 3vw;box-sizing:border-box;}
.iest-crop-ov *{box-sizing:border-box;}
.iest-crop-card{background:#fff;border-radius:14px;max-width:640px;width:100%;box-shadow:0 30px 80px rgba(0,0,0,.45);overflow:hidden;}
.iest-crop-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #eef2f7;font-weight:800;color:#0f172a;font-size:16px;}
.iest-crop-x{border:0;background:#f1f5f9;width:34px;height:34px;border-radius:8px;cursor:pointer;font-size:14px;}
.iest-crop-body{display:flex;justify-content:center;padding:18px;
    background:repeating-conic-gradient(#94a3b8 0% 25%, #cbd5e1 0% 50%) 50% / 24px 24px;}
.iest-crop-body .canvas-container{outline:2px solid #64748b;}
.iest-crop-hint{font-size:12.5px;color:#64748b;text-align:center;margin:0;padding:0 18px 6px;}
.iest-crop-foot{display:flex;gap:12px;justify-content:flex-end;padding:14px 18px;border-top:1px solid #eef2f7;}
.iest-crop-cancel{border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:9px;padding:11px 18px;font-weight:600;cursor:pointer;}
.iest-crop-ok{border:0;background:#2563eb;color:#fff;border-radius:9px;padding:11px 22px;font-weight:800;cursor:pointer;}
.iest-crop-ok:hover{background:#1d4ed8;}
.iest-ed-hint2{font-size:13px;color:#64748b;line-height:1.5;margin:0;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:10px;padding:12px;text-align:center;}
.iest-ed-badge{margin-top:10px;padding:8px 11px;border-radius:9px;font-size:12.5px;font-weight:600;line-height:1.4;}
.iest-ed-badge.ok{background:#ecfdf5;border:1px solid #a7f3d0;color:#047857;}
.iest-ed-badge.warn{background:#fffbeb;border:1px solid #fde68a;color:#b45309;}
.iest-ed-badge.err{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;}
.iest-ed-nota{font-size:11.5px;color:#94a3b8;line-height:1.5;margin:14px 0 0;}
/* Cuando el editor vive en la galería (imagen principal) */
.iest-en-galeria{width:100%;max-width:100%;box-sizing:border-box;}
.iest-en-galeria .iest-ed-canvas-wrap{max-width:560px;}
