/* Self-Hosted Inter Font (Local WOFF2) */


body, * { font-family: 'Inter', sans-serif; }
/* Range Slider Touch-Scroll Protection & Tactile Thumbs */
input[type="range"] {
  accent-color: #10b981;
  touch-action: pan-y !important;
  -webkit-tap-highlight-color: transparent !important;
  flex: 1 1 auto;
  min-width: 60px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: transform 0.12s ease;
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
  cursor: grabbing;
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* Stepper Buttons for Mobile Precision & Scroll Safety */
.slider-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
  margin-bottom: 2px;
}
.slider-step-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  line-height: 1;
}
.slider-step-btn:hover {
  background-color: #334155;
  color: #ffffff;
  border-color: #475569;
}
.slider-step-btn:active {
  background-color: #10b981;
  color: #020617;
  border-color: #10b981;
  transform: scale(0.92);
}

.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #0f172a; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Override global header from style.css so studio header flows naturally in flex column without overlapping sidebar tabs */
header.studio-header,
header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: 3.5rem !important; /* 56px / h-14 */
  padding: 0 1rem !important; /* overrides style.css padding: 0 8% */
  z-index: 30 !important;
}

/* Clean Overlay for Toast */
.studio-toast {
  position: fixed;
  bottom: 85px;
  left: 50%;
  right: auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #10b981;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translate(-50%, 80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 90vw;
}
.studio-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  /* On desktop, center the toast over the 3D viewport (leaving the right sidebar completely free) */
  .studio-toast {
    left: calc((100vw - 420px) / 2);
    bottom: 32px;
    transform: translate(-50%, 80px);
  }
  .studio-toast.show {
    transform: translate(-50%, 0);
  }
}

/* Keep shop cart drawer styles consistent */
.cart-drawer {
  z-index: 9999;
}
.cart-overlay {
  z-index: 9998;
}

/* Step-by-step Studio Navigation Tabs */
.tab-btn {
  position: relative;
  transition: all 0.2s ease-in-out;
}
.tab-btn .step-num {
  background-color: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  transition: all 0.2s ease-in-out;
}
.tab-btn:hover .step-num {
  border-color: #475569;
  color: #f1f5f9;
  background-color: #334155;
}
.tab-btn.active .step-num {
  background-color: #10b981;
  color: #020617;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}
.tab-btn .step-lbl {
  color: #64748b;
  transition: color 0.2s ease-in-out;
}
.tab-btn.active .step-lbl {
  color: #34d399;
}
.tab-btn .tab-title {
  color: #94a3b8;
  transition: color 0.2s ease-in-out;
}
.tab-btn:hover .tab-title {
  color: #e2e8f0;
}
.tab-btn.active .tab-title {
  color: #ffffff;
  font-weight: 700;
}

/* Fullscreen Mode (Whole Studio fills screen) */
:fullscreen,
:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* Document & Body Scrolling for Hybrid Studio + SEO Article Architecture */
html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: #020617;
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* When in App Fullscreen Mode, lock page scroll */
body.is-app-fullscreen,
html.is-app-fullscreen {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
}

body.is-app-fullscreen .studio-root-container {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
}

/* Root Studio App Container in standard view */
.studio-root-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

/* Mobile & Tablet Responsive Layout (Split View) */
@media (max-width: 1024px) {
  /* Allow vertical scrolling on mobile body while preventing horizontal spill */
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    position: relative !important;
  }

  body.is-app-fullscreen,
  html.is-app-fullscreen {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  /* Root Studio App Container occupies the initial mobile viewport */
  .studio-root-container {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }

  /* Main Workspace: Vertical Split View (3D Canvas top, Controls bottom) */
  .flex-1.flex.overflow-hidden.relative {
    flex-direction: column !important;
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    overflow: hidden !important;
  }

  /* 3D Canvas Viewport: dedicated top area */
  #canvasContainer {
    height: 42vh !important;
    min-height: 240px !important;
    max-height: 48vh !important;
    flex: none !important;
    width: 100% !important;
    position: relative !important;
  }

  /* Sticky Footer: Add to Cart Action must stay fully visible with safe-area support */
  .studio-sidebar-footer {
    flex-shrink: 0 !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 25 !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  /* Smooth finger rotation without scroll conflict */
  #canvasContainer canvas,
  #threeCanvas {
    touch-action: none !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Settings Sidebar: full-width bottom scrollable panel */
  aside {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 0% !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    height: auto !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    z-index: 20 !important;
    box-sizing: border-box !important;
  }

  #sidebarScrollArea {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain !important;
    padding: 12px 14px 24px 14px !important;
  }

  /* Header compact styling */
  header.studio-header {
    height: 52px !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }

  /* Hide secondary desktop-only items from header on mobile */
  #headerTypeIcon,
  #headerStudioTitle,
  #headerWeightBadge,
  #headerTimeBadge,
  #quickFilamentBtn,
  #photoRenderBtn,
  #shareLinkBtn,
  #randomizeBtn,
  #topAddToCartBtn,
  #quickGuideBtn,
  #seoFaqBtn {
    display: none !important;
  }

  /* Price badge compact & single-line */
  #headerPriceBadge {
    padding: 4px 8px !important;
    font-size: 0.78rem !important;
    margin-left: auto !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
  #headerPriceBadge span#headerPriceText {
    white-space: nowrap !important;
    font-size: 0.8rem !important;
  }

  /* Header icon buttons compact square on mobile */
  #headerFullscreenBtn,
  #btn-open-cart {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  /* Camera toolbar on canvas */
  #canvasContainer .absolute.top-4.left-4 {
    top: 8px !important;
    left: 8px !important;
    gap: 4px !important;
  }
  #canvasContainer .absolute.top-4.left-4 button {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.85rem !important;
  }

  /* Mobile floating action icons on canvas top-right */
  .mobile-canvas-actions {
    top: 8px !important;
    right: 8px !important;
    gap: 4px !important;
  }
  .mobile-canvas-actions button {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.85rem !important;
  }

  /* HUD status bar on canvas bottom */
  #canvasContainer .absolute.bottom-4.left-4 {
    bottom: 6px !important;
    left: 6px !important;
    right: 6px !important;
    gap: 4px !important;
  }
  #hudOverhangCard,
  #canvasContainer .absolute.bottom-4.left-4 > div {
    padding: 3px 8px !important;
    font-size: 10px !important;
  }

  /* Step navigation tabs */
  .tab-btn {
    padding: 10px 4px !important;
  }
  .tab-btn .tab-title {
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }
  #filamentCountBadge {
    font-size: 9.5px !important;
    padding: 1.5px 5px !important;
    line-height: 1 !important;
  }

  /* Swatches palette grid on mobile: 3 columns */
  #swatchesContainer {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-height: 220px !important;
  }

  /* Mobile stepper buttons: larger touch targets for fingers */
  .slider-stepper-wrap {
    gap: 10px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
  }
  .slider-step-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    font-size: 17px !important;
    color: #cbd5e1 !important;
  }

  /* Sticky sidebar bottom add to cart bar */
  aside > div:last-child {
    padding: 10px 12px !important;
  }
}

