/* ============================================
   TEESKULL Product Customizer (Fabric.js)
   Printify / Printful 3-Column POD Layout
   ============================================ */

/* Main Studio Container */
.tsk-studio {
  display: grid;
  grid-template-columns: 88px 1fr;
  background: var(--card-bg, #ffffff);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-light, #e2e8f0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  min-height: 640px;
  position: relative;
  margin-bottom: 32px;
}
@media (max-width: 991px) {
  .tsk-studio {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 520px;
  }
}

/* LEFT SIDEBAR (Side Switchers & Tools) */
.tsk-studio-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-alt, #f8fafc);
  border-right: 1px solid var(--border-light, #e2e8f0);
  padding: 12px 6px;
  gap: 16px;
  z-index: 10;
}
@media (max-width: 991px) {
  .tsk-studio-sidebar {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-light, #e2e8f0);
    padding: 8px 12px;
    justify-content: space-between;
    overflow-x: auto;
  }
}
.tsk-sidebar-section {
  display: flex;
  flex-direction: column;
}
.tsk-sidebar-heading {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  margin: 0 0 8px;
}
@media (max-width: 991px) {
  .tsk-sidebar-heading { display: none; }
}
.tsk-side-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
@media (max-width: 991px) {
  .tsk-side-tabs { flex-direction: row; gap: 8px; }
}
.tsk-side-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: var(--radius, 8px);
  background: #fff;
  color: var(--text-secondary, #475569);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tsk-side-tab:hover {
  border-color: var(--blue, #10ABD6);
  color: var(--blue, #10ABD6);
  transform: translateY(-1px);
}
.tsk-side-tab.active {
  border-color: var(--blue, #10ABD6);
  background: rgba(16, 171, 214, 0.08);
  color: var(--blue, #10ABD6);
  box-shadow: 0 0 0 1px var(--blue, #10ABD6);
}
.tsk-side-thumb {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 2px;
}
.tsk-side-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tsk-side-tab i { font-size: 1.2rem; margin-bottom: 2px; }
.tsk-side-label { font-size: 0.65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58px; }
.tsk-side-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange, #f97316);
  position: absolute;
  top: 4px;
  right: 4px;
  border: 1px solid #fff;
}
.tsk-tool-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
@media (max-width: 991px) {
  .tsk-tool-buttons { flex-direction: row; gap: 6px; }
}
.tsk-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 54px;
  border: none;
  border-radius: var(--radius, 8px);
  background: transparent;
  color: var(--text-secondary, #475569);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px;
}
.tsk-tool-btn i { font-size: 1.15rem; margin-bottom: 3px; }
.tsk-tool-btn span { font-size: 0.65rem; font-weight: 600; }
.tsk-tool-btn:hover {
  background: rgba(16, 171, 214, 0.08);
  color: var(--blue, #10ABD6);
}
.tsk-tool-btn.active {
  background: var(--blue, #10ABD6);
  color: #fff;
  box-shadow: 0 4px 10px rgba(16, 171, 214, 0.25);
}

/* CENTER WORKSPACE */
.tsk-studio-center {
  display: flex;
  flex-direction: column;
  position: relative;
  background: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
}
.tsk-studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  z-index: 20;
  height: 48px;
}
.tsk-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tsk-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--text-secondary, #475569);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.tsk-action-btn:hover:not(:disabled) {
  background: rgba(16, 171, 214, 0.1);
  color: var(--blue, #10ABD6);
}
.tsk-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.tsk-zoom-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  min-width: 44px;
  text-align: center;
}
.tsk-autosave-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--success, #10b981);
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: 600;
}
.tsk-autosave-status.visible { opacity: 1; }
.tsk-autosave-status.saving { color: var(--text-muted, #94a3b8); }

/* MOCKUP STAGE & CANVAS OVERLAY */
.tsk-mockup-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  position: relative;
  min-height: 520px;
}
.tsk-mockup-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 680px;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.tsk-garment-image {
  display: block;
  max-height: 580px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 768px) {
  .tsk-garment-image { max-height: 400px; }
}
.tsk-print-area-outline {
  position: absolute;
  border: 2px dashed var(--blue, #10ABD6);
  background: rgba(16, 171, 214, 0.02);
  pointer-events: none;
  z-index: 5;
  box-sizing: border-box;
  border-radius: 4px;
}
.tsk-print-area-label {
  position: absolute;
  top: -24px;
  left: -2px;
  background: var(--blue, #10ABD6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
  white-space: nowrap;
}
.tsk-canvas-overlay {
  position: absolute;
  z-index: 10;
  box-sizing: border-box;
}
.tsk-canvas-overlay .canvas-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
.tsk-canvas-overlay canvas {
  width: 100% !important;
  height: 100% !important;
}

/* RIGHT COLUMN PRICING WIDGET */
.tsk-pricing-widget-wrap {
  margin-top: 20px;
  margin-bottom: 24px;
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.tsk-pricing-header { margin-bottom: 14px; }
.tsk-pricing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--blue, #10ABD6), var(--orange, #f97316));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
}
.tsk-pricing-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-light, #cbd5e1);
}
.tsk-pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
}
.tsk-pricing-amount { color: var(--blue, #10ABD6); font-size: 1.25rem; }
.tsk-add-to-cart-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--blue, #10ABD6), #0a8db3);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(16, 171, 214, 0.35);
}
.tsk-add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 171, 214, 0.45);
}
.tsk-add-to-cart-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* Hide default WooCommerce Add to Cart button when customizable */
.teeskull-pdp.tsk-customizable form.cart .single_add_to_cart_button {
  display: none !important;
}

/* Properties Panel */
.tsk-properties-panel {
  border-left: 1px solid var(--border-light);
  background: var(--card-bg);
  overflow-y: auto;
  max-height: 600px;
}
@media (max-width: 991px) {
  .tsk-properties-panel {
    border-left: none;
    border-top: 1px solid var(--border-light);
    max-height: 400px;
  }
}
.tsk-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 2;
}
.tsk-panel-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tsk-panel-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.tsk-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Controls */
.tsk-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tsk-control-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tsk-control-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.tsk-flex-1 { flex: 1; }

.tsk-input, .tsk-select {
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: var(--card-bg);
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s;
}
.tsk-input:focus, .tsk-select:focus {
  border-color: var(--blue);
  outline: none;
}
.tsk-range {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
}
.tsk-color-input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: var(--card-bg);
}
.tsk-btn-group {
  display: flex;
  gap: 2px;
}
.tsk-style-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.82rem;
}
.tsk-style-btn:hover { border-color: var(--blue); color: var(--blue); }
.tsk-style-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Object Actions */
.tsk-object-actions {
  display: flex;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}
.tsk-action-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}
.tsk-action-sm:hover { border-color: var(--blue); color: var(--blue); }
.tsk-action-danger:hover { border-color: var(--danger); color: var(--danger); }

