/* =========================================================
   GW Configurador 3D — tema público
   Todas as cores/fontes vêm de variáveis definidas no painel
   (Aparência). Para ajustes finos use o campo "CSS extra".
   ========================================================= */
:root {
  --gw-primary: #0e2a47;
  --gw-accent: #e2611b;
  --gw-bg: #f4f2ee;
  --gw-surface: #ffffff;
  --gw-text: #1c2430;
  --gw-muted: #6b7480;
  --gw-scene: #ece9e3;
  --gw-radius: 14px;
  --gw-font-head: 'Outfit', system-ui, sans-serif;
  --gw-font-body: 'Inter', system-ui, sans-serif;
  --gw-line: color-mix(in srgb, var(--gw-text) 10%, transparent);
  --gw-soft: color-mix(in srgb, var(--gw-primary) 5%, var(--gw-surface));
  --gw-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .12);
  --gw-header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--gw-bg); color: var(--gw-text);
  font: 15px/1.55 var(--gw-font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--gw-font-head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gw-accent); outline-offset: 2px; }

/* ---------- Botões ---------- */
.gw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.3em; border-radius: calc(var(--gw-radius) * .7);
  background: var(--gw-accent); color: #fff; border: 1.5px solid var(--gw-accent);
  font-weight: 600; text-decoration: none; transition: transform .15s, filter .15s, background .15s;
}
.gw-btn:hover { filter: brightness(1.06); }
.gw-btn:active { transform: translateY(1px); }
.gw-btn.sm { padding: .5em .95em; font-size: 14px; }
.gw-btn.block { width: 100%; }
.gw-btn.ghost { background: transparent; color: var(--gw-primary); border-color: color-mix(in srgb, var(--gw-primary) 30%, transparent); }
.gw-btn.ghost:hover { background: var(--gw-soft); }
.gw-btn:disabled { opacity: .7; cursor: progress; }
.gw-btn.loading::after {
  content: ''; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: gw-spin .8s linear infinite;
}
.gw-link { background: none; border: 0; padding: 0; color: var(--gw-muted); text-decoration: underline; font-size: 13px; }

/* ---------- Cabeçalho / rodapé ---------- */
.gw-header {
  position: sticky; top: 0; z-index: 20; height: var(--gw-header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 36px);
  background: var(--gw-primary); color: #fff;
}
.gw-brand img { height: 38px; width: auto; }
.gw-brand span { font: 700 20px var(--gw-font-head); text-decoration: none; }
.gw-brand { text-decoration: none; }
.gw-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.gw-nav > a:not(.gw-btn) { text-decoration: none; opacity: .85; }
.gw-nav > a:not(.gw-btn):hover { opacity: 1; }

.gw-footer {
  margin-top: auto; padding: 22px clamp(16px, 3vw, 36px);
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--gw-line); color: var(--gw-muted); font-size: 13px;
}
.gw-footer div { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.gw-footer strong { color: var(--gw-text); }
.gw-credits { text-decoration: none; opacity: .8; }
.gw-credits:hover { opacity: 1; color: var(--gw-accent); }

/* ---------- Catálogo ---------- */
.gw-catalog { width: min(1240px, 100%); margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 3vw, 36px) 56px; flex: 1; }
.gw-hero { max-width: 720px; margin-bottom: 32px; }
.gw-eyebrow { margin: 0 0 10px; color: var(--gw-accent); font: 600 12px var(--gw-font-body); letter-spacing: .14em; text-transform: uppercase; }
.gw-hero h1 { font-size: clamp(30px, 4.6vw, 48px); color: var(--gw-primary); }
.gw-hero p:last-child { color: var(--gw-muted); font-size: 17px; margin: 14px 0 0; }

.gw-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.gw-filter a {
  padding: 7px 16px; border-radius: 999px; text-decoration: none; font-size: 14px;
  border: 1px solid var(--gw-line); background: var(--gw-surface);
}
.gw-filter a.active { background: var(--gw-primary); color: #fff; border-color: var(--gw-primary); }

.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.gw-card {
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  background: var(--gw-surface); border-radius: var(--gw-radius); box-shadow: var(--gw-shadow);
  transition: transform .25s, box-shadow .25s;
}
.gw-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(16,24,40,.06), 0 18px 40px -12px rgba(16,24,40,.22); }
.gw-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--gw-scene); display: grid; place-items: center; overflow: hidden; }
.gw-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gw-card:hover .gw-card-img img { transform: scale(1.04); }
.gw-card-ph { color: color-mix(in srgb, var(--gw-primary) 35%, transparent); }
.gw-badge {
  position: absolute; top: 12px; left: 12px; padding: 3px 9px; border-radius: 6px;
  background: var(--gw-primary); color: #fff; font: 700 11px var(--gw-font-body); letter-spacing: .08em;
}
.gw-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.gw-card-body small { color: var(--gw-accent); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.gw-card-body h2 { font-size: 19px; color: var(--gw-primary); }
.gw-card-body p { margin: 0; color: var(--gw-muted); font-size: 14px; }
.gw-card-cta { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 14px; color: var(--gw-accent); }
.gw-empty { padding: 48px; text-align: center; color: var(--gw-muted); background: var(--gw-surface); border-radius: var(--gw-radius); }

/* ---------- Configurador ---------- */
.page-product { height: 100vh; height: 100dvh; overflow: hidden; }
.page-product .gw-footer { display: none; }
.gw-config {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 420px);
}
.gw-stage { position: relative; min-height: 0; background: var(--gw-scene); }
.gw-viewer { position: absolute; inset: 0; }
.gw-canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; cursor: grab; }
.gw-canvas:active { cursor: grabbing; }

