/* =========================================================
   RotulArte Product Editor — rotularte-editor.css (REFAC v37)
   Objetivo: MISMA estética / MISMO layout.
   Limpieza: orden + dedupe + consolidación de hotfix (v33–v36).
   Scope: .rotularte-editor-page (no ensucia el theme).
   ========================================================= */

/* Safety: force hidden elements to stay hidden */
.rotularte-editor-page [hidden]{ display:none !important; }

/* =======================
   BASE TOKENS
   ======================= */
.rotularte-editor-page{
  --rot-max: 1200px;
  --rot-pad: 16px;

  --rot-bg: #fff;
  --rot-fg: #111;
  --rot-muted: #666;

  --rot-pill: 999px;
  --rot-border: 1px solid #ddd;

  --rot-btn-font: 15px;
  --rot-btn-pad-y: 8px;
  --rot-btn-pad-x: 16px;

  --rot-active-bg: #BDBDBD;
  --rot-active-bd: #A0A0A0;

  --rot-focus: #007cba;
}

.rotularte-editor-page,
.rotularte-editor-page *{ box-sizing:border-box; }

/* Hard reset dentro del editor para evitar estilos del theme */
.rotularte-editor-page button,
.rotularte-editor-page input,
.rotularte-editor-page select{
  font: inherit;
}

/* =======================
   LAYOUT GENERAL
   ======================= */
.rotularte-editor-page{
  max-width: var(--rot-max);
  margin: 0 auto 40px;
  padding: 0 var(--rot-pad);
  color: var(--rot-fg);
  display:block;
  float:none;
  clear:both;
  width:100%;
}

/* Wrapper del editor sin márgenes arriba */
.rotularte-editor-page-wrapper{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* =======================
   HEADER (DESKTOP BASE)
   ======================= */
.rotularte-editor-header{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;

  padding: 10px 20px;
  background: #f2f2f2;

  /* Full-bleed dentro de contenedor max-width */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  margin-top: 0;
  margin-bottom: 20px;
  border-radius: 0;
}

.rot-header-left{ justify-self:flex-start; }
.rot-header-center{ text-align:center; font-size:14px; min-width:0; }
.rot-header-right{
  justify-self:flex-end;
  display:flex;
  align-items:center;
  gap:10px;
}

/* Botón Volver */
.rot-back-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 12px;
  border-radius: var(--rot-pill);
  border: 1px solid #777;
  background: transparent;
  color: #444;
  text-decoration:none;
  font-size: 15px;
}
.rot-back-link:hover{
  background: rgba(0,0,0,0.04);
  color:#222;
  text-decoration:none;
}
.rot-back-icon{ line-height:1; }

.rot-product-title{
  font-weight:600;
  font-size:15px;
  margin-bottom:2px;
}
.rot-product-meta{
  font-size:15px;
  font-weight:600;
  color: var(--rot-muted);
}
.rot-product-size{ color:#444; }

/* Iconos header */
.rot-header-right .rot-btn-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-right:6px;
}
.rot-header-right .rot-btn-icon img{
  display:block;
  width:18px;
  height:18px;
}

/* =======================
   GRID PRINCIPAL
   ======================= */
.rotularte-editor-body{
  display:grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items:flex-start;
}

/* 3 columnas en pantallas grandes */
@media (min-width:1320px){
  .rotularte-editor-page{ max-width: 1400px; }
  .rotularte-editor-body{
    grid-template-columns: minmax(0, 280px) minmax(0, 650px) minmax(0, 280px);
  }
  .rot-sidebar{ grid-column:1; }
  .rot-main{ grid-column:2; }
}

/* Si algún editor NO tiene sidebar: 1 columna (evita “columna fantasma”) */
@supports(selector(:has(*))){
  .rotularte-editor-body:not(:has(.rot-editor-sidebar, .rot-sidebar, .rot-editor-sidebar)){
    grid-template-columns: 1fr !important;
    justify-items:center !important;
  }
  .rotularte-editor-body:not(:has(.rot-editor-sidebar, .rot-sidebar, .rot-editor-sidebar))
    :is(.rot-main, .rot-editor-main){
    grid-column: 1 / -1 !important;
    width:100%;
  }
}

/* =======================
   SIDEBAR
   ======================= */
