  :root {
    --bg-color: #FFFFFF;
    --text-color: #000000;
    --btn-bg: #000000;
    --btn-text: #FFFFFF;
    --btn-hover: #333333;

    --cream: #FFFFFF;
    --warm-white: #FFFFFF;
    --blush: #FF47E0;
    /* Nomination pink accent */
    --rose: #FF47E0;
    --rose-dark: #cc39b3;
    --rose-deep: #FF47E0;
    --gold: #FFD700;
    --gold-light: #FFECB3;
    --gold-dark: #B8860B;
    --taupe: #888888;
    --taupe-light: #CCCCCC;
    --charcoal: #333333;
    --soft-black: #1A1A1A;
    --border: #EEEEEE;
    --border-strong: #DDDDDD;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);

    --slot-bg: #FAFAFA;
    --slot-border: #DDDDDD;
    --modal-bg: #FFFFFF;
    --modal-overlay: rgba(255, 255, 255, 0.9);
  }


  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: clip;
    /* clip prevents scroll but allows sticky positioning */
  }

  /* ─── SPLASH SCREEN ─── */
  .splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
  }

  .splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
  }

  .splash-content {
    text-align: center;
    animation: splashReveal 1.2s ease-out forwards;
    width: 100%;
    max-width: 100vw;
    padding: 0 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .splash-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 4.5vw, 3.5rem);
    /* Scaled for 15-char word */
    font-weight: 500;
    letter-spacing: 0.3em;
    padding-left: 0.3em;
    /* Compensate for letter-spacing to truly center */
    color: var(--charcoal);
    margin-bottom: 2rem;
    word-break: break-word;
    /* Prevent overflowing */
    max-width: 100%;
  }

  .splash-loader {
    width: 40px;
    height: 2px;
    background: var(--border-strong);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
  }

  .splash-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--blush);
    animation: loaderLine 1.5s infinite ease-in-out;
  }

  @keyframes splashReveal {
    0% {
      opacity: 0;
      transform: translateY(10px);
      filter: blur(4px);
    }

    100% {
      opacity: 1;
      transform: translateY(0);
      filter: blur(0);
    }
  }

  @keyframes loaderLine {
    0% {
      left: -100%;
    }

    50% {
      left: 0%;
    }

    100% {
      left: 100%;
    }
  }

  /* ─── INTRO HERO (Phase 2) ─── */
  .intro-hero {
    text-align: center;
    max-width: 600px;
    padding: 20px;
    transition: opacity 1s ease-in-out, transform 1s ease-out;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .intro-hero.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
  }

  .hero-eyebrow {
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--taupe);
    text-transform: uppercase;
    margin-bottom: 24px;
  }

  .hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.8rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 48px;
    color: var(--charcoal);
  }

  .hero-start-btn {
    padding: 18px 48px;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .hero-start-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  }

  /* ─── HEADER ─── */
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: transparent;
    z-index: 10;
  }

  .logo h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-color);
    text-transform: uppercase;
  }

  .nav-links {
    display: flex;
    gap: 12px;
  }

  .nav-btn {
    padding: 8px 16px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s;
    background: transparent;
    color: var(--taupe);
  }

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

  .nav-btn.active-btn {
    color: var(--text-color);
  }

  /* Theme Toggle */
  .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
  }

  .theme-toggle:hover {
    background: rgba(128, 128, 128, 0.1);
  }

  .icon-sun,
  .icon-moon {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }


  /* ─── CONFIGURATOR LAYOUT ─── */
  .configurator-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    background: #fdfdfd;
  }

  .main-content {
    flex: 1;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    position: relative;
  }

  /* Right Sidebar (Desktop) */
  .right-sidebar {
    display: none;
    /* hidden on mobile by default */
  }

  @media (min-width: 1024px) {
    .configurator-wrapper {
      flex-direction: column;
      /* Back to column */
    }

    .main-content {
      padding: 40px;
      margin: 0 auto;
      max-width: 1000px;
    }

    .sticky-footer {
      display: flex !important;
    }
  }




  /* Sidebar Internals */
  .sidebar-header {
    background: #111;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar-header .total-price {
    font-size: 20px;
    font-weight: 400;
  }

  .sidebar-header .order-btn {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }

  .sidebar-favorites {
    padding: 40px 20px;
    text-align: center;
    color: #555;
    flex: 1;
  }

  .sidebar-favorites .fav-icon {
    font-size: 24px;
    margin-bottom: 15px;
    color: #999;
  }

  .sidebar-favorites .fav-title {
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #111;
  }

  .sidebar-favorites .fav-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
  }

  /* TRASH SIDEBAR STYLES REMOVED */


  /* ─── TOP TOOLBAR ─── */
  .top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin: 0;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 110;
  }

  .toolbar-left,
  .toolbar-center,
  .toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .toolbar-btn {
    padding: 8px 12px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    color: var(--taupe);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .toolbar-btn#undoBtn,
  .toolbar-btn#redoBtn {
    font-size: 16px;
    opacity: 0.3;
  }

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

  @keyframes randomPulse {

    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.6;
      transform: scale(0.95);
    }
  }

  .toolbar-btn.btn-save {
    color: var(--text-color);
    font-weight: 700;
  }

  .toolbar-btn.btn-save:hover {
    color: var(--blush);
  }

  .toolbar-btn.btn-template {
    color: #b08d57;
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  .toolbar-btn.btn-template:hover {
    color: #8a6a30;
  }

  /* ─── TEMPLATE MODAL GRID ─── */
  .template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
  }

  .template-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
  }

  .template-card:hover {
    border-color: var(--blush);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }

  .template-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
  }

  .template-card-desc {
    font-size: 11px;
    color: var(--taupe);
    line-height: 1.5;
    flex: 1;
  }

  .template-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
  }

  .template-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--bg-alt, #f5f5f5);
    color: var(--taupe);
    border: 1px solid var(--border);
  }

  .template-apply-btn {
    margin-top: 8px;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, transform 0.15s;
    width: 100%;
  }

  .template-apply-btn:hover {
    background: var(--blush);
    transform: translateY(-1px);
  }

  /* ─── SIZE SELECTION OVERLAY ─── */
  .size-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease, background-color 0.3s ease;
  }

  .size-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .size-modal {
    background: var(--modal-bg);
    padding: 2.5rem 3rem;
    border-radius: 0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-strong);
    text-align: center;
    max-width: 480px;
    width: 90%;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease;
  }

  .size-overlay.hidden .size-modal {
    transform: translateY(20px) scale(0.96);
  }

  .size-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 1px;
  }

  .size-subtitle {
    color: var(--taupe);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 2rem;
  }

  .size-presets {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    justify-content: center;
  }

  .preset-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1rem 0.5rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    color: var(--taupe);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s;
  }

  .preset-btn small {
    display: block;
    font-size: 0.75rem;
    color: var(--taupe-light);
    margin-top: 4px;
    font-weight: 400;
  }

  .preset-btn:hover {
    border-color: var(--border-strong);
    background: #FAFAFA;
  }

  .preset-btn.active {
    border-color: var(--blush);
    background: var(--theme-active-bg, #FFF5FB);
    box-shadow: inset 0 0 0 1px var(--blush);
    color: var(--text-color);
  }


  .preset-btn.active small {
    color: var(--taupe);
  }

  .size-counter-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
  }

  .size-label {
    font-size: 0.95rem;
    color: var(--charcoal);
  }

  .size-counter {
    display: flex;
    align-items: center;
    background: transparent;
    border-radius: 0;
    padding: 4px;
    border: 1px solid var(--border);
  }

  .counter-btn {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: none;
    background: var(--border);
    color: var(--text-color);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
  }

  .counter-btn:hover {
    background: var(--border-strong);
  }

  .counter-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    outline: none;
    -moz-appearance: textfield;
  }

  .counter-input::-webkit-outer-spin-button,
  .counter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .size-start-btn {
    width: 100%;
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 16px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.2s;
  }

  .size-start-btn:hover {
    background: var(--btn-hover);
  }

  /* ─── PREVIEW STAGE ─── */
  /* ─── PREVIEW STAGE ─── */
  .stage-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: 40px;
    position: -webkit-sticky;
    position: sticky;
    top: 60px;
    /* Sticks below toolbar */
    z-index: 100;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent flex blowout */
  }

  /* TOP INFO BAR */
  .stage-info-bar {
    padding: 15px 30px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 8px 8px 0 0;
  }

  .info-left,
  .info-right {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
  }

  .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .icon-svg {
    width: 16px;
    height: 16px;
    color: #999;
  }

  .info-label {
    font-size: 10px;
    letter-spacing: 0.8px;
    color: #bbb;
    font-weight: 600;
    text-transform: uppercase;
  }

  .current-value {
    font-size: 11px;
    font-weight: 700;
    color: #444;
    white-space: nowrap;
    min-width: 60px;
  }

  .color-swatch-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px #eee;
    cursor: pointer;
    transition: all 0.2s;
  }

  .swatch.active {
    box-shadow: 0 0 0 1.5px var(--blush);
    transform: scale(1.1);
  }

  .swatch.silver {
    background: #E0E0E0;
  }

  .swatch.gold {
    background: #FFD700;
  }

  .swatch.rosegold {
    background: #E6A8A8;
  }

  .swatch.black {
    background: #333333;
  }

  .action-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transition: opacity 0.2s;
  }

  .action-icon .icon-svg {
    width: 18px;
    height: 18px;
    color: #333;
  }

  .action-icon:focus {
    outline: none;
  }

  .action-icon:hover {
    opacity: 1;
  }

  /* BRACELET STAGE - Larger and more prominent */
  .bracelet-wrap {
    padding: 20px;
    position: relative;
    background: #ffffff;
    min-height: 250px;
    /* Matches the taller container */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem;
    overflow: visible;
    /* Ensure dangles can show even here */
  }

  /* STAGE ICONS */
  .stage-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #bbb;
    font-family: serif;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
  }

  .stage-icon:hover {
    color: #333;
    border-color: #ccc;
  }

  .icon-info {
    left: 20px;
    top: 20px;
  }

  .icon-zoom {
    left: 20px;
    bottom: 20px;
  }

  .icon-pencil {
    border: none;
    background: none;
    color: var(--blush);
    width: auto;
    height: auto;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
    bottom: 80px;
  }

  .icon-pencil .icon-svg {
    width: 20px;
    height: 20px;
    color: var(--blush);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }

  .bracelet-container {
    width: 100%;
    height: 180px;
    /* Force a tall container to prevent clipping */
    background: transparent;
    overflow-x: auto;
    overflow-y: visible;
    /* Allow dangles to hang out */
    scrollbar-width: thin;
    display: flex;
    align-items: center;
    /* Center bracelet vertically */
    justify-content: center;
    /* Center bracelet horizontally */
    padding: 0 40px;
    -webkit-overflow-scrolling: touch;
  }

  /* When empty, still center it */
  .bracelet-container:empty {
    justify-content: center;
  }

  /* The actual rail track */
  #braceletContainer {
    display: inline-flex;
    align-items: center;
    /* Center all slots on the same horizontal plane */
    gap: 2px;
    padding: 4px 0;
    background: transparent;
    box-shadow: none;
    min-width: min-content;
    position: relative;
  }

  .bracelet-clear-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px 14px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  }

  .bracelet-clear-btn:hover {
    background: #FFF1F1;
    color: #E63946;
    border-color: #FFC1C1;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.15);
  }

  .bracelet-clear-btn svg {
    transition: transform 0.3s ease;
  }

  .bracelet-clear-btn:hover svg {
    transform: rotate(-10deg) scale(1.1);
  }

  /* Italian slot styling */
  .italian-slot {
    flex: 0 1 46px;
    height: auto;
    aspect-ratio: 138 / 140;
    background: transparent;
    border: none;
    position: relative;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    /* Center charms vertically in slot */
    justify-content: center;
    cursor: pointer;
    overflow: visible;
    /* Allow dangles to hang out */
  }

  .italian-slot.span-3,
  .italian-slot.span-5 {
    z-index: 20;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .italian-slot.span-3 {
    width: 138px;
    height: 140px;
    flex-basis: 138px;
  }

  .italian-slot.span-5 {
    width: 230px;
    height: 200px;
    flex-basis: 230px;
  }

  .bg-pattern-span {
    background-repeat: repeat-x;
    background-position: center;
    background-size: 46px auto;
  }

  .italian-slot.filled {
    background-color: transparent;
  }

  .italian-slot:hover {
    transform: scale(1.05);
    z-index: 5;
  }

  .italian-slot.active-slot::after {
    display: none;
    /* Remove the box frame as requested */
  }

  .italian-slot.active-slot {
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.04);
    /* Subtle silver/grey highlight instead of pink */
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.8);
    border-radius: 4px;
  }

  .italian-slot.active-slot {
    z-index: 10;
  }


  .slot-drag-over {
    background: var(--theme-slot-active-bg, #FFF5FB) !important;
    border: 2px dashed var(--blush) !important;
    transform: none;
    z-index: 5;
    box-shadow: none;
  }

  @keyframes popIn {
    0% {
      transform: scale(0.6);
      opacity: 0;
    }

    60% {
      transform: scale(1.1);
      opacity: 1;
    }

    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  @keyframes popInRotated {
    0% {
      transform: scale(0.6) rotate(-90deg) translateY(5px);
      opacity: 0;
    }

    60% {
      transform: scale(0.95) rotate(-90deg) translateY(5px);
      opacity: 1;
    }

    100% {
      transform: scale(0.92) rotate(-90deg) translateY(5px);
      opacity: 1;
    }
  }

  .pop-in svg {
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }

  /* ─── TABS ─── */
  .mode-tabs {
    display: flex;
    background: transparent;
    border: none;
    padding: 0;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
  }

  .tab-pill {
    flex: none;
    padding: 12px 0;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--taupe);
    cursor: pointer;
    text-transform: uppercase;
    position: relative;
  }

  .tab-pill.active {
    background: transparent;
    color: var(--text-color);
  }

  .tab-pill.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--charcoal);
  }

  .tab-pill span {
    display: none;
  }

  /* ─── OPTIONS CONTAINER ─── */
  .options-container {
    background: transparent;
  }

  .section-title {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 400;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  /* ─── FILTERS ─── */
  .catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .search-wrap {
    position: relative;
    padding-bottom: 24px;
    flex: 1;
    max-width: 250px;
  }

  #charmSearch {
    width: 100%;
    padding: 8px 36px 8px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s;
  }

  #charmSearch:focus {
    border-bottom-color: var(--charcoal);
  }

  .search-icon {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 16px;
    height: 16px;
    color: var(--taupe);
    pointer-events: none;
  }

  .filter-scroll {
    display: flex;
    overflow-x: auto;
    padding-bottom: 15px;
    gap: 24px;
    justify-content: flex-start;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
  }

  .filter-scroll::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Webkit */
  }

  .filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0;
    min-width: 60px;
  }

  .filter-btn.active {
    color: #111;
  }

  .filter-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
  }

  .filter-btn.active .filter-icon-wrap {
    background: #e91e63;
    /* Nomination pink */
    color: #fff;
  }

  .filter-btn:hover .filter-icon-wrap {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  .filter-btn span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
  }

  /* ─── OPTIONS LAYOUT (Sidebar + Main) ─── */
  .options-layout {
    display: flex;
    gap: 2rem;
    margin-bottom: 6rem;
    align-items: flex-start;
  }

  .sidebar-categories {
    flex: 0 0 220px;
    position: sticky;
    top: 2rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  }

  .sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-bottom: 1.2rem;
    padding-left: 0.5rem;
  }

  .filter-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-vertical .filter-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 15px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
  }

  .filter-vertical .filter-btn:hover {
    background: #f8f8f8;
  }

  .filter-vertical .filter-btn.active {
    background: var(--blush-light, #FFF5F7);
    border-color: var(--blush);
    color: var(--blush);
  }

  .main-content {
    flex: 1;
  }

  .content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
  }

  /* ─── CHARM GRID ─── */
  .charm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 110px);
    gap: 16px;
    padding: 1rem;
    justify-content: center;
  }

  .charm-card {
    background: transparent;
    border: none;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-color);
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    width: 110px;
  }

  .charm-card:hover {
    transform: translateY(-4px) scale(1.02);
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }

  .charm-card:active {
    cursor: grabbing;
  }

  .charm-icon {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    margin-bottom: 8px;
    overflow: hidden;
  }

  .charm-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .charm-card:hover .charm-icon img:not(.watch-vertical) {
    transform: scale(1.15);
  }

  .charm-card:hover .charm-icon img.watch-vertical {
    transform: rotate(-90deg) scale(1.15);
  }

  /* Dangle charms — same box, no overflow */
  .charm-icon img.dangle {
    width: 80px;
    height: 80px;
    object-fit: contain;
  }

  /* Watch charms (vertical images) — rotate to horizontal in picker */
  .charm-icon img.watch-vertical {
    max-width: 140%;
    max-height: 80px;
    width: 140%;
    transform: rotate(-90deg);
  }

  /* Watch charms (vertical images) — rotate on bracelet */
  .charm-img-content.watch-vertical {
    transform: scale(0.92) rotate(-90deg) translateY(5px) !important;
    animation: popInRotated 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  }

  .charm-img-content {
    width: 100%;
    /* Match link size */
    height: auto;
    max-height: 250px;
    object-fit: contain;
    display: block;
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    mix-blend-mode: multiply;
    flex-shrink: 0;
    overflow: visible;
  }

  /* Dangle charms need special alignment — ONLY on bracelet */
  .italian-slot .charm-img-content.dangle {
    width: 115%;
    margin-top: -40px;
    margin-bottom: -80px;
    /* Negative margin cancels the extra height so row stays level */
    z-index: 5;
  }

  /* New dangle charms have more whitespace in images — need larger */
  .italian-slot .charm-img-content.dangle[class*="dangle69_"],
  .italian-slot .charm-img-content.dangle[class*="dangle_gold69_"] {
    width: 200%;
    max-height: none;
    margin-top: -50px;
    margin-bottom: -100px;
  }

  /* Safety chains have different padding in the image file */
  .italian-slot .charm-img-content.safety-chain {
    width: 150% !important;
    /* Force large size */
  }

  .italian-slot .charm-img-content.safety_chain_1_1 {
    position: relative;
    left: -15px;
    /* Adjusted for 300% width */
    margin-top: -0px;
    /* Align connector to link plane */
  }

  .italian-slot .charm-img-content.safety_chain_1_2 {
    position: relative;
    left: 15px;
    /* Adjusted for 300% width */
    margin-top: -20px;
    /* Align connector to link plane */
  }

  .charm-img-content.span-5 {
    width: 100%;
    height: auto;
    max-width: 230px;
    object-fit: contain;
    mix-blend-mode: normal;
    /* Make it opaque instead of transparent */
    transform: translateY(5px);
    pointer-events: none;
  }

  .content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }

  .header-reset-btn {
    background: #fff;
    border: 1px solid #fee2e2;
    color: #ef4444;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .header-reset-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.08);
  }

  .header-reset-btn svg {
    transition: transform 0.3s ease;
  }

  .header-reset-btn:hover svg {
    transform: rotate(15deg);
  }

  .charm-img-content.span-3 {
    width: 100%;
    height: auto;
    max-width: 138px;
    object-fit: contain;
    mix-blend-mode: multiply;
    translate: none;
    /* Reverted as requested */
    pointer-events: none;
    z-index: 11;
  }

  .charm-price {
    font-size: 13px;
    color: var(--taupe);
    margin-top: 4px;
  }


  /* ─── STICKY FOOTER ─── */
  .sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border-top: 1px solid var(--border);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    /* เพิ่ม z-index ให้อยู่เหนือทุกอย่าง */
    transition: background-color 0.3s ease;
    transform: translateZ(0);
    /* Force GPU layer - prevents mobile scroll jitter */
    -webkit-transform: translateZ(0);
  }

  .summary-info {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .total-label {
    font-size: 14px;
    color: var(--taupe);
  }

  .total-price {
    font-size: 22px;
    color: var(--text-color);
    font-weight: 500;
    margin-left: 8px;
  }

  .count-label {
    font-size: 14px;
    background: var(--border);
    padding: 4px 12px;
    border-radius: 99px;
    color: var(--text-color);
  }

  .action-row {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .clear-link {
    background: none;
    border: none;
    text-decoration: underline;
    color: var(--taupe);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
  }

  .order-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 10px 24px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
  }

  .order-btn:hover {
    background: var(--btn-hover);
  }

  /* ─── ORDER MODAL ─── */
  .modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
  }

  .modal-backdrop.open {
    display: block;
  }

  .modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease, background-color 0.3s ease;
    width: min(480px, 92vw);
    background: var(--modal-bg);
    border-radius: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    z-index: 101;
    overflow: hidden;
    border: 1px solid var(--border);
  }

  .modal.open {
    display: block;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.75rem 1.75rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  .modal-eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--taupe);
    margin-bottom: 4px;
    font-family: 'DM Sans', sans-serif;
  }

  .modal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: 0.02em;
  }

  .modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--taupe-light);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    margin-top: 2px;
  }

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

  .modal-body {
    padding: 1.25rem 1.75rem 1.75rem;
  }

  .modal-summary {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1rem;
  }

  .modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
  }

  .modal-row:last-child {
    border-bottom: none;
  }

  .modal-row .label {
    color: var(--taupe);
  }

  .modal-row .value {
    font-weight: 500;
    color: var(--text-color);
  }

  .modal-total {
    padding: 1rem;
    background: var(--slot-bg);
    border-radius: 0;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }

  .modal-total-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
  }

  .modal-total-amount {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
  }

  .modal-total-amount small {
    font-size: 1rem;
    font-weight: 400;
    margin-right: 2px;
  }

  .modal-note {
    font-size: 12px;
    color: var(--taupe);
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.6;
  }

  .modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
  }

  .line-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #06C755;
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s, transform 0.12s;
    flex: 1;
    justify-content: center;
  }

  .line-btn:hover {
    background: #05a648;
  }

  .modal-cancel {
    padding: 14px 20px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-strong);
    border-radius: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
  }

  .modal-cancel:hover {
    background: var(--border);
  }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 768px) {
    .header {
      padding: 1rem;
      flex-direction: column;
      gap: 1rem;
    }

    .logo h1 {
      font-size: clamp(0.9rem, 3.5vw, 1.2rem);
      letter-spacing: 1px;
    }

    .top-toolbar {
      overflow-x: auto;
      padding: 10px 1rem;
      gap: 12px;
      justify-content: flex-start;
      scrollbar-width: none;
      position: sticky;
      top: 0;
      z-index: 110;
      background: var(--bg-color);
      margin: 0;
    }

    .top-toolbar::-webkit-scrollbar {
      display: none;
    }

    .main {
      padding: 0 0 80px;
      gap: 1rem;
    }

    .stage-info-bar {
      flex-direction: row;
      padding: 10px;
      gap: 10px;
      width: 100%;
      box-sizing: border-box;
      align-items: center;
      justify-content: space-between;
    }

    .info-left {
      flex-direction: row;
      gap: 8px;
      align-items: center;
    }

    .info-right {
      display: flex;
      gap: 12px;
      margin-top: 0;
    }

    .info-item {
      justify-content: center;
      width: 100%;
    }

    .bracelet-wrap {
      padding: 20px 0;
      min-height: 140px;
      width: 100%;
      box-sizing: border-box;
      overflow-x: auto;
      /* Allow horizontal scroll to see all slots */
      overflow-y: visible;
      /* Allow dangles to hang out */
      -webkit-overflow-scrolling: touch;
    }

    .bracelet-container {
      width: 100%;
      display: block;
      overflow-x: auto;
      overflow-y: visible;
      scrollbar-width: thin;
      -webkit-overflow-scrolling: touch;
      padding: 10px 0;
    }

    #braceletContainer {
      display: inline-flex;
      justify-content: flex-start;
      min-width: min-content;
      margin: 0;
      padding: 0 10px;
    }

    .drop-hint {
      position: static;
      margin-bottom: 10px;
      font-size: 11px;
    }

    @media (max-width: 768px) {
      .top-toolbar {
        padding: 12px 16px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
        position: static;
      }
      .toolbar-left {
        flex: 1;
      }
      .toolbar-right {
        display: flex;
        justify-content: flex-end;
      }
      .toolbar-center {
        width: 100%;
        justify-content: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
      }
      /* Ensure toolbar buttons have nice padding on mobile */
      .toolbar-btn {
        padding: 6px 10px;
      }

      .toolbar-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        width: 100%;
      }

      .toolbar-btn {
        flex: 1 1 auto;
        min-width: 80px;
        justify-content: center;
        font-size: 11px;
        padding: 10px 8px;
      }

      .toolbar-btn#undoBtn,
      .toolbar-btn#redoBtn {
        grid-column: span 1;
      }

      .catalog-header {
        flex-direction: column;
        align-items: stretch;
      }

      .search-wrap {
        max-width: none;
      }

      .filter-scroll {
        min-width: 0;
        gap: 15px;
        padding-bottom: 12px;
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
      }



      .bg-pattern-span {
        background-size: 28px auto;
      }



      .charm-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
      }

      .charm-icon {
        max-width: 60px;
      }

      .charm-name {
        font-size: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: center;
        line-height: 1.3;
        word-break: break-word;
      }

      .sticky-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        height: auto;
      }

      .order-btn {
        width: 100%;
        text-align: center;
      }





      .bg-pattern-span {
        background-size: 22px auto;
      }

      .info-item {
        font-size: 10px;
      }

      .current-value {
        font-size: 10px;
        min-width: 50px;
      }

      .charm-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
      }

      .charm-name {
        font-size: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: center;
        line-height: 1.3;
        word-break: break-word;
        white-space: normal;
      }



      .sticky-footer {
        padding: 10px 15px;
        flex-direction: row;
        flex-wrap: nowrap;
        /* บังคับอยู่บรรทัดเดียว ไม่กระโดด */
        justify-content: space-between;
        align-items: center;
        gap: 10px;
      }

      .summary-info {
        width: 100%;
        justify-content: space-between;
      }

      .action-row {
        width: 100%;
        justify-content: space-between;
      }



      .size-modal {
        padding: 1.5rem 1rem;
      }
    }

    /* ─── DESIGN SECTION STICKY ─── */
    .design-section {
      position: -webkit-sticky;
      position: sticky;
      top: 0;
      z-index: 100;
      background: var(--bg-color);
      padding-top: 10px;
      padding-bottom: 10px;
      align-self: flex-start;
      /* Prevents stretching if parent is flex */
    }

    @media (max-width: 768px) {
      .design-section {
        padding-top: 0;
        /* Save space on mobile */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
        /* Slight shadow to separate sticky header */
      }
    }
  }

  /* 📱 MOBILE: Fit to Screen but PROPORTIONAL */
  @media (max-width: 768px) {
    .stage-card {
      position: -webkit-sticky;
      position: sticky;
      top: 55px;
      /* Sticks below toolbar on mobile */
      z-index: 100;
      border-radius: 0;
      /* Full width edge-to-edge */
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
      margin-bottom: 10px;
      border-left: none;
      border-right: none;
    }

    .bracelet-wrap {
      min-height: 80px;
      padding: 10px 15px;
      margin: 0 auto 0.5rem;
      overflow-x: hidden;
      overflow-y: visible;
    }

    .bracelet-container {
      height: auto;
      min-height: 60px;
      padding: 0;
      overflow: visible;
      width: 100%;
    }

    #braceletContainer {
      display: flex !important;
      width: 100% !important;
      min-width: 0 !important;
      gap: 1px;
      padding: 0;
      justify-content: center;
      align-items: center;
    }

    .italian-slot {
      flex: 1 1 0;
      min-width: 0;
      height: auto;
      aspect-ratio: 1 / 1;
    }

    .italian-slot.span-3 {
      flex: 3 3 0;
      height: auto;
      aspect-ratio: 3 / 1;
    }

    .italian-slot.span-5 {
      flex: 5 5 0;
      height: auto;
      aspect-ratio: 5 / 1;
    }

    .charm-img-content {
      width: 100%;
      height: auto;
      max-height: 250px;
      object-fit: contain;
      mix-blend-mode: multiply;
    }

    @keyframes popInRotatedMobile {
      0% {
        transform: scale(1.5) rotate(-90deg) translateY(5px);
        opacity: 0;
      }
      100% {
        transform: scale(2.8) rotate(-90deg) translateY(5px);
        opacity: 1;
      }
    }

    /* Enlarge the watch to fill the 3-span width using scale */
    .italian-slot.span-3 .charm-img-content.watch-vertical {
      animation: popInRotatedMobile 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
      height: 100%;
      width: 100%;
    }
    
    .italian-slot.span-5 .charm-img-content {
      transform: scale(1.1);
    }

    .charm-img-content.span-5 {
      width: 100%;
      height: 100%;
      transform: scale(1.1);
      max-height: none;
    }

    .italian-slot .charm-img-content.dangle {
      width: 160% !important;
      height: 150%;
      margin-top: -70px !important;
      max-height: none;
    }

    /* Specific fix for dangle69 group on mobile */
    .italian-slot .charm-img-content[class*="dangle69_"],
    .italian-slot .charm-img-content[class*="dangle_gold69_"] {
      width: 550% !important;
      margin-top: -140px !important;
      margin-bottom: -150px !important;
    }

    .italian-slot .charm-img-content.safety-chain {
      width: 150% !important;
      height: auto !important;
      max-height: none;
    }

    .italian-slot .charm-img-content.safety_chain_1_1 {
      margin-top: -45px !important;
      left: -5px !important;
    }

    .italian-slot .charm-img-content.safety_chain_1_2 {
      margin-top: -50px !important;
      left: 8px !important;
    }
  }