.gw-loading {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--gw-scene); color: var(--gw-muted); transition: opacity .5s;
}
.gw-loading.done { opacity: 0; pointer-events: none; }
.gw-loading p { margin: 0; font-size: 14px; }
.gw-spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--gw-line); border-top-color: var(--gw-accent); animation: gw-spin .9s linear infinite; }
.gw-progress { width: 180px; height: 4px; border-radius: 4px; background: var(--gw-line); overflow: hidden; }
.gw-progress span { display: block; height: 100%; width: var(--p, 8%); background: var(--gw-accent); transition: width .2s; }
@keyframes gw-spin { to { transform: rotate(360deg); } }

.gw-toolbar {
  position: absolute; z-index: 3; left: 50%; bottom: 46px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--gw-surface) 88%, transparent); backdrop-filter: blur(10px);
  box-shadow: var(--gw-shadow);
}
.gw-toolbar button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
  color: var(--gw-primary); transition: background .15s;
}
.gw-toolbar button:hover { background: var(--gw-soft); }
.gw-toolbar button.active { background: var(--gw-primary); color: #fff; }
.gw-toolbar svg { width: 20px; height: 20px; fill: currentColor; }
.gw-hint { position: absolute; z-index: 3; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; font-size: 12px; color: var(--gw-muted); pointer-events: none; }
.gw-stage:fullscreen { background: var(--gw-scene); }

.gw-panel {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  background: var(--gw-surface); border-left: 1px solid var(--gw-line);
}
.gw-panel-head { padding: 24px 24px 18px; border-bottom: 1px solid var(--gw-line); }
.gw-back { display: inline-block; margin-bottom: 12px; font-size: 13px; color: var(--gw-muted); text-decoration: none; }
.gw-back:hover { color: var(--gw-accent); }
.gw-panel-head h1 { font-size: 26px; color: var(--gw-primary); }
.gw-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; color: var(--gw-muted); font-size: 13px; }
.gw-meta span + span::before { content: '·'; margin-right: 14px; }
.gw-desc { margin: 12px 0 0; font-size: 14px; color: var(--gw-muted); }

.gw-parts { flex: 1; }
.gw-part { border-bottom: 1px solid var(--gw-line); }
.gw-part-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 24px;
  background: none; border: 0; text-align: left;
}
.gw-part-head:hover { background: var(--gw-soft); }
.gw-part-index { font: 600 12px var(--gw-font-head); color: var(--gw-accent); width: 20px; }
.gw-part-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gw-part-title strong { font-size: 15px; }
.gw-part-current { color: var(--gw-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-part-chip { width: 28px; height: 28px; border-radius: 50%; flex: none; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.gw-chev { flex: none; color: var(--gw-muted); transition: transform .25s; }
.gw-part.open .gw-chev { transform: rotate(180deg); }
.gw-part-body { display: none; padding: 2px 24px 20px; }
.gw-part.open .gw-part-body { display: block; animation: gw-in .25s ease; }
@keyframes gw-in { from { opacity: 0; transform: translateY(-4px); } }

.gw-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.gw-tabs button {
  flex: none; padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--gw-line); background: var(--gw-surface);
}
.gw-tabs button.active { background: var(--gw-primary); border-color: var(--gw-primary); color: #fff; }

.gw-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 10px; }
.gw-swatch { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gw-swatch[hidden] { display: none; }
.gw-swatch-img {
  width: 58px; height: 58px; border-radius: 50%; background-size: 220%; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.08);
  transition: transform .15s, box-shadow .15s;
}
.gw-swatch:hover .gw-swatch-img { transform: scale(1.06); }
.gw-swatch.active .gw-swatch-img { box-shadow: 0 0 0 2px var(--gw-surface), 0 0 0 4px var(--gw-accent); }
.gw-swatch-name { font-size: 11.5px; line-height: 1.25; text-align: center; color: var(--gw-muted); }
.gw-swatch.active .gw-swatch-name { color: var(--gw-text); font-weight: 600; }

.gw-free-color { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--gw-line); font-size: 13px; }
.gw-free-color input { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.gw-free-color input::-webkit-color-swatch-wrapper { padding: 0; }
.gw-free-color input::-webkit-color-swatch { border: 1px solid var(--gw-line); border-radius: 50%; }
.gw-free-color input::-moz-color-swatch { border: 1px solid var(--gw-line); border-radius: 50%; }
.gw-free-color span { flex: 1; }

.gw-summary-box {
  position: sticky; bottom: 0; padding: 18px 24px 22px;
  background: var(--gw-surface); border-top: 1px solid var(--gw-line);
  box-shadow: 0 -10px 24px -18px rgba(0,0,0,.25);
}
.gw-summary-box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--gw-muted); margin-bottom: 10px; }
.gw-summary { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.gw-summary li { display: flex; align-items: center; gap: 8px; }
.gw-summary li > span:nth-child(2) { color: var(--gw-muted); }
.gw-summary strong { margin-left: auto; text-align: right; font-weight: 600; }
.gw-summary em { font-style: normal; color: var(--gw-muted); font-weight: 400; }
.gw-summary .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background-size: 300%; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.gw-actions { display: grid; gap: 8px; }

/* ---------- Modal ---------- */
.gw-modal {
  width: min(480px, calc(100vw - 32px)); border: 0; padding: 0; border-radius: var(--gw-radius);
  background: var(--gw-surface); color: var(--gw-text); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4);
}
.gw-modal::backdrop { background: rgba(10, 16, 26, .55); backdrop-filter: blur(3px); }
.gw-modal form { padding: 26px; display: grid; gap: 12px; }
.gw-modal h2 { font-size: 21px; color: var(--gw-primary); }
.gw-modal p { margin: -6px 0 4px; color: var(--gw-muted); font-size: 14px; }
.gw-modal label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.gw-modal input, .gw-modal textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--gw-line); background: var(--gw-bg);
  font: inherit; color: inherit; resize: vertical;
}
.gw-modal input:focus, .gw-modal textarea:focus { outline: 0; border-color: var(--gw-accent); background: var(--gw-surface); }
.gw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gw-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.gw-modal-actions .gw-link { margin-right: auto; }

