/* ============================================================
   CustomGoods Advanced Sign Designer — Frontend Styles
   ============================================================ */

/* ── Reset / Base ──────────────────────────────────────────── */
.cgas-wrap *,
.cgas-wrap *::before,
.cgas-wrap *::after {
  box-sizing: border-box;
}

.cgas-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #222;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 24px 48px;
}

/* ── Header ────────────────────────────────────────────────── */
.cgas-header {
  text-align: center;
  padding: 32px 0 20px;
}
.cgas-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1a1a2e;
}
.cgas-subtitle {
  color: #666;
  margin: 0;
}

/* ── Templates Bar ─────────────────────────────────────────── */
.cgas-templates-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: #f0f4ff;
  border-radius: 8px;
  margin-bottom: 20px;
}
.cgas-templates-label {
  font-weight: 600;
  color: #444;
  margin-right: 4px;
}
.cgas-tpl-btn {
  background: #fff;
  border: 1px solid #c0c8e0;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.cgas-tpl-btn:hover {
  background: linear-gradient(180deg, #efeae4 0%, #e8e0d9 100%);
  color: #fff;
  border-color: #1a1a2e;
}

/* ── Main Layout ───────────────────────────────────────────── */
.cgas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cgas-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Preview Panel ─────────────────────────────────────────── */
.cgas-preview-panel {
  position: sticky;
  top: 80px;
}
.cgas-preview-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.cgas-mode-btn {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.cgas-mode-btn.active {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}
.cgas-size-label {
  margin-left: auto;
  font-size: 13px;
  color: #666;
}

/* ── Preview Stage ─────────────────────────────────────────── */
.cgas-preview-stage {
  position: relative;
  width: 100%;
  min-height: 72vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  transition: background 0.4s;
}
.cgas-preview-stage.daytime {
  background: linear-gradient(180deg, #f5f5f5 0%, #ececec 100%);
}
.cgas-scene-bg {
  position: absolute;
  inset: 0;
  background-size: 85% auto;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.25s ease, background-image 0.25s ease;
}
.cgas-backboard {
  position: relative;
  z-index: 1;
  padding: 30px 50px;
  border-radius: 12px;
  background: rgba(0,0,0,0.6);
  transition: background 0.3s, border-radius 0.3s, width 0.2s ease, min-height 0.2s ease, padding 0.2s ease;
  max-width: 94%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(1px);
  box-sizing: border-box;
}
.cgas-backboard.shape-none {
  background: transparent;
}
.cgas-backboard.shape-cut_to_letter {
  padding: 10px 14px;
  background: rgba(200,230,255,0.18);
  border-radius: 22px;
}
.cgas-backboard.shape-cut_to_shape {
  border-radius: 50px;
}
.cgas-sign-text {
  text-align: center;
  display: inline-block;
}
.cgas-text-layer {
  display: block;
  font-family: 'Pacifico', cursive;
  font-size: clamp(28px, 5vw, 72px);
  color: #ffe8c0;
  text-shadow: 0 0 5px #ffe8c0, 0 0 12px #ffe8c0, 0 0 25px #ffe8c0;
  line-height: 1.2;
  transition: all 0.2s;
  white-space: pre-wrap;
  word-break: break-word;
}
.cgas-preview-stage.daytime .cgas-text-layer {
  text-shadow: none;
  color: #333;
}

/* ── Preview Actions ───────────────────────────────────────── */
.cgas-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
#cgas-share-result {
  margin-top: 10px;
  padding: 10px;
  background: #f0f4ff;
  border-radius: 6px;
}

/* ── Options Panel ─────────────────────────────────────────── */
.cgas-options-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
}

/* ── Sections ──────────────────────────────────────────────── */
.cgas-section {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.cgas-section:last-child {
  border-bottom: none;
}
.cgas-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1a1a2e;
  margin: 0 0 14px;
}

/* ── Fields ────────────────────────────────────────────────── */
.cgas-field {
  margin-bottom: 12px;
}
.cgas-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}
.cgas-input,
.cgas-select,
.cgas-field input[type="text"],
.cgas-field input[type="email"],
.cgas-field input[type="tel"],
.cgas-field input[type="number"],
.cgas-field select,
.cgas-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}
.cgas-input:focus,
.cgas-select:focus,
.cgas-field input:focus,
.cgas-field select:focus,
.cgas-field textarea:focus {
  border-color: #1a1a2e;
  outline: none;
}
.cgas-text-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.cgas-text-input:focus {
  border-color: #1a1a2e;
  outline: none;
}
.cgas-mt {
  margin-top: 12px;
}
.cgas-desc {
  font-size: 12px;
  color: #777;
  margin: 0 0 10px;
  line-height: 1.5;
}

/* ── Font Grid ─────────────────────────────────────────────── */
.cgas-font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.cgas-font-swatch {
  padding: 10px 8px;
  border: 2px solid #eee;
  border-radius: 6px;
  text-align: center;
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cgas-font-swatch:hover {
  border-color: #1a1a2e;
  background: #f0f4ff;
}
.cgas-font-swatch.active {
  border-color: #1a1a2e;
  background: #e8eeff;
}

/* ── Color Grid ────────────────────────────────────────────── */
.cgas-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cgas-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}
.cgas-color-swatch:hover {
  transform: scale(1.15);
}
.cgas-color-swatch.active {
  border-color: #1a1a2e;
  transform: scale(1.15);
}

