/* ═══════════════════════════════════════════════════════════════
   INK'D CONFIGURATOR — Lava theme UI overrides
   Matches index.html design system. No JS/IDs changed.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --cfg-bg: #0a0a0a;
  --cfg-panel: #111111;
  --cfg-input: #1a1a1a;
  --cfg-accent: #ff4500;
  --cfg-accent-light: #ff6b35;
  --cfg-glow: rgba(255,69,0,0.25);
  --cfg-border: rgba(255,255,255,0.06);
  --cfg-border-accent: rgba(255,69,0,0.35);
  --cfg-text: #ffffff;
  --cfg-text-muted: #888888;
}

/* ── Body & font ───────────────────────────────────────────────── */
body {
  font-family: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  /* Match the lava gradient used behind the configurator so
     any spare space (top/bottom of the viewport) blends in
     instead of showing as a flat black band. */
  background:
    linear-gradient(145deg, #1a0a0a 0%, #0d0505 25%, #2a0f0f 50%, #150505 75%, #0a0303 100%) !important;
  background-size: cover;
  background-position: center;
}

/* ── Step indicator bar ────────────────────────────────────────── */
.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 0;
  background: rgba(10,10,10,0.8);
  border-bottom: 1px solid rgba(255,69,0,0.1);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.step-bar .step { color: #555; padding: 0 20px; }
.step-bar .step.active { color: #ff6b35; font-weight: 700; }
.step-bar .step-divider { color: #333; margin: 0 8px; }

/* ── Nav: sticky glass + lava ───────────────────────────────────── */
#nav {
  background: rgba(10,10,10,0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,69,0,0.2) !important;
  box-shadow: none !important;
  padding: 10px 24px !important;
}
#nav.stone-bar { background: rgba(10,10,10,0.95) !important; }
.nav-center {
  font-family: 'Black Ops One', cursive !important;
  font-size: 1rem !important;
  letter-spacing: 0.06em;
  color: var(--cfg-text) !important;
  pointer-events: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  left: calc(50% - 260px) !important;
  top: 45% !important;
  transform: translate(-50%, -50%) !important; /* moved left so T-SHIRT/TUMBLER/BLANKET don’t overlap Design Studio / Home */
}
.nav-switch {
  padding: 8px 18px !important;
  border-radius: 50px !important;
  border: 1px solid rgba(255,69,0,0.3) !important;
  background: #1a1a1a !important;
  color: #ff6b35 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  transition: all 0.25s ease !important;
  flex-shrink: 0 !important;
  margin: 0 2px !important;
}
.nav-switch:hover {
  background: rgba(255,69,0,0.1) !important;
  border-color: var(--cfg-accent) !important;
  color: #fff !important;
}
.nav-switch.active {
  background: linear-gradient(135deg, #ff4500, #ff6b35) !important;
  border-color: var(--cfg-accent) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(255,69,0,0.4) !important;
}
/* Keep nav-right links from shifting on click/focus */
.nav-right {
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}
.nav-site-link {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #ccc !important;
  text-decoration: none !important;
  border-radius: 6px !important;
  transition: color 0.2s ease !important;
  border: 1px solid transparent !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}
.nav-site-link:hover { color: #ff6b35 !important; }
.nav-site-link:focus,
.nav-site-link:active {
  outline: none !important;
  padding: 6px 12px !important;
  border: 1px solid transparent !important;
}
.nav-cart-link {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #ff6b35 !important;
  text-decoration: none !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255,69,0,0.3) !important;
  transition: color 0.2s ease, background 0.2s ease !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}
.nav-cart-link:hover {
  background: rgba(255,69,0,0.1) !important;
  color: #fff !important;
}

/* ── Configurator product switcher (tabs / dropdown) ────────────── */
.cfg-mobile-tabs {
  /* Hide by default (desktop); shown only on mobile breakpoint below */
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 0;
  padding: 0 16px;
  max-width: 560px;
}
.cfg-mobile-tabs[aria-label] {
  /* Deprecated container: kept only so any existing markup doesn’t break. */
}
.cfg-mobile-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px; /* strong pill shape */
  border: 1px solid var(--cfg-border-accent);
  background: radial-gradient(circle at 0 0, rgba(255,69,0,0.35), transparent 55%),
              rgba(10,10,10,0.96);
  color: var(--cfg-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.1;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7), 0 10px 24px rgba(0,0,0,0.85);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}
.cfg-mobile-home:hover,
.cfg-mobile-home:focus {
  border-color: var(--cfg-accent);
  background: radial-gradient(circle at 0 0, rgba(255,107,53,0.55), transparent 55%),
              rgba(15,15,15,0.98);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0,0,0,0.95), 0 0 16px rgba(255,69,0,0.55);
  transform: translateY(-1px);
}
.cfg-mobile-label {
  font-family: 'Black Ops One', cursive;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cfg-text-muted);
  white-space: nowrap;
}
.cfg-mobile-select-wrap {
  position: relative;
  flex: 1 1 auto;
}
.cfg-mobile-select {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--cfg-border-accent);
  background:
    radial-gradient(circle at 100% 0, rgba(255,69,0,0.35), transparent 55%),
    rgba(10,10,10,0.96);
  color: var(--cfg-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  appearance: none;
  line-height: 1.1;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7), 0 10px 24px rgba(0,0,0,0.85);
}
.cfg-mobile-select:focus {
  outline: none;
  border-color: var(--cfg-accent);
  box-shadow: 0 0 0 2px var(--cfg-glow), 0 12px 26px rgba(0,0,0,0.95);
}

