:root {
  color-scheme: dark;
  --ink: #f7f4ec;
  --muted: rgba(247, 244, 236, 0.68);
  --line: rgba(255, 255, 255, 0.16);
  --panel: #111310;
  --panel-soft: #191d18;
  --brand: #3e5e52;
  --warm: #9b7545;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  background: #0f110f;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.configurator-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  background: #111;
}

.configurator-stage {
  position: relative;
  min-width: 0;
  display: grid;
  align-items: center;
  padding: 104px clamp(16px, 2.4vw, 34px) 28px;
  overflow: hidden;
}

.configurator-topbar {
  position: absolute;
  z-index: 5;
  top: 18px;
  left: clamp(16px, 2.4vw, 34px);
  right: clamp(16px, 2.4vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #171817;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.brand-mark circle {
  fill: #171817;
}

.brand-mark text {
  fill: white;
  font-family: Georgia, serif;
  font-size: 118px;
  font-weight: 700;
  text-anchor: middle;
}

.brand-mark__small {
  fill: var(--brand) !important;
}

.brand-mark__small-text {
  font-size: 82px !important;
}

.brand small,
.panel-heading small,
.render-caption p {
  display: block;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.build-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(62, 94, 82, 0.32);
  border-radius: 8px;
  color: #233a32;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nav de la topbar del configurador */
.configurator-topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 22px);
  flex: 1;
  justify-content: center;
}

.configurator-topbar__nav a {
  color: #233a32;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 200ms ease, color 200ms ease;
  white-space: nowrap;
}

.configurator-topbar__nav a:hover {
  opacity: 1;
  color: #3e5e52;
}

.canvas-frame {
  position: relative;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #161715;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

#configCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  background: #e9dfcf;
}

.render-caption {
  position: absolute;
  left: clamp(14px, 2.2vw, 30px);
  bottom: clamp(14px, 2.2vw, 30px);
  max-width: min(560px, calc(100% - 36px));
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(17, 18, 16, 0.62);
  color: white;
  backdrop-filter: blur(12px);
}

.render-caption p {
  color: #dce8e1;
}

.render-caption h1 {
  margin: 0;
  font-size: clamp(23px, 2.2vw, 34px);
  line-height: 1.02;
}

.render-caption span {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.configurator-panel {
  position: relative;
  z-index: 3;
  display: grid;
  align-content: start;
  gap: 22px;
  max-height: 100svh;
  padding: 34px 24px;
  overflow-y: auto;
  background:
    linear-gradient(90deg, rgba(17, 19, 16, 0.96), rgba(17, 19, 16, 0.90)),
    linear-gradient(135deg, #111310, #2a2d28);
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.32);
}

.panel-heading {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading > span {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 2px solid rgba(255, 255, 255, 0.70);
  border-radius: 8px;
  color: white;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 900;
}

.panel-heading small {
  color: rgba(255, 255, 255, 0.62);
}

.panel-heading strong {
  display: block;
  margin-top: 3px;
  color: white;
  font-size: 24px;
  line-height: 1.02;
}

.combination-status {
  margin: -8px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.control-block {
  display: grid;
  gap: 10px;
}

.control-block--muted {
  opacity: 0.72;
}

.control-block > strong {
  display: block;
  padding: 12px 14px;
  background: var(--warm);
  color: white;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.control-help {
  margin: -2px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.option {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 900;
  cursor: pointer;
}

.option.is-active {
  border-color: white;
  background: white;
  color: #171817;
}

.option.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.option small {
  font-size: 9px;
  text-transform: uppercase;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.swatch-grid--compact {
  gap: 14px;
}

.swatch-option {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.swatch-option.is-active .swatch {
  outline: 3px solid white;
  outline-offset: 4px;
}

.swatch-option.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.swatch {
  position: relative;
  width: min(132px, 100%);
  height: 90px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 8px;
  background: var(--swatch, #d8d0c0);
  background-image: var(--swatch-image, none);
  background-position: center;
  background-size: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.10)),
    linear-gradient(90deg, rgba(255,255,255,0.10), transparent 42%, rgba(0,0,0,0.10));
  pointer-events: none;
}

.swatch-grid--compact .swatch {
  height: 78px;
}

.swatch-option span:not(.swatch) {
  display: grid;
  gap: 2px;
  max-width: 124px;
  font-size: 14px;
  line-height: 1.08;
}

.swatch-option small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  text-transform: uppercase;
}

.swatch-option em {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-style: normal;
  text-transform: uppercase;
}

.panel-actions {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  border: 0;
  background: var(--brand);
  color: white;
  cursor: pointer;
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.82);
}

.download-status {
  min-height: 18px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.quote-modal[hidden] {
  display: none;
}

.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 12, 10, 0.70);
  backdrop-filter: blur(10px);
}

.quote-dialog {
  position: relative;
  width: min(640px, 100%);
  display: grid;
  gap: 14px;
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: #f7f4ec;
  color: #171817;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.38);
}

.quote-dialog p,
.quote-dialog h2 {
  margin: 0;
}

.quote-dialog > p {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-dialog h2 {
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1.02;
}

.quote-selection {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(62, 94, 82, 0.24);
  border-radius: 8px;
  background: rgba(62, 94, 82, 0.08);
  color: #233a32;
  font-size: 13px;
  font-weight: 900;
}

.quote-dialog label {
  display: grid;
  gap: 7px;
  color: #233a32;
  font-size: 13px;
  font-weight: 900;
}

.quote-dialog input,
.quote-dialog textarea {
  width: 100%;
  border: 1px solid rgba(23, 24, 23, 0.18);
  border-radius: 8px;
  background: white;
  color: #171817;
  font: inherit;
}

.quote-dialog input {
  min-height: 44px;
  padding: 0 12px;
}

.quote-dialog textarea {
  resize: vertical;
  min-height: 132px;
  padding: 12px;
  line-height: 1.45;
}

.quote-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.quote-human {
  grid-template-columns: 20px 1fr;
  align-items: start;
  color: #39463f !important;
  line-height: 1.35;
}

.quote-human input {
  min-height: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.quote-turnstile {
  min-height: 0;
}

.quote-turnstile:empty {
  display: none;
}

.quote-error {
  min-height: 19px;
  color: #9f3028;
  font-size: 13px;
  font-weight: 900;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quote-actions .primary-action,
.quote-actions .secondary-action {
  min-width: 150px;
  padding: 0 16px;
}

.quote-actions .secondary-action {
  background: transparent;
  color: #233a32;
  cursor: pointer;
}

.quote-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(23, 24, 23, 0.14);
  border-radius: 8px;
  background: white;
  color: #171817;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 980px) {
  .configurator-shell {
    grid-template-columns: 1fr;
  }

  .configurator-stage {
    min-height: auto;
    padding-bottom: 18px;
  }

  .configurator-panel {
    max-height: none;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
  }
}

@media (max-width: 620px) {
  .configurator-stage {
    padding: 126px 10px 12px;
  }

  .configurator-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .configurator-topbar__nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .brand strong {
    font-size: 20px;
  }

  .canvas-frame {
    border-radius: 0;
  }

  .render-caption {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }

  .configurator-panel {
    padding: 26px 16px;
  }

  .swatch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .swatch {
    height: 68px;
  }

  .swatch-grid--compact .swatch {
    height: 62px;
  }

  .quote-dialog {
    padding: 22px 16px;
  }
}