/* ── Option Grid (backboard / mounting) ────────────────────── */
.cgas-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.cgas-option-card {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafa;
}
.cgas-option-card:hover {
  border-color: #1a1a2e;
  background: #f0f4ff;
}
.cgas-option-card.active {
  border-color: #1a1a2e;
  background: #e8eeff;
}
.cgas-option-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.cgas-option-card-price {
  font-size: 11px;
  color: #0073aa;
  margin-top: 3px;
}

/* ── Size Grid ─────────────────────────────────────────────── */
.cgas-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.cgas-size-card {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafa;
}
.cgas-size-card:hover {
  border-color: #1a1a2e;
  background: #f0f4ff;
}
.cgas-size-card.active {
  border-color: #1a1a2e;
  background: #e8eeff;
}
.cgas-size-price {
  display: block;
  font-size: 12px;
  color: #0073aa;
  margin-top: 3px;
}

/* ── Add-ons ───────────────────────────────────────────────── */
.cgas-addons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cgas-addon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.cgas-addon input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Price Summary ─────────────────────────────────────────── */
.cgas-price-summary {
  background: #f8f9ff;
  border-radius: 8px;
  padding: 16px;
  margin: 0 20px;
}
.cgas-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}
.cgas-price-total {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  border-top: 1px solid #ddd;
  padding-top: 8px;
  margin-top: 8px;
}

/* ── Actions ───────────────────────────────────────────────── */
.cgas-actions {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cgas-btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  text-decoration: none;
}
.cgas-btn-primary:hover {
  background: #2d2d5e;
}
.cgas-btn-secondary {
  display: inline-block;
  padding: 10px 18px;
  background: #fff;
  color: #1a1a2e;
  border: 2px solid #1a1a2e;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
  text-decoration: none;
}
.cgas-btn-secondary:hover {
  background: #1a1a2e;
  color: #fff;
}

/* ── Quote Form ────────────────────────────────────────────── */
#cgas-quote-form-wrap {
  padding: 20px;
  border-top: 1px solid #f0f0f0;
}
#cgas-quote-form-wrap h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

/* ── Messages ──────────────────────────────────────────────── */
#cgas-messages {
  padding: 0 20px 10px;
}
.cgas-msg-success {
  background: #d4edda;
  color: #155724;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
}
.cgas-msg-error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
}

/* ── Configure Button (product page) ──────────────────────── */
.cgas-configure-btn {
  display: inline-block;
  margin-bottom: 12px;
  padding: 12px 24px;
  background: #1a1a2e;
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.cgas-configure-btn:hover {
  background: #2d2d5e;
}

/* ── UV Upload ─────────────────────────────────────────────── */
.cgas-uv-section {
  background: #fffbf0;
  border-left: 3px solid #f0a500;
}

/* ── Upload Preview ────────────────────────────────────────── */
#cgas-upload-preview {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#cgas-upload-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

/* ── Admin Order Panel ─────────────────────────────────────── */
.cgas-order-config-panel {
  margin-top: 20px;
  padding: 16px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}


/* ── Scene Presets ─────────────────────────────────────────── */
.cgas-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cgas-scene-preset {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  border: 1px solid #d9deec;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  transition: all .2s ease;
}
.cgas-scene-preset img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}
.cgas-scene-preset span {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  text-align: center;
}
.cgas-scene-preset.active {
  border-color: #1a1a2e;
  box-shadow: 0 0 0 2px rgba(26,26,46,0.08);
}
@media (max-width: 900px) {
  .cgas-wrap {
    width: auto;
    margin-left: 0;
    margin-right: 0;
    padding: 0 12px 32px;
  }
  .cgas-preview-panel {
    position: static;
  }
  .cgas-preview-stage {
    min-height: 360px;
  }
  .cgas-scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* v1.1.1: reduce preview background/scene image scale by 15% */
.cgas-preview-stage .cgas-scene-bg {
  background-size: 85% auto !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}


/* v1.1.4: Backboard option descriptions */
.cgas-option-card-desc {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: #666;
  font-weight: 400;
}
.cgas-option-card.active .cgas-option-card-desc {
  color: #374151;
}
#cgas-backboard-grid .cgas-option-card {
  min-height: 86px;
  align-items: flex-start;
  justify-content: flex-start;
}


/* v1.1.8: customer wall dimensions resize the whole designer background canvas */
.cgas-preview-stage.cgas-has-wall-size {
  width: 100%;
  min-height: 0 !important;
  height: auto !important;
  max-height: 82vh;
}
.cgas-preview-stage.cgas-has-wall-size .cgas-scene-bg {
  background-size: cover !important;
  background-position: center center !important;
}
.cgas-wall-size-label {
  display: none;
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 4;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(26,26,46,0.82);
  color: #fff;
  pointer-events: none;
}
.cgas-install-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cgas-field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
.cgas-field-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
@media (max-width: 700px) {
  .cgas-install-fields {
    grid-template-columns: 1fr;
  }
}


