/* CodiQR3D — generador de QR para imprimir en 3D */

:root {
  --bg: #F6F5F1;
  --card: #FFFFFF;
  --ink: #16181D;
  --ink-2: #474C57;
  --muted: #7B808A;
  --line: #E5E2DA;
  --line-2: #D6D2C8;
  --accent: #EE5A24;
  --accent-d: #D44A17;
  --accent-soft: #FDEEE7;
  --ok: #1E7A45;
  --ok-bg: #E8F5EC;
  --warn: #8A5A00;
  --warn-bg: #FFF4DB;
  --bad: #B42318;
  --bad-bg: #FDECEA;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px rgba(22, 24, 29, .05);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 500; }
.small { font-size: 13px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header { background: rgba(246, 245, 241, .9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand b { color: var(--accent); }
.brand-mark { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding-top: 28px; padding-bottom: 20px; }
.hero h1 { font-size: clamp(27px, 4.2vw, 44px); font-weight: 800; max-width: 22ch; }
.hero .sub { margin-top: 10px; color: var(--ink-2); font-size: clamp(15px, 1.6vw, 18px); max-width: 68ch; }

/* ---------- tool layout ---------- */
.tool {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  grid-template-areas: "content preview" "design preview" "print preview";
  gap: 16px;
  align-items: start;
}
.c-content { grid-area: content; }
.c-preview { grid-area: preview; }
.c-design { grid-area: design; }
.c-print { grid-area: print; }
@media (min-height: 760px) and (min-width: 921px) {
  .c-preview { position: sticky; top: 74px; }
}
.nojs { grid-column: 1 / -1; background: var(--warn-bg); color: var(--warn); padding: 14px 16px; border-radius: var(--r-sm); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; flex: none; }

/* ---------- inputs ---------- */
.input {
  width: 100%;
  border: 1.5px solid var(--line-2);
  background: #fff;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 15px;
  min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 24, 29, .08); }
.input-big { font-size: 16px; min-height: 52px; padding: 12px 14px; font-weight: 600; }
.input-sm { width: auto; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.input.shake { animation: shake .4s; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23474C57' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; align-self: end; min-height: 44px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.grid2:first-child { margin-top: 0; }
.hint { margin-top: 10px; font-size: 13px; color: var(--muted); }
.hint.is-strong { color: var(--ink-2); background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }

/* tabs */
.tabs { display: inline-flex; background: #F0EEE8; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* groups & option cards */
.group { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.group:last-child { margin-bottom: 0; }
.group legend { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.grid2 .group { margin-bottom: 0; }
.opts { display: grid; gap: 8px; }
.opts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt-in { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 9px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 12.5px; font-weight: 700; text-align: center; color: var(--ink-2); transition: border-color .15s, background .15s; line-height: 1.2; }
.opt-in svg { width: 34px; height: 30px; fill: var(--ink); }
#formats .opt-in svg { width: 44px; height: 32px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#formats .opt-in svg .fill { fill: var(--accent); stroke: none; }
.opt:hover .opt-in { border-color: var(--line-2); }
.opt input:checked + .opt-in { border-color: var(--ink); background: #FAFAF7; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt input:focus-visible + .opt-in { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .14); padding: 0; position: relative; flex: none; }
.sw.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.sw-custom { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; position: relative; border: 1px dashed var(--line-2); background: conic-gradient(#f44, #fd4, #4d6, #4bf, #84f, #f4b, #f44); flex: none; }
.sw-custom.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.sw-custom input { position: absolute; inset: -8px; width: 46px; height: 46px; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* centre */
.center-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.center-none, .upload span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 700; background: #fff; color: var(--ink-2); }
.center-none.is-on, .upload.is-on span { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.upload { position: relative; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.emo { height: 38px; border: 1.5px solid transparent; background: #F4F2EC; border-radius: 9px; font-size: 20px; line-height: 1; padding: 0; }
.emo:hover { border-color: var(--line-2); }
.emo.is-on { border-color: var(--ink); background: #fff; }
.emojis-sm { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
.emojis-sm .emo { height: 34px; font-size: 18px; }
.emo-none { font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- preview ---------- */
.pv2d { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.qr-box { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; aspect-ratio: 1; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.demo-badge { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.demo-badge[hidden] { display: none; }
.pv2d-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pv-title { font-weight: 800; font-size: 14.5px; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.mini { font-size: 12.5px; color: var(--warn); background: var(--warn-bg); padding: 6px 9px; border-radius: 8px; }

.pv3d { padding-top: 14px; }
.pv3d-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pv3d-head .muted { font-weight: 600; font-size: 13px; }
.viewer {
  position: relative;
  height: clamp(250px, 36vh, 340px);
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #FFFFFF 0%, #EEECE6 60%, #E2DFD7 100%);
  border: 1px solid var(--line);
  touch-action: none;
  cursor: grab;
}
.viewer:active { cursor: grabbing; }
.viewer canvas { display: block; width: 100% !important; height: 100% !important; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; font-size: 14px; font-weight: 600; color: var(--muted); pointer-events: none; }
.viewer[data-state="ready"] .viewer-msg { display: none; }
.viewer[data-state="busy"] .viewer-msg { display: none; }
.viewer[data-state="nowebgl"], .viewer[data-state="error"] { cursor: default; touch-action: auto; }
.viewer::after { content: ""; position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(22, 24, 29, .15); border-top-color: var(--ink); opacity: 0; transition: opacity .2s; animation: spin .8s linear infinite; }
.viewer[data-state="busy"]::after, .viewer[data-state="loading"]::after { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.warns { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.warns li { font-size: 13px; line-height: 1.4; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.warns .ok { background: var(--ok-bg); color: var(--ok); }
.warns .warn { background: var(--warn-bg); color: var(--warn); }
.warns .bad { background: var(--bad-bg); color: var(--bad); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border-radius: 11px; border: 1.5px solid transparent; font-weight: 800; font-size: 14.5px; text-decoration: none; transition: background .15s, transform .1s, border-color .15s; text-align: center; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn small { font-weight: 600; opacity: .8; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2A2D35; }
.btn-line { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; min-height: 52px; font-size: 15.5px; box-shadow: 0 6px 16px rgba(238, 90, 36, .25); }
.btn-accent:hover { background: var(--accent-d); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.alt-dl { text-align: center; margin-top: 8px; }
.linkish { background: none; border: 0; padding: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }
.only-mobile { display: none; margin-top: 18px; }

.privacy { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }

/* ---------- publicidad (Google AdSense) ---------- */
.ad-slot { position: relative; text-align: center; margin-left: auto; margin-right: auto; }
.ad-slot::before { content: "Publicidad"; display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot ins.adsbygoogle { display: block; min-height: 90px; }
.ad-leaderboard { max-width: 970px; margin-top: 28px; }
.ad-incontent { max-width: 760px; margin-top: 8px; margin-bottom: 8px; }
.ad-incontent ins.adsbygoogle { min-height: 250px; }
/* sin bloque o sin anuncio que mostrar: el hueco desaparece */
.ad-slot:not(:has(ins.adsbygoogle)), .ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }

/* aviso de cookies */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, .18); padding: 14px 16px; display: flex; gap: 14px; align-items: center; }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { font-size: 14px; color: var(--ink-2); flex: 1; }
.cookie-bar a { color: var(--ink); font-weight: 700; }
.cookie-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 560px) {
  .cookie-bar { flex-direction: column; align-items: stretch; bottom: 12px; }
  .cookie-actions .btn { flex: 1; }
}

/* ---------- content sections ---------- */
.section { padding-top: 56px; padding-bottom: 8px; }
.section > h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.lead { color: var(--ink-2); margin-top: 8px; max-width: 64ch; }

.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: none; }
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-d); font-weight: 800; margin-bottom: 12px; }
.step-card h3 { font-size: 18px; margin-bottom: 6px; }
.step-card p { color: var(--ink-2); font-size: 15px; }

.ideas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.idea { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.idea-ico { font-size: 26px; display: block; margin-bottom: 8px; }
.idea h3 { font-size: 16px; margin-bottom: 5px; }
.idea p { font-size: 14px; color: var(--ink-2); }

.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; margin-top: 14px; }
.guide h3 { font-size: 17px; margin: 18px 0 6px; }
.guide p { color: var(--ink-2); }

.faq { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 860px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; padding: 15px 28px 15px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 600; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 16px; color: var(--ink-2); }

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 26px 0 40px; background: #EFEDE7; }
.footer-in { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-in nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-in nav a { color: var(--ink-2); }

/* legal pages */
.legal { max-width: 760px; padding-top: 36px; }
.legal h1 { font-size: 32px; margin-bottom: 16px; }
.legal h2 { font-size: 20px; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 20px; margin: 10px 0; }
.legal p + p { margin-top: 10px; }
.todo { background: var(--warn-bg); color: var(--warn); padding: 1px 6px; border-radius: 5px; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .tool { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content" "preview" "design" "print"; }
  .only-mobile { display: flex; }
  .steps { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding-top: 18px; padding-bottom: 14px; }
  .nav { display: none; }
  .card { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .opts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opts-4 .opt-in { flex-direction: row; justify-content: flex-start; padding: 8px 10px; }
  .opts-4 .opt-in svg { width: 24px; height: 22px; }
  .pv2d { grid-template-columns: 116px minmax(0, 1fr); gap: 12px; }
  .row { flex-wrap: wrap; }
  .pv2d-side .btn small { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .ideas { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .input.shake { animation: none; }
}
