/* ============================================================
   ADDO 3D CONFIGURATOR - NEW BASE CSS
   Ultra Minimalist / Full White / Dynamic Dropdowns
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --light-gray: #f0f0f0;
  --mid-gray: #e0e0e0;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted: #999999;
  --accent: #1a1a1a;
  --accent-light: #f5f5f5;
  --border: #e8e8e8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT - FULL SCREEN SPLIT
   ============================================================ */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.viewer-section {
  flex: 1;
  position: relative;
  background: var(--off-white);
  overflow: hidden;
}

.config-section {
  width: 380px;
  min-width: 300px;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
}

/* ============================================================
   HEADER / BRAND BAR
   ============================================================ */
.brand-bar {
  padding: 12px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-logo {
  height: 54px;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.brand-logo:hover {
  opacity: 1;
}

.product-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ============================================================
   PRODUCT TITLE AREA
   ============================================================ */
.product-header {
  padding: 24px 24px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.product-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.product-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

.product-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* ============================================================
   CONFIGURATOR PANEL (scrollable)
   ============================================================ */
.config-panel {
  flex: 1;
  overflow-y: auto;
  padding: 10px 24px 24px;
  scroll-behavior: smooth;
}

.config-panel::-webkit-scrollbar {
  width: 3px;
}

.config-panel::-webkit-scrollbar-track {
  background: transparent;
}

.config-panel::-webkit-scrollbar-thumb {
  background: var(--mid-gray);
  border-radius: 10px;
}

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */
.config-group {
  margin-bottom: 8px;
}

.config-group-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-group:first-child .config-group-title {
  padding-top: 4px;
}

.config-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   DROPDOWN - THE STAR COMPONENT
   ============================================================ */
.dropdown-wrapper {
  position: relative;
  margin-bottom: 6px;
}

.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  gap: 12px;
}

.dropdown-trigger:hover {
  border-color: #ccc;
  box-shadow: var(--shadow-sm);
}

.dropdown-trigger.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.06);
}

.dropdown-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.dropdown-label-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.dropdown-label-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-preview {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  transition: transform var(--transition-fast);
}

.dropdown-trigger:hover .dropdown-preview {
  transform: scale(1.05);
}

.dropdown-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition-smooth);
  opacity: 0.4;
}

.dropdown-trigger.active .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 0.8;
}

.dropdown-chevron svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   DROPDOWN CONTENT - ANIMATED PANEL
   ============================================================ */
.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity var(--transition-fast),
              padding var(--transition-smooth);
  opacity: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-content.open {
  max-height: 2000px;
  opacity: 1;
  padding: 12px 0 4px;
}

/* ============================================================
   TEXTURE/COLOR GRID INSIDE DROPDOWN
   ============================================================ */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  padding: 4px 2px;
}

.swatch-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
  background-size: cover;
  background-position: center;
}

.swatch-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: all var(--transition-fast);
}

.swatch-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.swatch-item:hover::after {
  background: rgba(255,255,255,0.1);
}

.swatch-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.swatch-item.selected::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='10' height='10'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
  animation: checkPop 0.3s var(--transition-spring);
}

@keyframes checkPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.swatch-tooltip {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  background: var(--text-primary);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

.swatch-item:hover .swatch-tooltip {
  opacity: 1;
}

/* ============================================================
   MODEL TYPE SELECTOR
   ============================================================ */
.type-selector {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.type-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  letter-spacing: 0.3px;
}

.type-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.6);
}

.type-btn.active {
  background: var(--white);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* ============================================================
   MODEL VIEWER - 3D SCENE
   ============================================================ */
.viewer-section model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  --progress-mask: transparent;
}

.viewer-gradient {
  display: none;
}

/* ============================================================
   CONFIG FOOTER - FIXED AR BUTTON AT BOTTOM OF RIGHT PANEL
   ============================================================ */
.config-footer {
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.ar-config-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.ar-config-btn:hover {
  background: #333;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.ar-config-btn:active {
  transform: translateY(0);
}

.ar-config-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--white);
}

.ar-config-btn span {
  color: var(--white);
}

.ar-config-btn .ar-arrow {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: transform var(--transition-fast);
}

