/* ENUT TrafficThai: letterforms of the Department of Highways manual (2554), © NDS Soft (ENUT); live preview of traffic signs only */
@font-face { font-family: 'ENUT TrafficThai'; src: url('../fonts/enut-trafficthai.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'ENUT TrafficThai Narrow'; src: url('../fonts/enut-trafficthai-narrow.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* natdesign shop — traffic & safety signs configurator + category styles (§7.1, §7.3) */

/* Hide generic made-to-order textarea/upload when sign configurator is active inside #buy */
#buy:has(.sign-cfg) .custom-box {
  display: none;
}

/* ---------- Live Preview Stage ---------- */
.sign-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sign-stage-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: clamp(18px, 4vw, 34px);
  border-radius: var(--r-xl, 24px);
  background:
    radial-gradient(circle at 50% 42%, #ffffff 0%, #f8f4f7 78%, #f1e9ef 100%);
  border: 1px solid var(--line, #efe1ea);
  overflow: hidden;
}

.sign-stage-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(29, 15, 27, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
}

.sign-stage-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}

.sign-stage-dim {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-2, #e2cfdb);
  color: var(--ink, #1d0f1b);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sign-canvas {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 24px rgba(29, 15, 27, 0.14));
}

.sign-canvas-inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
}

.sign-canvas-inner img.sign-plate {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.sign-canvas-inner svg.sign-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.sign-stage-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3, #7b6a78);
  text-align: center;
}

/* Integrated live preview inside .gallery .g-main */
.g-main .sign-live-mount {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #f8f4f7 78%, #f1e9ef 100%);
}

.g-main .sign-live-mount[hidden] {
  display: none !important;
}

.g-main .sign-live-mount .sign-stage-frame {
  flex: 1;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sign-live-caption {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-3, #7b6a78);
  text-align: center;
}

.g-thumbs button.sign-thumb-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--m-50, #fff0f7);
  color: var(--m-700, #a10a56);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 4px;
}

.g-thumbs button.sign-thumb-live svg {
  width: 22px;
  height: 22px;
}

/* Make gallery sticky on desktop when sign configurator is present so user sees live preview while editing */
@media (min-width: 721px) {
  /* the preview only stays in view beside the configurator; the description tabs run full width below it */
  .pdp:has(.sign-cfg) {
    grid-template-areas: "gal info" "tabs tabs";
    grid-template-rows: auto auto;
  }
  .pdp:has(.sign-cfg) > .gallery {
    position: sticky;
    top: 96px;
    align-self: start;
  }
  /* a sticky item is held by the whole grid, so the tabs slide over the preview instead of under it */
  .pdp:has(.sign-cfg) > .tabs {
    position: relative;
    z-index: 2;
    background: var(--bg);
    margin-top: 0;
    padding-top: 40px;
  }
}

/* ---------- Configurator Form ---------- */
.sign-cfg {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 18px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sign-step {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
}

.sign-step > legend,
.sign-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink, #1d0f1b);
  margin-bottom: 9px;
}

.sign-step-sub {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3, #7b6a78);
}

/* Standard size pills */
.sign-sizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.sign-size-btn {
  position: relative;
}

.sign-size-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sign-size-btn label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2, #e2cfdb);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sign-size-btn label:hover {
  border-color: var(--m-200, #ffc2df);
}

.sign-size-btn label strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #1d0f1b);
  line-height: 1.25;
}

.sign-size-btn label small {
  font-size: 11.5px;
  color: var(--ink-3, #7b6a78);
  line-height: 1.3;
}

.sign-size-btn input:checked + label {
  border-color: var(--m, #e0157a);
  background: var(--m-50, #fff0f7);
  box-shadow: 0 0 0 3px var(--m-100, #ffe0ef);
}

.sign-size-btn input:checked + label strong {
  color: var(--m-700, #a10a56);
}

.sign-size-btn input:focus-visible + label {
  outline: 3px solid var(--hot, #ff3d9a);
  outline-offset: 1px;
}

/* Custom size input row */
.sign-custom-size {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #efe1ea);
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sign-custom-size[hidden] {
  display: none !important;
}

.sign-custom-size label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2, #4b3a49);
}

.sign-cm-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sign-cm-wrap input {
  width: 116px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line-2, #e2cfdb);
  background: #fff;
  font-size: 16px;
  font-weight: 600;
}

.sign-cm-wrap input:focus {
  outline: none;
  border-color: var(--m, #e0157a);
  box-shadow: 0 0 0 3px var(--m-100, #ffe0ef);
}

.sign-cm-wrap input.is-invalid {
  border-color: var(--red, #e5383b);
  background: #fff8f8;
}

.sign-dim-readout {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-2, #4b3a49);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.sign-dim-readout b {
  color: var(--ink, #1d0f1b);
  font-variant-numeric: tabular-nums;
}

.sign-err {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #b42318;
}

/* Reflective sheeting cards */
.sign-refl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 520px) {
  .sign-refl-grid {
    grid-template-columns: 1fr;
  }
}

.sign-refl-opt {
  position: relative;
}

.sign-refl-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sign-refl-opt label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2, #e2cfdb);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sign-refl-opt label:hover {
  border-color: var(--m-200, #ffc2df);
}

.sign-refl-opt label strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #1d0f1b);
  line-height: 1.3;
}

.sign-refl-opt label small {
  font-size: 12px;
  color: var(--ink-3, #7b6a78);
  line-height: 1.35;
}

.sign-refl-opt label .sign-refl-delta {
  margin-top: auto;
  padding-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--m-700, #a10a56);
  font-variant-numeric: tabular-nums;
}

.sign-refl-opt label .sign-refl-delta.is-base {
  color: var(--green, #0c9f6a);
}

.sign-refl-opt input:checked + label {
  border-color: var(--m, #e0157a);
  background: var(--m-50, #fff0f7);
  box-shadow: 0 0 0 3px var(--m-100, #ffe0ef);
}

.sign-refl-opt input:focus-visible + label {
  outline: 3px solid var(--hot, #ff3d9a);
  outline-offset: 1px;
}

/* Addon checkboxes (Steel frame & Steel post) */
.sign-addons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sign-addon-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line-2, #e2cfdb);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.sign-addon-card:hover {
  border-color: var(--m-200, #ffc2df);
}

.sign-addon-card:has(input:checked) {
  border-color: var(--m, #e0157a);
  background: var(--m-50, #fff0f7);
}

.sign-addon-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--m, #e0157a);
}

.sign-addon-body {
  flex: 1;
  min-width: 0;
}

.sign-addon-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sign-addon-title strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink, #1d0f1b);
}

.sign-addon-price {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--m-700, #a10a56);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sign-addon-desc {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3, #7b6a78);
  line-height: 1.4;
}

.sign-wall-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--green-50, #e8f8f1);
  border: 1px solid #b5ebd4;
  color: #075e3f;
  font-size: 13.5px;
  font-weight: 600;
}

/* Editable & locked sign fields */
.sign-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r, 16px);
  background: var(--violet-50, #f2ecff);
  border: 1px solid #e1d4ff;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sign-fields-head {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--violet, #6d2bd9);
  margin: 0;
}

.sign-field-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.sign-field-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.sign-field-top label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #1d0f1b);
  margin: 0;
}

.sign-char-count {
  font-size: 12px;
  color: var(--ink-3, #7b6a78);
  font-variant-numeric: tabular-nums;
}

.sign-field-row input[type="text"],
.sign-field-row input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid #d5c2fa;
  background: #fff;
  font-size: 15.5px;
}

.sign-field-row input:focus {
  outline: none;
  border-color: var(--violet, #6d2bd9);
  box-shadow: 0 0 0 3px rgba(109, 43, 217, 0.14);
}

.sign-field-row input.is-invalid {
  border-color: var(--red, #e5383b);
  background: #fff8f8;
}

.sign-locked-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #c8b6ee;
}

.sign-locked-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink, #1d0f1b);
}

.sign-locked-val span {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--m-50, #fff0f7);
  color: var(--m-700, #a10a56);
}

.sign-locked-hint {
  font-size: 13px;
  color: var(--ink-2, #4b3a49);
}

.sign-locked-hint a {
  color: #059669;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Price breakdown summary card */
.sign-summary {
  padding: 14px 16px;
  border-radius: var(--r, 16px);
  background: #fff;
  border: 1.5px solid var(--m-100, #ffe0ef);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sign-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-2, #4b3a49);
}

.sign-sum-row b {
  font-weight: 600;
  color: var(--ink, #1d0f1b);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sign-sum-row.is-total {
  border-top: 1px dashed var(--line-2, #e2cfdb);
  margin-top: 4px;
  padding-top: 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink, #1d0f1b);
}

.sign-sum-row.is-total b {
  font-family: var(--font-d, "Anuphan", sans-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--m-700, #a10a56);
}

.sign-ship-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  background: #f8f5f7;
  color: var(--ink-2, #4b3a49);
}

.sign-ship-note.is-flat {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 600;
}

.sign-spec-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3, #7b6a78);
}

/* Mobile polish at 375px */
@media (max-width: 720px) {
  .pdp:has(.sign-cfg),
  .pdp:has(.sign-cfg) > * {
    min-width: 0;
    max-width: 100%;
  }
  .sign-sizes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sign-stage-frame {
    padding: 14px;
  }
  .sign-stage-badge,
  .sign-stage-dim {
    font-size: 11.5px;
    padding: 4px 9px;
  }
  .sign-addon-title {
    flex-wrap: wrap;
  }
}

/* ---------- §7.3 Traffic Signs Category Page & Cards ---------- */
.sign-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.sign-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2, #e2cfdb);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #1d0f1b);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.sign-cat-pill:hover,
.sign-cat-pill.on {
  border-color: var(--m, #e0157a);
  background: var(--m-50, #fff0f7);
  color: var(--m-700, #a10a56);
}

.sign-cat-pill small {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg, #fffafc);
  color: var(--ink-3, #7b6a78);
  font-size: 12px;
}

.sign-group-sec {
  margin-bottom: 38px;
  scroll-margin-top: 96px;
}

.sign-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--line, #efe1ea);
}

.sign-group-head h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  margin: 0;
}

.sign-group-head span {
  font-size: 13.5px;
  color: var(--ink-3, #7b6a78);
  white-space: nowrap;
}