.rot-editor-sidebar{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.rot-editor-main{ min-width:0; }

.rot-sidebar-section{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.rot-sidebar-section h3{
  font-size:15px;
  font-weight:600;
  color:#222;
  margin:0;
  padding-bottom:6px;
  border-bottom:1px solid #e5e5e5;
}

/* Meta mobile oculta por defecto */
.rot-product-meta-mobile{ display:none; }
.rot-meta-line1{ font-weight:700; }
.rot-meta-line2{ font-weight:400; }

/* =======================
   BOTONES (ORIENTACIÓN / MARCO)
   ======================= */
.rotularte-editor-page :is(.orientation-btn, .frame-btn){
  -webkit-appearance:none;
  appearance:none;

  border-radius: 30px;
  padding: var(--rot-btn-pad-y) var(--rot-btn-pad-x);
  font-size: var(--rot-btn-font);
  cursor:pointer;
  border: 1px solid #333;
  background: #fff;
  color:#111;
  outline: none;
  transition: background .2s ease, border-color .2s ease, transform .06s ease;
}
.rotularte-editor-page :is(.orientation-btn, .frame-btn):hover{
  background:#f4f4f4;
}
.rotularte-editor-page :is(.orientation-btn, .frame-btn):focus-visible{
  outline: 2px solid #888;
  outline-offset: 2px;
}
/* Orientación: activo negro / inactivo blanco */
.rotularte-editor-page .orientation-btn.active{
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: none;
}

/* Colores de marco */
.rotularte-editor-page .frame-btn[data-frame="white"]{ background:#fff; color:#333; }
.rotularte-editor-page .frame-btn[data-frame="black"]{ background:#000; color:#fff; }
.rotularte-editor-page .frame-btn[data-frame="wood"]{ background:#D8B58A; color:#3a2d1b; }

/* Aire extra entre marco y “Diseños” */
.rot-sidebar .frame-btn:last-of-type{ margin-bottom:18px; }

/* =======================
   DISEÑOS (THUMBS)
   ======================= */
.rot-layouts{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}

.rot-layout-thumb{
  width:120px;
  height:120px;
  border-radius:4px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border: 1px solid #333;
  outline: none;
  transition: background .2s ease, border-color .2s ease, transform .06s ease;
}
.rot-layout-thumb:hover{
  background:#f4f4f4;
}
.rot-layout-thumb:focus-visible{
  outline: 2px solid #888;
  outline-offset: 2px;
}
.rot-layout-thumb.active{
  background: #111;
  border-color: #111;
  box-shadow: none;
}
.rot-layout-thumb.active .rot-layout-icon{
  filter: brightness(0) invert(1);
}

.rot-layout-icon{
  display:block;
  width:110px;
  height:110px;
  object-fit:contain;
  pointer-events:none;
}

/* =======================
   CANVAS
   ======================= */
.rot-main{ text-align:center; }

.rotularte-canvas-wrapper{
  --rot-aspect: 1 / 1;

  position:relative;
  width:650px;
  max-width:100%;
  height:auto;
  aspect-ratio: var(--rot-aspect);

  margin: 0 auto;
  border-radius:0;
  overflow:hidden;

  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  background:#e4e4e4;
}

.rotularte-editor-page svg{
  display:block;
  width:100%;
  height:100%;
}

/* Overlay / Loading */
.rotularte-overlay,
.rotularte-loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.75);
  color:#fff;
  font-size:16px;
  cursor:pointer;
  z-index:10;
}
.rotularte-loading{
  background: rgba(0,0,0,0.9);
  font-size:18px;
  z-index:11;
}
.rotularte-overlay span{
  background: rgba(0,0,0,0.8);
  padding: 14px 24px;
  border-radius: 50px;
}

/* =======================
   CONTROLES (debajo del cuadro)
   ======================= */
.rotularte-controls{
  margin-top:16px;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  width:100%;
  margin-left:auto;
  margin-right:auto;
}

/* Header actions (Guardar / Carrito) */
.rotularte-editor-header .rot-btn{
  font-size:15px !important;
  padding: 8px 16px !important;
  border-radius: var(--rot-pill) !important;
  line-height:1.3 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* Debajo del cuadro (- + Quitar) */
.rotularte-editor-page .rotularte-controls .rot-btn{
  font-size:13px !important;
  padding: 4px 10px !important;
  border-radius: var(--rot-pill) !important;
  line-height:1.2 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.rotularte-editor-page .rotularte-controls .rot-btn.small{
  min-width:28px;
  height:28px;
  padding:0 !important;
}

/* =======================
   DPI Badge + tooltip
   ======================= */
.rot-dpi-badge{
  position:absolute;
  width:28px;
  height:28px;
  border-radius:50%;
  background:#d32f2f;
  border:none;
  padding:0;
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:20;
  box-shadow:0 8px 18px rgba(0,0,0,0.35);
}
.rot-dpi-badge span{
  color:#fff;
  font-weight:900;
  font-size:18px;
  line-height:1;
  transform: translateY(-1px);
}

#dpi-warning.rotularte-warning{
  position:absolute;
  left:0; top:0;

  width:min(320px, 85%);
  max-width:320px;

  background:#fff;
  color:#333;
  padding:10px 12px;
  border-radius:10px;

  box-shadow:0 12px 30px rgba(0,0,0,0.35);
  z-index:21;

  display:none;
  cursor:default;
}

#dpi-warning.rotularte-warning span{
  position:static;
  transform:none;
  background:none;
  color:#333;
  padding:0;
  border-radius:0;
  max-width:none;
  text-align:left;
  font-weight:600;
  font-size:13px;
  box-shadow:none;
  display:block;
}

/* flechita tooltip (en polaroid la apagamos más abajo) */
#dpi-warning.rotularte-warning::before{
  content:"";
  position:absolute;
  left:-8px;
  top:12px;
  width:0; height:0;
  border-top:8px solid transparent;
  border-bottom:8px solid transparent;
  border-right:8px solid #fff;
}

/* =======================
   FOCUS / BLINDAJE
   ======================= */
.rotularte-editor-page :is(button, a, input, [role="button"]):focus{ outline:none; }
.rotularte-editor-page :is(button, a, input, [role="button"]):focus-visible{
  outline: 2px solid var(--rot-focus);
  outline-offset: 2px;
}

/* Slots activos en SVG */
#active-outline{
  stroke:#9e9e9e !important;
  stroke-width:2 !important;
  opacity:.9 !important;
  vector-effect:non-scaling-stroke;
  stroke-linejoin:round;
}

/* =======================
   Botón en espera (Agregar al carrito / Guardar)
   ======================= */
@keyframes rotularteSpin{ to{ transform: rotate(360deg);} }

.rot-btn.rot-is-loading{
  position:relative;
  pointer-events:none;
}
.rot-btn.rot-is-loading .rot-btn-icon{ opacity:0; }
.rot-btn.rot-is-loading::after{
  content:"";
  position:absolute;
  top:50%; left:50%;
  width:18px; height:18px;
  margin-left:-9px; margin-top:-9px;
  border:2px solid currentColor;
  border-top-color:transparent;
  border-radius:50%;
  animation: rotularteSpin .8s linear infinite;
}

/* =========================================================
   TOOLBAR "PASTILLA" (unificada)
   ========================================================= */
#rot-photo-tools{
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  gap:8px;
  padding:10px 12px;
  border-radius: var(--rot-pill);
  background: rgba(245,245,245,0.95);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
  user-select:none;
  max-width:100%;
  margin: 14px auto 0;
  justify-content:center;
}

#rot-photo-tools .rot-tb-sep{
  width:1px;
  height:24px;
  background: rgba(0,0,0,0.18);
  display:inline-block;
  margin:0 2px;
}

#rot-photo-tools .rot-tb-btn{
  border:0;
  border-radius: var(--rot-pill);
  padding:10px 12px;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  color:#2a2a2a;
  background: transparent;
  transition: background .15s ease, transform .06s ease, opacity .15s ease;
}
#rot-photo-tools .rot-tb-btn:hover{ background: rgba(0,0,0,0.08); }
#rot-photo-tools .rot-tb-btn:active{ transform: translateY(1px); }
#rot-photo-tools .rot-tb-btn.is-active{ background: rgba(0,0,0,0.12); }

#rot-photo-tools .rot-tb-round{
  width:40px;
  height:40px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}
#rot-photo-tools .rot-tb-icon{
  font-size:24px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

#rot-photo-tools .rot-tb-danger{ background: rgba(0,0,0,0.06); }
#rot-photo-tools .rot-tb-danger:hover{ background: rgba(0,0,0,0.12); }

/* Mobile: toolbar puede wrappear sin generar scroll lateral */
@media (max-width:700px){
  #rot-photo-tools{
    flex-wrap:wrap;
    justify-content:center;
    max-width: calc(100vw - 24px);
    gap:6px;
    padding:10px 10px;
  }
  #rot-photo-tools .rot-tb-sep{ display:none; }
  #rot-photo-tools .rot-tb-btn{ padding:8px 10px; font-size:13px; }
  #rot-photo-tools .rot-tb-round{ width:36px; height:36px; font-size:18px; }
}

/* =========================================================
   POLAROID EDITOR
   ========================================================= */
.rotularte-editor-polaroid #rot-pol-preview{
  width:100%;
  height:100%;
  display:block;
}

.rotularte-editor-polaroid .rot-pol-progress{
  margin: 8px 0 10px;
  font-size:13px;
  color:#444;
  text-align:center;
}

/* Contenedor miniaturas: desktop -> grid + scroll vertical (consolidado) */
@media (min-width:901px){
  .rotularte-editor-polaroid :is(.rot-pol-carousel, #rot-pol-carousel){
    display:grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

    /* v36: más aire */
    gap:18px !important;
    row-gap:18px !important;
    column-gap:18px !important;
    padding:14px !important;

    align-content:start !important;

    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch !important;

    max-height: min(72vh, 640px) !important;

    border:1px solid #e6e6e6;
    border-radius:14px;
    background:#fff;
    box-shadow:0 10px 24px rgba(0,0,0,0.10);
  }

  .rotularte-editor-polaroid :is(.rot-pol-carousel, #rot-pol-carousel) > *{
    position:relative !important;
    float:none !important;
    clear:none !important;
    margin:0 !important;
  }
}