.ar-config-btn:hover .ar-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* ============================================================
   VIEWER CONTROLS - TOP BAR
   ============================================================ */
.viewer-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  z-index: 10;
}

.viewer-action-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.viewer-action-btn:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

.viewer-action-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

/* ============================================================
   HOTSPOTS
   ============================================================ */
.hotspot-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  --min-hotspot-opacity: 0;
}

.hotspot-btn:hover {
  transform: scale(1.15);
  background: rgba(26, 26, 26, 0.95);
}

.hotspot-btn .pulse-ring {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 1.5px solid rgba(26, 26, 26, 0.3);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hotspot-btn svg {
  width: 16px;
  height: 16px;
  fill: white;
  stroke: none;
}

/* ============================================================
   VIEWER CONTROLLER BAR - BOTTOM OF VIEWER
   Fully responsive: wraps & scrolls on all screen sizes
   ============================================================ */
.viewer-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  justify-content: center;
}

/* Control group - keeps related items together */
.ctrl-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Control item - each pill */
.ctrl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
  box-shadow: none;
  flex-shrink: 0;
}

.ctrl-item:hover {
  border-color: #ccc;
  color: var(--text-primary);
}

.ctrl-item.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.ctrl-item.active:hover {
  background: #333;
}

.ctrl-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

.ctrl-item.active svg {
  opacity: 1;
}

/* Divider between control groups */
.ctrl-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

/* Range slider inside controls */
.ctrl-slider {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: none;
  flex-shrink: 0;
}

.ctrl-slider label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.ctrl-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(40px, 6vw, 70px);
  height: 4px;
  background: var(--mid-gray);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.ctrl-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast);
}

.ctrl-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.ctrl-slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Slider icon (sun etc) */
.ctrl-slider svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.5;
}

/* Value display */
.ctrl-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

/* 3-way Tone Mapping Switcher (segmented control) */
.ctrl-tone-switcher {
  display: flex;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: none;
}

.tone-seg {
  padding: 7px 13px;
  border: none;
  background: transparent;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}

.tone-seg:hover {
  color: var(--text-primary);
}

.tone-seg.active {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ============================================================
   QR MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-spring);
}

.modal-overlay.visible .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--accent-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-card-close:hover {
  background: var(--mid-gray);
  transform: rotate(90deg);
}

.modal-qr {
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   LOADING ANIMATION
   ============================================================ */
.viewer-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--off-white);
  z-index: 5;
  transition: opacity 0.6s ease;
}

.viewer-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   SUBTLE ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.config-group {
  animation: fadeInUp 0.4s ease both;
}

