/* noticias */
.ntools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.ntools input { flex: 1 1 240px; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.nchips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip small { opacity: .6; margin-left: 4px; }
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ncard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.nmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); }
.ncat { color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.ncard h3 { font-size: 16px; line-height: 1.35; margin: 0; }
.ncard h3 a { color: var(--ink); text-decoration: none; }
.ncard h3 a:hover { color: var(--acc); }
.nsrc { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--mut); }
.nsrc a { color: var(--acc); font-weight: 700; text-decoration: none; white-space: nowrap; }
.nfoot { font-size: 12px; color: var(--mut); margin-top: 12px; }

.nsum { margin: 0; font-size: 14px; color: #475569; }
.ncard h3 a { display: block; }
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 10px 0 12px; }
.article .lead { font-size: 18px; color: #334155; margin: 0 0 18px; }
.article p { font-size: 17px; line-height: 1.7; margin: 0 0 16px; }
.asrc { background: #f8fafc; border-radius: 12px; padding: 14px 16px; margin-top: 22px; font-size: 14px; }
.asrc ul { margin: 6px 0 8px; padding-left: 18px; }
.asrc a { color: var(--acc); }
.asrc small { color: var(--mut); }

/* pestañas de calculadoras */
.ctabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctab { flex: 0 0 auto; scroll-snap-align: start; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 150px; }
.ctab b { display: block; font-size: 15px; }
.ctab small { display: block; color: var(--mut); font-size: 12px; margin-top: 2px; }
.ctab.on { border-color: var(--acc); background: #fff7f1; }
#calc-body { margin-top: 6px; }

/* Versión móvil: barra inferior, zonas fijas, barra de precio y hoja de resumen */
.tabbar, .mobonly, .sheet, .sheet-bg, .hwa { display: none; }

@media (max-width: 820px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
  body.noscroll { overflow: hidden; }
  input, select, textarea { font-size: 16px !important; }
  .wrap { padding: 0 14px; }
  section.view { padding: 16px 0 36px; }
  .head h2 { font-size: 24px; }
  .head p { font-size: 14px; }

  /* cabecera compacta */
  header.top { position: static; }
  nav.main { display: none; }
  .bar { height: 56px; padding: 0; flex-wrap: nowrap; gap: 10px; }
  .logo img { height: 34px; }
  .hwa { display: inline-flex; margin-left: auto; align-items: center; gap: 6px; background: #25d366; color: #fff; font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 999px; text-decoration: none; }

  /* barra de pestañas inferior */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px #0000000f; }
  .tabbar button { position: relative; background: none; border: 0; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: #64748b; min-height: 58px; }
  .tabbar button.on { color: var(--acc); }
  .tb-badge { display: none; position: absolute; top: 4px; left: calc(50% + 6px); background: var(--acc); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; font-size: 11px; place-items: center; padding: 0 4px; }
  .tb-badge.show { display: grid; }

  /* hojas deslizables */
  .mobonly { display: block; }
  .sheet-bg { display: block; position: fixed; inset: 0; background: rgba(8, 12, 20, .55); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 70; }
  .sheet-bg.open { opacity: 1; pointer-events: auto; }
  .sheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; background: #fff; border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .25s ease; max-height: 90vh; overflow-y: auto; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px #0004; }
  .sheet.open { transform: none; }
  .sheet.big { min-height: 50vh; }
  .sheet-grip { width: 44px; height: 5px; background: #cbd5e1; border-radius: 3px; margin: 4px auto 12px; }
  .sheet-x { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #f1f5f9; font-size: 16px; z-index: 2; }
  .mrow { display: block; width: 100%; text-align: left; padding: 16px 4px; font-size: 17px; font-weight: 600; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
  .sheet .sumcard { border: 0; box-shadow: none; padding: 6px 0 0; border-top: 0; }
  .sheet .sumcard h3 { padding-right: 44px; }

  /* barra de precio flotante */
  .sumbar { position: fixed; left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom) + 8px); z-index: 55; display: flex; align-items: center; gap: 12px; background: #0b1220; color: #fff; border: 0; border-radius: 16px; padding: 10px 14px; box-shadow: 0 8px 30px #0006; text-align: left; width: auto; }
  .sb-n { flex: none; background: var(--acc); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; font-weight: 800; }
  .sb-t { flex: 1; line-height: 1.2; min-width: 0; }
  .sb-t b { display: block; font-size: 15px; }
  .sb-t small { color: #9fb0cc; font-size: 12px; }
  .sb-p { text-align: right; line-height: 1.1; }
  .sb-p b { display: block; font-size: 17px; color: var(--acc2); }
  .sb-p small { color: #9fb0cc; font-size: 11px; }
  .sb-go { color: #9fb0cc; font-size: 13px; font-weight: 700; white-space: nowrap; }
  .sumbar.calc .sb-t b { font-size: 18px; color: var(--acc2); }
  body[data-view="configurador"] #v-configurador, body[data-view="impuestos"] #v-impuestos { padding-bottom: 96px; }
  body[data-view="configurador"] .chatbtn, body[data-view="impuestos"] .chatbtn { bottom: calc(64px + env(safe-area-inset-bottom) + 72px); }

  /* portada */
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero .cta .btn { flex: 1 1 100%; text-align: center; padding: 14px; }
  .stats { gap: 18px; margin-top: 26px; }
  .stats b { font-size: 22px; }
  .cards4 { grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px 0; }
  .tool { padding: 14px; }
  .tool .ic { width: 38px; height: 38px; margin-bottom: 8px; }
  .tool h3 { font-size: 16px; }
  .tool p { font-size: 13px; }
  .vgrid { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 2px 14px 8px; }
  .vgrid .vcard { flex: 0 0 190px; scroll-snap-align: start; }

  /* reformas */
  .stepbar { display: none; }
  .vgrid.small { margin-bottom: 8px; }
  .vgrid.small .vcard { flex: 0 0 130px; aspect-ratio: 4/3; }
  .vcard span { font-size: 13px; padding: 18px 8px 6px; }
  .cfg { display: block; }
  .cfg > .sticky { display: none; }
  .zonebar { position: sticky; top: 0; z-index: 30; background: var(--bg); margin: 0 -14px 10px; padding: 8px 14px; box-shadow: 0 6px 12px -10px #000a; }
  .zonebar .step-title { display: none; }
  .searchbox input { padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; }
  .zgrid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .zgrid::-webkit-scrollbar { display: none; }
  .ztile { flex: 0 0 88px; aspect-ratio: 1/1; border-radius: 12px; }
  .ztile span { font-size: 11.5px; padding: 16px 6px 5px; line-height: 1.15; }
  .cnt { top: 5px; right: 5px; min-width: 22px; height: 22px; font-size: 12px; }
  .listhead { margin: 14px 0 8px; }
  .zsec h4 { font-size: 16px; }
  .pcard { display: grid; grid-template-columns: 30px 1fr; gap: 6px 12px; padding: 14px 12px; align-items: start; }
  .pcard .chk2 { width: 30px; height: 30px; border-radius: 9px; }
  .pc-body b { font-size: 15px; line-height: 1.3; }
  .pc-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
  .pextra { margin: 6px 0 0 8px; padding-left: 12px; }
  .opt.sm { padding: 13px 12px; }
  .tool2 .row2 { grid-template-columns: 1fr; }

  /* ficha reducida, calculadora, servicios, presupuesto */
  .ficha-box { padding: 16px; }
  .ficha-box .cta .btn { flex: 1 1 100%; text-align: center; }
  .opts { grid-template-columns: 1fr; }
  .opt { padding: 16px; }
  .exgrid { grid-template-columns: 1fr; }
  .card.pad { padding: 14px; overflow-x: auto; }
  .tbl td { padding: 9px 3px; font-size: 14px; }
  .total { padding: 16px; }
  .total b { font-size: 32px; }
  .f .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bands { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .svc summary { flex-direction: column; align-items: flex-start; }
  .tools input { min-width: 0; }
  .bud .cta .btn { flex: 1 1 100%; text-align: center; }
  footer { padding-bottom: 20px; }
  .flogo { height: 64px; }
}