/* v1.1.9: safer wall-size preview behavior */
.cgas-preview-stage.cgas-has-wall-size {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.cgas-preview-stage.cgas-has-wall-size .cgas-backboard {
  transform-origin: center center !important;
  will-change: transform;
}
.cgas-wall-size-label {
  max-width: calc(100% - 28px);
  white-space: nowrap;
}


/* v1.2.0: optional buyer-controlled wall size fields */
.cgas-wall-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: #1a1a2e;
  margin: 10px 0 12px;
}
.cgas-wall-toggle input {
  margin-top: 2px;
}
#cgas-install-fields {
  margin-top: 12px;
}


/* v1.2.1: selected sign size visibly changes the design preview */
.cgas-backboard {
  transition: background 0.3s, border-radius 0.3s, width 0.2s ease, min-height 0.2s ease, padding 0.2s ease, transform 0.22s ease !important;
  transform-origin: center center;
}
.cgas-preview-stage {
  padding: 48px;
}
@media (max-width: 700px) {
  .cgas-preview-stage {
    padding: 24px;
  }
}


/* v1.2.2: auto-fit text width/font based on selected sign size */
.cgas-sign-text {
  margin-left: auto;
  margin-right: auto;
}
.cgas-text-layer {
  white-space: nowrap;
  word-break: normal !important;
  overflow-wrap: normal !important;
  max-width: 100%;
}
.cgas-preview-stage {
  padding: 56px;
}
@media (max-width: 700px) {
  .cgas-preview-stage {
    padding: 28px;
  }
}


/* v1.3.0: UV printed logo/graphic neon workflow */
.cgas-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cgas-design-type-card {
  border: 1px solid #d8ddec;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all .18s ease;
}
.cgas-design-type-card strong {
  display: block;
  color: #1a1a2e;
  font-size: 14px;
  margin-bottom: 5px;
}
.cgas-design-type-card span {
  display: block;
  color: #666;
  font-size: 12px;
  line-height: 1.35;
}
.cgas-design-type-card.active {
  border-color: #1a1a2e;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(26,26,46,.08);
}
.cgas-proof-notice {
  border-left: 4px solid #1a1a2e;
  background: #f7f7fb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.cgas-proof-notice p {
  margin: 6px 0 0;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
}
@media (max-width: 700px) {
  .cgas-mode-grid {
    grid-template-columns: 1fr;
  }
}


/* v1.3.2: size selection changes design view with measurement overlay */
.cgas-size-max {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.25;
  color: #777;
}
.cgas-size-card.active .cgas-size-max {
  color: #374151;
}
.cgas-measure {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 4px rgba(0,0,0,.55);
}
.cgas-measure-width {
  height: 18px;
  border-top: 2px solid rgba(255,255,255,.92);
  text-align: center;
}
.cgas-measure-width:before,
.cgas-measure-width:after {
  content: "";
  position: absolute;
  top: -5px;
  width: 2px;
  height: 10px;
  background: rgba(255,255,255,.92);
}
.cgas-measure-width:before { left: 0; }
.cgas-measure-width:after { right: 0; }
.cgas-measure-width span {
  position: relative;
  top: 6px;
  background: rgba(0,0,0,.28);
  padding: 2px 7px;
  border-radius: 999px;
}
.cgas-measure-height {
  width: 18px;
  border-left: 2px solid rgba(255,255,255,.92);
}
.cgas-measure-height:before,
.cgas-measure-height:after {
  content: "";
  position: absolute;
  left: -5px;
  width: 10px;
  height: 2px;
  background: rgba(255,255,255,.92);
}
.cgas-measure-height:before { top: 0; }
.cgas-measure-height:after { bottom: 0; }
.cgas-measure-height span {
  position: absolute;
  left: -46px;
  top: 35%;
  width: 42px;
  text-align: right;
  background: rgba(0,0,0,.28);
  padding: 2px 5px;
  border-radius: 999px;
}
.cgas-max-letters-note {
  display: inline-block;
  margin-left: 10px;
  color: #666;
  font-size: 12px;
}
.cgas-warning-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff2f2;
  color: #c01818;
  font-size: 13px;
  font-weight: 600;
}


/* v1.3.3: stronger design-board dimension overlay */
.cgas-measure {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 5px rgba(0,0,0,.75);
}
.cgas-measure-width {
  height: 20px;
  border-top: 2px solid rgba(255,255,255,.96);
  text-align: center;
}
.cgas-measure-width:before,
.cgas-measure-width:after {
  content: "";
  position: absolute;
  top: -6px;
  width: 2px;
  height: 12px;
  background: rgba(255,255,255,.96);
}
.cgas-measure-width:before { left: 0; }
.cgas-measure-width:after { right: 0; }
.cgas-measure-width span {
  position: relative;
  top: 7px;
  background: rgba(0,0,0,.34);
  padding: 3px 8px;
  border-radius: 999px;
}
.cgas-measure-height {
  width: 20px;
  border-left: 2px solid rgba(255,255,255,.96);
}
.cgas-measure-height:before,
.cgas-measure-height:after {
  content: "";
  position: absolute;
  left: -6px;
  width: 12px;
  height: 2px;
  background: rgba(255,255,255,.96);
}
.cgas-measure-height:before { top: 0; }
.cgas-measure-height:after { bottom: 0; }
.cgas-measure-height span {
  position: absolute;
  left: -56px;
  top: 36%;
  min-width: 48px;
  text-align: right;
  background: rgba(0,0,0,.34);
  padding: 3px 6px;
  border-radius: 999px;
}
.cgas-measure-size-badge {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  color: #fff;
  background: rgba(26,26,46,.78);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  display: none;
}


