/* ==========================================================================
   Marc Puig Studio — configurador de presupuestos
   Usa los tokens de main.css (colores, tipografías, botones)
   ========================================================================== */

.page-quote { background: radial-gradient(70% 50% at 100% 0%, rgba(255,31,31,.12), transparent 60%), var(--bg); }
.q-back { display: inline-flex; }
.q-page { padding: calc(var(--header-h) + clamp(40px, 7vw, 90px)) 0 clamp(80px, 10vw, 140px); min-height: 100vh; }
.q-hero { margin-bottom: clamp(36px, 5vw, 64px); }
.q-title { font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 7vw, 104px); line-height: .95; letter-spacing: -.05em; }
.q-title em { font-style: normal; color: var(--red); }
.q-lead { color: var(--muted); max-width: 640px; margin-top: 22px; font-size: clamp(16px, 1.2vw, 19px); }
.q-noscript { color: var(--muted); }

/* Layout */
.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(24px, 3vw, 44px); align-items: start; }
.q-main { min-width: 0; }
.q-panel { outline: none; padding: clamp(22px, 3vw, 40px); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: rgba(17,17,18,.7); backdrop-filter: blur(6px); animation: qIn .5s var(--ease); }
@keyframes qIn { from { opacity: 0; transform: translateY(14px); } }
.q-h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 2.6vw, 38px); letter-spacing: -.035em; line-height: 1.1; margin-bottom: 28px; display: flex; align-items: baseline; gap: 14px; }
.q-h2 .mono { font-size: 13px; color: var(--red); letter-spacing: .12em; }

/* Pasos */
.q-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; counter-reset: s; }
.q-step > span, .q-step > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 12px 14px; border-top: 2px solid var(--line-2); color: var(--dim); font-size: 13px; text-align: left; transition: color .3s, border-color .3s; }
.q-step i { font-style: normal; font-size: 11px; }
.q-step b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-step.is-done > * { color: var(--muted); border-color: rgba(255,31,31,.55); }
.q-step.is-done button:hover { color: var(--text); }
.q-step.is-current > * { color: var(--text); border-color: var(--red); }
.q-step.is-current i { color: var(--red); }