/* Slot SIEMPRE cuadrado (mata “barras”) */
.rotularte-editor-polaroid :is(.rot-pol-slot, button.rot-pol-slot, a.rot-pol-slot, input.rot-pol-slot){
  -webkit-appearance:none !important;
  appearance:none !important;

  display:block !important;
  width:100% !important;

  height:auto !important;
  min-height: 92px !important;
  aspect-ratio: 1 / 1 !important;

  padding:6px !important;
  margin:0 !important;

  border-radius:12px !important;
  border:1px solid #ddd !important;
  background:#fff !important;

  cursor:pointer;
  position:relative !important;
  overflow:hidden !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  box-sizing:border-box !important;

  top:auto !important; right:auto !important; bottom:auto !important; left:auto !important;
  transform:none !important;
}

.rotularte-editor-polaroid .rot-pol-slot.is-active{
  border-color:#A0A0A0;
  box-shadow: 0 0 0 2px #BDBDBD;
}

.rotularte-editor-polaroid .rot-pol-slot .rot-pol-num{
  position:absolute;
  top:6px;
  left:6px;
  font-size:11px;
  background: rgba(0,0,0,0.55);
  color:#fff;
  padding: 1px 6px;
  border-radius: 999px;
  z-index:3 !important;
}

.rotularte-editor-polaroid .rot-pol-slot .rot-pol-thumb{
  position:absolute !important;
  inset:6px !important;
  border-radius:6px !important;
  background:#f2f2f2 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
}

.rotularte-editor-polaroid .rot-pol-slot .rot-pol-thumb img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  display:block !important;
}

/* Scrollbar (webkits) */
.rotularte-editor-polaroid .rot-pol-carousel::-webkit-scrollbar{ width:8px; }
.rotularte-editor-polaroid .rot-pol-carousel::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.12);
  border-radius: var(--rot-pill);
}
.rotularte-editor-polaroid .rot-pol-carousel::-webkit-scrollbar-track{ background: transparent; }

.rotularte-editor-polaroid .rot-pol-upload{
  width:100%;
  margin-top:10px;
}

/* Polaroid: si usa #rot-photo-tools, aseguramos NO FIXED */
.rotularte-editor-polaroid #rot-photo-tools{
  position: static !important;
  left:auto !important;
  right:auto !important;
  top:auto !important;
  bottom:auto !important;
  transform:none !important;

  width: fit-content;
  margin: 14px auto 0 !important;
  overflow: visible !important;
}

/* Polaroid: tooltip sin flechita */
.rot-mode-polaroid #dpi-warning.rotularte-warning::before{ display:none !important; }

/* =======================
   RESPONSIVE GENERALES
   ======================= */
@media (max-width:960px){
  .rotularte-editor-body{ grid-template-columns: 1fr; }

  .rotularte-canvas-wrapper{
    width:100%;
    max-width:500px;
    height:auto;
    aspect-ratio: var(--rot-aspect);
  }
}

@media (max-width:600px){
  .rotularte-editor-header{
    grid-template-columns: 1fr;
    row-gap:8px;
    text-align:center;
  }
  .rot-header-left,
  .rot-header-right{ justify-self:center; }

  .rot-header-center{
    justify-self:center;
    width:100%;
    max-width: calc(100vw - 24px);
  }
  .rot-header-center .rot-product-title,
  .rot-header-center .rot-product-meta{
    margin-left:auto;
    margin-right:auto;
    text-align:center;
    white-space: nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
  }
  .rot-header-center .rot-product-title{ line-height:1.2; }
  .rot-header-center .rot-product-meta{
    font-size:12px;
    line-height:1.2;
  }
}

/* MOBILE (<=900): header full-bleed + body compacto + sin overflow lateral */
@media (max-width:900px){
  html, body{ overflow-x:hidden; }

  .rotularte-editor-page{
    max-width:none;
    margin:0;
    padding:0;
  }

  /* CENEFA full-bleed real */
  .rotularte-editor-header{
    width:100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    border-radius:0 !important;
    box-sizing:border-box !important;

    overflow: visible !important;
    padding: 6px 10px;

    padding-left: calc(10px + env(safe-area-inset-left)) !important;
    padding-right: calc(10px + env(safe-area-inset-right)) !important;

    display:grid;
    grid-template-columns: auto 1fr auto;
    align-items:center;
    column-gap:8px;
  }

  .rot-header-left{ justify-self:flex-start; }
  .rot-header-right{ justify-self:flex-end; gap:8px; }
  .rot-header-center{ text-align:center; min-width:0; }

  .rot-back-text{ display:none; }
  .rot-back-link{
    padding:0 !important;
    border:none !important;
    background:none !important;
    box-shadow:none !important;
  }
  .rot-back-icon{
    position:relative;
    display:inline-flex;
    width:30px;
    height:30px;
    font-size:0;
  }
  .rot-back-icon::before{
    content:"";
    display:block;
    width:100%;
    height:100%;
    background-image: url('imagenes/flecha.svg');
    background-repeat:no-repeat;
    background-position:center;
    background-size:contain;
  }

  /* Header actions icon-only */
  .rot-header-right .rot-btn,
  .rot-header-right .rot-btn.primary,
  .rot-header-right .rot-btn.ghost{
    background:none !important;
    border:none !important;
    box-shadow:none !important;
    padding:0 !important;
    min-width:auto;
  }
  .rot-header-right .rot-btn-text{ display:none; }
  .rot-header-right .rot-btn-icon{ margin:0; }
  .rot-header-right .rot-btn-icon img{ width:30px; height:30px; }

  .rot-product-title{
    display:block !important;
    font-size:13px;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    margin:0;
  }
  .rot-product-meta{
    display:block !important;
    font-size:12px;
    font-weight:400;
    margin:0;
  }

  .rotularte-editor-body{
    padding: 0 12px 16px;
    margin-top:8px;
    grid-template-columns:1fr;
    gap:12px;
  }

  /* Orden: canvas arriba, sidebar abajo */
  .rot-main,
  .rot-editor-main{ order:1; }
  .rot-sidebar,
  .rot-editor-sidebar{ order:2; }

  /* Thumbs: 3 columnas en mobile */
  .rot-layouts{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items:center;
    justify-content:center;
    gap:8px;
    margin: 0 auto;
  }
  .rot-layout-thumb{ width:80px; height:80px; }
  .rot-layout-icon{ width:70px; height:70px; }

  /* NO POLAROID: evitar “corrimiento” (no 100vw), centrar main */
  .rotularte-editor-page:not(.rotularte-editor-polaroid) :is(.rot-main, .rot-editor-main){
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    width:100% !important;
  }
  .rotularte-editor-page:not(.rotularte-editor-polaroid) .rotularte-canvas-wrapper{
    width:100% !important;
    max-width: min(520px, 100%) !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
  .rotularte-editor-page:not(.rotularte-editor-polaroid) #rot-photo-tools,
  .rotularte-editor-page:not(.rotularte-editor-polaroid) .rotularte-controls{
    width:100% !important;
    max-width: min(560px, 100%) !important;
    margin-left:auto !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
  }

  /* POLAROID mobile: fila con scroll horizontal 
  .rotularte-editor-polaroid :is(.rot-pol-carousel, #rot-pol-carousel){
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    max-height:none !important;
    -webkit-overflow-scrolling:touch;
  }*/
  .rotularte-editor-polaroid .rot-pol-slot{
    flex: 0 0 72px !important;
    width:72px !important;
    aspect-ratio: 1 / 1 !important;
    min-height: 72px !important;
  }

  /* Toolbar en mobile: misma pastilla, NO fixed */
  #rot-photo-tools{
    width: min(560px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    position: static !important;
    margin: 16px auto 0 !important;
    padding: 10px 12px !important;
    border-radius: var(--rot-pill) !important;
  }
}

/* Mobile extra chico */
@media (max-width:520px){
  #rot-photo-tools{
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    padding: 8px 10px !important;
    gap:6px !important;
  }
  #rot-photo-tools .rot-tb-btn{ padding:7px 9px !important; }
  #rot-photo-tools .rot-tb-round{ width:34px !important; height:34px !important; }
  #rot-photo-tools .rot-tb-icon{ font-size:22px !important; }
}
/* POLAROID mobile: 1 fila con scroll (SIN irse de caja) */
@media (max-width:900px){

  /* clave: si el carrusel es flex dentro de un grid, hay que permitir que “shrinkee” */
  .rotularte-editor-polaroid .rot-sidebar{ min-width:0 !important; }
  .rotularte-editor-polaroid .rotularte-editor-body{ grid-template-columns:1fr !important; }

  #rot-pol-carousel{
    min-width:0 !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;

    display:flex;              /* NO !important */
    flex-wrap:nowrap !important;
    gap:12px !important;

    padding:0 !important;
    margin:12px 0 0 !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
  }

  #rot-pol-carousel .rot-pol-slot{
    flex:0 0 76px !important;
    width:76px !important;
    min-height:76px !important;
    aspect-ratio:1/1 !important;
    margin:0 !important;
  }

  }/* === Info (i) + Modal ayuda === */