/* Overlay variants: sit on the canvas with Home/Fullscreen on top,
   Background bottom‑left and Product chooser bottom‑right.
   Match Fullscreen/Home button look. */
.cfg-mobile-home--overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 30;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  background: rgba(0,0,0,0.7) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6) !important;
  text-decoration: none;
}
.cfg-mobile-home--overlay:hover,
.cfg-mobile-home--overlay:focus {
  background: rgba(0,0,0,0.85) !important;
  border-color: rgba(255,255,255,0.5) !important;
  color: #fff !important;
}
.cfg-mobile-select-wrap--overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cfg-mobile-select-wrap--overlay .cfg-mobile-select {
  padding: 6px 28px 6px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  background: rgba(0,0,0,0.7) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6) !important;
  min-height: auto !important;
}
.cfg-mobile-select-wrap--overlay .cfg-mobile-select:focus {
  border-color: rgba(255,255,255,0.5) !important;
  background: rgba(0,0,0,0.85) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6) !important;
}
.cfg-mobile-label--overlay {
  display: none !important;
}

/* Only show the overlay versions on small screens; desktop stays clean */
@media (min-width: 769px) {
  .cfg-mobile-home--overlay,
  .cfg-mobile-select-wrap--overlay {
    display: none !important;
  }
}
.cfg-mobile-select-chevron {
  /* The tiny chevron icon on the mobile product dropdown.
     Hidden to avoid the stray “dot” artifact the user reported. */
  display: none;
}

/* Compact colour row under product selector (desktop)
   (now fully disabled to avoid the stray floating colour strip) */
.cfg-color-row {
  display: none !important;
}
.cfg-color-swatch-wrap {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  box-shadow: 0 0 12px rgba(0,0,0,0.7);
}
.cfg-color-swatch-wrap .color-swatch {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  box-shadow: none !important;
}
.cfg-color-swatch-wrap .color-swatch.active {
  box-shadow: 0 0 8px rgba(255,69,0,0.8) !important;
}

@media (max-width: 768px) {
  .cfg-color-row {
    display: none !important; /* keep mobile clean; use left sidebar colours */
  }
}

