/* CSS variables for a modern, dark, glassmorphic wood-craft design system */
:root {
  --bg-app: #090b0e;
  --bg-sidebar: rgba(15, 18, 24, 0.8);
  --bg-panel: rgba(22, 27, 38, 0.65);
  --bg-card: #161b26;
  --accent-color: #d4a373; /* Modern warm wood bronze */
  --accent-hover: #e9c46a;
  --text-primary: #f8f9fa;
  --text-secondary: #adb5bd;
  --text-muted: #6c757d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(212, 163, 115, 0.5);
  
  --color-cut: #4d94ff;
  --color-engrave: #ff4d4d;
  
  --font-main: 'Outfit', sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  
  --glass-blur: blur(12px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background-color: rgba(9, 11, 14, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  color: var(--accent-color);
  filter: drop-shadow(0 0 6px rgba(212, 163, 115, 0.4));
  animation: logo-glow 3s infinite alternate;
}

@keyframes logo-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(212, 163, 115, 0.3)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(212, 163, 115, 0.6)); }
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
}

.app-nav {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: var(--bg-app);
  background-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(212, 163, 115, 0.35);
}

.badge {
  background-color: #ff4d4d;
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Layout Views */
.app-content {
  flex: 1;
  position: relative;
}

.view-section {
  display: none;
  padding: 24px 40px;
}

.view-section.active {
  display: block;
}

/* Editor View Layout */
.editor-layout {
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  gap: 24px;
  height: calc(100vh - 120px);
}

@media (max-width: 1200px) {
  .editor-layout {
    grid-template-columns: 300px 1fr;
    height: auto;
  }
  .editor-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-sidebar {
    grid-column: 1;
  }
}

/* Sidebar Layout */
.editor-sidebar, .editor-summary {
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.sidebar-group h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-color);
  margin-bottom: 12px;
  font-weight: 700;
}

/* Template Selector */
.template-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-card:hover {
  border-color: rgba(212, 163, 115, 0.4);
  transform: translateY(-2px);
}

.template-card.active {
  border-color: var(--accent-color);
  background: rgba(212, 163, 115, 0.08);
  box-shadow: inset 0 0 12px rgba(212, 163, 115, 0.15);
}

.card-icon {
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.template-card.active .card-icon {
  background: var(--accent-color);
  color: var(--bg-app);
}

.card-label h3 {
  font-size: 0.875rem;
  font-weight: 600;
}

.card-label p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Thickness Selector */
.thickness-selector {
  display: flex;
  gap: 8px;
}

.thickness-btn {
  flex: 1;
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  position: relative;
}

.thickness-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.thickness-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.thickness-btn.active {
  border-color: var(--accent-color);
  background: rgba(212, 163, 115, 0.1);
  color: var(--accent-color);
}

/* Control Fields */
.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.control-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.control-row {
  display: flex;
  gap: 12px;
}

.control-field.half {
  flex: 1;
}

.form-control {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  width: 100%;
  transition: all 0.25s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.2);
}

.form-control option, select option {
  background-color: #1a1b23 !important;
  color: #ffffff !important;
}

.range-control {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-panel);
  outline: none;
  margin: 10px 0;
}

.range-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.range-control::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-val {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  display: block;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

/* Checkbox Toggle */
.toggle-field {
  flex-direction: row;
  align-items: center;
  margin-top: 10px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
  color: var(--text-primary);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
  border-color: rgba(212, 163, 115, 0.5);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--bg-app);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Canvas Area */
.editor-canvas-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.scale-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.scale-label strong {
  color: var(--accent-color);
}

.legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-color.cut {
  background-color: var(--color-cut);
}

.legend-color.engrave {
  background-color: var(--color-engrave);
}

.canvas-workspace {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 380px;
  border-radius: var(--radius-md);
  overflow: auto; /* Enable scrollbars when zoomed in */
  background: rgba(0, 0, 0, 0.15);
  border: 1px dashed rgba(255, 255, 255, 0.05);
}

/* Grid behind the preview */
.canvas-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  z-index: 1;
  pointer-events: none; /* Make grid clicks pass-through */
}

