/* Desktop and shared non-phone styles extracted from styles.css */
/* Phone-specific max-width: 980px rules live in mobile.css */


  :root {
    --bg-base: #FAF8F5;
    --surface: #FFFFFF;
    --surface-hover: #F6F2EB;
    --ink-primary: #1A1714;
    --ink-secondary: #6B6257;
    --ink-muted: #9E9384;
    --line: #E5DEC3;
    --line-subtle: #EFE9DD;
    --accent-gold: #C5A059;
    --accent-gold-dark: #8C6D37;
    --accent-gold-light: #F7EEDC;
    --accent-dark: #2C261F;
    --shadow-sm: 0 4px 12px rgba(26, 23, 20, 0.05);
    --shadow-md: 0 12px 28px -8px rgba(26, 23, 20, 0.12);
    --shadow-lg: 0 24px 48px -12px rgba(26, 23, 20, 0.18);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }

  body {
    background-color: var(--bg-base);
    background-image: 
      radial-gradient(1000px 500px at 0% 0%, rgba(197, 160, 89, 0.08), transparent 60%),
      radial-gradient(800px 600px at 100% 100%, rgba(44, 38, 31, 0.05), transparent 70%);
    color: var(--ink-primary);
    font-family: 'Noto Sans Thai', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
  }

  .wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 48px;
    width: 100%;
  }

  /* Top Navigation / Hero Header */
  header.hero-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
    padding: 10px 14px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(229, 222, 195, 0.9);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
  }

  .brand-group {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
  }

  .cga-alutech-logo {
    display: inline-flex;
    align-items: center;
    font-family: 'Noto Sans Thai', 'IBM Plex Sans Thai', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    user-select: none;
    white-space: nowrap;
  }

  .cga-alutech-logo .brand-cga {
    color: #EE4D2D;
    font-weight: 900;
    letter-spacing: 0.01em;
    margin-right: 5px;
  }

  .cga-alutech-logo .brand-alutech {
    color: #0F1B2D;
    font-weight: 800;
  }

  .brand-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: min(340px, 38vw);
  }

  .brand-logo-img {
    display: block;
    max-height: 52px;
    max-width: min(300px, 35vw);
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.08));
    vertical-align: middle;
  }

  .brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin-bottom: 2px;
    min-width: 0;
  }

  .sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent-gold-dark);
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent-gold-light);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(197, 160, 89, 0.3);
  }

  h1 {
    font-family: 'Noto Serif Thai', serif;
    font-weight: 700;
    font-size: clamp(24px, 3.2vw, 36px);
    line-height: 1.2;
    margin: 4px 0 0;
    color: var(--ink-primary);
  }

  .brand-group p {
    margin: 0;
    color: var(--ink-secondary);
    font-size: 14px;
    max-width: 480px;
    line-height: 1.55;
  }

  .action-toolbar {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: none !important;
    background: var(--surface);
    color: var(--ink-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    user-select: none;
  }

  .btn:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }

  .btn:active {
    transform: translateY(0);
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 6px 18px -4px rgba(197, 160, 89, 0.4);
    position: relative;
    overflow: hidden;
  }

  .btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 55%);
    pointer-events: none;
  }

  .btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 24px -4px rgba(197, 160, 89, 0.5);
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #FFFFFF;
  }

  /* Main Layout */
  .layout {
    display: grid;
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  @media (max-width: 1180px) {
    .wrap {
      max-width: 1080px;
      padding: 14px 16px 28px;
    }

    header.hero-nav {
      gap: 10px;
      padding-bottom: 14px;
      margin-bottom: 14px;
    }

    h1 {
      font-size: clamp(20px, 2.6vw, 28px);
    }

    .brand-group p {
      font-size: 12.5px;
      max-width: 390px;
    }

    .btn {
      font-size: 12.5px;
      padding: 8px 12px;
    }

    .layout {
      grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
      gap: 16px;
    }

    .panel-card,
    .stage-card {
      padding: 14px;
    }

    .preview-wrapper {
      gap: 12px;
    }

    .stage-toolbar {
      margin-bottom: 8px;
    }
  }

  /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
     MOBILE LAYOUT  â€“ 2-column split, 100dvh
     LEFT:  door preview (fixed)
     RIGHT: option tabs + swatches (scrollable)
     BOTTOM: spec summary + action buttons
     â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

  @media (max-width: 1180px) and (max-height: 820px) {
    .wrap {
      max-width: 1024px;
      padding-top: 8px;
      padding-bottom: 14px;
    }

    header.hero-nav {
      gap: 8px;
      padding-bottom: 8px;
      margin-bottom: 8px;
      align-items: flex-start;
    }

    .cga-alutech-logo {
      font-size: 19px;
    }

    .sub-badge {
      font-size: 9.5px;
      padding: 3px 8px;
    }

    h1 {
      font-size: clamp(16px, 2vw, 22px);
      margin-top: 0;
    }

    .brand-group {
      gap: 4px;
    }

    .brand-group p {
      display: none;
    }

    .action-toolbar {
      gap: 8px;
    }

    .btn {
      font-size: 12px;
      padding: 7px 11px;
    }

    .preview-wrapper {
      top: 6px;
    }

    .panel-card,
    .stage-card {
      padding: 10px;
    }

    .stage-toolbar {
      margin-bottom: 4px;
    }

    .layout {
      grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
      gap: 12px;
    }

    .stage {
      width: min(100%, 460px, calc((100vh - 170px) * 364 / 405));
      margin: 0 auto;
    }

    .spec-card {
      padding: 10px 12px;
    }

    .spec-details {
      gap: 8px 14px;
      font-size: 12px;
    }

    .spec-header {
      margin-bottom: 6px;
    }

    .spec-item .label {
      font-size: 11px;
    }

    .spec-item .value {
      margin-top: 1px;
    }

    h1 {
      font-size: clamp(18px, 2.3vw, 24px);
    }

    .brand-group p {
      font-size: 12px;
      line-height: 1.45;
    }
  }

  /* â”€â”€ 100vh Fit Screen Mode with Scroll ONLY on ALL (à¹à¸ªà¸”à¸‡à¸—à¸±à¹‰à¸‡à¸«à¸¡à¸”) â”€â”€ */

  @media (max-width: 640px) {
    .preview-wrapper {
      width: 57%;
    }

    .tab-btn {
      min-width: 48px;
      min-height: 52px;
    }
  }

  @media (min-width: 681px) and (max-width: 980px) {
    .preview-wrapper {
      width: 46%;
    }

    .swatches-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }


  @media (min-width: 981px) {
    html, body {
      min-height: 100vh;
      overflow-x: auto;
      overflow-y: auto;
      background-attachment: fixed !important;
    }

    .wrap {
      max-width: 1560px;
      min-width: 980px;
      min-height: 580px;
      height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 10px 18px 12px;
      box-sizing: border-box;
      overflow: hidden;
    }

    header.hero-nav {
      flex-shrink: 0;
      min-height: 52px;
      padding: 6px 14px;
      margin-bottom: 10px;
      gap: 12px;
    }

    .brand-group {
      flex-shrink: 0;
    }

    .action-toolbar {
      flex-shrink: 0;
    }

    .layout {
      flex: 1;
      min-height: 510px;
      height: calc(100vh - 74px);
      display: grid;
      grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
      gap: 14px;
      align-items: stretch;
      overflow: hidden;
    }

    .preview-wrapper {
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 510px;
      gap: 8px;
      position: static;
      overflow: hidden;
    }

    .stage-card {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      padding: 8px 10px;
      overflow: hidden;
      align-items: center;
      justify-content: center;
    }

    .stage-toolbar {
      flex-shrink: 0;
      margin-bottom: 4px;
      width: 100%;
    }

    .stage {
      width: 100%;
      max-width: 100%;
      height: auto;
      max-height: 100%;
      aspect-ratio: 1 / 1 !important;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
      margin: auto;
      flex-shrink: 0;
    }

    .stage img.scene-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: fill;
      display: block;
    }

    .spec-card {
      flex-shrink: 0;
      padding: 8px 12px;
      margin-top: 0;
    }

    .spec-card .spec-header {
      font-size: 11px;
      margin-bottom: 4px;
    }

    .spec-card .spec-details {
      gap: 6px 14px;
      font-size: 12px;
    }

    .spec-card .spec-item .label {
      font-size: 10.5px;
    }

    .spec-card .spec-item .value {
      font-size: 11.5px;
      margin-top: 1px;
    }

    .panel-card {
      height: 100%;
      max-height: 100%;
      min-height: 0;
      display: flex;
      flex-direction: row;
      gap: 12px;
      align-items: stretch;
      padding: 12px 14px;
      overflow: hidden;
      box-sizing: border-box;
    }

    .panel-card .nav-tabs {
      flex-shrink: 0;
      width: 120px;
      height: 100%;
      max-height: 100%;
      min-height: 0;
      overflow-y: auto;
      align-self: stretch;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .panel-card .panel-content {
      flex: 1;
      min-height: 0;
      height: 100%;
      max-height: 100%;
      display: flex;
      flex-direction: column;
      overflow-y: auto !important;
      overflow-x: hidden;
      scroll-behavior: smooth;
      position: relative;
      gap: 14px;
      padding-right: 6px;
    }

    .panel-card .panel-content::-webkit-scrollbar {
      width: 6px;
    }
    .panel-card .panel-content::-webkit-scrollbar-track {
      background: var(--bg-base);
      border-radius: 4px;
    }
    .panel-card .panel-content::-webkit-scrollbar-thumb {
      background: var(--line);
      border-radius: 4px;
    }
    .panel-card .panel-content::-webkit-scrollbar-thumb:hover {
      background: var(--accent-gold);
    }

    .category-section {
      display: none;
    }

    .category-section.active {
      display: block !important;
      width: 100%;
    }

    .swatches-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
      gap: 10px;
      width: 100%;
      padding-right: 4px;
      margin-bottom: 8px;
    }

    .section-wizard-nav {
      flex-shrink: 0;
      margin-top: 12px;
      padding-top: 8px;
      border-top: 1px solid var(--line-subtle);
    }

    footer {
      display: none;
    }
  }

  /* Left Panel: Tabs & Swatches */
  .panel-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 16px;
    display: flex;
    flex-direction: row;
    gap: 14px;
    align-items: stretch;
    overflow: hidden;
  }

  .panel-card .nav-tabs {
    flex-shrink: 0;
    width: 130px;
    min-width: 110px;
    align-self: stretch;
  }

  .panel-card .panel-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto !important;
    overflow-x: hidden;
    scroll-behavior: smooth;
  }

  /* Category Navigation Tabs */
  .nav-tabs {
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-subtle);
    gap: 4px;
  }

  .tab-btn {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius-md) - 4px);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
    text-align: left;
  }

  .tab-btn .tab-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-muted);
    letter-spacing: 0.05em;
    min-width: 28px;
    text-align: center;
    background: var(--bg-base);
    border: 1px solid var(--line-subtle);
    border-radius: 6px;
    padding: 2px 4px;
  }

  .tab-btn .tab-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-secondary);
    margin-top: 0;
    background: transparent !important;
    background-color: transparent !important;
  }

  .tab-btn:hover {
    background: rgba(255,255,255,0.6);
  }

  .tab-btn.active {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .tab-btn.active .tab-num {
    color: var(--accent-gold-dark);
    border-color: var(--accent-gold);
    background: rgba(197, 160, 89, 0.08);
  }

  .tab-btn.active .tab-title {
    color: var(--ink-primary);
    font-weight: 700;
  }

  /* Swatches Section */
  .category-section {
    display: none;
    animation: fadeIn 0.25s ease-out forwards;
  }

  .category-section.active {
    display: block;
    width: 100%;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    background-color: transparent !important;
  }

  .section-desc {
    font-size: 12.5px;
    color: var(--ink-muted);
    margin-top: 2px;
    background: transparent !important;
    background-color: transparent !important;
  }

  .swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    width: 100%;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
  }

  .swatches-grid::-webkit-scrollbar {
    width: 6px;
  }

  .swatches-grid::-webkit-scrollbar-track {
    background: var(--bg-base);
    border-radius: 4px;
  }

  .swatches-grid::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 4px;
  }

  .swatches-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
  }

  /* Search & Filter Bar */
  .search-wrapper {
    margin-bottom: 14px;
    position: relative;
  }

  .search-input {
    width: 100%;
    padding: 8px 14px 8px 34px;
    font-size: 13px;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-base);
    color: var(--ink-primary);
    outline: none;
    transition: all 0.2s ease;
  }

  .search-input:focus {
    border-color: var(--accent-gold);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
  }

  .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--ink-muted);
    pointer-events: none;
  }

  .item-count-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    background: var(--accent-gold-light);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    border: 1px solid rgba(197, 160, 89, 0.3);
  }

  /* Sub-Filter Controls for Door Options (Type, Color, Size) */
  .door-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    background: var(--bg-base);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-subtle);
  }

  .sub-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .sub-filter-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent !important;
    background-color: transparent !important;
  }

  #doorColorGroup {
    margin-bottom: 12px;
  }

  .chip-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
  }

  .chip-btn {
    padding: 7px 15px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    border: 1px solid var(--line, #E5DEC3) !important;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    color: var(--ink-secondary, #6B6257) !important;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .chip-btn:hover:not(.active) {
    background: #F8F9FA !important;
    border-color: #CBD5E1 !important;
    color: var(--ink-primary, #1A1714) !important;
  }

  .chip-btn.active {
    background: #CED4DA !important;
    background-color: #CED4DA !important;
    background-image: none !important;
    color: #1A1714 !important;
    border: 1px solid #B0B8C4 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    font-weight: 700 !important;
  }

  .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    display: inline-block;
  }

  .size-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .select-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 20px;
    padding: 7px 16px;
    transition: all var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
  }

  .select-field:hover, .select-field:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 10px rgba(197, 160, 89, 0.25);
    background: var(--surface-hover);
  }

  .select-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-secondary);
    white-space: nowrap;
  }

  .custom-select {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    cursor: pointer;
    padding: 2px 2px;
    border-radius: var(--radius-sm);
  }

  .custom-select option {
    background: #FFFFFF;
    color: #222222;
    font-weight: 600;
  }

  .size-times {
    display: none;
  }



  .swatch-card {
    position: relative;
    border: 1px solid var(--line-subtle);
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    min-width: 0;         /* à¸›à¹‰à¸­à¸‡à¸à¸±à¸™ grid item à¹à¸•à¸ overflow */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .swatch-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  .swatch-card:hover .thumb-frame img {
    transform: scale(1.04);
  }

  .swatch-card.active {
    border-color: var(--accent-gold);
    background: var(--accent-gold-light);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.18), var(--shadow-md);
  }

  .swatch-card .thumb-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #F2EDE4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .swatch-card .thumb-frame img {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .swatch-card.scene-thumb .thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .swatch-card.door-thumb .thumb-frame img {
    height: 94%;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  }

  .swatch-card.handle-thumb .thumb-frame img {
    height: 78%;
    width: auto;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.2));
  }

  .swatch-card .swatch-info {
    margin-top: 10px;
    text-align: center;
    width: 100%;
  }

  .swatch-card .swatch-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-primary);
    display: block;
    line-height: 1.3;
  }

  .swatch-card .swatch-tag {
    font-size: 11px;
    color: var(--ink-muted);
    margin-top: 3px;
    display: block;
  }

  .swatch-card.active .swatch-name {
    color: var(--accent-gold-dark);
    font-weight: 700;
  }

  .check-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gold-dark);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
  }

  .swatch-card.active .check-badge {
    display: flex;
  }

  /* Right Panel: Interactive Preview Stage */
  .preview-wrapper {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .stage-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.4) inset;
    padding: 16px;
    position: relative;
    overflow: hidden;
  }

  .stage-card::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 140px;
    background: radial-gradient(ellipse, rgba(197, 160, 89, 0.14), transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  .stage-toolbar, .stage {
    position: relative;
    z-index: 1;
  }

  .stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
    padding: 0 4px;
  }

  .stage-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
  }

  .stage-controls {
    display: flex;
    gap: 6px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-fast);
  }

  .icon-btn:hover {
    background: var(--accent-gold-light);
    border-color: var(--accent-gold);
    color: var(--accent-gold-dark);
  }

  .icon-btn.active {
    background: var(--accent-gold-dark);
    color: #FFFFFF;
    border-color: var(--accent-gold-dark);
  }

  .stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #EAE6DF;
    transition: filter 0.3s ease;
    box-shadow: 0 0 0 1px rgba(26, 23, 20, 0.06) inset;
  }

  .stage::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 42px rgba(26, 23, 20, 0.16);
    z-index: 5;
  }

  /* Ambiance Lighting Overlay Filters */
  .stage.light-warm {
    filter: sepia(0.15) brightness(1.02) contrast(1.02);
  }
  .stage.light-cool {
    filter: hue-rotate(10deg) brightness(1.05) contrast(0.98);
  }

  .stage img.scene-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: opacity 0.25s ease;
  }

  .door-wrap {
    position: absolute;
    width: 0; height: 0;       /* JS sets final size/position */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.11));
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
  }

  .door-wrap::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -0.15%;
    height: 2.1%;
    background:
      radial-gradient(ellipse at center, rgba(24, 20, 15, 0.24) 0%, rgba(24, 20, 15, 0.11) 40%, rgba(24, 20, 15, 0) 76%);
    filter: blur(1.2px);
    pointer-events: none;
    z-index: -1;
  }

  .door-wrap img {
    position: absolute;
    inset: auto;
    width: auto;
    height: auto;
    display: block;
    max-width: none;
    max-height: none;
  }

  .door-panels-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .door-panel-segment {
    position: absolute;
    top: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 0;
    /* ป้องกัน sub-pixel gap: overlap 1px ขวา ยกเว้น panel สุดท้าย */
    margin-right: -1px;
  }

  .door-panel-image,
  .door-panel-handle {
    position: absolute;
    inset: auto;
    display: block;
    max-width: none;
    max-height: none;
  }

  /* Dimension Overlay Lines */
  .dim-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    z-index: 10;
  }

  .dim-overlay.show {
    display: block;
  }

  .dim-line-h {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 2px;
    background: rgba(197, 160, 89, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dim-line-v {
    position: absolute;
    right: 4px;                /* à¸•à¹‰à¸­à¸‡à¸­à¸¢à¸¹à¹ˆà¸ à¸²à¸¢à¹ƒà¸™ overflow:hidden à¸‚à¸­à¸‡ stage */
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(197, 160, 89, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dim-label {
    background: rgba(26, 23, 20, 0.85);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  }

  /* Live Spec Bar */
  .spec-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
  }

  .spec-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .spec-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 13.5px;
  }

  .spec-item {
    display: flex;
    flex-direction: column;
  }

  .spec-item .label {
    font-size: 11.5px;
    color: var(--ink-muted);
  }

  .spec-item .value {
    font-weight: 600;
    color: var(--ink-primary);
    margin-top: 2px;
  }

  /* Toast Notification */
  .toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink-primary);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .toast.show {
    transform: translateY(0);
    opacity: 1;
  }

  footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line-subtle);
    font-size: 12.5px;
    color: var(--ink-muted);
    text-align: center;
  }

  /* Quick Presets Section */
  .presets-wrapper {
    background: var(--surface-hover);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line);
    margin-bottom: 16px;
  }

  .presets-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .presets-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
  }

  .preset-chip:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold-dark);
    background: var(--accent-gold-light);
    transform: translateY(-1px);
  }

  /* Step Navigation Buttons inside Category Section */
  .section-wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line-subtle);
  }

  .nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .nav-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent-gold);
  }

  .nav-btn.primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
  }

  .nav-btn.primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 16px rgba(197, 160, 89, 0.4);
  }

  /* Control Pill Buttons */
  .pill-group {
    display: inline-flex;
    align-items: center;
    background: var(--bg-base);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid var(--line);
    gap: 2px;
  }

  .pill-btn {
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: var(--ink-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .pill-btn svg {
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.2s ease;
  }

  .pill-btn.active svg {
    opacity: 1;
  }

  .pill-btn.active {
    background: var(--surface);
    color: var(--accent-gold-dark);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
  }

  /* Fullscreen Zoom Modal */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 23, 20, 0.88);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 24px;
  }

  .modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-container {
    position: relative;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    background: #1A1714;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .modal-toolbar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-right: 44px;
    flex-wrap: wrap;
  }

  .modal-tool-btn {
    min-width: 44px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #FFFFFF;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .modal-tool-btn:hover {
    background: rgba(255,255,255,0.16);
    transform: translateY(-1px);
  }

  .modal-zoom-hint {
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    line-height: 1.4;
  }

  .modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #FFFFFF;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .modal-close-btn:hover {
    background: rgba(255,255,255,0.3);
  }

  .modal-stage-view {
    width: 100%;
    max-height: 75vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    cursor: grab;
    border-radius: var(--radius-md);
    background: radial-gradient(circle at center, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  }

  .modal-stage-view canvas,
  .modal-stage-view img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
  }

  .modal-stage-view.is-dragging {
    cursor: grabbing;
  }

  /* Mobile Floating Bar */
  .mobile-float-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 12px 18px;
    box-shadow: 0 -6px 20px rgba(0,0,0,0.12);
    z-index: 90;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-spec-summary {
    display: flex;
    flex-direction: column;
  }

  .mobile-spec-brand {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    text-transform: uppercase;
  }

  .mobile-spec-text {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
  }