/* Desktop-only styling for the Background pill + dropdown in the left rail */
#bgThemeSelectDesktop {
  width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background:
    radial-gradient(circle at 0 0, rgba(255,69,0,0.35), transparent 55%),
    rgba(10,10,10,0.96);
  color: var(--cfg-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
}
@media (max-width: 768px) {
  #bgThemeSelectDesktop {
    display: none !important;
  }
}

.sidebar-section-background {
  margin-top: 18px;
}
.sidebar-section-background .sidebar-sub-label {
  font-family: 'Black Ops One', cursive;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff6b35;
  margin-bottom: 6px;
}
.nav-cart-link:focus,
.nav-cart-link:active {
  outline: none !important;
  padding: 6px 12px !important;
  border: 1px solid rgba(255,69,0,0.3) !important;
}

/* ── Left sidebar: 220px glass panel ─────────────────────────────── */
#leftSidebar {
  width: 220px !important;
  /* Align the lava layout left rail with the nav so
     the left edge is a solid column from top to bottom. */
  top: 80px !important;
  background: rgba(10,10,10,0.92) !important;
  border-right: 1px solid rgba(255,69,0,0.15) !important;
  backdrop-filter: blur(16px);
  box-shadow: none !important;
  padding: 12px 12px 20px !important;
  align-items: stretch !important;
  overflow-y: auto !important;
}
#main {
  padding-left: 220px !important;
}
#leftSidebar .sidebar-label {
  writing-mode: horizontal !important;
  transform: none !important;
  font-family: 'Black Ops One', cursive !important;
  font-size: 11px !important;
  letter-spacing: 2px !important;
  color: #ff6b35 !important;
  padding: 16px 0 8px !important;
  border-bottom: 1px solid rgba(255,69,0,0.15) !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
#leftSidebar .sidebar-label::before { content: '🔥'; font-size: 12px; }
#leftSidebar .sidebar-desc { display: none !important; }
#leftSidebar .shirt-colour-inline { min-height: 0 !important; margin-bottom: 12px !important; }
#leftSidebar #shirtColorBar {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
  max-width: none !important;
  max-height: none !important;
  justify-content: center !important;
}
#leftSidebar #shirtColorBar .color-swatch {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 50% !important;
  border: 2px solid transparent !important;
  transition: all 0.2s ease !important;
}
#leftSidebar #shirtColorBar .color-swatch:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 0 8px rgba(255,69,0,0.4) !important;
}
#leftSidebar #shirtColorBar .color-swatch.active {
  border-color: #ff4500 !important;
  box-shadow: 0 0 10px rgba(255,69,0,0.6) !important;
  transform: scale(1.15) !important;
}
#leftSidebar .area-picker-section {
  border-top: 1px solid rgba(255,69,0,0.15) !important;
  padding-top: 12px !important;
  margin-top: 8px !important;
}
#leftSidebar .area-picker-label {
  font-family: 'Black Ops One', cursive !important;
  font-size: 11px !important;
  letter-spacing: 2px !important;
  color: #ff6b35 !important;
  margin-bottom: 10px !important;
}
#leftSidebar .area-picker-label::before { content: '🔥 '; }
#leftSidebar #areaPicker { flex-direction: column !important; gap: 8px !important; }
#leftSidebar .area-btn {
  width: 100% !important;
  height: auto !important;
  min-height: 52px !important;
  border-radius: 10px !important;
  padding: 10px !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  background: #1a1a1a !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  transition: all 0.2s ease !important;
}
#leftSidebar .area-btn:hover {
  border-color: rgba(255,69,0,0.4) !important;
  background: rgba(255,69,0,0.05) !important;
}
#leftSidebar .area-btn.active {
  border-color: #ff4500 !important;
  background: rgba(255,69,0,0.1) !important;
  box-shadow: 0 0 12px rgba(255,69,0,0.2) !important;
}
#leftSidebar .area-btn .area-thumb {
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0;
  border-radius: 6px !important;
}
#leftSidebar .area-btn .area-label {
  display: inline !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #ccc !important;
}
#leftSidebar .area-btn.active .area-label { color: #ff6b35 !important; }

