
html.wccpd-modal-open,
body.wccpd-modal-open { overflow: hidden; }

body.wccpd-modal-open .header-wrapper,
body.wccpd-modal-open .header-main,
body.wccpd-modal-open .ux-header,
body.wccpd-modal-open header#header { display: none !important; }

.wccpd-custom-design-section {
  clear: both;
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.wccpd-open-btn {
  background: #007cba !important;
  color: #fff !important;
  border: none !important;
  padding: 12px 24px !important;
  border-radius: 6px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-block !important;
  transition: background 0.3s !important;
}
.wccpd-open-btn:hover { background: #005a87 !important; }

.wccpd-designer-modal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 9999999;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 20px 20px;
  box-sizing: border-box;
}

.wccpd-modal-content {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
  box-sizing: border-box;
}

.wccpd-modal-header {
  flex: 0 0 auto;
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}
.wccpd-modal-header h2 { margin:0; font-size:20px; }

.wccpd-close-modal {
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  color: #666;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wccpd-close-modal:hover { color:#333; }

.wccpd-modal-body {
  flex: 1 1 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.wccpd-upload-button {
  width: 100%;
  padding: 15px;
  border: 2px dashed #007cba;
  background: #f0f8ff;
  color: #007cba;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  box-sizing: border-box;
}
.wccpd-upload-button:hover { background:#e6f3ff; }

.wccpd-content-panels { display:flex; gap:20px; box-sizing:border-box; }
.wccpd-left-panel, .wccpd-right-panel {
  width:200px; background:#f8f9fa; padding:15px; border-radius:6px;
  overflow-y:auto; overflow-x:hidden; box-sizing:border-box; flex:0 0 200px;
}
.wccpd-center-panel {
  flex: 1 1 auto; display:flex; align-items:center; justify-content:center;
  background:#e9ecef; border-radius:6px; touch-action:none; position:relative;
}

#wccpd-design-canvas {
  width:auto; max-width:100%; height:auto !important; max-height:60vh;
  cursor:grab; border:2px dashed #999 !important; background:#fff; touch-action:none;
  display:block; box-sizing:border-box;
}

.wccpd-canvas-wrapper { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; }
.wccpd-canvas-help-text { display:none; margin-top:10px; font-size:13px; color:#555; text-align:center; padding:0 8px; line-height:1.4; }

.wccpd-rotate-handle {
  position:absolute; width:18px; height:18px; border-radius:50%;
  border:2px solid #007cba; background:#fff; box-shadow:0 0 4px rgba(0,0,0,0.2);
  cursor:grab; touch-action:none; z-index:3; display:none;
}
.wccpd-rotate-handle-top-left { top:4px; left:4px; }
.wccpd-rotate-handle-top-right { top:4px; right:4px; }
.wccpd-rotate-handle-bottom-left { bottom:4px; left:4px; }
.wccpd-rotate-handle-bottom-right { bottom:4px; right:4px; }

.wccpd-control-group { margin-bottom:20px; }
.wccpd-control-group label { display:block; margin-bottom:5px; font-size:14px; }
.wccpd-pos-btn {
  width:100%; padding:8px; margin-bottom:5px; background:#fff; border:1px solid #ddd; border-radius:4px; cursor:pointer;
}
.wccpd-pos-btn:hover { background:#f0f0f0; }

#wccpd-add-to-cart, #wccpd-add-to-cart-mobile {
  background:#28a745; color:#fff; border:none; padding:12px 24px; border-radius:6px;
  cursor:pointer; font-size:16px; font-weight:bold; width:100%; box-sizing:border-box;
}
#wccpd-add-to-cart:hover, #wccpd-add-to-cart-mobile:hover { background:#218838; }
#wccpd-add-to-cart:disabled, #wccpd-add-to-cart-mobile:disabled { background:#6c757d; cursor:not-allowed; }

.wccpd-mobile-add-to-cart { display:none; margin-top:10px; }

.wccpd-interaction-toggle { margin-top:10px; display:flex; gap:6px; justify-content:center; font-size:13px; padding:0 8px; box-sizing:border-box; }
.wccpd-interaction-btn {
  flex:1 1 auto; padding:6px 10px; border-radius:999px; border:1px solid #ccc; background:#f8f9fa;
  cursor:pointer; text-align:center; white-space:nowrap;
}
.wccpd-interaction-btn.active { background:#007cba; border-color:#007cba; color:#fff; }

@media (max-width: 768px) {
  .wccpd-designer-modal { padding:0 0 10px; align-items:flex-start; }
  .wccpd-modal-content { width:100%; max-width:100%; max-height:100vh; border-radius:0; }
  .wccpd-modal-body { padding:15px; }
  .wccpd-content-panels { flex-direction:column !important; }
  .wccpd-center-panel { order:1 !important; min-height:260px; }
  .wccpd-left-panel { order:2 !important; width:100%; flex:0 0 auto; }
  .wccpd-right-panel { order:3 !important; width:100%; display:none !important; }
  .wccpd-mobile-add-to-cart { display:block; }
  .wccpd-canvas-help-text { display:block; }
  #wccpd-design-canvas { max-height:50vh; }
}