.gw-toast {
  position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  padding: 11px 18px; border-radius: 10px; background: var(--gw-primary); color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.gw-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Ficha online ---------- */
.gw-sheet { width: min(860px, 100%); margin: 0 auto; padding: 28px 16px 56px; flex: 1; }
.gw-sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-bottom: 16px; }
.gw-sheet-page { background: var(--gw-surface); border-radius: var(--gw-radius); box-shadow: var(--gw-shadow); padding: 0 0 26px; overflow: hidden; }
.gw-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; background: var(--gw-primary); color: #fff; border-bottom: 4px solid var(--gw-accent); }
.gw-sheet-head img { height: 36px; width: auto; }
.gw-sheet-head div { display: grid; text-align: right; font-size: 13px; }
.gw-sheet-head strong { font-size: 16px; }
.gw-sheet-page > h1 { margin: 26px 28px 0; color: var(--gw-primary); font-size: 28px; }
.gw-sheet-page > .gw-meta { margin: 6px 28px 0; }
.gw-sheet-img { width: calc(100% - 56px); margin: 18px 28px; border-radius: 10px; background: var(--gw-scene); }
.gw-sheet-page > h2 { margin: 22px 28px 10px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gw-primary); }
.gw-sheet-table { width: calc(100% - 56px); margin: 0 28px; border-collapse: collapse; font-size: 14px; }
.gw-sheet-table tr:nth-child(odd) { background: var(--gw-soft); }
.gw-sheet-table td { padding: 10px 12px; vertical-align: middle; }
.gw-sheet-table td small { display: block; color: var(--gw-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.gw-sheet-table td.sw { width: 52px; }
.gw-sheet-table td.sw span { display: block; width: 36px; height: 36px; border-radius: 6px; background-size: 260%; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.gw-sheet-table td.r { text-align: right; color: var(--gw-muted); font-size: 13px; }
.gw-client { margin: 0 28px; font-size: 14px; }
.gw-sheet-foot { margin: 26px 28px 0; padding-top: 14px; border-top: 1px solid var(--gw-line); display: grid; gap: 4px; color: var(--gw-muted); font-size: 12.5px; }

@media print {
  .no-print, .gw-header, .gw-footer { display: none !important; }
  body { background: #fff; }
  .gw-sheet { padding: 0; width: 100%; }
  .gw-sheet-page { box-shadow: none; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Texturas tingidas pela cor do material */
.gw-swatch-img, .gw-part-chip, .gw-summary .dot, .gw-sheet-table td.sw span { background-blend-mode: multiply; }

/* ---------- Embed / iframe ---------- */
.is-embed.page-product { --gw-header-h: 0px; }
.is-embed .gw-catalog { padding-top: 24px; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .page-product { height: auto; overflow: visible; }
  .gw-config { grid-template-columns: 1fr; }
  .gw-stage { height: 58vh; height: 58svh; position: sticky; top: var(--gw-header-h); z-index: 5; }
  .is-embed .gw-stage { top: 0; }
  .gw-panel { border-left: 0; overflow: visible; }
  .gw-hint { display: none; }
  .gw-toolbar { bottom: 12px; }
  .gw-panel-head { padding: 18px 16px 14px; }
  .gw-part-head { padding: 14px 16px; }
  .gw-part-body { padding: 2px 16px 18px; }
  .gw-summary-box { padding: 16px; position: static; box-shadow: none; }
  .gw-row { grid-template-columns: 1fr; }
  .gw-nav > a:not(.gw-btn) { display: none; }
}