/* ── App row: ensure canvas/viewport gets space; panel on right ── */
.app-row {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: row !important;
}
#main {
  flex: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  position: relative !important;
  /* Reserve space for the fixed right design panel
     so the canvas doesn’t run underneath it. */
  padding-right: 320px !important;
}
/* Viewport block: fill the central black area between left and right panels */
#viewportWrap {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  /* Push the lava scene further past the bottom edge
     so there’s no visible gap between it and the window. */
  bottom: -24px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
#viewport {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
/* Canvas fills viewport; JS reads clientWidth/clientHeight so it renders at 500×200 */
#viewport > canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
}


#viewportFullscreenBtn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 20 !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  background: rgba(0,0,0,0.7) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6) !important;
}
#viewportFullscreenBtn span {
  display: inline-block !important;
}
#viewportFullscreenBtn .fs-exit-icon { display: none !important; }

/* Home pill over the viewport — mirror fullscreen button on the left */
#homeOverlayBtn {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 20 !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  background: rgba(0,0,0,0.7) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6) !important;
}

body.fs-active #viewportWrap > #viewportFullscreenBtn,
body.fs-active #viewportWrap > #homeOverlayBtn {
  display: inline-flex !important;
}
body.fs-active #viewportFullscreenBtn .fs-enter-icon { display: none !important; }
body.fs-active #viewportFullscreenBtn .fs-exit-icon { display: inline-block !important; }

/* Show the Animate / Stop spin button only in fullscreen
   so the normal desktop header area stays clean. */
#bgAnimateBtn {
  display: none !important;
}
body.fs-active #bgAnimateBtn {
  display: inline-flex !important;
}