/* v1.3.4: measurement dimensions are based on rendered text/font ratio */
.cgas-measure-size-badge {
  max-width: calc(100% - 28px);
  white-space: nowrap;
}
.cgas-measure-height span {
  min-width: 52px;
}


/* v1.3.5: preview redraw feedback when selected size changes */
.cgas-preview-stage.cgas-size-changing .cgas-backboard,
.cgas-preview-stage.cgas-size-changing .cgas-sign-text,
.cgas-preview-stage.cgas-size-changing .cgas-measure {
  transition: all .22s ease !important;
}


/* v1.3.7: stronger neon tube brightness and glow */
.cgas-text-layer {
  font-weight: 700;
  opacity: 1 !important;
  filter: brightness(1.45) saturate(1.35);
  -webkit-text-stroke: 0.35px rgba(255,255,255,0.45);
}
.cgas-preview-stage:not(.daytime) .cgas-text-layer {
  filter: brightness(1.7) saturate(1.55) drop-shadow(0 0 3px currentColor) drop-shadow(0 0 7px currentColor);
}
.cgas-preview-stage.daytime .cgas-text-layer {
  filter: brightness(1.28) saturate(1.25) drop-shadow(0 0 2px currentColor);
}

/* Prevent selected scene/wall images from washing out the LED effect too much */
.cgas-preview-stage .cgas-scene-bg {
  opacity: 0.48 !important;
}
.cgas-preview-stage.daytime .cgas-scene-bg {
  opacity: 0.36 !important;
}

/* Acrylic backing should not cover the LED too strongly */
.cgas-backboard {
  background-color: rgba(200,230,255,0.10);
}
.cgas-backboard.shape-cut_to_shape,
.cgas-backboard.shape-cut_to_letter,
.cgas-backboard.shape-custom_shape {
  backdrop-filter: blur(0.5px);
}


/* v1.3.8: reduce neon bloom and keep letters readable */
.cgas-text-layer {
  font-weight: 700;
  opacity: 1 !important;
  filter: brightness(1.16) saturate(1.08) !important;
  -webkit-text-stroke: 0.18px rgba(255,255,255,0.28) !important;
}
.cgas-preview-stage:not(.daytime) .cgas-text-layer {
  filter: brightness(1.22) saturate(1.12) drop-shadow(0 0 2px currentColor) drop-shadow(0 0 6px currentColor) !important;
}
.cgas-preview-stage.daytime .cgas-text-layer {
  filter: brightness(1.12) saturate(1.08) drop-shadow(0 0 2px currentColor) !important;
}

/* Text size adjustment slider */
.cgas-font-scale-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
#cgas-font-scale {
  flex: 1;
  width: 100%;
}
#cgas-font-scale-value {
  min-width: 52px;
  text-align: right;
  font-weight: 700;
  color: #1a1a2e;
}


/* v1.3.9: keep brightness, sharply reduce bloom/spread */
.cgas-text-layer {
  font-weight: 800 !important;
  opacity: 1 !important;
  filter: brightness(1.55) saturate(1.35) !important;
  -webkit-text-stroke: 0.25px rgba(255,255,255,0.55) !important;
}
.cgas-preview-stage:not(.daytime) .cgas-text-layer {
  filter: var(--cgas-text-filter-night, brightness(1.65) saturate(1.45) drop-shadow(0 0 2px currentColor)) !important;
}
.cgas-preview-stage.daytime .cgas-text-layer {
  filter: var(--cgas-text-filter-day, brightness(1.35) saturate(1.25) drop-shadow(0 0 1px currentColor)) !important;
}


/* v1.5.0: draggable sign placement + multi-color text */
.cgas-preview-stage {
  position: relative;
  overflow: hidden;
}
.cgas-backboard {
  position: absolute !important;
  left: 50%;
  top: 50%;
  cursor: move;
  user-select: none;
  touch-action: none;
  z-index: 3;
}
.cgas-preview-stage.cgas-dragging {
  cursor: grabbing;
}
.cgas-drag-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(26,26,46,.72);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}
.cgas-color-part {
  display: inline-block;
  margin: 0 .08em;
}
.cgas-multicolor-fields {
  border: 1px solid #e4e7f0;
  border-radius: 12px;
  padding: 12px;
  background: #fbfcff;
}
.cgas-color-part-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .cgas-color-part-row {
    grid-template-columns: 1fr;
  }
  .cgas-drag-hint {
    left: 14px;
    right: auto;
    bottom: 12px;
  }
}


