/* Pilot only: Braco 6550 and Dogo 6502. Existing pricing and desktop form stay intact. */
@media(max-width:700px){
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__preview-actions .cp-ps__open-editor{
    display:block!important;grid-column:1/-1;min-height:52px;background:#102345;color:#fff;border-color:#102345;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"]:not(:has(.cp-ps__editor[open])) .cp-ps__preview-actions .cp-ps__quick-upload,
  body .cp-ps[data-cp-ps-editor-pilot="1"]:not(:has(.cp-ps__editor[open])) .cp-ps__preview-actions .cp-ps__quick-text{
    display:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor[open]{
    height:100dvh!important;padding-top:env(safe-area-inset-top)!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-body{
    width:100%;padding:0 12px env(safe-area-inset-bottom);gap:0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones{
    width:100%;max-width:520px;flex:none;min-height:0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker{
    margin:6px 0 2px;border:0;background:#fff;overflow:visible;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker>summary,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker .cp-ps__combine-hint{display:none!important}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker--single>.cp-ps__zone-summary{
    min-height:44px;padding:5px 8px;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker .cp-ps__tabs{
    display:flex!important;gap:7px!important;max-height:none;padding:4px 2px 8px;border:0;
    overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker .cp-ps__tabs button{
    flex:0 0 auto;width:auto;min-width:92px!important;max-width:125px;min-height:48px;padding:6px 9px!important;
    scroll-snap-align:start;text-align:center;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-hint{
    margin:2px 0 4px;font-size:11px;line-height:1.2;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-preview{
    width:100%;max-width:520px;flex:none;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview{
    width:100%;max-width:none;display:flex!important;flex-direction:column!important;
    padding:2px!important;margin:0!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__stage{
    width:min(93vw,42dvh,430px)!important;height:min(93vw,42dvh,430px)!important;
    min-height:0!important;max-height:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__quick-position{
    display:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview-actions{
    display:grid!important;grid-template-columns:1fr 1fr;gap:7px;margin:6px 0 0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview-actions .cp-ps__quick-upload,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview-actions .cp-ps__quick-text{
    display:block!important;grid-column:auto;min-height:44px;padding:7px 8px;font-size:13px;line-height:1.2;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview-actions .cp-ps__quick-text[hidden]{display:none!important}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview-actions .cp-ps__preview-clear{
    grid-column:auto;min-height:44px;padding:7px 8px;font-size:13px;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls{
    display:block;width:100%;max-width:520px;min-height:0;flex:1;
    margin-top:6px;border-top:1px solid #e4e8ee;overflow-y:auto;overscroll-behavior:contain;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__controls{
    display:block;width:100%;padding:8px 0 16px;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__surface-panel{
    padding:10px;border:0;box-shadow:none;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-title{
    margin:0 0 5px;font-size:13px;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__other-methods{
    display:contents;border:0;margin:0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__other-methods>summary{
    display:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__other-methods .cp-ps__methods{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__methods span{
    min-height:48px;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__mobile-fine{
    display:block!important;margin:8px 0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__mobile-fine>summary{
    display:list-item!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price{
    display:block;width:100%;max-width:520px;flex:none;border-top:1px solid #e4e8ee;background:#fff;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar,
  body form.cp-live-matrix .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar{
    display:flex!important;align-items:center;justify-content:space-between;gap:8px;
    margin:0!important;padding:8px 4px!important;border:0!important;box-shadow:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar strong{
    font-size:18px;
  }
}
@media(max-width:700px) and (max-height:700px){
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__stage{
    width:min(85vw,36dvh,350px)!important;height:min(85vw,36dvh,350px)!important;
  }
}

/* Keep all seven print areas in a single swipeable row, even against theme grid rules. */
@media(max-width:700px){
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker .cp-ps__tabs{
    flex-wrap:nowrap!important;grid-template-columns:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones .cp-ps__zone-picker--single .cp-ps__tabs{
    display:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview-actions .cp-ps__open-editor{
    display:none!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar>span{
    display:flex;flex:1;flex-direction:column;gap:2px;min-width:0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar small{
    display:block;color:#526580;font-size:11px;line-height:1.2;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar strong{
    display:block;line-height:1.2;white-space:nowrap;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price .cp-ps__pricebar em{
    flex:0 1 42%;font-size:11px;line-height:1.25;text-align:right;
  }
}

/* v4: one garment canvas and one compact, contextual tray. */
@media(max-width:700px){
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor[open]{
    height:var(--cp-ps-viewport-height,100dvh)!important;
    max-height:var(--cp-ps-viewport-height,100dvh)!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-body{
    display:flex!important;flex-direction:column;justify-content:stretch;min-height:0;overflow:hidden;
    padding:0 10px max(6px,env(safe-area-inset-bottom))!important;gap:0;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones{flex:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones [data-cp-ps-tab-state]{display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-zones [data-cp-ps-tab].has-personalization:after{
    content:"✓ Añadida";display:block;color:#a50950;font-size:10px;font-weight:750;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-hint{flex:none;margin:2px 0 3px!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-preview{
    display:flex;align-items:center;justify-content:center;flex:1 1 auto!important;
    min-height:108px;max-height:none;overflow:hidden;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__preview{
    display:flex!important;align-items:center;justify-content:center;height:100%!important;
    min-height:0!important;overflow:hidden!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor .cp-ps__stage{
    display:block!important;height:100%!important;width:auto!important;max-width:100%!important;
    aspect-ratio:1;min-height:0!important;max-height:100%!important;margin:auto!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-tray{
    display:flex;flex-direction:column;flex:none;width:100%;max-width:520px;
    max-height:var(--cp-ps-tray-max,210px);min-height:0;overflow:hidden;
    border-top:1px solid #e4e8ee;background:#fff;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-actions{flex:none;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-actions .cp-ps__preview-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;
    margin:7px 0 0!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-actions .cp-ps__preview-actions button{
    min-height:44px;font-size:13px;line-height:1.2;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-actions .cp-ps__preview-actions .cp-ps__open-editor,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor button[hidden]{display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"][data-cp-ps-mobile-flow="1"]:has(.cp-ps__editor[open]) .cp-ps__editor .cp-ps__preview-actions .cp-ps__open-editor{display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor [data-cp-ps-undo],
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor [data-cp-ps-contrast]{
    flex:none;min-height:44px;width:100%;margin-top:5px;padding:6px 10px;
    border:1px solid #b5165c;border-radius:10px;background:#fff;color:#a50950;font-weight:750;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls{
    flex:1 1 auto!important;min-height:0!important;max-height:none!important;width:100%;
    margin:5px 0 0!important;overflow-y:auto!important;overscroll-behavior:contain;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__controls{padding:0 0 12px!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__surface-panel{padding:4px!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-controls{display:flex;flex-direction:column;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-controls>[data-cp-ps-method-panel]{order:0;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-controls>[data-cp-ps-text-style]{order:1;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-controls>.cp-ps__other-methods{order:2;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-controls>.cp-ps__notes{order:3;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__zone-title,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__placement-help,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__size-help,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__guide-link{display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__other-methods{
    display:block!important;margin:5px 0!important;border:1px solid #dfe4ec;border-radius:10px;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__other-methods>summary{
    display:list-item!important;min-height:44px!important;padding:10px 12px!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__other-methods:not([open]) .cp-ps__methods{display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__mobile-fine{
    display:block!important;margin:5px 0!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls .cp-ps__mobile-fine>summary{
    display:list-item!important;min-height:44px!important;padding:10px 12px!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-controls textarea[data-cp-ps-text]{
    min-height:48px!important;height:54px!important;resize:vertical;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor-price{flex:none!important;}
}

/* Keep the canvas large when an on-screen keyboard takes the lower viewport. */
@media(max-width:700px){
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-zones,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-hint,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-actions,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-price,
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing [data-cp-ps-contrast],
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing [data-cp-ps-undo]{display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-body{
    padding-bottom:4px!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-tray{
    max-height:120px;overflow:hidden;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-controls{
    flex:none!important;margin:0!important;overflow-y:auto!important;
  }
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-controls .cp-ps__controls>:not(:focus-within),
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__surface-panel:focus-within>:not(:focus-within),
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__zone-controls:focus-within>:not(:focus-within),
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing [data-cp-ps-method-panel]:focus-within>:not(:focus-within),
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing [data-cp-ps-people]:focus-within>:not(:focus-within),
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing [data-cp-ps-person]:focus-within>:not(:focus-within){display:none!important;}
  body .cp-ps[data-cp-ps-editor-pilot="1"] .cp-ps__editor--typing .cp-ps__editor-controls .cp-ps__surface-panel{
    padding:0!important;border:0!important;box-shadow:none!important;
  }
}