/* Buttons */
.tsk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.tsk-btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.tsk-btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.tsk-btn-full { width: 100%; }
.tsk-btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
}
.tsk-btn-primary:hover {
  box-shadow: var(--shadow-blue);
  transform: translateY(-1px);
}
.tsk-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Upload Zone */
.tsk-upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.tsk-upload-zone:hover, .tsk-upload-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.tsk-upload-zone i { font-size: 2rem; margin-bottom: 8px; display: block; }
.tsk-upload-zone p { margin: 0 0 4px; font-weight: 600; font-size: 0.85rem; }
.tsk-upload-hint { font-size: 0.72rem; opacity: 0.6; }

/* Shape Grid */
.tsk-shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.tsk-shape-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}
.tsk-shape-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

/* Clipart */
.tsk-clipart-categories {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.tsk-clipart-cat-btn {
  padding: 4px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.tsk-clipart-cat-btn:hover, .tsk-clipart-cat-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.tsk-clipart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.tsk-clipart-item {
  aspect-ratio: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
}
.tsk-clipart-item:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}
.tsk-clipart-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tsk-clipart-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Layers */
.tsk-layers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tsk-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}
.tsk-layer-item:hover { background: var(--blue-light); }
.tsk-layer-item.active { border-color: var(--blue); background: var(--blue-light); }
.tsk-layer-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.tsk-layer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.tsk-layer-actions {
  display: flex;
  gap: 2px;
}
.tsk-layer-action {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.68rem;
  border-radius: 3px;
}
.tsk-layer-action:hover { background: var(--border-light); color: var(--text); }

/* Pricing Widget */
.tsk-pricing-widget {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.tsk-pricing-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tsk-pricing-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue);
  font-family: var(--font-heading);
}
.tsk-pricing-breakdown {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.tsk-pricing-breakdown span { margin-right: 10px; }

/* Cart badge */
.tsk-cart-custom-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-light);
  color: var(--blue);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 767px) {
  .tsk-customizer-workspace {
    border-radius: var(--radius);
  }
  .tsk-canvas-area {
    padding: 12px;
    min-height: 350px;
  }
  .tsk-properties-panel {
    max-height: 350px;
  }
  .tsk-pricing-widget {
    flex-direction: column;
    text-align: center;
  }
}

/* Canvas object selection styling */
.canvas-container {
  border-radius: var(--radius) !important;
}
