/* Diseño de páginas (tableros 4 y 5 del lienzo). Solo tokens: nada de colores ni medidas sueltas
   salvo las del propio diseño (alturas de fotos, tamaños de título). */
.pg { min-height: 100vh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; background: var(--surface); }
.pg-main { flex: 1; }
h1, h2, h3 { font-family: var(--font-display); }
.muted { color: var(--ink-muted); }
.caption { font: 500 13px/18px var(--font-sans); }
.label { font: 600 14px/20px var(--font-sans); }
.nums { font-variant-numeric: tabular-nums; }

/* Encabezado y pie */
.pg-head { border-bottom: 1px solid var(--line); }
.pg-head-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 10px var(--space-4); }
.pg-head-tight .pg-head-in { padding: 6px var(--space-2); }
.head-tools { display: flex; align-items: center; gap: 2px; }
.theme-btn .i-moon, .theme-btn .i-sun { display: inline-flex; }
.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: inline-flex; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }
.pg-head .cq-btn-ghost { padding: 0 10px; }
.pg-head .icon-btn { color: var(--ink); }
.pg-foot { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface-sunken); }
.pg-foot-in, .foot-col, .foot-brand { display: flex; flex-direction: column; gap: var(--space-3); }
.pg-foot-in { padding: var(--space-6) var(--space-4) var(--space-8); }
.pg-foot-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.pg-foot a { color: var(--ink); }
.skip { position: absolute; left: -999px; top: 0; z-index: 10; padding: var(--space-2) var(--space-4); background: var(--surface-raised); }
.skip:focus { left: var(--space-2); }

/* Secciones */
.sec { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-2) var(--space-4) var(--space-6); }
.sec-title { margin: 0; font: 700 22px/28px var(--font-display); letter-spacing: -0.01em; }
.sec-title-3 { margin: 0; font: 700 18px/24px var(--font-display); }
.box { margin: 0 var(--space-4) var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.box-strong { border-color: var(--line-strong); padding: var(--space-4); gap: var(--space-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }

/* Home */
.hero { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-8) var(--space-4) var(--space-6); }
.hero h1 { margin: 0; font: 800 36px/40px var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.hero p { margin: 0; color: var(--ink-muted); }
.hero form { display: flex; flex-direction: column; gap: var(--space-2); }
.near-btn { justify-content: space-between; border-radius: var(--radius-pill); min-height: 48px; padding: 0 var(--space-4); }
.near-btn > span { display: inline-flex; align-items: center; gap: var(--space-2); }
.near-btn .pin { color: var(--rocoto); }
.popular { display: flex; flex-direction: column; gap: var(--space-1); }
.needs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.need { min-height: 104px; padding: var(--space-3); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2); }
.need-ico { display: inline-flex; }
.need .cq-icon { width: 22px; height: 22px; color: var(--rocoto); }
.need-text { display: flex; flex-direction: column; gap: 2px; }
.need-name { font: 700 14px/20px var(--font-sans); }
.need-hint { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); }
.need-0 { background: var(--rocoto-soft); }
.need-1 { background: var(--aji-soft); }
.need-2 { background: var(--huacatay-soft); }
.need-3 { background: var(--cielo-soft); }
.need-4, .need-5 { background: var(--surface-sunken); }
.center { align-self: center; }
.urgent-head { display: flex; align-items: center; gap: 10px; }
.urgent-head .cq-icon { color: var(--rocoto); }
.tabs { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); border-bottom: 1px solid var(--line); }
.tablist { display: flex; gap: var(--space-1); }
.tab { min-height: var(--tap-min); padding: 0 var(--space-3); margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--ink-muted); font: 400 16px/20px var(--font-sans); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-selected="true"] { border-bottom-color: var(--rocoto); color: var(--ink); font-weight: 700; }
.tab .cq-dot { color: var(--huacatay); }
.tab .cq-icon { width: var(--icon-sm); height: var(--icon-sm); }
.cards { display: flex; flex-direction: column; gap: var(--space-3); }
.cta { margin: var(--space-2) var(--space-4) var(--space-6); padding: 20px; border-radius: var(--radius-lg); background: var(--rocoto-soft); display: flex; flex-direction: column; gap: var(--space-3); }
.cta p { margin: 0; }
.cta-head { display: flex; align-items: center; gap: 10px; }
.cta-head .cq-icon { color: var(--rocoto); }
.cta .cq-btn { align-self: flex-start; }

/* Búsqueda */
.search-top { padding-top: var(--space-4); }
.search-top form { display: flex; flex-direction: column; gap: var(--space-2); }
.search-top .caption { display: inline-flex; align-items: center; gap: var(--space-1); }