#rightPanel.right-sidebar-panel {
  /* Pin the design panel so it runs all the way
     from under the steps bar down to the window
     bottom, removing the gap you highlighted. */
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 105px !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 320px !important;
  max-width: 320px !important;
  min-width: 320px !important;
  height: auto !important;
  margin-left: 0 !important;
  order: 2 !important;
  align-items: stretch !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.right-sidebar-panel .mobile-drawer-inner {
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow-x: auto !important;
  overflow-y: auto !important;   /* allow horizontal scroll so right edge isn’t clipped */
  box-sizing: border-box !important;
  padding: 16px 12px 16px 16px !important;   /* slightly less right padding to show full layout */
}
.right-sidebar-panel .layout-panel,
.right-sidebar-panel .layout-preview-frame {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.right-sidebar-panel .layout-meta {
  white-space: normal !important;
  overflow-wrap: break-word !important;
  min-width: 0 !important;
}

/* ── Right sidebar panel (#rightPanel) — sleek vertical design panel ── */
#rightPanel {
  background: rgba(10,10,10,0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#rightPanel.right-sidebar-panel {
  border-top: none !important;
  border-left: 1px solid rgba(255,69,0,0.15) !important;
  box-shadow: -4px 0 24px rgba(0,0,0,0.4), inset 1px 0 0 rgba(255,255,255,0.03) !important;
  padding: 0 !important;
}
.right-sidebar-panel .panel-section-card,
.right-sidebar-panel #panelEditor,
.right-sidebar-panel #designAlways,
.right-sidebar-panel .panel-size-row {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 10px !important;
}

/* ── Flat layout preview card (used on tumbler) ─────────────────── */
.layout-panel {
  margin-bottom: 14px !important;
}
.layout-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.layout-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.layout-title-group .panel-label {
  margin-bottom: 0 !important;
}
.layout-meta {
  font-size: 11px;
  color: var(--cfg-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.layout-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.layout-btn {
  padding: 6px 10px !important;
  font-size: 10px !important;
  border-radius: 999px !important;
}
.layout-preview-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.layout-size-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cfg-text-muted);
}
.layout-preview-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--cfg-border);
  background: #111111;
  /* Tumbler wrap is 4:1; use same aspect so full left-to-right layout shows. */
  width: 100%;
  aspect-ratio: 4 / 1;
  height: auto;
  min-height: 120px;
}
.layout-preview-frame #layoutPreviewCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain;
}
.layout-checker {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.12) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.12) 75%, transparent 75%, transparent),
    linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.12) 25%, rgba(255,255,255,0.12) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.12) 75%, rgba(255,255,255,0.12));
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.45;
}
#layoutPreviewCanvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}
.font-and-color-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.font-and-color-row select#fontSelect {
  flex: 1 1 auto;
}
.font-and-color-row .text-color-selector-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-panel--meta {
  /* On small screens, we hide the header and meta rows to save space,
     but keep the actual layout canvas available if needed. */
}
@media (max-width: 768px) {
  .mobile-drawer-inner .panel-header {
    display: none !important;
  }
  /* Hide redundant text labels in the editor on phones to save space;
     keep inputs and colour picker accessible via placeholders and aria labels. */
  #panelEditor .panel-label {
    display: none !important;
  }
  .layout-panel--meta .layout-header-row,
  .layout-panel--meta .layout-size-label {
    display: none !important;
  }
  .layout-panel--meta {
    margin-bottom: 8px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
}
.bottom-bar-row1 { border-bottom: none !important; }
#panelEditor #textInput,
#panelEditor input,
#panelEditor textarea {
  background: #1a1a1a !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 10px 14px !important;
  font-family: 'Space Grotesk', sans-serif !important;
}
#panelEditor #textInput:focus {
  border-color: #ff4500 !important;
  box-shadow: 0 0 0 3px rgba(255,69,0,0.12) !important;
  outline: none !important;
}
#textColorInput {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
  border: 2px solid rgba(255,69,0,0.4) !important;
  background: #1a1a1a !important;
  cursor: pointer !important;
}
#panelEditor #fontSelect,
#shirtSizeSelect,
.compact-select {
  background: #1a1a1a !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 10px 14px !important;
}
#panelEditor #fontSelect:focus,
#shirtSizeSelect:focus {
  border-color: #ff4500 !important;
  box-shadow: 0 0 0 3px rgba(255,69,0,0.12) !important;
  outline: none !important;
}
/* Layer pills */
#designAlways .layer-item {
  background: #1a1a1a !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px !important;
  color: #ccc !important;
  padding: 8px 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}
#designAlways .layer-item:hover {
  border-color: rgba(255,69,0,0.3) !important;
  background: rgba(255,69,0,0.05) !important;
  color: #ff6b35 !important;
}
#designAlways .layer-item.active,
#designAlways .layer-item.busy {
  border-color: #ff4500 !important;
  background: rgba(255,69,0,0.1) !important;
  color: #ff6b35 !important;
  box-shadow: 0 0 12px rgba(255,69,0,0.2) !important;
  animation: none !important;
}
.add-layer-btn {
  background: transparent !important;
  border: 1px solid rgba(255,69,0,0.4) !important;
  color: #ff6b35 !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: all 0.25s ease !important;
}
.add-layer-btn:hover {
  background: rgba(255,69,0,0.1) !important;
  border-color: #ff4500 !important;
  box-shadow: 0 0 12px rgba(255,69,0,0.3) !important;
}
.clear-all-btn {
  background: rgba(220,38,38,0.15) !important;
  border: 1px solid rgba(220,38,38,0.4) !important;
  color: #ff6b6b !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  box-shadow: none !important;
}
.clear-all-btn:hover {
  background: rgba(220,38,38,0.25) !important;
  box-shadow: 0 0 12px rgba(220,38,38,0.3) !important;
}
.upload-image-btn {
  background: transparent !important;
  border: 1px solid rgba(255,69,0,0.4) !important;
  color: #ff6b35 !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  transition: all 0.25s ease !important;
}
.upload-image-btn:hover {
  background: rgba(255,69,0,0.1) !important;
  border-color: #ff4500 !important;
  box-shadow: 0 0 12px rgba(255,69,0,0.3) !important;
}
.ghost-btn.rainbow-btn,
#saveDesignBtn,
#importDesignBtn {
  background: transparent !important;
  border: 1px solid rgba(255,69,0,0.4) !important;
  color: #ff6b35 !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  transition: all 0.25s ease !important;
}
.ghost-btn.rainbow-btn:hover,
#saveDesignBtn:hover,
#importDesignBtn:hover {
  background: rgba(255,69,0,0.1) !important;
  border-color: #ff4500 !important;
  box-shadow: 0 0 12px rgba(255,69,0,0.3) !important;
}
.bottom-bar-add-to-cart #addToCart,
.primary-btn#addToCart {
  background: linear-gradient(135deg, #ff4500, #ff6b35) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 0 18px rgba(255,69,0,0.4) !important;
  transition: all 0.25s ease !important;
}
.bottom-bar-add-to-cart #addToCart:hover,
.primary-btn#addToCart:hover {
  box-shadow: 0 0 32px rgba(255,69,0,0.7) !important;
  transform: translateY(-1px) !important;
}