/* v1.5.1: bigger text scaling + reliable drag positioning */
.cgas-preview-stage {
  position: relative !important;
  overflow: hidden !important;
  touch-action: none;
}
.cgas-backboard {
  position: absolute !important;
  left: 50%;
  top: 50%;
  cursor: grab !important;
  user-select: none;
  touch-action: none;
  overflow: visible !important;
  z-index: 3;
}
.cgas-sign-text,
.cgas-text-layer,
.cgas-color-part {
  overflow: visible !important;
  pointer-events: auto;
}
.cgas-preview-stage.cgas-dragging,
.cgas-preview-stage.cgas-dragging .cgas-backboard {
  cursor: grabbing !important;
}
#cgas-font-scale {
  accent-color: #1a1a2e;
}


/* v1.5.2: font-width normalization so different fonts keep similar overall sign length */
.cgas-sign-text {
  max-width: none !important;
}
.cgas-text-layer {
  transform-origin: center center;
}


/* v1.5.3: keep selected sign width consistent while normalizing font visual width */
.cgas-sign-text {
  max-width: none !important;
  overflow: visible !important;
}
.cgas-text-layer {
  transform-origin: center center !important;
  overflow: visible !important;
}
.cgas-color-part {
  transform-origin: center center !important;
}


/* Glow strength slider */
.cgas-glow-strength-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cgas-glow-strength-row input[type=range] {
  flex: 1;
  width: 100%;
}
.cgas-glow-strength-label {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}
#cgas-glow-strength-value {
  min-width: 68px;
  text-align: right;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
}


/* v1.6.3: collapsed font picker like CustomNeon-style dropdown */
.cgas-font-picker-toggle {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid #d9dde7;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}
.cgas-selected-font-label {
  font-size: 28px;
  line-height: 1;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cgas-font-picker-arrow {
  font-family: Arial, sans-serif;
  font-size: 26px;
  line-height: 1;
  color: #1a1a2e;
  flex: 0 0 auto;
}
#cgas-font-grid.cgas-font-grid-collapsed {
  display: none !important;
}
#cgas-font-grid.cgas-font-grid-open {
  display: grid !important;
  margin-top: 12px;
}
#cgas-font-grid .cgas-font-swatch {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1.05;
}
#cgas-font-grid .cgas-font-swatch.active {
  background: #2563ff;
  color: #fff;
  border-color: #2563ff;
}


/* v1.6.4: CustomNeon-style step sections and special effects */
.cgas-options-panel form {
  counter-reset: cgasStep;
}
.cgas-options-panel .cgas-section {
  position: relative;
}
.cgas-options-panel .cgas-section > .cgas-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cgas-options-panel .cgas-section > .cgas-section-title::before {
  counter-increment: cgasStep;
  content: counter(cgasStep);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #2563ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex: 0 0 24px;
}
.cgas-effect-list {
  display: grid;
  gap: 10px;
}
.cgas-effect-card {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #e2e6ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.cgas-effect-card input {
  display: none;
}
.cgas-effect-radio {
  width: 19px;
  height: 19px;
  border: 2px solid #a5adbd;
  border-radius: 50%;
  margin-top: 2px;
  box-sizing: border-box;
}
.cgas-effect-card.active {
  border-color: #2563ff;
  background: #f4f7ff;
  box-shadow: 0 6px 18px rgba(37,99,255,.12);
}
.cgas-effect-card.active .cgas-effect-radio {
  border-color: #2563ff;
  box-shadow: inset 0 0 0 4px #fff;
  background: #2563ff;
}
.cgas-effect-copy strong {
  display: block;
  color: #111827;
  font-size: 15px;
}
.cgas-effect-copy small {
  display: block;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}
.cgas-effect-note {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #2563ff;
  border-radius: 8px;
  color: #475569;
  font-size: 12px;
}
.cgas-text-color-parts-section {
  background: #fbfcff;
  border-left: 3px solid #2563ff;
}
.cgas-part-count-buttons {
  display: flex;
  gap: 8px;
}
.cgas-part-count-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d9dde7;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.cgas-part-count-btn.active {
  background: #2563ff;
  border-color: #2563ff;
  color: #fff;
}
.cgas-logo-proof-cta {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg,#3157ff,#664dff);
  color: #fff;
}
.cgas-logo-proof-cta strong {
  display: block;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.cgas-logo-proof-cta p {
  margin: 6px 0 12px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  line-height: 1.4;
}
.cgas-logo-proof-btn,
#cgas-btn-quote {
  border-radius: 999px;
  font-weight: 800;
}
.cgas-logo-proof-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: 1px solid rgba(255,255,255,.72);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
}
.cgas-logo-proof-btn:hover {
  background: rgba(255,255,255,.22);
}
#cgas-btn-quote {
  border-color: #2563ff;
  color: #2563ff;
}
#cgas-btn-quote:hover {
  background: #2563ff;
  color: #fff;
}