/* Wood Preview Board styling */
.wood-preview-card {
  position: relative;
  width: 320px;
  height: 320px;
  margin: auto; /* Keep centered when scrollable */
  flex-shrink: 0; /* Prevent container from squeezing card on zoom */
  background: 
    linear-gradient(rgba(172, 126, 75, 0.15), rgba(130, 89, 44, 0.25)),
    radial-gradient(circle at 60% 40%, rgba(246, 218, 178, 0.85) 0%, rgba(222, 180, 122, 0.95) 100%);
  box-shadow: 
    0 15px 35px rgba(0,0,0,0.5), 
    inset 0 0 20px rgba(0,0,0,0.2), 
    0 1px 3px rgba(255,255,255,0.1) inset;
  border-radius: var(--radius-md);
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Dynamic wood fibers */
.wood-preview-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 2px,
      rgba(92, 59, 23, 0.04) 2px,
      rgba(92, 59, 23, 0.04) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 8px,
      rgba(92, 59, 23, 0.015) 8px,
      rgba(92, 59, 23, 0.015) 16px
    );
  opacity: 0.8;
  pointer-events: none;
  mix-blend-mode: multiply;
  border-radius: inherit;
}

/* SVG Rendering */
#svg-preview {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

#svg-preview path, #svg-preview circle, #svg-preview rect {
  vector-effect: non-scaling-stroke;
}

/* Laser burning glowing simulation on vectors */
.laser-cut {
  stroke: var(--color-cut);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0.5px rgba(77, 148, 255, 0.5));
}

.laser-engrave {
  stroke: var(--color-engrave);
  stroke-width: 0.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.laser-engrave-filled {
  stroke: var(--color-engrave);
  stroke-width: 0.1;
  fill: var(--color-engrave);
}

.laser-wood-fill {
  fill: rgba(72, 45, 17, 0.08);
}

.canvas-footer {
  text-align: center;
  margin-top: 16px;
}

.canvas-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Summary Card styling */
.summary-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.summary-card h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-color);
  margin-bottom: 14px;
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.price-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

.price-row.total {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 700;
}

.price-row.total .highlight {
  color: var(--accent-color);
  font-size: 1.2rem;
}

/* Action buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-app);
  box-shadow: 0 4px 14px rgba(212, 163, 115, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 163, 115, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background-color: #ff4d4d;
  color: white;
}

.btn-danger:hover {
  background-color: #ff6666;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  width: auto;
}

.btn-block {
  width: 100%;
}

.info-notes h3 {
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.info-notes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-notes li {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  position: relative;
  padding-left: 12px;
}

.info-notes li::before {
  content: "•";
  color: var(--accent-color);
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
}

.modal.active {
  display: flex !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 10000 !important;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 1 !important;
  transform: scale(1);
}

.modal.active .modal-content {
  animation: modal-enter 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modal-enter {
  from { transform: scale(0.92) translateY(15px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0,0,0,0.1);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  margin-top: 18px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.form-section-title:first-of-type {
  margin-top: 0;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.form-row .control-field {
  flex: 1;
  margin-bottom: 0;
}

.checkout-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border: 1px solid var(--border-color);
}

.checkout-summary span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkout-summary strong {
  color: var(--accent-color);
  font-size: 1.25rem;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.25);
  border-radius: 50%;
  border-top-color: #000;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success Content */
.success-content {
  text-align: center;
  padding: 40px 24px;
  max-width: 420px;
}

.success-icon {
  background-color: rgba(77, 255, 148, 0.1);
  color: #4dff94;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 20px rgba(77, 255, 148, 0.25);
}

.success-content h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.success-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 6px;
}

.order-details-p {
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: inline-block;
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  margin-top: 10px;
}

/* Admin Dashboard Styling */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.admin-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
}

.admin-table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.admin-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.01);
}

.admin-table td {
  color: var(--text-primary);
}