/* Tarjetas seleccionables */
.q-grid { display: grid; gap: 12px; }
.q-grid--types { grid-template-columns: repeat(3, 1fr); }
.q-grid--3 { grid-template-columns: repeat(3, 1fr); }
.q-grid--2 { grid-template-columns: repeat(2, 1fr); }
.q-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); transition: border-color .3s, background-color .3s, transform .4s var(--ease), box-shadow .4s; }
.q-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.q-card strong { font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; line-height: 1.2; }
.q-card span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.q-card em { font-style: normal; font-size: 11px; color: var(--dim); margin-top: auto; padding-top: 6px; }
.q-card::after { content: ""; position: absolute; top: 16px; right: 16px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); transition: background-color .3s, border-color .3s; }
.q-card.is-on { border-color: var(--red); background: linear-gradient(180deg, rgba(255,31,31,.10), rgba(255,31,31,.02)), var(--bg-2); box-shadow: 0 14px 40px -24px var(--red-glow); }
.q-card.is-on::after { background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--red); }
.q-card.is-on em { color: var(--text); }
.q-ico { width: 30px; height: 30px; fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.q-card.is-on .q-ico { stroke: var(--red); }
.q-card--type { min-height: 190px; }

/* Campos */
.q-field { border: 0; margin: 0 0 30px; padding: 0; min-width: 0; }
.q-field legend, .q-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; padding: 0; }
.q-field legend small, .q-label small { color: var(--dim); font-weight: 400; }
.q-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.q-chip { height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; color: var(--muted); transition: all .3s; }
.q-chip:hover { color: var(--text); border-color: var(--text); }
.q-chip.is-on { background: var(--red); border-color: var(--red); color: #fff; }
.q-stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.q-stepper button { width: 48px; height: 48px; border: 1px solid var(--line-2); font-size: 22px; transition: background-color .3s; }
.q-stepper button:first-child { border-radius: 999px 0 0 999px; }
.q-stepper button:nth-of-type(2) { border-radius: 0 999px 999px 0; }
.q-stepper button:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.q-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.q-stepper input { width: 72px; height: 48px; text-align: center; font: 600 18px var(--f-display); color: var(--text); background: var(--bg-3); border: 1px solid var(--line-2); border-left: 0; border-right: 0; -moz-appearance: textfield; }
.q-stepper input::-webkit-outer-spin-button, .q-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.q-hint { margin-left: 16px; font-size: 11px; color: var(--muted); }
.q-hint b { color: #6ee7a8; font-weight: 500; }

/* Interruptores de extras */
.q-toggles { display: grid; gap: 10px; }
.q-toggle { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; transition: border-color .3s, background-color .3s; }
.q-toggle:hover { border-color: var(--line-2); }
.q-toggle.is-on { border-color: rgba(255,31,31,.6); background: rgba(255,31,31,.06); }
.q-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.q-switch { width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background-color .3s; }
.q-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .35s var(--ease); }
.q-toggle input:checked + .q-switch { background: var(--red); }
.q-toggle input:checked + .q-switch::after { transform: translateX(18px); }
.q-toggle input:focus-visible + .q-switch { outline: 2px solid var(--red); outline-offset: 3px; }
.q-toggle__txt { display: grid; gap: 2px; }
.q-toggle__txt strong { font-size: 15px; font-weight: 600; }
.q-toggle__txt small { color: var(--muted); font-size: 13px; }
.q-toggle em { font-style: normal; font-size: 11px; color: var(--dim); }
.q-toggle.is-on em { color: var(--text); }

/* Oferta de lanzamiento */
.q-promo { display: inline-flex; align-items: center; gap: 10px; margin: -12px 0 14px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid rgba(255,31,31,.5); background: rgba(255,31,31,.08); font-size: 13px; color: var(--text); }
.q-promo b { background: var(--red); color: #fff; border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.q-card em s, .q-pkg em s { color: var(--dim); margin-right: 4px; }

/* Aviso: solo edición */
.q-editonly { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.q-editonly svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Paquete elegido */
.q-pkg { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 22px; border: 1px solid rgba(255,31,31,.5); border-radius: var(--radius-sm); background: rgba(255,31,31,.07); }
.q-pkg span.mono { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.q-pkg strong { display: block; font-family: var(--f-display); font-size: 20px; letter-spacing: -.02em; }
.q-pkg strong em { font-style: normal; font-family: var(--f-body); font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.q-pkg small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.q-pkg__x { flex: none; font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--line-2); padding: 4px 0; }
.q-pkg__x:hover { color: var(--text); }
.q-toggle.is-included { cursor: default; opacity: .95; }
.q-toggle.is-included em { color: #6ee7a8; }
.q-inc { color: #6ee7a8; font-weight: 500 !important; font-size: 12px; }

/* Formulario */
.q-form { display: grid; }
.q-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.q-field--input { margin-bottom: 20px; }
.q-input { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; transition: border-color .3s, box-shadow .3s; }
.q-input:hover { border-color: var(--line-2); }
.q-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(255,31,31,.15); }
textarea.q-input { resize: vertical; min-height: 130px; }
.q-input--date { max-width: 260px; color-scheme: dark; }
.q-error { display: block; min-height: 0; color: #ff6b6b; font-size: 12px; margin-top: 6px; }
.is-invalid .q-input { border-color: #ff6b6b; }
.q-check label { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.q-check input { width: 20px; height: 20px; accent-color: var(--red); margin-top: 1px; flex: none; }
.q-check a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.q-note { color: var(--muted); font-size: 14px; margin-top: 12px; }
.q-note b { color: var(--text); font-weight: 600; }
.q-warn { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255,180,0,.08); border: 1px solid rgba(255,180,0,.35); color: #ffd27a; font-size: 14px; }

/* Navegación */
.q-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.q-nav .btn:disabled, .q-actions .btn:disabled { opacity: .4; cursor: not-allowed; }

/* Resumen lateral */
.q-summary { position: sticky; top: calc(var(--header-h) + 24px); }
.q-sum { padding: 28px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: linear-gradient(180deg, rgba(255,31,31,.08), transparent 40%), var(--bg-2); }
.q-sum__label { font-size: 11px; color: var(--muted); }
.q-sum__price { display: block; font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 4vw, 58px); letter-spacing: -.045em; line-height: 1; margin: 12px 0 6px; }
.q-sum__price.is-bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { color: var(--red); } }
.q-muted { color: var(--muted); font-size: 13px; }
.q-lines { margin-top: 20px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.q-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.q-lines li span { color: var(--muted); }
.q-lines li small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.q-lines li b { font-weight: 600; white-space: nowrap; }
.q-lines--sm li { font-size: 13px; padding: 9px 0; }
.q-sum__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.q-sum__meta span { display: block; font-size: 10px; color: var(--dim); margin-bottom: 4px; }
.q-sum__meta b { font-size: 14px; font-weight: 600; }
.q-sum__note { margin-top: 18px; color: var(--dim); font-size: 12px; line-height: 1.5; }

.q-layout--full { grid-template-columns: 1fr; max-width: 980px; margin: 0 auto; }
.q-layout--full .q-summary, .q-layout--full + .q-mobilebar { display: none !important; }

/* Barra móvil */
.q-mobilebar { display: none; }

/* Resultado */
.q-result__hero { padding: 28px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(255,31,31,.16), rgba(255,31,31,.02) 60%), var(--bg-3); border: 1px solid rgba(255,31,31,.35); margin-bottom: 28px; }
.q-result__hero .mono { font-size: 11px; color: var(--muted); }
.q-bigprice { display: block; font-family: var(--f-display); font-weight: 800; font-size: clamp(52px, 7vw, 92px); letter-spacing: -.05em; line-height: 1; margin: 10px 0 10px; }
.q-result__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; }
.q-result h3 { font-size: 11px; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.q-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.q-dl dt { color: var(--dim); }
.q-dl dd { margin: 0; font-weight: 500; }
.q-dl small { color: var(--muted); font-weight: 400; }
.q-result .q-lines { margin-top: 0; }
.q-totals { margin-top: 10px; display: grid; }
.q-totals li { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--muted); }
.q-totals li b { color: var(--text); font-weight: 600; }
.q-totals li small { color: var(--dim); font-weight: 400; font-size: 12px; }
.q-totals__total { margin-top: 6px; padding-top: 14px !important; border-top: 2px solid var(--red); }
.q-totals__total span { color: var(--text); font-weight: 600; }
.q-totals__total b { font-family: var(--f-display); font-size: 24px; letter-spacing: -.02em; }
.q-disclaimer { margin-top: 24px; color: var(--dim); font-size: 13px; }
.q-turnstile { margin-top: 18px; min-height: 0; }
.q-formerror { color: #ff6b6b; font-size: 14px; margin-top: 10px; min-height: 1em; }
.q-formerror a { color: var(--text); text-decoration: underline; }
.q-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.q-actions--center { justify-content: center; border-top: 0; }
.q-actions--start { justify-content: flex-start; border-top: 0; }
.q-fallback p { color: var(--muted); }
.q-actions .btn__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.q-actions.is-sending .btn__spinner { display: block; }

/* Enviado */
.q-sent { text-align: center; padding: clamp(20px, 4vw, 50px) 0; }
.q-sent__icon { width: 76px; height: 76px; border-radius: 50%; background: var(--red); display: grid; place-items: center; margin: 0 auto 24px; box-shadow: 0 0 0 12px rgba(255,31,31,.15); animation: pop .6s var(--ease); }
.q-sent__icon svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.q-sent .q-h2 { justify-content: center; }
.q-sent p { color: var(--muted); max-width: 520px; margin: 0 auto; }
.q-ref { margin-top: 18px !important; font-size: 12px; }
.q-ref b { color: var(--text); }

/* Pie reducido */
.footer--slim { padding: 28px 0 32px; }
.footer--slim .footer__legal { padding-top: 0; }

/* Responsive */
@media (max-width: 1080px) {
  .q-layout { grid-template-columns: 1fr; }
  .q-summary { position: static; }
  .q-grid--types { grid-template-columns: repeat(2, 1fr); }
  .q-mobilebar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: rgba(10,10,10,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .q-mobilebar__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 68px; }
  .q-mobilebar span.mono { display: block; font-size: 10px; color: var(--muted); }
  .q-mobilebar strong { font-family: var(--f-display); font-size: 24px; letter-spacing: -.03em; }
  .page-quote .q-page { padding-bottom: 120px; }
}
@media (max-width: 760px) {
  .q-steps { grid-template-columns: repeat(5, auto); overflow-x: auto; gap: 4px; }
  .q-step b { display: none; }
  .q-step.is-current b { display: inline; }
  .q-grid--types, .q-grid--3, .q-grid--2 { grid-template-columns: 1fr; }
  .q-card--type { min-height: 0; }
  .q-row { grid-template-columns: 1fr; gap: 0; }
  .q-toggle { grid-template-columns: 46px 1fr; }
  .q-toggle em { grid-column: 2; }
  .q-result__grid { grid-template-columns: 1fr; }
  .q-actions .btn { flex: 1 1 100%; }
  .q-nav .btn { flex: 1; }
  .q-hint { margin: 10px 0 0; width: 100%; }
  .q-pkg { flex-direction: column; align-items: flex-start; }
  .q-back { display: none; }
  .quote-cta { flex-direction: row; }
}