/* v1.6.5: Product page becomes designer-first, like CustomNeon create page */
body.cgas-embedded-product-designer.single-product .product .summary,
body.cgas-embedded-product-designer.single-product .product .woocommerce-product-gallery,
body.cgas-embedded-product-designer.single-product .product .images,
body.cgas-embedded-product-designer.single-product .product .product_title,
body.cgas-embedded-product-designer.single-product .product .price,
body.cgas-embedded-product-designer.single-product .product form.cart {
  display: none !important;
}

body.cgas-embedded-product-designer.single-product .product {
  display: block !important;
}

.cgas-product-designer-hero {
  width: 100%;
  clear: both;
  margin: 0 0 34px;
  padding: 0;
}

.cgas-product-designer-inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

/* Make the embedded designer feel like the main hero/banner area. */
body.cgas-embedded-product-designer .cgas-wrap {
  max-width: none;
  width: 100%;
  margin: 0 auto 28px;
  padding-top: 0;
}

body.cgas-embedded-product-designer .cgas-layout {
  min-height: 680px;
}

/* Put product description/tabs below the designer as normal content. */
body.cgas-embedded-product-designer.single-product .woocommerce-tabs,
body.cgas-embedded-product-designer.single-product .related.products,
body.cgas-embedded-product-designer.single-product .upsells.products {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

body.cgas-embedded-product-designer.single-product .woocommerce-tabs {
  padding-top: 24px;
}

@media (max-width: 900px) {
  body.cgas-embedded-product-designer .cgas-layout {
    min-height: auto;
  }
  .cgas-product-designer-hero {
    margin-bottom: 22px;
  }
}


/* v1.6.9: stronger embedded product-page designer mode */
body.cgas-embedded-product-designer.single-product div.product > .summary,
body.cgas-embedded-product-designer.single-product div.product > .images,
body.cgas-embedded-product-designer.single-product div.product > .woocommerce-product-gallery,
body.cgas-embedded-product-designer.single-product .single-product-wrapper .summary,
body.cgas-embedded-product-designer.single-product .single-product-wrapper .images,
body.cgas-embedded-product-designer.single-product .product-summary,
body.cgas-embedded-product-designer.single-product .product-info,
body.cgas-embedded-product-designer.single-product .entry-summary {
  display: none !important;
}

body.cgas-embedded-product-designer.single-product .cgas-product-designer-hero {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  clear: both !important;
}


/* v1.7.0: collapsed Special Effects selector */
.cgas-special-effect-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid #d9dde7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}
.cgas-selected-effect-copy strong {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}
.cgas-selected-effect-copy small {
  display: block;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}
.cgas-special-effect-arrow {
  font-family: Arial, sans-serif;
  font-size: 26px;
  line-height: 1;
  color: #1a1a2e;
  flex: 0 0 auto;
}
#cgas-special-effects-list.cgas-effect-list-collapsed {
  display: none !important;
}
#cgas-special-effects-list.cgas-effect-list-open {
  display: grid !important;
  margin-top: 12px;
}
#cgas-special-effects-list .cgas-effect-card.active {
  border-color: #2563ff;
  background: #f4f7ff;
}


/* v1.7.1: Mobile CustomNeon-style sticky preview + scrollable options */
.cgas-mobile-preview-total {
  display: none;
}