.admin-table tbody tr:hover {
  background: rgba(255,255,255,0.015);
}

.text-center {
  text-align: center;
}

/* Mode Selector Styling */
.mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  margin-top: 8px;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: var(--font-main);
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--accent-color);
  color: var(--bg-app);
  box-shadow: var(--shadow-sm);
}

/* Textarea Customization */
textarea.form-control {
  resize: vertical;
  min-height: 120px;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Sandbox WYSIWYG Interactive Editing */
.sandbox-element-path {
  transition: opacity 0.2s;
  pointer-events: auto;
}

.sandbox-element-path:hover {
  opacity: 0.85;
}

.sandbox-element-path:hover .laser-cut,
.sandbox-element-path:hover .laser-engrave {
  stroke-width: 1.6px !important;
}

.sandbox-resize-handle {
  transition: fill 0.15s, stroke-width 0.15s;
  pointer-events: all;
}

.sandbox-resize-handle:hover {
  fill: #ffffff !important;
  stroke: var(--accent-color) !important;
  stroke-width: 0.75px !important;
}

.sandbox-selection-outline {
  pointer-events: none;
}

/* Sandbox Element Toolbar */
.toolbar-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.toolbar-btn:hover {
  background: rgba(212, 163, 115, 0.15);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.toolbar-btn:active {
  transform: translateY(0);
}

/* Category tabs inside Gallery Modal */
.category-tab {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.category-tab:hover {
  color: var(--text-primary);
  border-color: rgba(212, 163, 115, 0.4);
}

.category-tab.active {
  background: var(--accent-color) !important;
  color: var(--bg-app) !important;
  border-color: var(--accent-color) !important;
}

/* Template Gallery Cards */
.gallery-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-color);
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gallery-card.active {
  background: rgba(212, 163, 115, 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.gallery-card-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.5rem;
}

.gallery-card-info h3 {
  margin: 0 0 3px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gallery-card-info p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Layer list item delete button hover */
.layer-delete-btn:hover {
  transform: scale(1.25);
  color: #ff3333 !important;
}

/* Status Badge Styling */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  text-align: center;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-new {
  background: rgba(243, 156, 18, 0.12);
  color: #f39c12;
  border-color: rgba(243, 156, 18, 0.3);
}

.status-production {
  background: rgba(52, 152, 219, 0.12);
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.status-shipped {
  background: rgba(230, 126, 34, 0.12);
  color: #e67e22;
  border-color: rgba(230, 126, 34, 0.3);
}

.status-done {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.3);
}

.status-cancelled {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.3);
}

.status-select {
  padding: 6px 10px;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.status-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.2);
}

/* Delivery Options Grid */
.delivery-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.delivery-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  user-select: none;
}

.delivery-tile:hover {
  border-color: var(--accent-color);
  background: rgba(212, 163, 115, 0.05);
}

.delivery-tile.active {
  border-color: var(--accent-color);
  background: rgba(212, 163, 115, 0.12);
  box-shadow: 0 0 8px rgba(212, 163, 115, 0.2);
}

.delivery-tile input[type="radio"] {
  display: none;
}

.delivery-tile .tile-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.delivery-tile .tile-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.delivery-tile .tile-price {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 4px;
}

/* Bank Choice Grid */
.bank-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.bank-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bank-tile:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.bank-tile.active {
  border-color: var(--accent-color);
  background: rgba(212, 163, 115, 0.12);
  color: var(--text-primary);
  box-shadow: 0 0 8px rgba(212, 163, 115, 0.2);
}

.bank-tile input[type="radio"] {
  display: none;
}

/* Site Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.2s ease;
  font-family: inherit;
}

.footer-link-btn:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.footer-sep {
  color: rgba(255, 255, 255, 0.15);
}

.footer-credits p {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Legal Tabs */
.legal-tab-btn {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.legal-tab-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.legal-tab-btn.active {
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
}

/* Ensure Legal Modal stays on top of Checkout Modal */
#legal-modal {
  z-index: 11000;
}