.rot-sidebar-top{
  display:flex;
  justify-content:flex-end;
  margin: 2px 0 10px;
}
.rot-info-btn{
  width:28px;height:28px;
  border:1px solid rgba(0,0,0,.18);
  background:#fff;
  border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
  padding:0;
}
.rot-info-btn:hover{background:#f7f7f7}
.rot-info-btn:focus{outline:2px solid rgba(0,0,0,.35); outline-offset:2px}

.rot-info-btn__icon{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-weight:700;
  font-size:14px;
  line-height:1;
  transform: translateY(-.5px);
}

/* overlay */
.rot-help-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:99990;
}

.rot-help-overlay[hidden],
.rot-help-modal[hidden]{
  display:none !important;
}

/* modal */
.rot-help-modal{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  padding:16px;
  z-index:99991;
}
.rot-help-modal__box{
  width:min(560px, 100%);
  max-height:min(80vh, 720px);
  overflow:auto;
  background:#fff;
  border-radius:14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border:1px solid rgba(0,0,0,.12);
}
.rot-help-modal__head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px;
  padding:14px 16px 10px;
  border-bottom:1px solid rgba(0,0,0,.08);
}
.rot-help-modal__title{
  margin:0;
  font-size:16px;
  line-height:1.2;
}
.rot-help-modal__close{
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:22px;
  line-height:1;
  padding:2px 8px;
}
.rot-help-modal__body{
  padding:12px 16px 6px;
  font-size:14px;
  line-height:1.45;
}
.rot-help-modal__body ul{margin:10px 0 10px 18px}
.rot-help-note{opacity:.85; margin:10px 0 0}

.rot-help-modal__foot{
  padding:10px 16px 14px;
  display:flex; justify-content:flex-end;
  border-top:1px solid rgba(0,0,0,.08);
}

/* Mobile */
@media (max-width: 600px){
  .rot-help-modal{padding:10px}
  .rot-help-modal__box{max-height: 86vh}
}



/* Rot Help - compact black override (strong reset)
   Objetivo: que NO herede el verde/size de estilos globales del tema.
*/

#rotularte-editor .rot-sidebar-top{
  display:flex;
  justify-content:flex-end;
  margin: 2px 0 10px;
}

/* Trigger: círculo negro + texto “+ INFO” afuera (sin pastilla) */
#rotularte-editor .rot-sidebar-top .rot-info-btn{
  -webkit-appearance:none!important;
  appearance:none!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
  margin:0!important;
  box-shadow:none!important;
  text-decoration:none!important;
  font: inherit!important;
  color:#111!important;

  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  cursor:pointer!important;
}

#rotularte-editor .rot-sidebar-top .rot-info-btn:focus{
  outline:2px solid rgba(0,0,0,.35)!important;
  outline-offset:2px!important;
}

#rotularte-editor .rot-sidebar-top .rot-info-btn__icon{
  width:24px!important;
  height:24px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:999px!important;
  background:#111!important;
  color:#fff!important;
  font-weight:800!important;
  font-size:13px!important;
  line-height:1!important;
  transform: translateY(-.5px)!important;
}

#rotularte-editor .rot-sidebar-top .rot-info-btn__label{
  font-size:11px!important;
  font-weight:700!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
  color:#111!important;
}

/* Modal: botones chicos, negros, sin estilo del tema */
#rotularte-editor .rot-help-modal__close{
  -webkit-appearance:none!important;
  appearance:none!important;
  width:26px!important;
  height:26px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-radius:999px!important;
  background:#111!important;
  color:#fff!important;
  box-shadow:none!important;
  padding:0!important;
  margin:0!important;
  cursor:pointer!important;
  font-size:18px!important;
  line-height:1!important;
}

#rotularte-editor .rot-help-modal__ok{
  -webkit-appearance:none!important;
  appearance:none!important;
  height:30px!important;
  padding:0 14px!important;
  border-radius:999px!important;
  border:1px solid rgba(0,0,0,.85)!important;
  background:transparent!important;
  color:#111!important;
  cursor:pointer!important;
  box-shadow:none!important;
  font-size:12px!important;
  font-weight:700!important;
  letter-spacing:.02em!important;
}

#rotularte-editor .rot-help-modal__ok:hover{
  background:rgba(0,0,0,.05)!important;
}

/* =========================================================
   ROT HELP (i) — UI compacta NEGRA (fuera de media queries)
   ========================================================= */

/* Contenedor arriba de la sidebar */
.rotularte-editor-page .rot-sidebar-top{
  display:flex;
  justify-content:flex-start; /* si lo querés a la izquierda */
  /* si lo querés a la derecha: justify-content:flex-end; */
  margin: 4px 0 10px;
}

