/* =========================================================
   РЕДАКТОР МАКЕТА (kruzhki.php, futbolki.php) и КОРЗИНА (korzina.php).
   Цвета, шрифты, рамки — токены из /assets/style.css
   ========================================================= */

/* ---------- шапка страницы ---------- */
.ed-hero{padding:10px 0 28px;}
.ed-hero-inner{display:grid;grid-template-columns:1.2fr 1fr;gap:40px;align-items:end;}
.ed-lead{max-width:560px;font-size:16px;color:var(--grey);margin:12px 0 0;}
.ed-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:2px;background:var(--black);border:2px solid var(--black);}
.ed-steps li{background:var(--paper);padding:12px 14px;font-size:14px;font-weight:600;display:flex;align-items:center;gap:10px;}
.ed-steps b{
  flex:none;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;
  background:var(--black);color:var(--yellow);font-family:var(--font-mono);font-size:13px;
}
.ed-steps li:first-child b{background:var(--yellow);color:var(--black);transform:rotate(-5deg);}

/* ---------- каркас редактора ---------- */
.ed-section{background:var(--paper-dark);padding:28px 24px 60px;}
.ed{
  max-width:1600px;margin:0 auto;background:#fff;border:2px solid var(--black);
  display:grid;
  grid-template-columns:84px 280px minmax(0,1fr) 280px;
  grid-template-rows:auto minmax(560px,auto);
  grid-template-areas:
    "top top top top"
    "tabs panel stage props";
}
.ed button{font-family:var(--font-body);}
.ed svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}

/* верхняя панель */
.ed-topbar{
  grid-area:top;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;
  padding:12px 16px;border-bottom:2px solid var(--black);
}
.ed-products{display:flex;gap:0;border:2px solid var(--black);}
.ed-product{
  background:#fff;border:none;border-right:2px solid var(--black);padding:8px 16px;cursor:pointer;
  font-family:var(--font-display) !important;font-weight:900;text-transform:uppercase;font-size:13px;color:var(--ink);
  display:flex;flex-direction:column;align-items:flex-start;line-height:1.15;
}
.ed-product:last-child{border-right:none;}
.ed-product small{font-family:var(--font-mono);font-size:12px;color:var(--grey);letter-spacing:.04em;margin-top:2px;}
.ed-product:hover{background:var(--paper);}
.ed-product.active{background:var(--black);color:var(--paper);}
.ed-product.active small{color:var(--yellow);}
.ed-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.ed-sep{width:2px;height:28px;background:var(--line);margin:0 4px;}
.ed-btn{padding:9px 14px;font-size:12px;}
.ed-btn.btn-outline{padding:7px 12px;}
.ed-full{width:100%;justify-content:center;margin-top:10px;}

.ed-icon-btn{
  width:38px;height:38px;flex:none;display:inline-flex;align-items:center;justify-content:center;
  background:#fff;border:2px solid var(--black);color:var(--black);cursor:pointer;border-radius:var(--radius);
  transition:background .15s ease;
}
.ed-icon-btn svg{width:18px;height:18px;}
.ed-icon-btn:hover:not(:disabled){background:var(--yellow);}
.ed-icon-btn:disabled{opacity:.3;cursor:default;}
.ed-icon-btn.active{background:var(--black);color:var(--yellow);}
.ed-icon-btn.ed-sm{width:30px;height:30px;border-width:0;}
.ed-icon-btn.ed-danger:hover{background:var(--black);color:var(--paper);}

/* вкладки */
.ed-tabs{grid-area:tabs;border-right:2px solid var(--black);background:var(--black);display:flex;flex-direction:column;gap:2px;}
.ed-tab{
  background:#fff;border:none;cursor:pointer;padding:14px 4px 12px;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--ink);
}
.ed-tab svg{width:24px;height:24px;}
.ed-tab:hover{background:var(--paper);}
.ed-tab.active{background:var(--yellow);}
.ed-tabs::after{content:"";flex:1;background:#fff;}

/* панели */
.ed-panel{grid-area:panel;border-right:2px solid var(--black);padding:18px 16px;overflow-y:auto;max-height:760px;}
.ed-pane{display:none;}
.ed-pane.active{display:block;}
.ed-pane-title{font-size:18px;margin-bottom:14px;}
.ed-label{
  font-family:var(--font-mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--grey);margin:16px 0 8px;
}
.ed-hint{font-size:12.5px;color:var(--grey);margin:10px 0;line-height:1.45;}
.ed-empty{font-size:13px;color:var(--grey);text-align:center;padding:20px 0;border:2px dashed var(--line);margin:8px 0 0;}

.ed-drop{
  display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;cursor:pointer;
  padding:22px 12px;border:2px dashed var(--black);background:var(--paper);transition:background .15s ease;
}
.ed-drop svg{width:28px;height:28px;}
.ed-drop b{font-size:14px;text-transform:uppercase;letter-spacing:.03em;}
.ed-drop span{font-size:12px;color:var(--grey);}
.ed-drop:hover,.ed-drop.drag{background:var(--yellow);}
.ed-drop-sm{padding:12px;}

.ed-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:12px;}
.ed-thumb{
  position:relative;aspect-ratio:1;border:2px solid var(--line);background:var(--paper) center/cover no-repeat;
  cursor:pointer;padding:0;
}
.ed-thumb:hover{border-color:var(--black);}
.ed-thumb .ed-thumb-used{
  position:absolute;left:3px;bottom:3px;background:var(--black);color:var(--yellow);
  font-family:var(--font-mono);font-size:12px;padding:1px 4px;
}
.ed-thumb .ed-thumb-del{
  position:absolute;top:0;right:0;width:20px;height:20px;border:none;background:var(--black);color:var(--paper);
  font-size:14px;line-height:1;cursor:pointer;display:none;
}
.ed-thumb:hover .ed-thumb-del,.ed-thumb:focus-within .ed-thumb-del{display:block;}
.ed-thumb.loading{background-image:none;}
.ed-thumb.loading::after{
  content:"";position:absolute;inset:35%;border:2px solid var(--black);border-top-color:transparent;
  animation:edSpin .8s linear infinite;
}
@keyframes edSpin{to{transform:rotate(360deg);}}
@media (hover:none){ .ed-thumb .ed-thumb-del{display:block;} }