/* Ficha */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 132px 92px; gap: var(--space-1); padding: var(--space-1); }
.photo { border-radius: var(--radius-md); background: var(--surface-sunken); object-fit: cover; width: 100%; height: 100%; }
.photo-main { grid-column: 1 / -1; background: var(--rocoto-soft); color: var(--rocoto); display: grid; place-items: center; }
.photo-main .cq-icon { width: 48px; height: 48px; stroke-width: 1.5; }
.photo-more { border-radius: var(--radius-md); background: var(--ink); color: var(--surface); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.biz-head { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-4) 20px; }
.biz-head h1 { margin: 0; font: 750 32px/36px var(--font-display); letter-spacing: -0.015em; }
.biz-head .cq-meta { font-size: 15px; }
.biz-head p { margin: var(--space-1) 0 0; }
.biz-head .cq-rating { text-decoration: none; align-self: flex-start; }
.biz-head .cq-rating-count { text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-4) 20px; }
.info-title { margin: 0; padding: 14px var(--space-4) 6px; }
.info-list { padding: 0 var(--space-4); }
.info-list li { justify-content: flex-start; }
.info-list li > .cq-icon { color: var(--ink-muted); }
.info-list a { color: var(--ink); text-decoration: none; }
.info-list a.ig { color: var(--link); }
.info-text { display: flex; flex-direction: column; padding: 10px 0; }
.hours summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 56px; padding: 0 var(--space-4); cursor: pointer; list-style: none; }
.hours summary::-webkit-details-marker { display: none; }
.hours summary > span { display: flex; flex-direction: column; }
.hours[open] summary .cq-icon { transform: rotate(180deg); }
.hours-now { font: 700 13px/18px var(--font-sans); }
.hours-now.open { color: var(--huacatay); }
.hours-now.soon { color: var(--aji-ink); }
.hours-now.closed, .hours-now.unknown { color: var(--ink-muted); }
.hours ul { padding: 0 var(--space-4) 6px; }
.hours li { min-height: 40px; }
.hours li.today { font-weight: 700; }
.hours .closed-day { color: var(--ink-muted); }
.hours p { margin: 0; padding: 0 var(--space-4) 14px; color: var(--ink-muted); }
.pay { height: 32px; padding: 0 var(--space-3); color: var(--ink); }
.amenities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px var(--space-3); }
.amenity { display: inline-flex; align-items: center; gap: var(--space-2); }
.amenity .cq-icon { color: var(--huacatay); }
.menu { border-top: 1px solid var(--line); }
.menu-item { display: flex; flex-direction: column; padding: var(--space-2) 0; }
.strong { font-weight: 600; }
.map { position: relative; height: 180px; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-sunken); border: 1px solid var(--line); }
.map svg.roads { display: block; width: 100%; height: 100%; }
.map svg.roads path { fill: none; stroke: var(--line); stroke-width: 10; }
.map .pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); display: grid; }
.map .pin svg { width: 40px; height: 40px; fill: var(--rocoto); stroke: var(--on-rocoto); stroke-width: 1.5; }
.stats { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.stats-big { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.stats-big span:first-child { font: 800 48px/48px var(--font-display); font-variant-numeric: tabular-nums; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 12px minmax(0, 1fr) 28px; gap: var(--space-2); align-items: center; }
.bar meter { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--surface-sunken); }
.bar meter::-webkit-meter-bar { background: var(--surface-sunken); border: 0; border-radius: 4px; height: 8px; }
.bar meter::-webkit-meter-optimum-value { background: var(--star); border-radius: 4px; }
.bar meter::-moz-meter-bar { background: var(--star); border-radius: 4px; }
.bar .n { text-align: right; color: var(--ink-muted); }
.reply { padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); display: flex; flex-direction: column; gap: var(--space-1); }
.reply p { margin: 0; }
.mini { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: var(--space-1); }
.mini .open, .mini .soon { color: var(--huacatay); font-weight: 700; }
.mini .closed { color: var(--ink-muted); font-weight: 700; }
.owner { margin: 0 var(--space-4) var(--space-6); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunken); display: flex; flex-direction: column; gap: var(--space-2); }
.owner p { margin: 0; color: var(--ink-muted); }
.owner-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.owner-links a.muted { color: var(--ink-muted); }
[hidden] { display: none !important; }

.ficha-body { display: flex; flex-direction: column; }
.ficha-main, .ficha-side { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; }
.o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; } .o9 { order: 9; } .o10 { order: 10; }
.reviews { display: flex; flex-direction: column; gap: var(--space-3); }