/* ── Order modal ────────────────────────────────────────────────── */
#orderModal {
  background: rgba(0,0,0,0.85) !important;
  backdrop-filter: blur(8px);
}
#orderModalBox {
  background: #111111 !important;
  border: 1px solid rgba(255,69,0,0.3) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 60px rgba(255,69,0,0.15), 0 24px 80px rgba(0,0,0,0.8) !important;
  padding: 32px !important;
  max-width: 520px !important;
}
#orderModalBox h2 {
  font-family: 'Black Ops One', cursive !important;
  font-size: 20px !important;
  color: #ff6b35 !important;
  letter-spacing: 1px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
#orderPreviewImg {
  border-radius: 10px !important;
  border: 1px solid rgba(255,69,0,0.2) !important;
  margin-bottom: 20px !important;
  background: #1a1a1a !important;
}
#orderModal .form-row label {
  font-size: 12px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: #888 !important;
  margin-bottom: 6px !important;
  margin-top: 16px !important;
}
#orderModal .form-row input,
#orderModal .form-row select,
#orderModal .form-row textarea {
  width: 100% !important;
  background: #1a1a1a !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 11px 14px !important;
  font-size: 14px !important;
  font-family: 'Space Grotesk', sans-serif !important;
}
#orderModal .form-row input:focus,
#orderModal .form-row select:focus {
  border-color: #ff4500 !important;
  box-shadow: 0 0 0 3px rgba(255,69,0,0.12) !important;
  outline: none !important;
}
#orderModalClose {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  background: none !important;
  border: none !important;
  color: #888 !important;
  font-size: 1.4rem !important;
  cursor: pointer !important;
  transition: color 0.2s !important;
}
#orderModalClose:hover { color: #ff6b35 !important; }
#orderModal .primary-btn#orderSendEmail {
  background: linear-gradient(135deg, #ff4500, #ff6b35) !important;
  border: none !important;
  color: #fff !important;
  padding: 14px 24px !important;
  font-weight: 700 !important;
  box-shadow: 0 0 18px rgba(255,69,0,0.4) !important;
}
#orderModal .secondary-btn#orderDownload {
  background: transparent !important;
  border: 1px solid rgba(255,69,0,0.4) !important;
  color: #ff6b35 !important;
}
#orderModal .secondary-btn#orderDownload:hover {
  background: rgba(255,69,0,0.1) !important;
  box-shadow: 0 0 12px rgba(255,69,0,0.3) !important;
}
#orderModal .btn-row { gap: 12px !important; margin-top: 24px !important; }
#orderModal .order-note {
  margin-top: 20px !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255,69,0,0.15) !important;
  font-size: 12px !important;
  color: #888 !important;
}
#orderModal .order-note strong { color: #ff6b35 !important; }