.config-group:nth-child(1) { animation-delay: 0.05s; }
.config-group:nth-child(2) { animation-delay: 0.1s; }
.config-group:nth-child(3) { animation-delay: 0.15s; }
.config-group:nth-child(4) { animation-delay: 0.2s; }
.config-group:nth-child(5) { animation-delay: 0.25s; }

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media only screen and (max-width: 768px) {

  .app-container {
    flex-direction: column;
  }

  .viewer-section {
    height: 50vh;
    flex: none;
  }

  .config-section {
    width: 100%;
    height: 50vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: -16px;
    z-index: 100;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.08);
  }

  .config-section::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--mid-gray);
    border-radius: 2px;
    z-index: 10;
  }

  .brand-bar { padding: 16px 16px 10px; }

  .product-header {
    padding: 6px 16px 6px;
    padding-bottom: 8px;
  }
  .product-title { font-size: 18px; }
  .product-subtitle { font-size: 12px; margin-top: 2px; }
  .product-badge { font-size: 9px; padding: 3px 8px; }

  .config-panel { padding: 6px 16px 50px; }
  .config-group { margin-bottom: 4px; }
  .config-group-title { padding: 8px 0 6px; font-size: 9px; }
  .config-group:first-child .config-group-title { padding-top: 2px; }

  .dropdown-wrapper { margin-bottom: 4px; }
  .dropdown-trigger { padding: 10px 12px; gap: 10px; }
  .dropdown-label-title { font-size: 10px; }
  .dropdown-label-value { font-size: 13px; }
  .dropdown-preview { width: 30px; height: 30px; }

  .type-selector { padding: 3px; gap: 4px; margin-bottom: 10px; }
  .type-btn { padding: 8px 10px; font-size: 11px; }

  .swatch-grid {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 6px;
  }

  .config-footer {
    padding: 10px 16px;
  }

  .ar-config-btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .viewer-top-bar { padding: 10px 12px; }
  .brand-logo { height: 40px; }
  .viewer-action-btn { width: 34px; height: 34px; }
  .viewer-action-btn svg { width: 15px; height: 15px; }

  .modal-card { padding: 28px; }

  /* Controller bar mobile - fixed at very bottom of screen */
  .viewer-controls-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    scrollbar-width: none;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  }

  .viewer-controls-bar::-webkit-scrollbar {
    display: none;
  }

  .ctrl-group {
    flex-shrink: 0;
  }

  .ctrl-divider { display: none; }

  .ctrl-item {
    padding: 6px 10px;
    font-size: 11px;
  }

  .ctrl-item svg {
    width: 12px;
    height: 12px;
  }

  .ctrl-slider {
    padding: 5px 8px;
    gap: 4px;
  }

  .ctrl-slider label { font-size: 9px; }

  .ctrl-slider input[type="range"] {
    width: 40px;
    height: 3px;
  }

  .ctrl-slider input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
  }

  .ctrl-slider input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
  }

  .ctrl-slider svg {
    width: 12px;
    height: 12px;
  }

  .ctrl-value { font-size: 10px; min-width: 20px; }

  .ctrl-tone-switcher { padding: 2px; }
  .tone-seg { padding: 5px 9px; font-size: 11px; }

  /* AR button - float over viewer area as compact pill, right-aligned */
  .config-footer {
    position: fixed;
    top: calc(50vh - 64px);
    right: 10px;
    left: auto;
    padding: 0;
    border: none;
    background: none;
    z-index: 150;
    width: auto;
  }

  .ar-config-btn {
    width: auto;
    padding: 8px 14px;
    font-size: 11px;
    gap: 5px;
    border-radius: 100px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  }

  .ar-config-btn .ar-arrow { display: none; }
  .ar-config-btn img { width: 14px !important; height: 14px !important; }

  /* Hotspots smaller on mobile */
  .hotspot-btn { width: 30px; height: 30px; }
  .hotspot-btn svg { width: 13px; height: 13px; }
  .hotspot-btn .pulse-ring { width: 42px; height: 42px; }
}

/* Small mobile */
@media only screen and (max-width: 480px) {
  .viewer-controls-bar {
    gap: 3px;
    padding: 5px 6px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
  }

  .ctrl-item { padding: 5px 8px; font-size: 10px; }
  .ctrl-slider { padding: 4px 6px; }
  .tone-seg { padding: 4px 7px; font-size: 10px; }
  .product-title { font-size: 16px; }

  .config-footer {
    top: calc(50vh - 58px);
    right: 8px;
  }
  .ar-config-btn { padding: 7px 12px; font-size: 10px; }
}

@media only screen and (max-width: 380px) {
  .config-section { height: 52vh; }
  .viewer-section { height: 48vh; }
  .swatch-grid {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  }
  .config-footer {
    top: calc(48vh - 56px);
  }
}

/* Landscape mobile */
@media only screen and (max-height: 500px) and (orientation: landscape) {
  .viewer-controls-bar {
    padding: 4px 8px;
    gap: 3px;
  }
}

/* Small laptops - 13 inch screens: only narrow config panel & spacing */
@media only screen and (max-width: 1440px) and (min-width: 769px) {
  .config-section {
    width: 320px;
    min-width: 280px;
  }

  .viewer-controls-bar {
    gap: 4px;
    padding: 8px 10px;
  }

  .ctrl-divider { margin: 0 1px; }
}

/* Very small laptops */
@media only screen and (max-width: 1280px) and (min-width: 769px) {
  .config-section {
    width: 260px;
    min-width: 260px;
  }

  .viewer-controls-bar {
    gap: 3px;
    padding: 8px 8px;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.no-scroll { overflow: hidden; }

.no-context {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