.ed-text-presets{display:flex;flex-direction:column;gap:8px;}
.ed-text-preset{
  text-align:left;background:#fff;border:2px solid var(--black);padding:12px 14px;cursor:pointer;color:var(--ink);
}
.ed-text-preset:hover{background:var(--yellow);}
.ed-tp-h{font-family:var(--font-display) !important;font-weight:900;font-size:20px;text-transform:uppercase;}
.ed-tp-s{font-weight:700;font-size:16px;}
.ed-tp-b{font-size:14px;}
.ed-tp-hand{font-family:'Neucha',cursive !important;font-size:20px;}

.ed-swatches{display:grid;grid-template-columns:repeat(8,1fr);gap:4px;}
.ed-swatch{aspect-ratio:1;border:2px solid var(--line);cursor:pointer;padding:0;}
.ed-swatch:hover{border-color:var(--black);}
.ed-swatch.active{border-color:var(--black);outline:2px solid var(--yellow);outline-offset:-5px;}
.ed-swatch.ed-swatch-none{background:#fff;position:relative;overflow:hidden;}
.ed-swatch.ed-swatch-none::after{content:"";position:absolute;left:-20%;top:50%;width:140%;height:2px;background:#d64545;transform:rotate(-45deg);}
.ed-color-custom{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;margin-top:8px;cursor:pointer;}
.ed-color-custom input{width:34px;height:28px;border:2px solid var(--black);padding:0;background:#fff;cursor:pointer;}

.ed-seg{display:flex;border:2px solid var(--black);}
.ed-seg button{
  flex:1;background:#fff;border:none;border-right:2px solid var(--black);padding:8px 4px;cursor:pointer;
  font-size:12px;font-weight:700;text-transform:uppercase;color:var(--ink);
  display:inline-flex;align-items:center;justify-content:center;
}
.ed-seg button:last-child{border-right:none;}
.ed-seg button.active{background:var(--black);color:var(--yellow);}
.ed-seg button:hover:not(.active){background:var(--paper);}
.ed-seg-icons button{font-size:15px;text-transform:none;}
.ed-seg-icons svg{width:16px;height:16px;}

.ed-layers{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;}
.ed-layer{
  display:flex;align-items:center;gap:8px;border:2px solid var(--line);padding:4px 6px;cursor:pointer;background:#fff;
}
.ed-layer:hover{border-color:var(--black);}
.ed-layer.active{border-color:var(--black);background:var(--paper);}
.ed-layer-ph{
  width:36px;height:36px;flex:none;background:var(--paper) center/cover no-repeat;border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;font-family:var(--font-display);font-weight:900;font-size:16px;
}
.ed-layer-name{flex:1;min-width:0;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ed-layer-btn{width:26px;height:26px;border:none;background:none;cursor:pointer;color:var(--grey);padding:3px;flex:none;}
.ed-layer-btn svg{width:18px;height:18px;}
.ed-layer-btn:hover,.ed-layer-btn.on{color:var(--black);}
.ed-layer.hidden-obj .ed-layer-name{color:var(--grey);text-decoration:line-through;}

/* холст */
.ed-stage{
  grid-area:stage;background:var(--paper-dark);padding:28px 24px 18px;min-width:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;position:relative;
}
.ed-canvas-box{position:relative;outline:2px solid var(--black);background:var(--mug-body,#fff);}
.ed-canvas-box.drag{outline:3px dashed var(--black);outline-offset:4px;}
.ed-overlay{position:absolute;inset:0;pointer-events:none;z-index:5;}
.ed-overlay.off .ed-safe,.ed-overlay.off .ed-handle{display:none;}
.ed-safe{position:absolute;border:1.5px dashed rgba(13,13,12,.55);}
.ed-handle{
  position:absolute;top:0;bottom:0;display:none;align-items:center;justify-content:center;
  background:repeating-linear-gradient(-45deg,rgba(13,13,12,.07) 0 6px,transparent 6px 12px);
}
.ed-handle-l{left:0;border-right:1px solid rgba(13,13,12,.25);}
.ed-handle-r{right:0;border-left:1px solid rgba(13,13,12,.25);}
.ed-handle span{
  writing-mode:vertical-rl;transform:rotate(180deg);font-family:var(--font-mono);font-size:12px;
  letter-spacing:.1em;text-transform:uppercase;color:rgba(13,13,12,.55);
}
.ed-overlay.mug .ed-handle{display:flex;}
.ed-guide{position:absolute;background:var(--yellow);display:none;}
.ed-guide-v{top:0;bottom:0;left:50%;width:2px;margin-left:-1px;}
.ed-guide-h{left:0;right:0;top:50%;height:2px;margin-top:-1px;}
.ed-guide.show{display:block;}

.ed-stage-info{display:flex;gap:18px;align-items:center;flex-wrap:wrap;justify-content:center;font-size:12px;color:var(--grey);}
.ed-stage-info .mono{letter-spacing:.04em;}
.ed-toggle{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;cursor:pointer;color:var(--ink);margin-top:10px;}
.ed-stage-info .ed-toggle{margin-top:0;font-size:12px;}
.ed-toggle input{accent-color:var(--black);width:16px;height:16px;}
.ed-legend{display:flex;gap:18px;flex-wrap:wrap;justify-content:center;font-size:12px;color:var(--grey);}
.ed-legend span{display:inline-flex;align-items:center;gap:6px;}
.ed-legend i{width:18px;height:10px;display:inline-block;}
.ed-lg-safe{border:1.5px dashed var(--black);}
.ed-lg-handle{background:repeating-linear-gradient(-45deg,rgba(13,13,12,.25) 0 3px,transparent 3px 6px);border:1px solid rgba(13,13,12,.3);}
.ed-legend.no-handle .ed-lg-handle-row{display:none;}

/* свойства */
.ed-props{grid-area:props;border-left:2px solid var(--black);padding:18px 16px;overflow-y:auto;max-height:760px;}
.ed-props-empty{text-align:center;color:var(--grey);font-size:13.5px;padding-top:30px;}
.ed-props-sq{width:54px;height:54px;background:var(--black);margin:0 auto 18px;transform:rotate(-6deg);box-shadow:14px 10px 0 -4px var(--yellow);}
.ed-kbd{font-size:12px;line-height:1.7;margin-top:18px;}
.ed-props-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;}
.ed-props-head b{font-family:var(--font-display);font-weight:900;text-transform:uppercase;font-size:16px;}
.ed-group{margin-bottom:6px;}
.ed-group + .ed-group{border-top:2px solid var(--line);padding-top:6px;}
.ed-props-body[data-kind="text"] .ed-group[data-for="image"],
.ed-props-body[data-kind="image"] .ed-group[data-for="text"],
.ed-props-body[data-kind="multi"] .ed-group[data-for]{display:none;}
.ed-input{
  width:100%;border:2px solid var(--line);background:#fff;padding:8px 10px;font:inherit;font-size:14px;color:var(--ink);
  border-radius:var(--radius);
}
.ed-input:focus{outline:none;border-color:var(--black);}
textarea.ed-input{resize:vertical;min-height:64px;}
.ed-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0;}
.ed-mini{display:flex;flex-direction:column;gap:4px;font-family:var(--font-mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--grey);}
.ed-tools{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}
.ed-tools .ed-icon-btn{width:100%;height:34px;border-width:2px;}
.ed-tools .ed-icon-btn svg{width:16px;height:16px;}
.ed-range{display:flex;flex-wrap:wrap;justify-content:space-between;font-size:12.5px;font-weight:600;margin-top:12px;}
.ed-range span{font-family:var(--font-mono);color:var(--grey);}
.ed-range input{width:100%;accent-color:var(--black);margin-top:4px;}
.ed-grid2{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px;}
.ed-grid2 .btn{justify-content:center;padding:8px 6px;font-size:12px;}

.ed-quality{border:2px solid var(--black);padding:10px 12px;font-size:13px;line-height:1.4;}
.ed-quality b{display:block;font-family:var(--font-mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;margin-bottom:2px;}
.ed-quality{position:relative;padding-left:34px;}
.ed-quality::before{content:"";position:absolute;left:11px;top:13px;width:12px;height:12px;transform:rotate(-6deg);background:var(--black);}
.ed-quality.q-ok::before{background:var(--yellow);outline:2px solid var(--black);}
.ed-quality.q-bad{border-color:#d64545;}
.ed-quality.q-bad::before{background:#d64545;}
.ed-quality.q-bad b{color:#c0392b;}

/* модалка предпросмотра */
.ed-modal-overlay{
  display:none;position:fixed;inset:0;background:rgba(13,13,12,.6);z-index:200;
  align-items:center;justify-content:center;padding:20px;
}
.ed-modal-overlay.open{display:flex;}
.ed-modal{background:#fff;border:2px solid var(--black);width:100%;max-width:980px;max-height:92vh;overflow:auto;padding:28px;position:relative;}
.ed-modal h3{font-size:22px;margin-bottom:18px;}
.ed-preview{display:flex;gap:28px;flex-wrap:wrap;justify-content:center;align-items:center;background:var(--paper);padding:30px 16px;}
.ed-pv-item{display:flex;flex-direction:column;align-items:center;gap:10px;}
.ed-pv-cap{font-family:var(--font-mono);font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--grey);}

/* кружка: видна половина запечатки с каждой стороны */
.ed-mug{position:relative;width:206px;height:190px;}
.ed-mug-body{
  position:absolute;left:0;top:0;width:164px;height:190px;background-color:var(--mug-body,#fff);background-repeat:no-repeat;background-size:200% 96%;
  border:2px solid var(--black);border-radius:4px 4px 14px 14px;overflow:hidden;
}
.ed-mug-body::after{ /* объём — функциональная подсветка, не декор */
  content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(0,0,0,.18),rgba(0,0,0,0) 18%,rgba(255,255,255,.25) 35%,rgba(0,0,0,0) 55%,rgba(0,0,0,.2));
}
.ed-mug-handle{position:absolute;top:36px;width:56px;height:112px;border:14px solid var(--mug-accent,#fff);outline:2px solid var(--black);border-radius:0 40px 40px 0;}
.ed-mug.right .ed-mug-handle{left:150px;}
.ed-mug.left .ed-mug-handle{left:-6px;border-radius:40px 0 0 40px;}
.ed-mug.left .ed-mug-body{left:36px;}
.ed-mug.right .ed-mug-body{background-position:100% 50%;}
.ed-mug.left .ed-mug-body{background-position:0 50%;}
.ed-mug.front{width:164px;}
.ed-mug.front .ed-mug-body{background-position:50% 50%;}
.ed-mug-top{position:absolute;top:-8px;height:16px;width:164px;border:2px solid var(--black);border-radius:50%;background:var(--mug-accent,#fff);z-index:2;}
.ed-mug.left .ed-mug-top{left:36px;}

.ed-flat{max-width:100%;border:2px solid var(--black);background:var(--mug-body,#fff);}
.ed-flat img{width:100%;display:block;}
.ed-flat-mug{width:520px;}
.ed-pv-wide{flex-basis:100%;}
.ed-shirt{position:relative;width:340px;}
.ed-shirt svg{width:100%;display:block;fill:#fff;stroke:var(--black);stroke-width:2;}
.ed-shirt img{position:absolute;left:31%;top:20%;width:38%;}
.ed-card{width:360px;transform:rotate(-4deg);border:2px solid var(--black);background:#fff;}
.ed-card-back{width:360px;aspect-ratio:9/5;transform:rotate(5deg);background:var(--black);margin-top:-150px;margin-left:120px;position:relative;z-index:-1;}

/* всплывающее сообщение */
.ed-toast{
  position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;
  background:var(--black);color:var(--paper);padding:12px 18px;font-size:14px;font-weight:600;z-index:300;
  max-width:calc(100% - 32px);transition:opacity .2s ease,transform .2s ease;
  display:flex;align-items:center;gap:12px;
}
.ed-toast::before{content:"";width:12px;height:12px;flex:none;background:var(--yellow);transform:rotate(-6deg);}
.ed-toast.show{opacity:1;transform:translate(-50%,0);}

/* ---------- адаптив ---------- */
@media (max-width:1280px){
  .ed{
    grid-template-columns:84px 270px minmax(0,1fr);
    grid-template-areas:
      "top top top"
      "tabs panel stage"
      "tabs panel props";
    grid-template-rows:auto minmax(480px,auto) auto;
  }
  .ed-props{border-left:none;border-top:2px solid var(--black);max-height:none;}
  .ed-props-empty{display:flex;align-items:center;gap:16px;text-align:left;padding-top:0;}
  .ed-props-empty p{margin:0;}
  .ed-props-sq{width:30px;height:30px;margin:0;flex:none;box-shadow:8px 6px 0 -3px var(--yellow);}
  .ed-kbd{display:none;}
  .ed-props-body:not([hidden]){display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:0 24px;}
  .ed-props-head{grid-column:1/-1;}
  .ed-group + .ed-group{border-top:none;padding-top:0;}
}
@media (max-width:900px){
  .ed-hero-inner{grid-template-columns:1fr;gap:20px;}
}
@media (max-width:860px){
  .ed-section{padding:16px 0 40px;}
  .ed{
    border-left:none;border-right:none;
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"top" "stage" "props" "tabs" "panel";
    grid-template-rows:auto;
  }
  .ed-topbar{padding:10px 16px;}
  .ed-products{width:100%;}
  .ed-product{flex:1;padding:8px 8px;font-size:12px;}
  .ed-actions{width:100%;}
  .ed-actions .ed-btn{flex:1;justify-content:center;padding-left:6px;padding-right:6px;}
  .ed-sep{display:none;}
  .ed-stage{padding:20px 16px 14px;}
  .ed-tabs{flex-direction:row;border-right:none;border-top:2px solid var(--black);border-bottom:2px solid var(--black);}
  .ed-tabs::after{display:none;}
  .ed-tab{flex:1;padding:10px 4px;}
  .ed-panel{border-right:none;max-height:none;}
  .ed-gallery{grid-template-columns:repeat(4,1fr);}
  .ed-swatches{grid-template-columns:repeat(8,1fr);}
  .ed-props-body:not([hidden]){display:block;}
  .ed-modal{padding:20px 16px;}
  .ed-flat-mug{width:100%;}
}
@media (max-width:600px){
  .ed-steps{grid-template-columns:1fr;}
  .ed-actions .ed-icon-btn{width:34px;height:34px;}
  .ed-actions .ed-btn{font-size:12px;}
  .ed-gallery{grid-template-columns:repeat(3,1fr);}
  .ed-mug{transform:scale(.8);margin:-24px -20px;}
  .ed-card,.ed-card-back{width:260px;}
  .ed-card-back{margin-top:-110px;margin-left:60px;}
  .ed-shirt{width:280px;}
}

/* пустой макет и прозрачный фон */
.ed-empty-hint{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  text-align:center;padding:12px;color:var(--grey);font-size:13px;
}
.ed-empty-hint b{font-family:var(--font-display);font-weight:900;text-transform:uppercase;font-size:18px;color:var(--grey);}
.ed-empty-hint[hidden]{display:none;}
.ed-canvas-box.transparent{background:var(--mug-body,#fff);}
.ed-pv-item{isolation:isolate;}

/* ---------- v2: варианты кружки, «Далее», утверждение, корзина ---------- */
.ed-mugvars{display:flex;flex-wrap:wrap;gap:6px;}
.ed-mugvar{
  display:inline-flex;align-items:center;gap:8px;background:#fff;border:2px solid var(--line);
  padding:6px 10px 6px 6px;cursor:pointer;font-size:13px;font-weight:700;color:var(--ink);
}
.ed-mugvar:hover{border-color:var(--black);}
.ed-mugvar.active{border-color:var(--black);background:var(--paper);box-shadow:inset 0 -4px 0 var(--yellow);}
.ed-mugvar-ic{ /* мини-кружка: корпус + ручка цвета варианта */
  position:relative;width:22px;height:22px;flex:none;background:var(--c-body);border:2px solid var(--black);
  border-top:5px solid var(--c-acc);margin-right:6px;
}
.ed-mugvar-ic::after{content:"";position:absolute;right:-9px;top:2px;width:7px;height:10px;border:2px solid var(--black);border-left:none;background:var(--c-acc);}
.ed-next{padding:12px 22px;font-size:14px;}
.ed-next svg{width:18px;height:18px;}

.ed-side{position:absolute;top:0;bottom:0;width:22px;display:flex;align-items:center;justify-content:center;pointer-events:none;}
.ed-side-l{left:-30px;border-right:2px solid var(--grey);}
.ed-side-r{right:-30px;border-left:2px solid var(--grey);}
.ed-side span{writing-mode:vertical-rl;transform:rotate(180deg);font-family:var(--font-mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--grey);white-space:nowrap;}
.ed-stage{padding-left:48px;padding-right:48px;}
p.ed-legend{max-width:560px;text-align:center;margin:0;line-height:1.45;}

.ed-modal .eyebrow{margin-bottom:8px;}
.ed-modal h3 em{font-style:normal;background:var(--yellow);padding:0 6px;}
.ed-modal .ed-hint b{color:var(--ink);}
.ed-warn{border:2px solid #d64545;padding:10px 14px 10px 34px;position:relative;font-size:13.5px;margin-top:14px;color:#c0392b;background:#fff;}
.ed-warn[hidden]{display:none;}
.ed-approve-row{display:grid;grid-template-columns:1fr 1.3fr;gap:24px;margin-top:20px;align-items:start;}
.ed-qty{display:inline-flex;border:2px solid var(--black);}
.ed-qty button{width:42px;height:42px;border:none;background:var(--paper);font-family:var(--font-display);font-weight:900;font-size:18px;cursor:pointer;}
.ed-qty button:hover{background:var(--black);color:var(--yellow);}
.ed-qty input{width:64px;height:42px;border:none;border-left:2px solid var(--black);border-right:2px solid var(--black);text-align:center;font-family:var(--font-display);font-weight:900;font-size:16px;-moz-appearance:textfield;}
.ed-qty input::-webkit-inner-spin-button,.ed-qty input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}
.ed-price{display:flex;align-items:baseline;gap:14px;margin-top:12px;}
.ed-price span{font-size:12px;color:var(--grey);}
.ed-price b{font-family:var(--font-display);font-weight:900;font-size:28px;}
.ed-tiers{font-size:12px;color:var(--grey);margin-top:6px;line-height:1.6;}
.ed-approve{display:flex;gap:12px;align-items:flex-start;cursor:pointer;border:2px solid var(--black);padding:14px;background:var(--paper);}
.ed-approve input{width:22px;height:22px;flex:none;accent-color:var(--black);margin:2px 0 0;}
.ed-approve b{display:block;font-family:var(--font-display);font-weight:900;text-transform:uppercase;font-size:15px;margin-bottom:2px;}
.ed-approve span{font-size:13.5px;line-height:1.4;}
.ed-approve:has(input:checked){background:var(--yellow);}
.ed-approve-btns{display:flex;gap:10px;margin-top:14px;}
.ed-approve-btns .btn{flex:1;justify-content:center;}
.btn:disabled{background:var(--line);color:var(--grey);cursor:not-allowed;transform:none;}
.ed-err{color:#c0392b;font-size:13px;margin:8px 0 0;min-height:1em;}

/* корзина */
.ct{padding:10px 0 70px;}
.ct-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin-bottom:24px;flex-wrap:wrap;}
.ct-error{margin-bottom:20px;}
.ct-empty{border:2px dashed var(--black);padding:40px 20px;text-align:center;background:#fff;}
.ct-empty p{margin:0 0 16px;font-size:16px;}
.ct-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:28px;align-items:start;}
.ct-items{display:flex;flex-direction:column;gap:12px;}
.ct-item{display:grid;grid-template-columns:150px 1fr auto;gap:20px;align-items:center;background:#fff;border:2px solid var(--black);padding:16px;}
.ct-item-pic{display:flex;justify-content:center;background:var(--paper);padding:16px 0 8px;overflow:hidden;}
.ct-item-pic .ed-mug{transform:scale(.55);margin:-40px -44px -40px -46px;}
.ct-item-info h3{font-size:16px;}
.ct-item-meta{font-size:12px;color:var(--grey);margin:6px 0 8px;letter-spacing:.03em;}
.ct-ok{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;margin:0 0 6px;}
.ct-ok span{width:14px;height:14px;background:var(--yellow);border:2px solid var(--black);transform:rotate(-6deg);}
.ct-link{font-size:13px;color:var(--grey);}
.ct-link:hover{color:var(--ink);}
.ct-item-qty{display:flex;flex-direction:column;align-items:flex-end;gap:8px;}
.ct-item-qty .ed-qty button{width:34px;height:34px;font-size:15px;}
.ct-item-qty .ed-qty input{width:50px;height:34px;font-size:14px;}
.ct-item-sum{font-family:var(--font-display);font-weight:900;font-size:18px;}
.ct-remove{background:none;border:none;color:var(--grey);font-size:12.5px;text-decoration:underline;cursor:pointer;padding:0;}
.ct-remove:hover{color:#c0392b;}
.ct-checkout{background:#fff;border:2px solid var(--black);padding:22px;position:sticky;top:90px;}
.ct-title{font-size:22px;margin-bottom:6px;}
.ct-checkout .ed-label:first-of-type{margin-top:10px;}
.ct-checkout .field{margin-bottom:12px;}
.ct-checkout .field input,.ct-checkout .field textarea{
  width:100%;border:2px solid var(--line);padding:10px 12px;font:inherit;font-size:15px;background:#fff;border-radius:var(--radius);
}
.ct-checkout .field input:focus,.ct-checkout .field textarea:focus{outline:none;border-color:var(--black);}
.ct-checkout .field-row{margin-top:14px;}
.ct-radios{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;}
.ct-radio{display:flex;gap:10px;align-items:flex-start;border:2px solid var(--line);padding:10px 12px;cursor:pointer;}
.ct-radio input{accent-color:var(--black);margin-top:3px;}
.ct-radio span{font-size:12.5px;color:var(--grey);line-height:1.4;}
.ct-radio b{display:block;color:var(--ink);font-size:14px;}
.ct-radio:has(input:checked){border-color:var(--black);background:var(--paper);}
.ct-radio.disabled{opacity:.45;cursor:not-allowed;}
.ct-address[hidden]{display:none;}
.ct-sum{border-top:2px solid var(--black);margin-top:16px;padding-top:12px;}
.ct-sum-row{display:flex;justify-content:space-between;font-size:14px;padding:4px 0;}
.ct-sum-row[hidden]{display:none;}
.ct-total{display:flex;justify-content:space-between;align-items:baseline;margin-top:8px;}
.ct-total span{font-family:var(--font-mono);text-transform:uppercase;font-size:12px;letter-spacing:.08em;color:var(--grey);}
.ct-total b{font-family:var(--font-display);font-weight:900;font-size:30px;}
.ct-agree{margin-top:14px;padding:10px 12px;}
.ct-agree span{font-size:12.5px;}
.ct-submit{width:100%;justify-content:center;margin-top:12px;padding:16px;font-size:14px;}
.ct-done{padding:40px 0 80px;text-align:center;}
.ct-done .ed-lead{margin:14px auto 0;}
.ct-done-sq{width:70px;height:70px;background:var(--black);margin:0 auto 26px;transform:rotate(-6deg);box-shadow:16px 12px 0 -4px var(--yellow);}
.ct-done-btns{display:flex;gap:12px;justify-content:center;margin-top:26px;flex-wrap:wrap;}

@media (max-width:860px){
  .ed-stage{padding-left:40px;padding-right:40px;}
  .ed-mugvars{width:100%;}
  .ed-mugvar{flex:1 1 calc(25% - 6px);justify-content:flex-start;font-size:12px;padding-right:6px;}
  .ed-actions .ed-next{flex:2;}
  .ed-approve-row{grid-template-columns:1fr;}
  .ct-layout{grid-template-columns:1fr;}
  .ct-checkout{position:static;}
}
@media (max-width:600px){
  .ed-mugvar{flex:1 1 calc(50% - 6px);}
  .ct-item{grid-template-columns:96px 1fr;gap:12px;padding:12px;}
  .ct-item-pic .ed-mug{transform:scale(.4);margin:-58px -62px -58px -64px;}
  .ct-item-qty{grid-column:1/-1;flex-direction:row;justify-content:space-between;align-items:center;}
  .ed-approve-btns{flex-direction:column-reverse;}
}
.ed-mug.center .ed-mug-body{background-position:50% 50%;}
@media (max-width:600px){
  .ed-mugvars{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px 4px;}
  .ed-mugvars::-webkit-scrollbar{display:none;}
  .ed-mugvar{flex:0 0 auto;}
  .ed-preview{gap:0;padding:18px 0;justify-content:space-around;}
  .ed-preview .ed-mug{transform:scale(.48);margin:-50px -54px;}
  .ed-preview .ed-mug.front{margin:-50px -43px;}
  .ed-pv-cap{font-size:12px;letter-spacing:.04em;}
  .ed-pv-wide{margin-top:14px;padding:0 10px;}
}

/* ---------- v3: переключатель изделий и футболки DTF ---------- */
.ed-prodnav{display:inline-flex;border:2px solid var(--black);margin-bottom:18px;}
.ed-prodnav a{padding:7px 14px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;text-decoration:none;color:var(--ink);background:#fff;}
.ed-prodnav a + a{border-left:2px solid var(--black);}
.ed-prodnav a:hover{background:var(--yellow);}
.ed-prodnav a.active{background:var(--black);color:var(--yellow);}
.ct-add{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;}
.ct-files{display:flex;gap:12px;flex-wrap:wrap;margin:0;}
.ct-item-count{font-size:12px;color:var(--grey);}
.ct-item-tee .ct-item-pic{padding:8px;}
.ct-item-tee .ct-item-pic img{width:100%;height:auto;max-height:150px;object-fit:contain;}

/* цены в шапке страницы */
.sh-prices{display:grid;grid-template-columns:1.3fr 1fr;gap:2px;background:var(--black);border:2px solid var(--black);}
.sh-price-table{width:100%;border-collapse:collapse;background:var(--paper);}
.sh-price-table caption{text-align:left;padding:12px 14px 0;margin:0 0 6px;background:var(--paper);caption-side:top;}
.sh-price-table th,.sh-price-table td{padding:5px 14px;text-align:left;font-size:14px;border-top:1px dashed var(--line);}
.sh-price-table th{font-family:var(--font-display);font-weight:900;}
.sh-price-table td.mono{font-size:12px;color:var(--grey);}
.sh-price-table td b{font-family:var(--font-display);font-weight:900;}
.sh-price-shirts{background:var(--paper);padding:12px 14px;}
.sh-price-shirts .ed-label{margin-top:0;}
.sh-price-shirts > div:not(.ed-label){display:flex;justify-content:space-between;padding:5px 0;border-top:1px dashed var(--line);font-size:14px;}
.sh-price-shirts b{font-family:var(--font-display);font-weight:900;white-space:nowrap;}
.sh-price-shirts span{white-space:nowrap;}

/* верхняя панель: крой и цвет */
.sh-type{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.sh-fits button,.sh-gsms button{padding:8px 14px;gap:6px;}
.sh-fits small,.sh-gsms small{font-family:var(--font-mono);font-size:12px;font-weight:500;}
.sh-gsms button[hidden]{display:none;}
.sh-colors{display:flex;gap:6px;flex-wrap:wrap;}
.sh-color{display:inline-flex;align-items:center;gap:8px;background:#fff;border:2px solid var(--line);padding:6px 10px 6px 6px;cursor:pointer;font-size:13px;font-weight:700;color:var(--ink);}
.sh-color i{width:22px;height:22px;background:var(--c);border:2px solid var(--black);display:block;}
.sh-color:hover{border-color:var(--black);}
.sh-color.active{border-color:var(--black);background:var(--paper);box-shadow:inset 0 -4px 0 var(--yellow);}

/* сцена футболки */
.ed-stage.sh-stage{padding:16px 20px;justify-content:flex-start;gap:12px;}
.sh-sides{display:grid;grid-template-columns:repeat(4,1fr);gap:2px;width:100%;background:var(--black);border:2px solid var(--black);}
.sh-side{background:#fff;border:none;padding:9px 8px;cursor:pointer;text-align:left;display:flex;flex-direction:column;gap:2px;color:var(--ink);}
.sh-side b{font-size:13px;}
.sh-side-meta{font-size:12px;color:var(--grey);}
.sh-side:hover{background:var(--paper);}
.sh-side.filled .sh-side-meta{color:var(--ink);}
.sh-side.filled b::after{content:"";display:inline-block;width:8px;height:8px;background:var(--yellow);border:1.5px solid var(--black);margin-left:6px;transform:rotate(-6deg);vertical-align:middle;}
.sh-side.active{background:var(--black);color:var(--paper);}
.sh-side.active .sh-side-meta{color:var(--yellow);}
.sh-sizebar{display:flex;gap:8px;align-items:center;width:100%;flex-wrap:wrap;}
.sh-sizes{display:flex;flex:1;min-width:0;border:2px solid var(--black);}
.sh-size{flex:1;background:#fff;border:none;border-right:2px solid var(--black);padding:6px 4px;cursor:pointer;display:flex;flex-direction:column;align-items:center;color:var(--ink);}
.sh-size:last-of-type{border-right:none;}
.sh-size b{font-family:var(--font-display);font-weight:900;font-size:14px;}
.sh-size small{font-family:var(--font-mono);font-size:12px;color:var(--grey);}
.sh-size:hover{background:var(--paper);}
.sh-size.active{background:var(--yellow);}
.sh-size.active small{color:var(--ink);}
.sh-size[hidden]{display:none;}
.sh-viewport{position:relative;width:100%;height:clamp(380px,62vh,640px);overflow:hidden;background:var(--paper-dark);}
.sh-mock{position:absolute;display:block;pointer-events:none;}
.sh-viewport .ed-canvas-box{position:absolute;background:transparent;outline:1.5px dashed rgba(13,13,12,.6);outline-offset:0;}
.sh-viewport .ed-canvas-box.transparent{background:transparent;}
.sh-viewport.dark .ed-canvas-box{outline-color:rgba(255,255,255,.75);}
.sh-viewport.dark .ed-empty-hint,.sh-viewport.dark .ed-empty-hint b{color:rgba(255,255,255,.7);}
.sh-viewport .ed-empty-hint{font-size:12px;}
.sh-viewport .ed-empty-hint b{font-size:13px;}
.sh-calc{width:100%;display:flex;justify-content:space-between;align-items:center;gap:14px;border:2px solid var(--black);background:#fff;padding:10px 14px;flex-wrap:wrap;}
.sh-calc-parts{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;font-size:13px;}
.sh-calc-parts i{font-style:normal;color:var(--grey);}
.sh-calc-parts b{font-family:var(--font-display);font-weight:900;}
.sh-calc-empty{color:var(--grey);}
.sh-calc-total{display:flex;align-items:baseline;gap:8px;}
.sh-calc-total small{font-family:var(--font-mono);font-size:12px;color:var(--grey);text-transform:uppercase;}
.sh-calc-total b{font-family:var(--font-display);font-weight:900;font-size:24px;background:var(--yellow);padding:0 8px;transform:rotate(-3deg);display:inline-block;}
#shAreaNote{font-size:12px;}

/* шаг 2 для футболки */
.sh-modal{max-width:1040px;}
.sh-pv img{width:300px;max-width:100%;display:block;}
.sh-pv-sleeve img{width:190px;}
.sh-size-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px;}
.sh-q{display:flex;align-items:center;justify-content:space-between;gap:8px;border:2px solid var(--line);padding:6px 6px 6px 10px;background:#fff;}
.sh-q.on{border-color:var(--black);background:var(--paper);}
.sh-q > b{font-family:var(--font-display);font-weight:900;font-size:14px;}
.sh-q .ed-qty button{width:28px;height:30px;font-size:14px;}
.sh-q .ed-qty input{width:38px;height:30px;font-size:13px;}
.sh-breakdown{border-top:2px solid var(--black);}
.sh-breakdown > div{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-bottom:1px dashed var(--line);font-size:14px;}
.sh-breakdown > div b{font-weight:700;white-space:nowrap;}
.sh-breakdown .sh-bd-per{font-weight:700;}
.sh-total{justify-content:space-between;margin:10px 0 14px;}

@media (max-width:1280px){
  .sh-ed .ed-stage.sh-stage{padding:14px 16px;}
}
@media (max-width:900px){
  .sh-prices{grid-template-columns:1fr;}
}
@media (max-width:860px){
  .sh-type{width:100%;}
  .sh-fits,.sh-gsms{width:100%;}
  .sh-gsms button{flex:1;padding:8px 6px;}
  .sh-colors{width:100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;}
  .sh-colors::-webkit-scrollbar{display:none;}
  .sh-color{flex:0 0 auto;}
  .sh-viewport{height:clamp(320px,58vh,480px);}
}
@media (max-width:600px){
  .sh-sides{grid-template-columns:repeat(2,1fr);}
  .sh-sizebar .ed-icon-btn{width:34px;height:34px;}
  .sh-size{padding:5px 2px;}
  .sh-size b{font-size:12px;}
  .sh-size small{font-size:12px;}
  .sh-calc-total b{font-size:20px;}
  .sh-pv img{width:260px;}
  .sh-pv-sleeve img{width:150px;}
  .ed-preview .sh-pv{flex-basis:100%;align-items:center;}
}

/* v4: футболка целиком, область печати двигается */
.sh-viewport{height:clamp(420px,72vh,720px);}
.sh-grip{
  position:absolute;left:-2px;top:-26px;height:24px;display:inline-flex;align-items:center;gap:4px;
  padding:0 8px 0 6px;background:var(--black);color:var(--yellow);border:none;cursor:grab;touch-action:none;
  font-family:var(--font-mono);font-size:12px;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;z-index:6;
}
.sh-grip svg{width:14px;height:14px;}
.sh-grip:hover{background:var(--yellow);color:var(--black);}
.sh-grip:focus-visible{outline:2px solid var(--yellow);outline-offset:2px;}
.sh-viewport.dragging .sh-grip{cursor:grabbing;background:var(--yellow);color:var(--black);}
.sh-viewport.dragging .ed-canvas-box{outline-style:solid;}
.sh-viewport.zoomed .sh-grip{display:none;}
.sh-stage .ed-legend{max-width:640px;}
@media (max-width:860px){ .sh-viewport{height:clamp(360px,62vh,540px);} }

/* v5: перетаскивание слоёв */
.ed-layer{user-select:none;-webkit-user-select:none;position:relative;}
@media (hover:hover){ .ed-layer{cursor:grab;} }
.ed-layer-grip{width:16px;height:28px;flex:none;display:flex;align-items:center;justify-content:center;color:var(--grey);touch-action:none;cursor:grab;margin-left:-2px;}
.ed-layer-grip svg{width:16px;height:16px;fill:currentColor;stroke:none;}
.ed-layer:hover .ed-layer-grip{color:var(--black);}
.ed-layer.dragging{z-index:5;opacity:.92;border-color:var(--black);background:var(--yellow);cursor:grabbing;box-shadow:4px 4px 0 var(--black);transition:none;}
.ed-layer.drop-before::before,.ed-layer.drop-after::after{
  content:"";position:absolute;left:-2px;right:-2px;height:4px;background:var(--black);
}
.ed-layer.drop-before::before{top:-5px;}
.ed-layer.drop-after::after{bottom:-5px;}
.sh-fit small,.sh-size small{white-space:nowrap;}
.ed-warn::before{content:"";position:absolute;left:11px;top:14px;width:12px;height:12px;background:#d64545;transform:rotate(-6deg);}
/* выбранный пункт: жёлтый наклонный квадрат вместо боковой полосы */
.ed-layer.active,.ct-radio:has(input:checked),.sh-q.on{position:relative;}
.ed-layer.active:not(.drop-after)::after,.ct-radio:has(input:checked)::after,.sh-q.on::after{content:"";position:absolute;right:-6px;top:-6px;width:12px;height:12px;background:var(--yellow);border:2px solid var(--black);transform:rotate(-6deg);pointer-events:none;}

/* Печати и штампы в корзине (из мастера /zakaz-pechati.php) */
.ct-item-stamp .ct-item-pic{padding:8px;}
.ct-item-stamp .ct-item-pic img{width:100%;height:auto;max-height:150px;object-fit:contain;mix-blend-mode:multiply;}
.ct-flash{display:flex;align-items:center;gap:10px;margin:0 0 20px;padding:12px 16px;background:#fff;border:2px solid var(--black);font-size:14px;font-weight:600;}
.ct-flash span{flex:0 0 14px;height:14px;background:var(--yellow);border:2px solid var(--black);transform:rotate(-6deg);}

/* таблица размеров поверх редактора и «Шага 2» (inc/tee-size-chart.php) */
.ed-modal-overlay.szc-modal{z-index:210;}
.szc-modal .ed-modal{max-width:880px;}
.sh-approve-row .szc-link{font-size:13px;margin:0 0 8px;}
.sh-size-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.sh-price-shirts .szc-link{font-size:13px;margin-top:2px;}
