
.unit-page{padding:34px 0 60px}
.unit-page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:30px;margin-bottom:24px}
.unit-page-head h1{margin:5px 0 8px;font-size:36px}
.unit-page-head p{margin:0;color:var(--muted)}
.back-home{color:#9a6d1c;font-weight:600}
.unit-layout{display:grid;grid-template-columns:390px 1fr;gap:24px;align-items:start}
.unit-form-card,.preview-card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}
.unit-form-card{padding:20px;display:grid;gap:14px}
.field{display:grid;gap:7px}
.field label{font-size:14px;font-weight:700}
.field input,.field select,.field textarea{width:100%;border:1px solid #ddd5cb;background:#fff;border-radius:10px;padding:11px 12px;font:inherit;outline:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:#c99a3e;box-shadow:0 0 0 3px rgba(201,154,62,.08)}
.dims-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.toggle-row{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #eee8e1;padding-top:13px}
.toggle-row div{display:flex;flex-direction:column}
.toggle-row small{color:var(--muted);font-size:11px;margin-top:2px}
.toggle-row input{width:20px;height:20px}
.sub-options{background:#fbf8f3;padding:12px;border-radius:10px}
.hidden{display:none!important}
.add-cart-btn{height:52px;border:0;border-radius:10px;background:linear-gradient(135deg,var(--gold),var(--gold2));color:#fff;font:inherit;font-weight:800;cursor:pointer}
.preview-card{padding:20px}
.preview-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}
.preview-head div{display:flex;flex-direction:column}
.preview-head small{color:var(--muted);font-size:12px;margin-top:3px}
.preview-head>span{direction:ltr;color:#9a6d1c;font-weight:700}
.preview-stage{height:500px;border-radius:16px;background:linear-gradient(#fdfbf8,#f2ede7);display:grid;place-items:center;overflow:hidden;perspective:950px}
.cabinet{position:relative;width:330px;height:360px;transform:rotateX(-5deg) rotateY(-10deg);transform-style:preserve-3d;transition:.25s}
.panel,#shelvesLayer .shelf,#drawersLayer .drawer{position:absolute;background:#f4f4f0;border:1px solid #d2d0ca;box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}
.side{top:0;bottom:0;width:20px}
.side.left{left:0}.side.right{right:0}
.bottom{left:0;right:0;bottom:0;height:20px}
.topbar{left:20px;right:20px;height:20px}
.topbar.front{top:0}.topbar.rear{top:28px;opacity:.72}.topbar.screw{top:56px;opacity:.52}
#shelvesLayer .shelf{left:20px;right:20px;height:14px}
#drawersLayer .drawer{left:24px;right:24px;height:44px;background:#ecebe6;border-color:#c7c3bc}
.handle-cut{position:absolute;left:20px;right:20px;top:0;height:10px;background:#d8d4ca;border-radius:0 0 7px 7px;z-index:5}
.summary-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:9px;margin-top:16px}
.summary-grid div{border:1px solid var(--line);background:#fbf8f3;border-radius:10px;padding:11px;display:flex;flex-direction:column;gap:3px}
.summary-grid span{font-size:11px;color:var(--muted)}
.summary-grid b{font-size:13px}
.price-box{margin-top:14px;border:1px solid #e7d6b7;background:#fffaf1;border-radius:12px;padding:15px;display:flex;justify-content:space-between;gap:20px;align-items:center}
.price-box div{display:flex;flex-direction:column}
.price-box small{color:var(--muted)}
.price-box strong{font-size:20px;color:#8f641a}
.price-box>span{font-size:12px;color:var(--muted)}
@media(max-width:1000px){
 .unit-layout{grid-template-columns:1fr}
 .preview-card{order:1}.unit-form-card{order:2}
 .summary-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:640px){
 .unit-page-head{align-items:flex-start;flex-direction:column}
 .unit-page-head h1{font-size:28px}
 .dims-grid{grid-template-columns:1fr}
 .preview-stage{height:380px}
 .cabinet{width:250px;height:300px}
 .summary-grid{grid-template-columns:repeat(2,1fr)}
 .price-box{align-items:flex-start;flex-direction:column}
}

.two-cols{grid-template-columns:repeat(2,1fr)}
.preview-stage{position:relative}
.cabinet{
  --t:16px;
  transform:rotateX(-4deg) rotateY(-7deg);
}
.panel,#shelvesLayer .shelf,#drawersLayer .drawer{
  background:#f8f8f5;
  border:2px solid #111;
  box-shadow:none;
}
.side{width:var(--t)}
.bottom{height:var(--t)}
.topbar{height:calc(var(--t) * 1.0);border-width:2px}
.topbar.front{background:#fafaf7}
.topbar.rear,.topbar.screw{background:#f2f2ee}
#shelvesLayer .shelf{height:var(--t);border-width:2px}
#drawersLayer .drawer{background:#efefea;border:2px solid #111}
.handle-cut{
  border:2px solid #111;
  border-top:0;
  background:#fff;
  z-index:6;
}
.calc-card{margin-top:16px;border:1px solid var(--line);border-radius:14px;background:#fff;padding:14px}
.calc-title{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:12px}
.calc-title>div{display:flex;flex-direction:column}
.calc-title small{font-size:11px;color:var(--muted);margin-top:3px}
.calc-title>span{font-size:12px;color:#8c641e;background:#fff8eb;border:1px solid #ead5ad;border-radius:999px;padding:7px 10px;white-space:nowrap}
.calc-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.calc-grid div{border:1px solid var(--line);background:#fbf8f3;border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:3px}
.calc-grid span{font-size:11px;color:var(--muted)}
.calc-grid b{font-size:12px}
@media(max-width:900px){.calc-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:640px){
 .two-cols{grid-template-columns:1fr}
 .calc-title{align-items:flex-start;flex-direction:column}
 .calc-grid{grid-template-columns:repeat(2,1fr)}
}

.preview-stage-3d{
  position:relative;
  height:540px;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 45%, #ffffff 0%, #faf8f4 52%, #f0ebe4 100%);
  border:1px solid #ece6de;
}
.three-container{position:absolute;inset:0}
.three-container canvas{display:block;width:100%!important;height:100%!important;cursor:grab}
.three-container canvas:active{cursor:grabbing}
.viewer-help{
  position:absolute;right:14px;top:14px;z-index:5;
  display:flex;gap:8px;flex-wrap:wrap;pointer-events:none
}
.viewer-help span{
  background:rgba(255,255,255,.90);border:1px solid #ded7cf;border-radius:8px;
  padding:7px 10px;font-size:11px;color:#49423d;box-shadow:0 5px 15px rgba(0,0,0,.04)
}
.view-buttons{
  position:absolute;left:14px;top:14px;z-index:6;
  display:flex;gap:6px;direction:rtl
}
.view-buttons button{
  border:1px solid #d8d0c6;background:rgba(255,255,255,.93);border-radius:8px;
  padding:7px 11px;font:inherit;font-size:11px;cursor:pointer;color:#2c2926
}
.view-buttons button:hover{border-color:#b9852f;color:#8d631d}
.three-loading{
  position:absolute;inset:auto 50% 18px auto;transform:translateX(50%);
  background:rgba(255,255,255,.92);border:1px solid #e5ddd4;border-radius:999px;
  padding:7px 14px;font-size:11px;color:#70685f;z-index:7
}
@media(max-width:640px){
  .preview-stage-3d{height:430px}
  .viewer-help{right:8px;top:8px}
  .viewer-help span:nth-child(2){display:none}
  .view-buttons{left:8px;top:48px;flex-wrap:wrap;max-width:170px}
}


/* === TAJ PATCH: compact desktop + Vazirmatn === */
.unit-page,
.unit-page input,
.unit-page select,
.unit-page textarea,
.unit-page button {
  font-family:"Vazirmatn",Tahoma,Arial,sans-serif !important;
}

@media (min-width: 1001px){
  .unit-page{
    padding:16px 0 28px;
  }

  .unit-page-head{
    margin-bottom:12px;
    gap:18px;
  }

  .unit-page-head h1{
    font-size:27px;
    line-height:1.35;
    margin:2px 0 4px;
  }

  .unit-page-head p{
    font-size:13px;
  }

  .unit-layout{
    grid-template-columns:340px minmax(0,1fr);
    gap:14px;
  }

  .unit-form-card{
    padding:14px;
    gap:9px;
    border-radius:14px;
  }

  .preview-card{
    padding:14px;
    border-radius:14px;
  }

  .field{
    gap:4px;
  }

  .field label{
    font-size:12px;
  }

  .field input,
  .field select,
  .field textarea{
    padding:8px 10px;
    min-height:38px;
    border-radius:8px;
    font-size:13px;
  }

  .dims-grid{
    gap:6px;
  }

  .toggle-row{
    padding-top:9px;
  }

  .toggle-row b{
    font-size:13px;
  }

  .toggle-row small{
    font-size:10px;
  }

  .toggle-row input{
    width:17px;
    height:17px;
  }

  .sub-options{
    padding:8px;
    border-radius:8px;
  }

  .add-cart-btn{
    height:44px;
    border-radius:8px;
    font-size:13px;
  }

  .preview-head{
    margin-bottom:9px;
  }

  .preview-head b{
    font-size:14px;
  }

  .preview-head small{
    font-size:10px;
  }

  .preview-stage-3d{
    height:390px;
    border-radius:12px;
  }

  .viewer-help span,
  .view-buttons button{
    padding:5px 8px;
    font-size:10px;
  }

  .summary-grid{
    margin-top:9px;
    gap:6px;
  }

  .summary-grid div{
    padding:8px 9px;
    border-radius:8px;
  }

  .summary-grid span{
    font-size:10px;
  }

  .summary-grid b{
    font-size:12px;
  }

  .calc-card{
    margin-top:9px;
    padding:9px;
    border-radius:10px;
  }

  .calc-title{
    margin-bottom:7px;
  }

  .calc-title b{
    font-size:13px;
  }

  .calc-title small,
  .calc-title>span{
    font-size:10px;
  }

  .calc-title>span{
    padding:5px 8px;
  }

  .calc-grid{
    gap:5px;
  }

  .calc-grid div{
    padding:7px;
    border-radius:7px;
  }

  .calc-grid span{
    font-size:9px;
  }

  .calc-grid b{
    font-size:11px;
  }

  .price-box{
    margin-top:8px;
    padding:9px 11px;
    border-radius:9px;
  }

  .price-box strong{
    font-size:17px;
  }

  .price-box>span{
    font-size:10px;
  }
}

/* Keep the overall site header more compact on desktop */
@media (min-width: 901px){
  .header-inner{
    height:70px;
    gap:22px;
  }

  .brand-text strong{
    font-size:23px;
  }

  .brand-text small{
    font-size:10px;
  }

  .crown{
    font-size:36px;
  }

  .nav{
    gap:20px;
    font-size:13px;
  }

  .nav a{
    padding:25px 0 22px;
  }

  .nav a.active:after,
  .nav a:hover:after{
    bottom:13px;
  }

  .topbar{
    height:36px;
  }

  .topbar-inner{
    font-size:12px;
  }

  .icon-btn{
    width:34px;
    height:34px;
    font-size:18px;
  }
}

/* === LOCAL 3D PATCH: works directly from file:// === */
.local3d-viewport{
  position:absolute;
  inset:0;
  perspective:1100px;
  overflow:hidden;
  touch-action:none;
  user-select:none;
  cursor:grab;
}
.local3d-viewport:active{cursor:grabbing}
.local3d-scene{
  position:absolute;
  left:50%;
  top:50%;
  width:1px;
  height:1px;
  transform-style:preserve-3d;
  transform:translate(-50%,-50%);
}
.local3d-cabinet{
  position:absolute;
  left:0;
  top:0;
  transform-style:preserve-3d;
  transform-origin:center center;
  will-change:transform;
}

.l3-part{
  position:absolute;
  transform-style:preserve-3d;
  box-sizing:border-box;
}
.l3-face{
  position:absolute;
  box-sizing:border-box;
  background:#f5f3ed;
  border:1px solid #111;
  backface-visibility:visible;
}
.l3-face.inner{background:#ece8df}
.l3-face.dark{background:#303030}
.l3-face.foot{background:#202020;border-color:#111}

.l3-front,.l3-back{left:0;top:0}
.l3-left,.l3-right{top:0}
.l3-top,.l3-bottom{left:0}

.local3d-shadow{
  position:absolute;
  width:330px;
  height:85px;
  left:-165px;
  top:110px;
  border-radius:50%;
  background:radial-gradient(ellipse,rgba(0,0,0,.18),rgba(0,0,0,0) 68%);
  transform:rotateX(90deg) translateZ(-8px);
  pointer-events:none;
  filter:blur(2px);
}

.preview-stage-3d{
  background:
    radial-gradient(circle at 50% 42%,#fff 0,#faf8f4 52%,#efeae3 100%) !important;
}

/* Drawer dimension patch */
.mini-check-row{
  display:flex;align-items:center;justify-content:flex-start;gap:9px;
  padding:8px 2px;font-size:12px;font-weight:600;cursor:pointer
}
.mini-check-row input{width:17px;height:17px;margin:0}
.drawer-rows{display:grid;gap:6px}
.drawer-row{
  display:grid;grid-template-columns:54px 1fr 1fr;gap:6px;align-items:center;
  background:#fff;border:1px solid #e7e0d8;border-radius:8px;padding:7px
}
.drawer-row>span{font-size:11px;font-weight:700}
.drawer-row label{font-size:9px;color:#756e67;display:grid;gap:3px}
.drawer-row input{
  width:100%;min-height:32px!important;padding:5px 7px!important;
  border:1px solid #ddd5cb;border-radius:7px;font:inherit
}
.dimension-tag{
  position:absolute;z-index:20;pointer-events:none;
  background:rgba(255,255,255,.92);border:1px solid #cfc7bd;border-radius:6px;
  padding:3px 6px;font-size:10px;font-weight:700;color:#24211f;
  box-shadow:0 2px 8px rgba(0,0,0,.04);direction:ltr
}
.dimension-line{
  position:absolute;z-index:19;pointer-events:none;background:#292623;opacity:.7
}
.dimension-line.h{height:1px}
.dimension-line.v{width:1px}
@media(max-width:640px){
 .drawer-row{grid-template-columns:46px 1fr 1fr}
}


/* === MODEL FIX: tighter solid geometry, fiber, cylindrical feet, visible zoom === */
.local3d-scene{
  top:54% !important;
}

.local3d-cabinet{
  transform-origin:0 0 !important;
}

.l3-part{
  width:0 !important;
  height:0 !important;
  position:absolute;
  transform-style:preserve-3d;
}

.l3-face{
  position:absolute;
  box-sizing:border-box;
  background:#f5f3ed;
  border:1px solid #111;
  opacity:1 !important;
  backface-visibility:visible;
}

.l3-face.inner{background:#ebe7df}
.l3-face.fiber{
  background:#c9aa7c;
  border-color:#2a241d;
}
.l3-face.foot{
  background:#202020;
  border-color:#0f0f0f;
}

.l3-cylinder-side{
  position:absolute;
  background:#242424;
  border-left:1px solid #0d0d0d;
  border-right:1px solid #0d0d0d;
  box-sizing:border-box;
  backface-visibility:visible;
}

.l3-cylinder-cap{
  position:absolute;
  background:#1c1c1c;
  border:1px solid #080808;
  border-radius:50%;
  box-sizing:border-box;
}

.view-buttons{
  align-items:center;
}
.view-buttons button{
  min-width:32px;
}
#zoomResetBtn{min-width:48px}

.handle-cut-label{
  position:absolute;
  z-index:18;
  pointer-events:none;
  background:#2b2926;
  color:#fff;
  border-radius:6px;
  padding:3px 6px;
  font-size:9px;
  white-space:nowrap;
}

/* Fit / ground / drawer patch */
.preview-stage-3d{overflow:hidden!important}
.local3d-viewport{overflow:hidden!important}
.local3d-scene{top:72%!important}
#zoomResetBtn{font-variant-numeric:tabular-nums}


/* === PATCH: hidden-handle / front-rail / sticky preview / no floating shadow === */

/* 3D preview stays visible while the right settings panel scrolls */
@media (min-width:1001px){
  .preview-card{
    position:sticky !important;
    top:82px !important;
    align-self:start !important;
    max-height:calc(100vh - 94px);
    overflow:hidden;
  }
}

/* remove fake ground shadow: it made the unit look suspended */
.local3d-shadow{
  display:none !important;
}

/* hidden handle is a real missing notch, not a separate horizontal seam */
.side-lower .l3-face,
.side-upper-cut .l3-face{
  border-color:transparent !important;
}

/* keep outer visible vertical edge of the two side panels */
.side-lower .l3-face.l3-front,
.side-upper-cut .l3-face.l3-front{
  outline:0;
}

/* drawer boxes stay visually clean */
.drawer-bottom .l3-face,
.drawer-side .l3-face{
  opacity:1 !important;
}


/* === PATCH: black body edges / per-drawer / 3D dimensions === */
.side-lower .l3-face,
.side-upper-cut .l3-face{
  border:1px solid #111 !important;
}

/* mask only the artificial join seam from the handle split */
.handle-seam-mask{
  position:absolute;
  background:#f5f3ed;
  pointer-events:none;
  z-index:12;
}

.drawer-help{
  font-size:10px;
  color:#7a726a;
  margin:2px 0 4px;
}

.drawer-row{
  grid-template-columns:58px 1fr 1fr !important;
}

.model-dim{
  position:absolute;
  transform-style:preserve-3d;
  pointer-events:none;
  z-index:30;
  color:#111;
  font-family:"Vazirmatn",Tahoma,Arial,sans-serif;
}

.model-dim .dim-label{
  position:absolute;
  background:rgba(255,255,255,.94);
  border:1px solid #bdb5ac;
  border-radius:6px;
  padding:2px 6px;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
  box-shadow:0 2px 6px rgba(0,0,0,.05);
}

.model-dim .dim-line{
  position:absolute;
  background:#111;
  opacity:.75;
}

.model-dim.width-dim .dim-line{height:1px}
.model-dim.height-dim .dim-line{width:1px}
.model-dim.depth-dim .dim-line{height:1px}



/* Drawer editor: stable numeric typing and 0.5cm native spinner steps */
.drawer-row input,
#drawerDepth,
#drawerBoxHeight{
  direction:ltr;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
.drawer-help{
  line-height:1.7;
}


/* === PATCH: lower model + clearer depth dimension === */
@media (min-width:1001px){
  .local3d-scene{
    top:76% !important;
  }
}

.model-dim.depth-dim .dim-label{
  transform:translate(-50%,-50%) rotateY(-90deg) !important;
  min-width:46px;
  text-align:center;
}



/* === PATCH: medium gray 3D background + clearer depth label === */
.preview-stage-3d{
  background:#b9b9b9 !important;
}

.local3d-viewport{
  background:#b9b9b9 !important;
}

.model-dim.depth-dim .dim-label{
  background:rgba(255,255,255,.96) !important;
  border-color:#8f8f8f !important;
  color:#111 !important;
}

.model-dim .dim-line{
  background:#111 !important;
  opacity:.9 !important;
}


/* === PATCH: per-shelf editor + better depth dimension === */
.shelf-help{
  font-size:10px;
  color:#756f68;
  line-height:1.8;
  margin:2px 0 6px;
}

.shelf-rows{
  display:grid;
  gap:6px;
}

.shelf-row{
  display:grid;
  grid-template-columns:58px 1fr 1fr;
  gap:6px;
  align-items:center;
  background:#fff;
  border:1px solid #e7e0d8;
  border-radius:8px;
  padding:7px;
}

.shelf-row>span{
  font-size:11px;
  font-weight:700;
}

.shelf-row label{
  display:grid;
  gap:3px;
  font-size:9px;
  color:#756e67;
}

.shelf-row input{
  width:100%;
  min-height:32px!important;
  padding:5px 7px!important;
  border:1px solid #ddd5cb;
  border-radius:7px;
  font:inherit;
  direction:ltr;
  text-align:center;
}

/* Depth dimension: keep label tight to its own line */
.model-dim.depth-dim .dim-label{
  transform:translate(-50%,-50%) !important;
  min-width:44px;
  text-align:center;
  padding:2px 5px;
}

@media(max-width:640px){
  .shelf-row{grid-template-columns:48px 1fr 1fr}
}


/* === PATCH: shelf final dimensions + clean model dimensions === */
.shelf-row{
  grid-template-columns:58px 1fr 1fr 88px !important;
}
.shelf-final-size{
  align-self:stretch;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  border:1px solid #d8d0c7;
  border-radius:7px;
  background:#faf7f2;
  font-size:11px;
  font-weight:800;
  direction:ltr;
  color:#27231f;
}
.shelf-final-size::before{
  content:"ابعاد ";
  direction:rtl;
  font-size:9px;
  font-weight:500;
  color:#817970;
  margin-left:4px;
}

.model-dim .dim-label{
  min-width:auto !important;
  padding:2px 5px !important;
  line-height:1.2;
}
.model-dim.height-dim .dim-label{
  transform:translate(-100%,-50%) !important;
}
.model-dim.depth-dim .dim-label{
  transform:translateY(-50%) !important;
}

@media(max-width:720px){
  .shelf-row{
    grid-template-columns:48px 1fr 1fr !important;
  }
  .shelf-final-size{
    grid-column:2 / 4;
  }
}


/* === PATCH: direct shelf dimensions + screen-facing depth label === */
.shelf-row{
  grid-template-columns:58px 1fr 1fr !important;
}
.shelf-final-size{
  display:none !important;
}
.depth-screen-label{
  position:absolute;
  z-index:40;
  pointer-events:none;
  background:rgba(255,255,255,.96);
  border:1px solid #9f978e;
  border-radius:6px;
  padding:2px 6px;
  font-size:10px;
  font-weight:800;
  color:#111;
  direction:ltr;
  line-height:1.2;
  box-shadow:0 2px 6px rgba(0,0,0,.05);
  transform:translate(-50%,-50%);
}
.model-dim.depth-dim{
  display:none !important;
}


/* === PATCH: readable screen-space dimensions === */
.model-dim,
.depth-screen-label{
  display:none !important;
}

.screen-dims{
  position:absolute;
  inset:0;
  z-index:50;
  pointer-events:none;
}

.screen-dim{
  position:absolute;
  transform:translate(-50%,-50%);
  background:rgba(255,255,255,.97);
  border:1px solid #8f8982;
  border-radius:6px;
  padding:2px 7px;
  min-width:28px;
  text-align:center;
  font-size:10px;
  font-weight:800;
  line-height:1.25;
  color:#111;
  box-shadow:0 2px 7px rgba(0,0,0,.06);
  direction:ltr;
}

.screen-dim-h::before,
.screen-dim-w::before,
.screen-dim-d::before{
  content:"";
}

.local3d-scene{
  top:72% !important;
}


/* === PATCH: clean hidden-handle cut + tall-unit fit === */

/* Handle split must not create fake seam lines on the body */
.side-lower .l3-face.l3-top,
.side-upper-cut .l3-face.l3-bottom{
  border-color:transparent !important;
}

/* Hide only the artificial join edge between lower and upper side pieces */
.side-lower .l3-face.l3-front{
  border-top-color:transparent !important;
}
.side-upper-cut .l3-face.l3-front{
  border-bottom-color:transparent !important;
}

/* No extra seam-mask object */
.handle-seam-mask{
  display:none !important;
}

/* Tall units need more vertical room */
.local3d-scene{
  top:84% !important;
}



/* === PATCH: remove internal top seams + remove dimension numbers === */

/* remove all numeric dimension overlays from the 3D viewport */
.screen-dims,
.screen-dim,
.model-dim,
.depth-screen-label{
  display:none !important;
}

/* Hide internal seams between top rail / side / handle-cut pieces.
   Keep outside silhouette borders on main body. */
.rail-front .l3-face,
.rail-back .l3-face,
.rail-screw .l3-face{
  border-color:transparent !important;
}

/* For split side used by hidden handle, suppress seam where the two pieces touch */
.side-lower .l3-face.l3-top,
.side-upper-cut .l3-face.l3-bottom{
  border-color:transparent !important;
}

/* suppress the short front seam at the split */
.side-lower .l3-face.l3-front{
  border-top-color:transparent !important;
}
.side-upper-cut .l3-face.l3-front{
  border-bottom-color:transparent !important;
}

/* keep main outside body edges black */
.side .l3-face,
.bottom .l3-face,
.top .l3-face,
.shelf .l3-face,
.fiber .l3-face{
  border-color:#111 !important;
}


/* === FIX: restore rail outlines, hide ONLY hidden-handle body seam === */

/* Restore visible black outlines for all rails */
.rail-front .l3-face,
.rail-back .l3-face,
.rail-screw .l3-face{
  border:1px solid #111 !important;
}

/* Hidden-handle side is split into two solids internally.
   Hide ONLY their horizontal joining seam. */
.side-lower .l3-face.l3-top{
  border-color:transparent !important;
}
.side-upper-cut .l3-face.l3-bottom{
  border-color:transparent !important;
}

/* On the visible front/outer face, remove just the touching horizontal borders */
.side-lower .l3-face.l3-front{
  border-top-color:transparent !important;
}
.side-upper-cut .l3-face.l3-front{
  border-bottom-color:transparent !important;
}

/* Keep every other outer edge of both side pieces black */
.side-lower .l3-face.l3-left,
.side-lower .l3-face.l3-right,
.side-lower .l3-face.l3-back,
.side-lower .l3-face.l3-bottom,
.side-upper-cut .l3-face.l3-left,
.side-upper-cut .l3-face.l3-right,
.side-upper-cut .l3-face.l3-back,
.side-upper-cut .l3-face.l3-top{
  border-color:#111 !important;
}


/* === FIX واقعی: چون makeBox کلاس جهت‌دار ندارد، seam را با ترتیب Faceها می‌گیریم === */
/* ترتیب Faceها در makeBox:
   1=front, 2=back, 3=left, 4=right, 5=top, 6=bottom */

/* فقط seam جلوی بغل در محل دستگیره مخفی حذف شود */
.side-lower .l3-face:nth-child(1){
  border-top-color: transparent !important;
}
.side-upper-cut .l3-face:nth-child(1){
  border-bottom-color: transparent !important;
}

/* seam داخلی بین دو تکه روی سطح افقی هم حذف شود */
.side-lower .l3-face:nth-child(5){
  border-color: transparent !important;
}
.side-upper-cut .l3-face:nth-child(6){
  border-color: transparent !important;
}

/* بقیه خطوط بدنه و مخصوصاً تیرک‌ها واضح بمانند */
.rail-front .l3-face,
.rail-back .l3-face,
.rail-screw .l3-face,
.side-lower .l3-face:nth-child(2),
.side-lower .l3-face:nth-child(3),
.side-lower .l3-face:nth-child(4),
.side-lower .l3-face:nth-child(6),
.side-upper-cut .l3-face:nth-child(2),
.side-upper-cut .l3-face:nth-child(3),
.side-upper-cut .l3-face:nth-child(4),
.side-upper-cut .l3-face:nth-child(5){
  border-color:#111 !important;
}


/* === FINAL FIX: hide hidden-handle split seam on ALL visible side faces ===
   Face order in makeBox:
   1 front, 2 back, 3 left, 4 right, 5 top, 6 bottom
*/

/* Lower piece: remove ONLY its top border on all four vertical faces */
.side-lower .l3-face:nth-child(1),
.side-lower .l3-face:nth-child(2),
.side-lower .l3-face:nth-child(3),
.side-lower .l3-face:nth-child(4){
  border-top-color:transparent !important;
}

/* Upper piece: remove ONLY its bottom border on all four vertical faces */
.side-upper-cut .l3-face:nth-child(1),
.side-upper-cut .l3-face:nth-child(2),
.side-upper-cut .l3-face:nth-child(3),
.side-upper-cut .l3-face:nth-child(4){
  border-bottom-color:transparent !important;
}

/* The touching horizontal faces themselves must have no outline */
.side-lower .l3-face:nth-child(5),
.side-upper-cut .l3-face:nth-child(6){
  border-color:transparent !important;
}

/* Keep all rail outlines visible */
.rail-front .l3-face,
.rail-back .l3-face,
.rail-screw .l3-face{
  border:1px solid #111 !important;
}

/* Keep all OTHER outer edges of split side pieces black */
.side-lower .l3-face:nth-child(1),
.side-lower .l3-face:nth-child(2),
.side-lower .l3-face:nth-child(3),
.side-lower .l3-face:nth-child(4),
.side-lower .l3-face:nth-child(6),
.side-upper-cut .l3-face:nth-child(1),
.side-upper-cut .l3-face:nth-child(2),
.side-upper-cut .l3-face:nth-child(3),
.side-upper-cut .l3-face:nth-child(4),
.side-upper-cut .l3-face:nth-child(5){
  border-left-color:#111 !important;
  border-right-color:#111 !important;
}

/* outer top/bottom edges that are NOT the seam */
.side-lower .l3-face:nth-child(6){
  border-color:#111 !important;
}
.side-upper-cut .l3-face:nth-child(5){
  border-color:#111 !important;
}


/* === PATCH: drawer defaults + global colors === */
.global-color-row{
  background:#fbf8f3;
  border:1px solid #ece4da;
  border-radius:8px;
  padding:9px 10px;
}

.drawer-default-note{
  font-size:10px;
  color:#776f67;
  line-height:1.8;
}



/* === FIXED / ثابتی === */
.fixed-help{
  font-size:10px;
  color:#776f67;
  line-height:1.8;
  margin:4px 0 8px;
}
.fixed-rows{
  display:grid;
  gap:8px;
}
.fixed-row{
  display:grid;
  grid-template-columns:auto minmax(100px,1fr) minmax(90px,1fr);
  gap:8px;
  align-items:end;
  padding:8px;
  border:1px solid #ece4da;
  border-radius:9px;
  background:#fbf8f3;
}
.fixed-row>span{
  font-size:11px;
  font-weight:800;
  align-self:center;
  white-space:nowrap;
}
.fixed-row label{
  font-size:10px;
  display:grid;
  gap:4px;
}
.fixed-row input,
.fixed-row select{
  min-width:0;
}
.fixed-stile .l3-face,
.fixed-full .l3-face{
  border:1px solid #111 !important;
}
@media(max-width:620px){
  .fixed-row{
    grid-template-columns:1fr 1fr;
  }
  .fixed-row>span{
    grid-column:1/-1;
  }
}


/* Fixed is always a double body-direction stile; no fixed facade mode. */
.fixed-full{display:none !important;}
.fixed-stile .l3-face{
  border:1px solid #111 !important;
}


/* === Column bypass === */
.column-bypass-cut .l3-face{
  border:1px solid #111 !important;
}


/* === Rhino-style column wrap === */
.column-wrap-front .l3-face,
.column-wrap-return .l3-face,
.column-wrap-rear .l3-face,
.column-cut-front .l3-face,
.column-cut-side .l3-face,
.column-cut-back .l3-face{
  border-color:#111 !important;
}

/* Internal faces where our CSS boxes join represent one Boolean-cut part in Rhino. */
.column-cut-front .l3-face:nth-child(2),
.column-cut-side .l3-face:nth-child(1){
  border-color:transparent !important;
}


/* === Column Wrap V2: true one-piece L geometry === */
.column-cut-l .l3-face,
.l3-poly-top,
.l3-poly-bottom,
.l3-poly-edge{
  border:1px solid #111 !important;
  box-sizing:border-box;
}

/* Three side pieces must stay visibly distinct like Rhino Breps. */
.column-wrap-front .l3-face,
.column-wrap-return .l3-face,
.column-wrap-rear .l3-face{
  border:1px solid #111 !important;
}

/* Fiber is visibly terminated at the center of the third side groove. */
.column-trimmed-fiber .l3-face{
  border-color:#2a241d !important;
}


/* === Clean column-wrap visual overflow === */
.column-wrap-front,
.column-wrap-return,
.column-wrap-rear,
.column-cut-l{
  backface-visibility:hidden;
}

.column-cut-l .l3-poly-top,
.column-cut-l .l3-poly-bottom{
  overflow:hidden !important;
}


/* Final cleanup: custom polygon side faces are intentionally not rendered.
   Prevent any stale/cached edge element from appearing if present. */
.column-cut-l .l3-poly-edge{
  display:none !important;
}

/* V3: remove only the false underside/front flap of L-cut horizontal parts */
.column-cut-l .l3-poly-bottom{display:none!important;}
.column-cut-l{overflow:visible;}


/* === V4: real 16mm solid L panels === */
.column-cut-l .l3-poly-bottom{
  display:block !important;
  visibility:visible !important;
}

.column-cut-l .l3-poly-edge{
  display:block !important;
  visibility:visible !important;
  border:1px solid #111 !important;
  box-sizing:border-box;
}

.column-cut-l .l3-poly-top,
.column-cut-l .l3-poly-bottom{
  border:1px solid #111 !important;
  box-sizing:border-box;
}


/* Disabled wall-only options */
.toggle-row input:disabled{
  opacity:.38;
  cursor:not-allowed;
}


/* Wall lift / هوایی جکی */
.wall-lift-rail .l3-face,
.wall-lift-shelf .l3-face{
  border:1px solid #111 !important;
}


/* V13 - make wall-lift center assembly visually clear */
.wall-lift-shelf .l3-face,
.wall-lift-rail .l3-face{
  border:1px solid #111 !important;
  opacity:1 !important;
  visibility:visible !important;
}



/* =========================================================
   UNIT ORDER LIST — V18 responsive compact
   ========================================================= */
.unit-order-list-card{
  margin:16px 0 34px;
  padding:16px;
  border:1px solid #e7dfd5;
  border-radius:14px;
  background:#fff;
  direction:rtl;
}

.unit-order-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding-bottom:12px;
  border-bottom:1px solid #eee8e0;
}

.unit-order-head h2{
  margin:0 0 3px;
  font-size:18px;
  line-height:1.5;
}

.unit-order-head p{
  margin:0;
  color:#847b72;
  font-size:11px;
  line-height:1.7;
}

.unit-order-summary{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

.unit-order-summary span{
  display:flex;
  gap:5px;
  align-items:center;
  padding:7px 10px;
  border:1px solid #eadfce;
  border-radius:9px;
  background:#fbf8f3;
  font-size:11px;
  white-space:nowrap;
}

.unit-order-empty{
  padding:26px 12px;
  text-align:center;
  color:#948a80;
  font-size:12px;
}

.unit-order-list{
  display:grid;
  gap:9px;
  margin-top:12px;
}

.unit-order-item{
  padding:11px 12px;
  border:1px solid #e7dfd5;
  border-radius:11px;
  background:#fdfcf9;
  box-shadow:0 2px 8px rgba(45,35,20,.025);
}

.unit-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.unit-order-main{
  min-width:0;
  flex:1;
}

.unit-type-line{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}

.unit-type-line b{
  font-size:14px;
  line-height:1.5;
}

.unit-dim{
  padding:3px 7px;
  border-radius:6px;
  background:#f4efe8;
  color:#6e655c;
  font-size:10px;
  direction:ltr;
}

.unit-order-specs{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:7px;
}

.unit-order-specs span{
  padding:3px 7px;
  border:1px solid #ede5db;
  border-radius:6px;
  background:#fff;
  color:#655d55;
  font-size:10px;
  line-height:1.4;
}

.unit-order-actions{
  display:flex;
  gap:5px;
  flex:0 0 auto;
}

.unit-order-actions button{
  height:29px;
  padding:0 9px;
  border:1px solid #ddd4ca;
  border-radius:7px;
  background:#fff;
  font-family:inherit;
  font-size:10px;
  cursor:pointer;
}

.unit-order-actions .edit-unit{
  color:#8a6219;
}

.unit-order-actions .delete-unit{
  color:#a64137;
}

.unit-card-bottom{
  display:grid;
  grid-template-columns:minmax(130px,1fr) auto minmax(150px,1fr);
  align-items:center;
  gap:12px;
  margin-top:10px;
  padding-top:9px;
  border-top:1px dashed #e9e1d8;
}

.unit-price-block,
.unit-total-block{
  display:flex;
  align-items:center;
  gap:7px;
}

.unit-price-block small,
.unit-total-block small,
.qty-value small{
  color:#92887e;
  font-size:9px;
  white-space:nowrap;
}

.unit-price-block strong,
.unit-total-block strong{
  font-size:12px;
  white-space:nowrap;
}

.unit-total-block{
  justify-content:flex-end;
}

.unit-total-block strong{
  color:#7c5715;
}

.unit-order-qty{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.unit-order-qty button{
  width:28px;
  height:28px;
  padding:0;
  border:1px solid #ddd5cb;
  border-radius:7px;
  background:#fff;
  font-family:inherit;
  font-size:16px;
  line-height:1;
  cursor:pointer;
}

.qty-value{
  min-width:42px;
  text-align:center;
  line-height:1.2;
}

.qty-value small{
  display:block;
  margin-bottom:2px;
}

.qty-value b{
  font-size:12px;
}

.unit-order-footer{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #eee8e0;
}

.send-units-cart{
  min-width:230px;
  border:0;
  border-radius:9px;
  padding:11px 16px;
  background:#c99532;
  color:#fff;
  font:700 12px inherit;
  cursor:pointer;
}

.send-units-cart:disabled{
  opacity:.42;
  cursor:not-allowed;
}

/* Tablet */
@media(max-width:900px){
  .unit-order-head{
    align-items:flex-start;
  }

  .unit-card-bottom{
    grid-template-columns:1fr auto 1fr;
  }
}

/* Mobile */
@media(max-width:640px){
  .unit-order-list-card{
    margin:10px 0 24px;
    padding:10px;
    border-radius:11px;
  }

  .unit-order-head{
    display:block;
    padding-bottom:9px;
  }

  .unit-order-head h2{
    font-size:15px;
  }

  .unit-order-head p{
    display:none;
  }

  .unit-order-summary{
    margin-top:7px;
    gap:6px;
  }

  .unit-order-summary span{
    flex:1;
    justify-content:center;
    padding:6px 7px;
    font-size:10px;
  }

  .unit-order-list{
    gap:7px;
    margin-top:8px;
  }

  .unit-order-item{
    padding:9px;
    border-radius:9px;
  }

  .unit-card-top{
    gap:7px;
  }

  .unit-type-line{
    gap:5px;
  }

  .unit-type-line b{
    font-size:12px;
  }

  .unit-dim{
    font-size:9px;
    padding:2px 5px;
  }

  .unit-order-specs{
    margin-top:5px;
    gap:4px;
  }

  .unit-order-specs span{
    font-size:9px;
    padding:2px 5px;
  }

  .unit-order-actions{
    gap:4px;
  }

  .unit-order-actions button{
    height:26px;
    padding:0 7px;
    font-size:9px;
  }

  .unit-card-bottom{
    grid-template-columns:1fr auto;
    gap:7px;
    margin-top:7px;
    padding-top:7px;
  }

  .unit-price-block{
    display:none;
  }

  .unit-order-qty{
    grid-column:1;
    grid-row:1;
    justify-content:flex-start;
  }

  .unit-total-block{
    grid-column:2;
    grid-row:1;
    display:block;
    text-align:left;
  }

  .unit-total-block small{
    display:block;
    margin-bottom:2px;
  }

  .unit-total-block strong{
    font-size:11px;
  }

  .unit-order-qty button{
    width:27px;
    height:27px;
  }

  .qty-value{
    min-width:32px;
  }

  .unit-order-footer{
    margin-top:9px;
    padding-top:9px;
  }

  .send-units-cart{
    width:100%;
    min-width:0;
    padding:10px 12px;
    font-size:11px;
  }
}


/* V19 — readable unit specifications */
.unit-order-specs{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 8px;
}

.unit-order-specs .unit-spec{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 7px;
  border:0;
  border-radius:6px;
  background:#f6f2ec;
  color:#3f3933;
  white-space:nowrap;
}

.unit-order-specs .unit-spec em{
  font-style:normal;
  font-size:10px;
  color:#8a8178;
}

.unit-order-specs .unit-spec b{
  font-size:10px;
  font-weight:700;
  color:#3f3933;
}

@media(max-width:640px){
  .unit-order-specs{
    gap:4px 6px;
  }

  .unit-order-specs .unit-spec{
    padding:3px 5px;
  }

  .unit-order-specs .unit-spec em,
  .unit-order-specs .unit-spec b{
    font-size:9px;
  }
}