@media (max-width: 768px) {
  body.cgas-embedded-product-designer,
  body.cgas-embedded-product-designer.single-product {
    overflow-x: hidden;
  }

  body.cgas-embedded-product-designer .cgas-header,
  body.cgas-embedded-product-designer .cgas-templates-bar,
  body.cgas-embedded-product-designer .cgas-preview-actions,
  body.cgas-embedded-product-designer #cgas-share-result {
    display: none !important;
  }

  body.cgas-embedded-product-designer .cgas-wrap {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.cgas-embedded-product-designer .cgas-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-height: 0 !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-panel {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    background: #111827 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 8px 18px rgba(0,0,0,.25);
  }

  body.admin-bar.cgas-embedded-product-designer .cgas-preview-panel {
    top: 46px !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-toolbar {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 10;
    margin: 0 !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-toolbar .cgas-size-label {
    display: none !important;
  }

  body.cgas-embedded-product-designer .cgas-mode-btn {
    border-radius: 999px !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    background: rgba(255,255,255,.85) !important;
    color: #111827 !important;
  }

  body.cgas-embedded-product-designer .cgas-mode-btn.active {
    background: #fff !important;
    color: #39d353 !important;
    border-color: #fff !important;
  }

  body.cgas-embedded-product-designer .cgas-mobile-preview-total {
    display: flex !important;
    position: absolute;
    right: 14px;
    top: 10px;
    z-index: 10;
    align-items: baseline;
    gap: 8px;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,.45);
    pointer-events: none;
  }

  body.cgas-embedded-product-designer .cgas-mobile-preview-total span {
    font-size: 18px;
    font-weight: 500;
    opacity: .92;
  }

  body.cgas-embedded-product-designer .cgas-mobile-preview-total strong {
    font-size: clamp(30px, 8vw, 48px);
    font-weight: 500;
    letter-spacing: .01em;
  }

  body.cgas-embedded-product-designer .cgas-preview-stage {
    height: 46vh !important;
    min-height: 330px !important;
    max-height: 430px !important;
    border-radius: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body.cgas-embedded-product-designer .cgas-scene-bg {
    background-size: cover !important;
    background-position: center !important;
  }

  body.cgas-embedded-product-designer .cgas-wall-size-label {
    display: none !important;
  }

  body.cgas-embedded-product-designer .cgas-drag-hint {
    display: none !important;
  }

  body.cgas-embedded-product-designer .cgas-options-panel {
    position: relative !important;
    z-index: 2 !important;
    margin-top: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  body.cgas-embedded-product-designer .cgas-options-panel form {
    margin: 0 !important;
    padding: 0 14px 120px !important;
    background: transparent !important;
  }

  body.cgas-embedded-product-designer .cgas-options-panel .cgas-section,
  body.cgas-embedded-product-designer .cgas-price-summary,
  body.cgas-embedded-product-designer .cgas-actions,
  body.cgas-embedded-product-designer #cgas-quote-form-wrap {
    background: #fff !important;
    border-radius: 18px !important;
    margin: 0 0 12px !important;
    padding: 18px !important;
    box-shadow: 0 3px 12px rgba(15,23,42,.08);
  }

  body.cgas-embedded-product-designer .cgas-options-panel .cgas-section:first-of-type {
    margin-top: -10px !important;
  }

  body.cgas-embedded-product-designer .cgas-section-title {
    font-size: 24px !important;
    text-transform: uppercase;
    letter-spacing: .01em;
  }

  body.cgas-embedded-product-designer .cgas-options-panel .cgas-section > .cgas-section-title::before {
    width: 34px !important;
    height: 34px !important;
    border-radius: 7px !important;
    font-size: 20px !important;
    flex-basis: 34px !important;
    background: #4b5cff !important;
  }

  body.cgas-embedded-product-designer .cgas-color-grid,
  body.cgas-embedded-product-designer .cgas-size-grid,
  body.cgas-embedded-product-designer .cgas-backboard-grid,
  body.cgas-embedded-product-designer .cgas-mount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.cgas-embedded-product-designer .cgas-price-summary {
    display: none !important;
  }

  body.cgas-embedded-product-designer .cgas-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
    border-radius: 18px 18px 0 0 !important;
    margin: 0 -14px !important;
    box-shadow: 0 -6px 18px rgba(15,23,42,.16) !important;
  }
}

@media (max-width: 390px) {
  body.cgas-embedded-product-designer .cgas-preview-stage {
    height: 43vh !important;
    min-height: 300px !important;
  }

  body.cgas-embedded-product-designer .cgas-mobile-preview-total strong {
    font-size: 34px;
  }
}


/* v1.7.2: Mobile fixed preview correction
   Preview stays fixed under the site header, options scroll underneath.
   This also fixes the issue where the preview was only visible as a thin left strip. */
@media (max-width: 768px) {
  body.cgas-embedded-product-designer .cgas-product-designer-hero,
  body.cgas-embedded-product-designer .cgas-product-designer-inner,
  body.cgas-embedded-product-designer .cgas-wrap,
  body.cgas-embedded-product-designer .cgas-layout {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: visible !important;
    transform: none !important;
  }

  body.cgas-embedded-product-designer .cgas-layout {
    display: block !important;
    position: relative !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: var(--cgas-mobile-header-offset, 96px) !important;
    width: 100vw !important;
    height: var(--cgas-mobile-preview-height, 355px) !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9998 !important;
    background: #111827 !important;
    overflow: hidden !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.28) !important;
  }

  body.admin-bar.cgas-embedded-product-designer .cgas-preview-panel {
    top: calc(var(--cgas-mobile-header-offset, 96px) + 46px) !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-stage {
    width: 100vw !important;
    height: var(--cgas-mobile-preview-height, 355px) !important;
    min-height: var(--cgas-mobile-preview-height, 355px) !important;
    max-height: var(--cgas-mobile-preview-height, 355px) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body.cgas-embedded-product-designer .cgas-options-panel {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-top: calc(var(--cgas-mobile-preview-height, 355px) + 10px) !important;
    position: relative !important;
    z-index: 2 !important;
    background: #f5f5f5 !important;
    overflow: visible !important;
  }

  body.cgas-embedded-product-designer .cgas-options-panel form {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body.cgas-embedded-product-designer .cgas-backboard {
    max-width: 92vw !important;
  }

  body.cgas-embedded-product-designer .cgas-mobile-preview-total {
    display: flex !important;
    position: absolute !important;
    right: 14px !important;
    top: 12px !important;
    z-index: 12 !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-toolbar {
    position: absolute !important;
    left: 12px !important;
    top: 12px !important;
    z-index: 12 !important;
  }
}

@media (max-width: 390px) {
  body.cgas-embedded-product-designer {
    --cgas-mobile-preview-height: 320px;
  }
}


/* v1.7.6: prominent customer background-image upload button */
.cgas-bg-upload-top-btn {
  color: #ff6a00 !important;
  border-color: #ff6a00 !important;
  font-weight: 900 !important;
  background: #fff7ed !important;
  cursor: pointer;
}
.cgas-bg-upload-top-btn:hover {
  background: #ff6a00 !important;
  color: #fff !important;
}

@media (max-width: 768px) {
  body.cgas-embedded-product-designer .cgas-preview-actions {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--cgas-mobile-header-offset, 96px) + var(--cgas-mobile-preview-height, 355px)) !important;
    width: 100vw !important;
    z-index: 9999 !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: #fff !important;
    box-shadow: 0 8px 18px rgba(0,0,0,.16) !important;
  }

  body.admin-bar.cgas-embedded-product-designer .cgas-preview-actions {
    top: calc(var(--cgas-mobile-header-offset, 96px) + 46px + var(--cgas-mobile-preview-height, 355px)) !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-actions #cgas-btn-export-svg,
  body.cgas-embedded-product-designer .cgas-preview-actions #cgas-btn-share,
  body.cgas-embedded-product-designer .cgas-preview-actions #cgas-btn-reset-position {
    display: none !important;
  }

  body.cgas-embedded-product-designer .cgas-preview-actions .cgas-bg-upload-top-btn {
    display: flex !important;
    width: 100% !important;
    min-height: 46px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #ff6a00 !important;
    border-radius: 12px !important;
    color: #ff6a00 !important;
    background: #fff7ed !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    letter-spacing: .01em !important;
    text-align: center !important;
  }

  body.cgas-embedded-product-designer .cgas-options-panel {
    padding-top: calc(var(--cgas-mobile-preview-height, 355px) + 72px) !important;
  }
}

/* ── v1.8.0 Template Gallery + Locked Layer ───────────────────────── */
.cgas-template-gallery-wrap {
  margin: 0 0 24px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);
  border: 1px solid #e5e7f0;
  border-radius: 16px;
}
.cgas-template-gallery-head h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: #1a1a2e;
}
.cgas-template-gallery-head p {
  margin: 0 0 14px;
  color: #666;
}
.cgas-template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.cgas-template-filter {
  border: 1px solid #d3d7e6;
  background: #fff;
  color: #1f2937;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
}
.cgas-template-filter.active,
.cgas-template-filter:hover {
  background: #ff7a00;
  border-color: #ff7a00;
  color: #fff;
}
.cgas-template-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.cgas-template-card {
  min-width: 0;
}
.cgas-template-card .cgas-tpl-btn {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e1e5ef;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  color: #111827;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cgas-template-card .cgas-tpl-btn:hover,
.cgas-template-card.active .cgas-tpl-btn {
  transform: translateY(-2px);
  border-color: #ff7a00;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
.cgas-template-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #111827;
}
.cgas-template-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.cgas-template-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 10px;
  color: #fff;
  text-align: center;
}
.cgas-template-card strong {
  font-size: 14px;
  line-height: 1.25;
}
.cgas-template-card em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #ff7a00;
}
.cgas-locked-template-image {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 78%;
  max-height: 78%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.25));
}
.cgas-backboard.cgas-has-template-image .cgas-sign-text {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}
@media (max-width: 640px) {
  .cgas-template-gallery-wrap {
    padding: 14px;
    margin-left: -8px;
    margin-right: -8px;
  }
  .cgas-template-gallery {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
  }
  .cgas-template-card {
    flex: 0 0 150px;
  }
  .cgas-template-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }
  .cgas-template-filter {
    flex: 0 0 auto;
  }
}