/* ── Canvas transform controls (#textHandleOverlay) ────────────── */
/* Transparent overlay so design text shows through; only dashed border and buttons are solid */
#textHandleOverlay {
  background: transparent !important;
  border: none !important;
  border-radius: 10px !important;
  backdrop-filter: none !important;
  /* Slight lift so the toolbar floats just above the text */
  padding: 8px !important;
  box-shadow: none !important;
  transform: translate(0, -10px) !important;
  z-index: 100 !important;
}
#thRing {
  position: relative !important;
  background: transparent !important;
  /* Let JS‑computed width/height hug the text box directly so
     the inner orange dashed line can sit tight around the text. */
  padding: 0 !important;
  box-shadow: none !important;
}
#thRing::before {
  content: '' !important;
  position: absolute !important;
  /* Draw the single orange dashed ring exactly on the edge of the
     overlay box (no extra inner spacing). */
  inset: 0 !important;
  border: 2px dashed rgba(255,105,53,0.9) !important;
  border-radius: 10px !important;
  pointer-events: none !important;
}
#textHandleOverlay .th-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 8px !important;
  background: #3a3a3e !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #ffffff !important;
  font-size: 17px !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
}
#textHandleOverlay .th-btn .th-icon {
  color: inherit !important;
  text-shadow: 0 0 1px rgba(0,0,0,0.5) !important;
}
#textHandleOverlay .th-btn:hover {
  background: rgba(255,69,0,0.25) !important;
  border-color: #ff4500 !important;
  color: #fff !important;
}
#textHandleOverlay .th-btn#hDelete:hover {
  background: rgba(220,38,38,0.3) !important;
  border-color: #dc2626 !important;
  color: #ffb3b3 !important;
}
#textHandleOverlay .resize-strip {
  border-color: rgba(255,69,0,0.4) !important;
}
#textHandleOverlay .resize-strip::after {
  color: #fff !important;
  text-shadow: 0 0 2px rgba(0,0,0,0.8) !important;
  background: #3a3a3e !important;
  border-color: rgba(255,255,255,0.2) !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
}
#textHandleOverlay .resize-strip:hover::after {
  background: #b45309 !important;
  border-color: #e6a23c !important;
  color: #fef3c7 !important;
}
#textHandleOverlay .resize-strip.active-resize::after,
#textHandleOverlay .resize-strip:active::after {
  background: #ff6b35 !important;
  border-color: #ff4500 !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(255,107,53,0.6) !important;
}

/* ── Loading overlay ───────────────────────────────────────────── */
#loadingMsg {
  background: rgba(10,10,10,0.9) !important;
  color: #ff6b35 !important;
  font-family: 'Black Ops One', cursive !important;
  letter-spacing: 3px !important;
  font-size: 16px !important;
  padding: 24px !important;
  border-radius: 12px !important;
}
@keyframes loadingDots {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}
#loadingMsg { animation: loadingDots 1.5s ease-in-out infinite; }

/* ── Scrollbars ─────────────────────────────────────────────────── */
#leftSidebar::-webkit-scrollbar,
#rightPanel::-webkit-scrollbar,
#orderModalBox::-webkit-scrollbar { width: 4px !important; }
#leftSidebar::-webkit-scrollbar-track,
#rightPanel::-webkit-scrollbar-track { background: #0a0a0a !important; }
#leftSidebar::-webkit-scrollbar-thumb,
#rightPanel::-webkit-scrollbar-thumb {
  background: #ff4500 !important;
  border-radius: 2px !important;
}
#leftSidebar::-webkit-scrollbar-thumb:hover,
#rightPanel::-webkit-scrollbar-thumb:hover { background: #ff6b35 !important; }

