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

    body {
      background: #f2f4f7;
      font-family: 'SackersGothic', Arial, sans-serif;
      padding: 40px;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 40px;
    }

    /* -- Card layout: vertical stack -- */
    .card {
      background: #fff;
      border-radius: 16px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.08);
      max-width: 800px;
      width: 100%;
      padding: 24px;
      display: flex;
      flex-direction: column; /* always stack image/swatches vertically */
      align-items: center;
      margin-bottom: 16px;
    }

    /* -- Image/Heading block -- */
    .preview {
      background: #f7f8fa;
      border-radius: 12px;
      padding: 16px;
      text-align: center;
      box-shadow: 0 2px 8px rgba(0,0,0,0.05);
      width: 100%;
      max-width: 400px;
      position: relative;
      margin-bottom: 0; /* remove gap for clean stack */
    }
    .preview h3 {
      font-size: 16px;
      margin-bottom: 12px;
      color: #333;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .preview img {
      width: 100%;
      height: auto;
      border-radius: 8px;
      object-fit: cover;
      cursor: zoom-in;
      max-height: 70vh;
      display: block;
    }
    @media (orientation: portrait) {
      .preview img { max-height: 80vh; }
    }

    /* -- Swatch buttons directly below the image -- */
    .fabric-list {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      justify-content: center;
      width: 100%;
      max-width: 400px;
      margin-top: 16px;
    }

    .fabric-list button {
      background: #f7f8fa;
      border: none;
      width: 110px;
      height: 52px;
      border-radius: 7px;
      padding: 4px 6px;
      font-size: 14px;
      font-weight: 500;
      color: #444;
      cursor: pointer;
      transition: background 0.2s, color 0.2s, box-shadow 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
    .fabric-list button .color-box {
      width: 19px;
      height: 19px;
      border-radius: 4px;
      border: 1px solid #ccc;
    }
    .fabric-list button span {
      font-size: 11px;
      margin-top: 2px;
    }
    .fabric-list button:hover:not(.active),
    .fabric-list button:focus-visible:not(.active) {
      background: #e1e4eb;
      color: #222;
      outline: none;
    }
    .fabric-list button.active {
      background: #d1d5db;
      color: #111;
      box-shadow: 0 0 8px rgba(0,0,0,0.12);
    }

    /* -- Responsive Breakpoints -- */
    @media (max-width: 900px) {
      .card { max-width: 95vw; padding: 20px; }
      .preview, .fabric-list { max-width: 100%; }
      .fabric-list { gap: 10px; }
    }
    @media (max-width: 600px) {
      body { padding: 12px; }
      .card { padding: 12px; }
      .preview { padding: 8px; }
      .fabric-list { gap: 8px; }
      .fabric-list button {
        width: 48%;
        height: 46px;
        font-size: 12px;
      }
      .fabric-list button .color-box { width: 16px; height: 16px; }
      .fabric-list button span { font-size: 10px; }
    }
    @media (max-width: 375px) {
      .fabric-list button { width: 95%; min-width: 98px; }
    }

    /* -- Zoom Overlay -- */
    .zoom-overlay {
      position: fixed;
      top: 0; left: 0;
      width: 100vw; height: 100vh;
      background: rgba(0,0,0,0.8);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }
    .zoom-overlay img {
      max-width: 90vw;
      max-height: 90vh;
      border-radius: 8px;
      cursor: zoom-out;
    }
  