/* v1.8.1: category template grids + related templates under designer */
.cgas-public-template-gallery,
.cgas-related-template-gallery-wrap {
  max-width: 1280px;
  margin: 34px auto;
  padding: 0 20px;
}
.cgas-public-template-head,
.cgas-template-gallery-head {
  text-align: center;
  margin-bottom: 18px;
}
.cgas-public-template-head h3,
.cgas-template-gallery-head h3 {
  font-size: clamp(24px, 3vw, 38px);
  margin: 0 0 8px;
  color: #111827;
}
.cgas-public-template-head p,
.cgas-template-gallery-head p {
  margin: 0;
  color: #6b7280;
}
.cgas-public-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.cgas-public-template-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  text-decoration: none !important;
  color: #111827;
  box-shadow: 0 5px 18px rgba(15,23,42,.06);
  transition: transform .16s ease, box-shadow .16s ease;
}
.cgas-public-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15,23,42,.12);
}
.cgas-public-template-thumb,
.cgas-template-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
}
.cgas-public-template-thumb img,
.cgas-template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cgas-public-template-card strong {
  font-size: 15px;
}
.cgas-public-template-card em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: #2563ff;
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
}
.cgas-related-template-toggle {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  border: 2px dashed #2563ff;
  border-radius: 18px;
  background: #f4f7ff;
  color: #111827;
  cursor: pointer;
}
.cgas-related-template-toggle span {
  font-size: 22px;
  font-weight: 900;
}
.cgas-related-template-toggle em {
  color: #5b6475;
  font-style: normal;
}
.cgas-related-template-panel {
  margin-top: 18px;
}
@media (max-width: 768px) {
  .cgas-public-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .cgas-related-template-gallery-wrap {
    margin-top: 18px;
    padding: 0 14px 110px;
  }
}