/* SEO Article & Technical Documentation Styling */
.seo-article-section {
  background: radial-gradient(circle at 50% 0%, #0f172a 0%, #020617 100%);
  color: #cbd5e1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.seo-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease;
}

.seo-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.seo-table th {
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #334155;
}

.seo-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

/* SEO Article and Footer Isolation from global style.css */
.seo-article-section header,
.seo-article-section div,
.seo-article-section article {
  position: static;
  background-color: transparent;
}

.seo-article-section .seo-card {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(8px) !important;
}

/* Universal Footer Styling for Vase & Bowl Studio */
#global-footer footer {
  position: static !important;
  background-color: #020617 !important; /* deep slate-950 */
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
  margin-top: 0 !important;
}

#global-footer .footer-col-title {
  color: #f8fafc !important;
  font-weight: 700 !important;
}

#global-footer .footer-links a {
  color: #94a3b8 !important;
  text-decoration: none !important;
}

#global-footer .footer-links a:hover {
  color: #10b981 !important; /* emerald accent */
  padding-left: 4px;
}

#global-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #64748b !important;
}

#global-footer .footer-bottom a {
  color: #94a3b8 !important;
}

#global-footer .footer-bottom a:hover {
  color: #10b981 !important;
}

/* Universal Studio Search Dropdown */
.search-container #search-results {
  background: #0f172a !important; /* slate-900 */
  border: 1px solid #334155 !important; /* slate-700 */
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.7), 0 8px 10px -6px rgb(0 0 0 / 0.7) !important;
  border-radius: 12px !important;
}

.search-container #search-results a {
  color: #f8fafc !important;
  border-bottom: 1px solid #1e293b !important;
  font-size: 0.8rem !important;
  padding: 0.6rem 0.85rem !important;
}

.search-container #search-results a:hover {
  background-color: #1e293b !important;
  color: #34d399 !important;
}

/* Responsive HUD Status & Mobile Drawer */
#hudMobileCard {
  animation: hudCardSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.95);
}

@keyframes hudCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#btnToggleHud {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.88);
}

#btnToggleHud:hover {
  background: rgba(30, 41, 59, 0.95);
}