/* Páginas simples (404, pronto, rubros) */
.simple { padding: var(--space-8) var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.simple h1 { margin: 0; font: 750 28px/32px var(--font-display); }
.cat-group { display: flex; flex-direction: column; gap: var(--space-2); }
.cat-group h2 { display: flex; align-items: center; gap: var(--space-2); }

@media (min-width: 720px) and (max-width: 1023.98px) {
  .pg { border-inline: 1px solid var(--line); }
}
@media (max-width: 1023.98px) {
  .desk-only { display: none !important; }
}

/* Escritorio (≥ 1024 px): lienzo "Escritorio B · Portada de barrio" y "Ficha · escritorio". */
@media (min-width: 1024px) {
  .mob-only { display: none !important; }
  .pg { max-width: none; overflow-x: clip; }
  .pg-head-in, .pg-head-tight .pg-head-in { max-width: 1240px; margin: 0 auto; padding: 12px 32px; gap: var(--space-6); justify-content: flex-start; }
  .head-search { flex: 1 1 320px; max-width: 480px; }
  .head-nav { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }
  .head-nav .cq-btn { gap: var(--space-2); }
  .head-tools .head-login { margin-left: var(--space-2); }
  .pg-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px 56px; box-sizing: border-box; }
  .pg-foot-in { max-width: 1240px; margin: 0 auto; padding: 40px 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; box-sizing: border-box; }
  .pg-foot-links { flex-direction: column; gap: var(--space-2); }

  /* Home */
  .home-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "hero hero" "needs needs" "near near" "urgent cta"; column-gap: var(--space-4); }
  .home-main > * { margin: 0; }
  .a-hero { grid-area: hero; }
  .a-needs { grid-area: needs; }
  .a-near { grid-area: near; }
  .a-urgent { grid-area: urgent; }
  .a-cta { grid-area: cta; }
  .hero { align-items: center; text-align: center; gap: 20px; padding: 72px 0 56px; margin-bottom: 48px;
    border-image: conic-gradient(var(--rocoto-soft) 0 0) fill 0 / / 0 100vmax; }
  .hero > * { width: 100%; max-width: 860px; }
  .hero h1 { font-size: 60px; line-height: 64px; }
  .hero p { font-size: 20px; line-height: 28px; }
  .hero form { flex-direction: row; align-items: center; padding: var(--space-2); box-sizing: border-box; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-float); }
  .hero form .cq-search { flex: 1 1 auto; min-width: 0; }
  .hero form .cq-input { border-color: transparent; background: transparent; font-size: 18px; }
  .hero form .near-btn { flex: none; width: auto; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
  .hero form .cq-btn-primary { flex: none; width: auto; border-radius: var(--radius-pill); padding: 0 32px; }
  .popular { align-items: center; }
  .popular .cq-chips { justify-content: center; }
  .a-needs, .a-near { padding: 0 0 40px; gap: var(--space-4); }
  .needs { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); }
  .need { min-height: 140px; padding: var(--space-4); border-radius: var(--radius-lg); border: 1px solid var(--line); gap: var(--space-3); }
  .need-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
  .need .cq-icon { width: 26px; height: 26px; }
  .need-1 .cq-icon { color: var(--aji-ink); }
  .need-2 .cq-icon { color: var(--huacatay); }
  .need-3 .cq-icon { color: var(--cielo); }
  .need-4 .cq-icon, .need-5 .cq-icon { color: var(--ink); }
  .need-name { font: 700 18px/22px var(--font-display); }
  .need-hint { font-size: 13px; line-height: 18px; }
  .a-needs > .center { align-self: flex-start; padding-left: 0; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-4); }
  .cards > .cq-empty { grid-column: 1 / -1; }
  .a-near > .cq-btn-block { width: auto; align-self: flex-start; }
  .a-urgent { padding: var(--space-6); }
  .a-cta { padding: var(--space-6); background: var(--ink); color: var(--surface); }
  .a-cta .sec-title { color: var(--surface); }
  .a-cta .cta-head .cq-icon { color: var(--aji); }

  /* Ficha */
  .ficha .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 170px 170px; gap: var(--space-2); padding: 0; margin-top: var(--space-4); border-radius: var(--radius-lg); overflow: hidden; }
  .ficha .photos > * { border-radius: 0; }
  .ficha .photo-main { grid-column: 1 / 3; grid-row: 1 / 3; }
  .ficha .photo-main .cq-icon { width: 56px; height: 56px; }
  .ficha-body { flex-direction: row; align-items: flex-start; gap: 40px; padding-top: 32px; }
  .ficha-main { display: flex; flex-direction: column; gap: 40px; flex: 1 1 0; min-width: 0; }
  .ficha-side { display: flex; flex-direction: column; gap: var(--space-4); flex: none; width: 360px; }
  .ficha-main > *, .ficha-side > * { margin: 0; padding-inline: 0; }
  .ficha .biz-head { padding: 0; gap: 10px; }
  .ficha .biz-head h1 { font-size: 48px; line-height: 52px; }
  .ficha .biz-head .cq-meta { font-size: 16px; }
  .ficha .biz-head p { font-size: 18px; line-height: 28px; max-width: 64ch; }
  .ficha-main > .sec { padding: 0; gap: var(--space-4); }
  .amenities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
  .reviews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
  .similar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
  .ficha .actions { padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); gap: 10px; }
  .ficha .actions > .grid-2:first-child { grid-template-columns: minmax(0, 1fr); }
  .ficha-side > .box { padding: var(--space-2) 0; }
  .ficha-side > .sec { padding: 0; gap: var(--space-2); }
  .ficha-side .map { height: 200px; }
  .ficha-side .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ficha-side > .owner { padding: var(--space-4) 20px; }
}