/* Botón: reset fuerte para que NO herede verde/tamaños del theme */
.rotularte-editor-page .rot-info-btn{
  all: unset;                 /* mata estilos del theme */
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* Círculo negro con la i */
.rotularte-editor-page .rot-info-btn__icon{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
}

/* Texto “+ INFO” afuera del círculo */
.rotularte-editor-page .rot-info-btn__label{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #111;
}

/* Focus prolijo */
.rotularte-editor-page .rot-info-btn:focus-visible{
  outline: 2px solid rgba(0,0,0,.35);
  outline-offset: 2px;
  border-radius: 999px;
}

/* ===== Modal: X chica negra ===== */
.rotularte-editor-page .rot-help-modal__close{
  all: unset;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

/* ===== Modal: botón Listo chico negro (outline) ===== */
.rotularte-editor-page .rot-help-modal__ok{
  all: unset;
  box-sizing: border-box;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.85);
  color: #111;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.rotularte-editor-page .rot-help-modal__ok:hover{
  background: rgba(0,0,0,.06);
}

/* =========================================================
   CART CONFIRM — mismo look que +INFO (negro, compacto)
   ========================================================= */

.rotularte-editor-page .rot-cart-confirm__title{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  font-size:16px;
  line-height:1.2;
}

.rotularte-editor-page .rot-cart-confirm__icon{
  width:22px;
  height:22px;
  border-radius:999px;
  background:#111;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:12px;
  line-height:1;
}

.rotularte-editor-page .rot-cart-confirm__actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

.rotularte-editor-page .rot-cart-confirm__btn{
  all: unset;
  box-sizing: border-box;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.rotularte-editor-page .rot-cart-confirm__btn--cancel{
  border: 1px solid rgba(0,0,0,.35);
  color:#111;
  background: transparent;
}
.rotularte-editor-page .rot-cart-confirm__btn--cancel:hover{
  background: rgba(0,0,0,.06);
}

.rotularte-editor-page .rot-cart-confirm__btn--ok{
  border: 1px solid rgba(0,0,0,.85);
  color:#fff;
  background:#111;
}
.rotularte-editor-page .rot-cart-confirm__btn--ok:hover{
  filter: brightness(0.95);
}

.rotularte-editor-page .rot-cart-confirm__actions{ gap: 10px; }

/* Separar acciones: Cancelar a la izquierda, OK a la derecha */
.rotularte-editor-page .rot-cart-confirm__actions{
  display:flex;
  align-items:center;
  gap: 0; /* opcional: lo anulamos */
}

.rotularte-editor-page .rot-cart-confirm__btn--cancel{
  margin-right: auto; /* empuja el OK hacia la derecha */
}

/* opcional: un poquito de aire general */
.rotularte-editor-page .rot-cart-confirm__btn{
  margin: 0;
}

/* =========================================================
   CART CONFIRM (modal) — fuerza estilo aunque el modal esté en <body>
   ========================================================= */
.rot-help-modal.rotularte-ui .rot-cart-confirm__actions{
  display:flex !important;
  align-items:center !important;
  width:100% !important;
  gap:12px !important;
  justify-content:flex-end !important;
}

.rot-help-modal.rotularte-ui .rot-cart-confirm__btn{
  all: unset !important;
  box-sizing: border-box !important;

  height: 34px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;

  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;

  line-height: 1 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* Cancelar a la izquierda */
.rot-help-modal.rotularte-ui .rot-cart-confirm__btn--cancel{
  margin-right: auto !important; /* empuja el OK a la derecha */
  border: 1px solid rgba(0,0,0,.35) !important;
  color:#111 !important;
  background: transparent !important;
}
.rot-help-modal.rotularte-ui .rot-cart-confirm__btn--cancel:hover{
  background: rgba(0,0,0,.06) !important;
}

/* OK negro */
.rot-help-modal.rotularte-ui .rot-cart-confirm__btn--ok{
  border: 1px solid rgba(0,0,0,.85) !important;
  color:#fff !important;
  background:#111 !important;
}
.rot-help-modal.rotularte-ui .rot-cart-confirm__btn--ok:hover{
  filter: brightness(0.95) !important;
}

/* =======================
   EDITOR FOTO 10×15
   ======================= */

/* Todos los botones del editor responden de inmediato en iOS (sin delay de doble-tap) */
.rotularte-editor-foto10x15 button{
  touch-action: manipulation;
}

/* Canvas wrapper: aspect-ratio y max-width controlados por JS según orientación del slot */
.rotularte-editor-foto10x15 .rot-ft-canvas-wrapper{
  position: relative;
  width: 100%;
  max-width: 320px;      /* JS sobreescribe dinámicamente */
  aspect-ratio: 10 / 15; /* valor inicial; JS lo sobreescribe */
  margin: 0 auto;
  background: #fff;      /* blanco = mismo que el fill del canvas; evita gris visible */
  border: 1px solid #ddd;
  overflow: visible;
  /* Sin transition: getBoundingClientRect() daría dimensiones intermedias y el canvas quedaría mal dimensionado */
}
.rotularte-editor-foto10x15 .rot-dpi-badge{ top:8px; left:8px; }

.rotularte-editor-foto10x15 .rot-ft-preview-canvas{
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

.rotularte-editor-foto10x15 .rot-ft-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(248,248,248,0.92);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  letter-spacing: 0.01em;
}

/* Drop-zone dashed border */
.rotularte-editor-foto10x15 .rot-ft-overlay::before{
  content: '';
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(0,0,0,0.18);
  border-radius: 4px;
  pointer-events: none;
}

.rotularte-editor-foto10x15 .rot-ft-overlay .rot-ft-overlay-icon{
  width: 52px;
  height: 52px;
  opacity: 0.55;
  pointer-events: none;
  position: relative; /* above the ::before dashed border */
  z-index: 1;
}

.rotularte-editor-foto10x15 .rot-ft-overlay span{
  position: relative;
  z-index: 1;
  background: #444;
  color: #fff;
  padding: 8px 22px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}


/* Sidebar options: finish + paper buttons compactos */
.rotularte-editor-foto10x15 .rot-ft-finish-btn,
.rotularte-editor-foto10x15 .rot-ft-paper-btn{
  font-size: 13px !important;
  padding: 5px 12px !important;
  background: #fff;
  color: #111;
  border: 1px solid #333 !important;
  outline: none;
}

/* Orientation bar */
.rotularte-editor-foto10x15 .rot-ft-orientation-bar{
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.rotularte-editor-foto10x15 .rot-ft-orient-btn{
  font-size: 13px !important;
  padding: 4px 10px !important;
  min-width: 76px;
  background: #fff;
  color: #111;
  border: 1px solid #333 !important;
  outline: none;
}

.rotularte-editor-foto10x15 .rot-ft-orient-btn.active{
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

/* Navigation */
.rotularte-editor-foto10x15 .rot-ft-nav{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.rotularte-editor-foto10x15 .rot-ft-nav .rot-btn{
  width: 28px;
  height: 28px;
  padding: 0 !important;
  font-size: 18px !important;
  min-width: unset !important;
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #333 !important;
  border-radius: 50% !important;
  outline: none !important;
  box-shadow: none !important;
}
.rotularte-editor-foto10x15 .rot-ft-nav .rot-btn:focus,
.rotularte-editor-foto10x15 .rot-ft-nav .rot-btn:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}

.rotularte-editor-foto10x15 .rot-ft-counter{
  min-width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Contiene el overlay de carga dentro del área principal */
.rotularte-editor-foto10x15 .rot-ft-main{
  position: relative;
}

/* Photo tools: no fixed positioning */
.rotularte-editor-foto10x15 #rot-photo-tools{
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: fit-content;
  margin: 14px auto 0 !important;
  overflow: visible !important;
}

/* Thumbnail grid */
.rot-ft-thumbs-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 5px;
  margin-top: 6px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}
.rot-ft-thumbs-grid::-webkit-scrollbar{ width: 4px; }
.rot-ft-thumbs-grid::-webkit-scrollbar-thumb{ background: #ccc; border-radius: 2px; }
.rot-ft-thumbs-grid::-webkit-scrollbar-track{ background: transparent; }

.rot-ft-thumb{
  aspect-ratio: 1 / 1;
  background: #f2f2f2;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #888;
  transition: border-color .15s;
}

.rot-ft-thumb:hover{ border-color: #999; }
.rot-ft-thumb.active{ border-color: #111; }
.rot-ft-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }


/* Finish and paper buttons — activo: negro / inactivo: blanco + borde */
.rotularte-editor-foto10x15 .rot-ft-finish-btn.active,
.rotularte-editor-foto10x15 .rot-ft-paper-btn.active{
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

/* Sidebar: spacing between sections */
.rotularte-editor-foto10x15 .rot-sidebar{
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Mobile adjustments */
@media (max-width: 960px){
  .rotularte-editor-foto10x15 .rotularte-editor-body{
    grid-template-columns: 1fr !important;
  }

  /* Sidebar arriba, canvas abajo.
     Ambos en order:0 → DOM order aplica (sidebar primero, main segundo).
     Evita el bug de hit-testing de iOS con valores de order distintos. */
  .rotularte-editor-foto10x15 .rot-sidebar { order: 0 !important; min-width: 0 !important; }
  .rotularte-editor-foto10x15 .rot-ft-main { order: 0 !important; }

  /* Thumbnails: tira horizontal scrollable en mobile */
  .rotularte-editor-foto10x15 .rot-ft-thumbs-grid{
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    max-height: none !important;
    height: 72px;
    gap: 5px;
    padding-bottom: 2px;
  }
  .rotularte-editor-foto10x15 .rot-ft-thumbs-grid .rot-ft-thumb{
    flex: 0 0 auto;
    height: 100%;
    width: auto;
    min-width: 40px;
  }

  /* max-width del wrapper controlado exclusivamente por JS (wrapper.style.maxWidth = 'none') */

  /* Guardar: solo para usuarios registrados en desktop */
  .rot-save-btn,
  #rotularte-save { display: none !important; }
}

/* =======================
   FOTO 13×18 — hereda todos los estilos de foto10x15 con selector paralelo
   Solo se sobreescribe lo que difiere (aspect-ratio y max-width iniciales).
   ======================= */

.rotularte-editor-foto13x18 button{ touch-action: manipulation; }

.rotularte-editor-foto13x18 .rot-ft-canvas-wrapper{
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 18 / 13; /* landscape: 18cm × 13cm */
  margin: 0 auto;
  background: #fff;
  border: 1px solid #ddd;
  overflow: visible;
}
.rotularte-editor-foto13x18 .rot-dpi-badge{ top:8px; left:8px; }

.rotularte-editor-foto13x18 .rot-ft-preview-canvas{
  display: block; width: 100%; height: 100%; touch-action: none; cursor: default;
}

.rotularte-editor-foto13x18 .rot-ft-overlay{
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(248,248,248,0.92); cursor: pointer;
  font-size: 13px; font-weight: 500; color: #444; letter-spacing: 0.01em;
}
.rotularte-editor-foto13x18 .rot-ft-overlay::before{
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed rgba(0,0,0,0.18); border-radius: 4px; pointer-events: none;
}
.rotularte-editor-foto13x18 .rot-ft-overlay .rot-ft-overlay-icon{
  width: 52px; height: 52px; opacity: 0.55; pointer-events: none; position: relative; z-index: 1;
}
.rotularte-editor-foto13x18 .rot-ft-overlay span{
  position: relative; z-index: 1; background: #444; color: #fff;
  padding: 8px 22px; border-radius: 22px; font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.rotularte-editor-foto13x18 .rot-ft-finish-btn,
.rotularte-editor-foto13x18 .rot-ft-paper-btn{
  font-size: 13px !important; padding: 5px 12px !important;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto13x18 .rot-ft-finish-btn.active,
.rotularte-editor-foto13x18 .rot-ft-paper-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}

.rotularte-editor-foto13x18 .rot-ft-orientation-bar{
  display: flex; gap: 8px; justify-content: center; margin-top: 10px;
}
.rotularte-editor-foto13x18 .rot-ft-orient-btn{
  font-size: 13px !important; padding: 4px 10px !important; min-width: 76px;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto13x18 .rot-ft-orient-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}

.rotularte-editor-foto13x18 .rot-ft-nav{
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 10px; font-size: 0.9rem;
}
.rotularte-editor-foto13x18 .rot-ft-nav .rot-btn{
  width: 28px; height: 28px; padding: 0 !important; font-size: 18px !important;
  min-width: unset !important; background: #fff !important; color: #111 !important;
  border: 1px solid #333 !important; border-radius: 50% !important;
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto13x18 .rot-ft-nav .rot-btn:focus,
.rotularte-editor-foto13x18 .rot-ft-nav .rot-btn:focus-visible{
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto13x18 .rot-ft-counter{
  min-width: 60px; text-align: center; font-variant-numeric: tabular-nums;
}
.rotularte-editor-foto13x18 .rot-ft-main{ position: relative; }
.rotularte-editor-foto13x18 #rot-photo-tools{
  position: static !important; left: auto !important; right: auto !important;
  top: auto !important; bottom: auto !important; transform: none !important;
  width: fit-content; margin: 14px auto 0 !important; overflow: visible !important;
}
.rotularte-editor-foto13x18 .rot-sidebar{
  display: flex; flex-direction: column; gap: 22px;
}

@media (max-width: 960px){
  .rotularte-editor-foto13x18 .rotularte-editor-body{
    grid-template-columns: 1fr !important;
  }
  .rotularte-editor-foto13x18 .rot-sidebar { order: 0 !important; min-width: 0 !important; }
  .rotularte-editor-foto13x18 .rot-ft-main { order: 0 !important; }
  .rotularte-editor-foto13x18 .rot-ft-thumbs-grid{
    display: flex !important; flex-direction: row !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; max-height: none !important;
    height: 72px; gap: 5px; padding-bottom: 2px;
  }
  .rotularte-editor-foto13x18 .rot-ft-thumbs-grid .rot-ft-thumb{
    flex: 0 0 auto; height: 100%; width: auto; min-width: 40px;
  }
}

/* =======================
   Foto 15×20 — overrides
   Celdas landscape 20×15 cm. Mismo layout que foto13x18.
   ======================= */

.rotularte-editor-foto15x20 button{ touch-action: manipulation; }

.rotularte-editor-foto15x20 .rot-ft-canvas-wrapper{
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 20 / 15; /* landscape: 20cm × 15cm */
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,0.13);
  background: #f9f9f9;
  overflow: visible;
  border-radius: 2px;
}
/* ── foto20x30 ── */
.rotularte-editor-foto20x30 .rot-ft-canvas-wrapper{
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 30 / 20; /* landscape: 30cm × 20cm */
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,0.13);
  background: #f9f9f9;
  overflow: visible;
  border-radius: 2px;
}
.rotularte-editor-foto15x20 .rot-dpi-badge{ top:8px; left:8px; }
.rotularte-editor-foto15x20 .rot-ft-preview-canvas{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
.rotularte-editor-foto15x20 .rot-ft-overlay{
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(248,248,248,0.92); cursor: pointer;
  font-size: 13px; font-weight: 500; color: #444; letter-spacing: 0.01em;
}
.rotularte-editor-foto15x20 .rot-ft-overlay::before{
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed rgba(0,0,0,0.18); border-radius: 4px; pointer-events: none;
}
.rotularte-editor-foto15x20 .rot-ft-overlay .rot-ft-overlay-icon{
  width: 52px; height: 52px; opacity: 0.55; pointer-events: none; position: relative; z-index: 1;
}
.rotularte-editor-foto15x20 .rot-ft-overlay span{
  position: relative; z-index: 1; background: #444; color: #fff;
  padding: 8px 22px; border-radius: 22px; font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.rotularte-editor-foto15x20 .rot-ft-finish-btn,
.rotularte-editor-foto15x20 .rot-ft-paper-btn{
  font-size: 13px !important; padding: 5px 12px !important;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto15x20 .rot-ft-finish-btn.active,
.rotularte-editor-foto15x20 .rot-ft-paper-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}
.rotularte-editor-foto15x20 .rot-ft-orientation-bar{
  display: flex; gap: 8px; justify-content: center; margin-top: 10px;
}
.rotularte-editor-foto15x20 .rot-ft-orient-btn{
  font-size: 13px !important; padding: 4px 10px !important; min-width: 76px;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto15x20 .rot-ft-orient-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}
.rotularte-editor-foto15x20 .rot-ft-nav{
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 10px; font-size: 0.9rem;
}
.rotularte-editor-foto15x20 .rot-ft-nav .rot-btn{
  width: 28px; height: 28px; padding: 0 !important; font-size: 18px !important;
  min-width: unset !important; background: #fff !important; color: #111 !important;
  border: 1px solid #333 !important; border-radius: 50% !important;
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto15x20 .rot-ft-nav .rot-btn:focus,
.rotularte-editor-foto15x20 .rot-ft-nav .rot-btn:focus-visible{
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto15x20 .rot-ft-counter{
  min-width: 60px; text-align: center; font-variant-numeric: tabular-nums;
}
.rotularte-editor-foto15x20 .rot-ft-main{ position: relative; }
.rotularte-editor-foto15x20 #rot-photo-tools{
  position: static !important; left: auto !important; right: auto !important;
  top: auto !important; bottom: auto !important; transform: none !important;
  width: fit-content; margin: 14px auto 0 !important; overflow: visible !important;
}
.rotularte-editor-foto15x20 .rot-sidebar{
  display: flex; flex-direction: column; gap: 22px;
}

@media (max-width: 960px){
  .rotularte-editor-foto15x20 .rotularte-editor-body{
    grid-template-columns: 1fr !important;
  }
  .rotularte-editor-foto15x20 .rot-sidebar { order: 0 !important; min-width: 0 !important; }
  .rotularte-editor-foto15x20 .rot-ft-main { order: 0 !important; }
  .rotularte-editor-foto15x20 .rot-ft-thumbs-grid{
    display: flex !important; flex-direction: row !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; max-height: none !important;
    height: 72px; gap: 5px; padding-bottom: 2px;
  }
  .rotularte-editor-foto15x20 .rot-ft-thumbs-grid .rot-ft-thumb{
    flex: 0 0 auto; height: 100%; width: auto; min-width: 40px;
  }
}

/* ════════════════════════════════════════
   FOTO 20×30
   Celdas landscape 30cm × 20cm, 2 columnas
   ════════════════════════════════════════ */
.rotularte-editor-foto20x30 .rot-dpi-badge{ top:8px; left:8px; }
.rotularte-editor-foto20x30 .rot-ft-preview-canvas{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
.rotularte-editor-foto20x30 .rot-ft-overlay{
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(248,248,248,0.92); cursor: pointer;
  font-size: 13px; font-weight: 500; color: #444; letter-spacing: 0.01em;
}
.rotularte-editor-foto20x30 .rot-ft-overlay::before{
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed rgba(0,0,0,0.18); border-radius: 4px; pointer-events: none;
}
.rotularte-editor-foto20x30 .rot-ft-overlay .rot-ft-overlay-icon{
  width: 52px; height: 52px; opacity: 0.55; pointer-events: none; position: relative; z-index: 1;
}
.rotularte-editor-foto20x30 .rot-ft-overlay span{
  position: relative; z-index: 1; background: #444; color: #fff;
  padding: 8px 22px; border-radius: 22px; font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.rotularte-editor-foto20x30 .rot-ft-finish-btn,
.rotularte-editor-foto20x30 .rot-ft-paper-btn{
  font-size: 13px !important; padding: 5px 12px !important;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto20x30 .rot-ft-finish-btn.active,
.rotularte-editor-foto20x30 .rot-ft-paper-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}
.rotularte-editor-foto20x30 .rot-ft-orientation-bar{
  display: flex; gap: 8px; justify-content: center; margin-top: 10px;
}
.rotularte-editor-foto20x30 .rot-ft-orient-btn{
  font-size: 13px !important; padding: 4px 10px !important; min-width: 76px;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto20x30 .rot-ft-orient-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}
.rotularte-editor-foto20x30 .rot-ft-nav{
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 10px; font-size: 0.9rem;
}
.rotularte-editor-foto20x30 .rot-ft-nav .rot-btn{
  width: 28px; height: 28px; padding: 0 !important; font-size: 18px !important;
  min-width: unset !important; background: #fff !important; color: #111 !important;
  border: 1px solid #333 !important; border-radius: 50% !important;
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto20x30 .rot-ft-nav .rot-btn:focus,
.rotularte-editor-foto20x30 .rot-ft-nav .rot-btn:focus-visible{
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto20x30 .rot-ft-counter{
  min-width: 60px; text-align: center; font-variant-numeric: tabular-nums;
}
.rotularte-editor-foto20x30 .rot-ft-main{ position: relative; }
.rotularte-editor-foto20x30 #rot-photo-tools{
  position: static !important; left: auto !important; right: auto !important;
  top: auto !important; bottom: auto !important; transform: none !important;
  width: fit-content; margin: 14px auto 0 !important; overflow: visible !important;
}
.rotularte-editor-foto20x30 .rot-sidebar{
  display: flex; flex-direction: column; gap: 22px;
}

@media (max-width: 960px){
  .rotularte-editor-foto20x30 .rotularte-editor-body{
    grid-template-columns: 1fr !important;
  }
  .rotularte-editor-foto20x30 .rot-sidebar { order: 0 !important; min-width: 0 !important; }
  .rotularte-editor-foto20x30 .rot-ft-main { order: 0 !important; }
  .rotularte-editor-foto20x30 .rot-ft-thumbs-grid{
    display: flex !important; flex-direction: row !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; max-height: none !important;
    height: 72px; gap: 5px; padding-bottom: 2px;
  }
  .rotularte-editor-foto20x30 .rot-ft-thumbs-grid .rot-ft-thumb{
    flex: 0 0 auto; height: 100%; width: auto; min-width: 40px;
  }
}

/* ════════════════════════════════════════
   FOTO 30×40
   Celdas portrait 30cm × 40cm, 2 columnas
   ════════════════════════════════════════ */
.rotularte-editor-foto30x40 button{ touch-action: manipulation; }

/* ── canvas-wrapper ── */
.rotularte-editor-foto30x40 .rot-ft-canvas-wrapper{
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 30 / 40; /* portrait: 30cm × 40cm */
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,0.13);
  background: #f9f9f9;
  overflow: visible;
  border-radius: 2px;
}
.rotularte-editor-foto30x40 .rot-dpi-badge{ top:8px; left:8px; }
.rotularte-editor-foto30x40 .rot-ft-preview-canvas{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
.rotularte-editor-foto30x40 .rot-ft-overlay{
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(248,248,248,0.92); cursor: pointer;
  font-size: 13px; font-weight: 500; color: #444; letter-spacing: 0.01em;
}
.rotularte-editor-foto30x40 .rot-ft-overlay::before{
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed rgba(0,0,0,0.18); border-radius: 4px; pointer-events: none;
}
.rotularte-editor-foto30x40 .rot-ft-overlay .rot-ft-overlay-icon{
  width: 52px; height: 52px; opacity: 0.55; pointer-events: none; position: relative; z-index: 1;
}
.rotularte-editor-foto30x40 .rot-ft-overlay span{
  position: relative; z-index: 1; background: #444; color: #fff;
  padding: 8px 22px; border-radius: 22px; font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.rotularte-editor-foto30x40 .rot-ft-finish-btn,
.rotularte-editor-foto30x40 .rot-ft-paper-btn{
  font-size: 13px !important; padding: 5px 12px !important;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto30x40 .rot-ft-finish-btn.active,
.rotularte-editor-foto30x40 .rot-ft-paper-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}
.rotularte-editor-foto30x40 .rot-ft-orientation-bar{
  display: flex; gap: 8px; justify-content: center; margin-top: 10px;
}
.rotularte-editor-foto30x40 .rot-ft-orient-btn{
  font-size: 13px !important; padding: 4px 10px !important; min-width: 76px;
  background: #fff; color: #111; border: 1px solid #333 !important; outline: none;
}
.rotularte-editor-foto30x40 .rot-ft-orient-btn.active{
  background: #111 !important; color: #fff !important; border-color: #111 !important;
}
.rotularte-editor-foto30x40 .rot-ft-nav{
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 10px; font-size: 0.9rem;
}
.rotularte-editor-foto30x40 .rot-ft-nav .rot-btn{
  width: 28px; height: 28px; padding: 0 !important; font-size: 18px !important;
  min-width: unset !important; background: #fff !important; color: #111 !important;
  border: 1px solid #333 !important; border-radius: 50% !important;
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto30x40 .rot-ft-nav .rot-btn:focus,
.rotularte-editor-foto30x40 .rot-ft-nav .rot-btn:focus-visible{
  outline: none !important; box-shadow: none !important;
}
.rotularte-editor-foto30x40 .rot-ft-counter{
  min-width: 60px; text-align: center; font-variant-numeric: tabular-nums;
}
.rotularte-editor-foto30x40 .rot-ft-main{ position: relative; }
.rotularte-editor-foto30x40 #rot-photo-tools{
  position: static !important; left: auto !important; right: auto !important;
  top: auto !important; bottom: auto !important; transform: none !important;
  width: fit-content; margin: 14px auto 0 !important; overflow: visible !important;
}
.rotularte-editor-foto30x40 .rot-sidebar{
  display: flex; flex-direction: column; gap: 22px;
}

@media (max-width: 960px){
  .rotularte-editor-foto30x40 .rotularte-editor-body{
    grid-template-columns: 1fr !important;
  }
  .rotularte-editor-foto30x40 .rot-sidebar { order: 0 !important; min-width: 0 !important; }
  .rotularte-editor-foto30x40 .rot-ft-main { order: 0 !important; }
  .rotularte-editor-foto30x40 .rot-ft-thumbs-grid{
    display: flex !important; flex-direction: row !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; max-height: none !important;
    height: 72px; gap: 5px; padding-bottom: 2px;
  }
  .rotularte-editor-foto30x40 .rot-ft-thumbs-grid .rot-ft-thumb{
    flex: 0 0 auto; height: 100%; width: auto; min-width: 40px;
  }
}

/* =======================
   MODO CARTEL
   ======================= */

/* Preview: el SVG ocupa el ancho disponible y mantiene su aspect ratio */
.rotularte-cartel-editor .rot-cartel-preview-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f5f5f5;
  padding: 16px;
  box-sizing: border-box;
}

.rotularte-cartel-editor .rot-cartel-preview-wrapper svg {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Campos del formulario */
.rot-cartel-field {
  margin-bottom: 18px;
}

.rot-cartel-field label {
  display: block;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin-bottom: 6px;
}

.rot-cartel-field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  text-transform: uppercase;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: #111;
  box-sizing: border-box;
}

.rot-cartel-field input[type="text"]:focus {
  outline: none;
  border-color: var(--rot-focus, #007cba);
  box-shadow: 0 0 0 2px rgba(0,124,186,0.18);
}

/* Hint text */
.rot-cartel-hint {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  font-style: italic;
  line-height: 1.4;
}

/* Mensaje de validación */
.rot-cartel-validation-msg {
  display: none;
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.4;
}

/* Mensaje "generando..." */
.rot-cartel-generating {
  display: none;
  font-size: 13px;
  color: #666;
  margin-top: 12px;
  text-align: center;
  font-style: italic;
}

/* Toggle completar datos / subir diseño */
.rot-cartel-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rot-cartel-mode-btn {
  flex: 1 1 auto;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  color: #666;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.rot-cartel-mode-btn + .rot-cartel-mode-btn {
  border-left: 1.5px solid #ccc;
}

.rot-cartel-mode-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.rot-cartel-mode-btn:hover:not(.active) {
  background: #f5f5f5;
  border-color: #888;
  color: #333;
}

/* Área de upload */
.rot-cartel-upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.rot-cartel-file-btn {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 15px !important;
  padding: 8px 16px !important;
  border-radius: 30px !important;
  border: 1.5px solid #333 !important;
  background: transparent !important;
  color: #111 !important;
  cursor: pointer;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.rot-cartel-file-btn:hover {
  background: #111 !important;
  color: #fff !important;
}

.rot-cartel-filename {
  font-size: 13px;
  color: #555;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

/* Disclaimer de requisitos para archivo propio */
.rot-cartel-upload-disclaimer {
  margin-top: 12px;
  padding: 9px 12px;
  background: #fff8e6;
  border: 1px solid #f0c040;
  border-radius: 6px;
  font-size: 11px;
  color: #7a5a00;
  line-height: 1.5;
}

.rot-cartel-upload-disclaimer strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a4000;
}

/* Responsive: en mobile el preview va arriba, form abajo */
@media (max-width: 960px) {
  .rotularte-cartel-editor .rotularte-editor-body {
    grid-template-columns: 1fr !important;
  }
  .rotularte-cartel-editor .rot-main  { order: 1; }
  .rotularte-cartel-editor .rot-sidebar { order: 2; }
}