/* ── Mobile: stacked layout tuned for phones ───────────────────── */
@media (max-width: 768px) {
  /* Allow vertical scrolling on small screens (override desktop lock) */
  html {
    touch-action: pan-y !important;
    overscroll-behavior: contain !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  /* Prevent any horizontal overflow; allow vertical flow so page scrolls (match t-shirt) */
  .app-row {
    max-width: 100% !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    padding-left: env(safe-area-inset-left, 0) !important;
    padding-right: env(safe-area-inset-right, 0) !important;
  }
  #main {
    overflow: visible !important;
  }

  /* Hide desktop nav + step bar; canvas becomes first visible element */
  #nav,
  .step-bar {
    display: none !important;
  }

  /* Let swipes on the 3D view scroll the page instead of getting “stuck” */
  #viewportWrap,
  #viewport {
    touch-action: pan-y !important;
  }

  /* Centered single-column layout like a card */
  .app-row {
    flex-direction: column !important;
    align-items: center !important;
  }
  #main {
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  #viewportWrap,
  #rightPanel.right-sidebar-panel,
  #leftSidebar {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .cfg-mobile-tabs,
  .cfg-color-row {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Canvas comes first, then colour / print‑area block (left sidebar) */
  #viewportWrap { order: 0 !important; margin: 0 auto 0 !important; }
  #leftSidebar {
    order: 1 !important;
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 8px 12px !important;
    margin: 0 auto 8px !important;
    overflow: visible !important;
  }
  #leftSidebar .shirt-colour-inline {
    width: 100% !important;
    margin-bottom: 8px !important;
    min-height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  #leftSidebar #shirtColorBar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
    max-width: none !important;
    max-height: none !important;
  }

  /* Hide print-area buttons on phones to keep things clean */
  #leftSidebar .area-picker-section {
    display: none !important;
  }

  /* Canvas sits between nav/left-strip and design panel */
  #viewportWrap {
    position: relative !important;
    inset: auto !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 46vh !important;
    min-height: 260px !important;
  }
  #viewport {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
  }
  #viewport > canvas {
    position: relative !important;
    inset: auto !important;
  }

  /* Design panel becomes a full‑width block below the canvas (t‑shirt, tumbler, blanket) */
  #rightPanel.right-sidebar-panel {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid rgba(255,69,0,0.15) !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.6) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .right-sidebar-panel .mobile-drawer-inner {
    max-height: none !important;
  }

  /* Make controls stack nicely */
  .bottom-bar-row1,
  .bottom-bar-row2,
  .panel-size-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #rightPanel button,
  #rightPanel select,
  #rightPanel textarea,
  #rightPanel input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mobile configurator dropdown under the canvas */
  .cfg-mobile-tabs {
    /* Tuck the buttons closer to the canvas so they sit well above
       the text editor and don’t cover what the user is typing. */
    margin: 2px auto -4px !important;
    padding: 0 12px !important;
    max-width: 480px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }
  .cfg-mobile-home {
    padding: 7px 14px !important;
    font-size: 0.8rem !important;
  }
  .cfg-mobile-home,
  .cfg-mobile-select {
    min-height: 32px !important;
  }
  .cfg-mobile-label {
    font-size: 8px !important;
    letter-spacing: 0.12em !important;
  }
  .cfg-mobile-select-wrap {
    flex: 1 1 0 !important;
  }
  .cfg-mobile-select {
    font-size: 0.78rem !important;
  }

  /* Make the text editor feel roomy on phones */
  #panelEditor #textInput {
    min-height: 72px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  /* Use only the in-panel Add to Cart on phones; hide floating FAB */
  #inkd-mobile-cart-fab {
    display: none !important;
  }
  .bottom-bar-add-to-cart #addToCart,
  .primary-btn#addToCart {
    width: 100% !important;
    justify-content: center !important;
  }

  #leftSidebar .sidebar-label { display: none !important; }
  /* On phones, colour swatches can wrap so they don’t force horizontal overflow */
  #leftSidebar #shirtColorBar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
    max-width: 100% !important;
  }
  #leftSidebar #shirtColorBar .color-swatch {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
  }
  #leftSidebar .area-btn .area-label { display: none !important; }
  .step-bar { font-size: 10px !important; padding: 6px 4px !important; }
  .step-bar .step { padding: 0 8px !important; }
}
