/* ══════════════════════════════════════════════════════════════
   NexoQR · Perfil público del negocio (/u/slug)
   Diseño tipo app, mobile first, con el color de marca del negocio.
   ══════════════════════════════════════════════════════════════ */

body.profile {
  background:
    radial-gradient(700px 320px at 50% -8%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: 96px;
}

.preview-flag {
  position: sticky; top: 0; z-index: 60;
  text-align: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 7px 12px; text-transform: uppercase;
  background: var(--warn-soft); color: #fcd34d; border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}

.pwrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 16px; }

/* ── Cabecera ───────────────────────────────────────────────── */
.hero { margin: 0 -16px 22px; }

.cover {
  height: 132px;
  background:
    linear-gradient(135deg, var(--brand), var(--brand-2, #111827));
  background-size: cover; background-position: center;
  position: relative;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--bg) 92%, transparent));
}

.hero-main { display: flex; gap: 14px; padding: 0 20px; margin-top: -44px; position: relative; align-items: flex-end; }

.avatar {
  width: 92px; height: 92px; flex: none; border-radius: 24px;
  background: var(--surface-2);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-size: 2.1rem; font-weight: 800; color: #04121f; }

.hero-txt { min-width: 0; padding-bottom: 6px; }
.hero-txt h1 { font-size: 1.55rem; margin: 0 0 4px; }
.hero-txt .tagline { margin: 6px 0 0; font-size: 0.92rem; color: var(--text-dim); }

.open-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 8px 0 0; padding: 3px 10px; border-radius: var(--r-full);
  font-size: 0.76rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-dim);
}
.open-badge.is-open { background: var(--ok-soft); color: #86efac; }
.open-badge.is-closed { background: var(--danger-soft); color: #fca5a5; }

.hero-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 8px; padding: 16px 20px 0;
}
.ha {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 11px 8px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 0.76rem; font-weight: 600;
  cursor: pointer; text-align: center;
}
.ha:hover { border-color: var(--brand); background: var(--surface-2); text-decoration: none; }
.ha:active { transform: scale(0.97); }

/* ── Bloques ────────────────────────────────────────────────── */
.blocks { display: flex; flex-direction: column; gap: 22px; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block h3 { font-size: 1.05rem; margin: 0; }
.block-sm { gap: 0; }
.about {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; font-size: 0.94rem; color: var(--text-dim); line-height: 1.6;
}
.muted { color: var(--text-mute); }

/* Enlace grande */
.plink {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.plink:hover { text-decoration: none; border-color: var(--brand); background: var(--surface-2); transform: translateY(-1px); }
.plink-ico {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 26%, transparent), color-mix(in srgb, var(--brand-2, #111827) 30%, transparent));
  color: var(--brand);
}
.plink-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.plink-txt strong { font-size: 0.97rem; font-weight: 650; }
.plink-txt small { color: var(--text-mute); font-size: 0.82rem; }
.plink-arrow { font-size: 1.5rem; color: var(--text-mute); line-height: 1; }

/* Redes sociales */
.social {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.94rem;
}
.social:hover { text-decoration: none; border-color: var(--sc, var(--brand)); }
.social svg { color: var(--sc, var(--brand)); flex: none; }

/* Multimedia */
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; border: 1px solid var(--line); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media { width: 100%; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
video.media { max-height: 62vh; }
audio.media { padding: 6px; }

.doc {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.doc-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-3); color: var(--brand); }
.doc .grow { display: flex; flex-direction: column; min-width: 0; }
.doc small { color: var(--text-mute); font-size: 0.8rem; }
.doc-preview { margin-top: 8px; }
.doc-preview summary { cursor: pointer; font-size: 0.86rem; color: var(--brand); padding: 6px 0; }
.doc-preview iframe { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--r); margin-top: 8px; background: #fff; }

.imgwrap { padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); cursor: zoom-in; display: block; width: 100%; }
.imgwrap img { width: 100%; height: auto; display: block; }

.prose { font-size: 0.95rem; color: var(--text-dim); line-height: 1.7; }

/* Horarios */
.hours { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.hours th, .hours td { padding: 9px 14px; font-size: 0.88rem; }
.hours th { width: 42%; text-transform: capitalize; color: var(--text-dim); font-weight: 600; background: var(--surface-2); }
.hours tr[data-day].today th, .hours tr[data-day].today td { background: var(--brand-soft); }
.closed { color: #fca5a5; }

/* ── Carta y catálogo ──────────────────────────────────────── */
.mnav-wrap { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.mnav {
  flex: none; padding: 6px 13px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 0.84rem; color: var(--text-dim); text-decoration: none; white-space: nowrap;
}
.mnav:hover { text-decoration: none; border-color: var(--brand); color: var(--text); }
.mcat { margin-bottom: 22px; scroll-margin-top: 16px; }
.mcat h3 { font-size: 1.08rem; margin-bottom: 2px; }
.mitems { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }

.mitem {
  display: flex; align-items: stretch; gap: 12px;
  padding: 12px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.mitem.is-off { opacity: 0.55; }
.mitem-img { width: 74px; height: 74px; flex: none; border-radius: 10px; object-fit: cover; }
.mitem-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mitem-body header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mitem-body h4 { margin: 0; font-size: 0.96rem; font-weight: 650; }
.mitem-body p { margin: 0; font-size: 0.85rem; color: var(--text-mute); line-height: 1.5; }
.price { font-weight: 750; color: var(--brand); white-space: nowrap; font-size: 0.95rem; }
.price s { color: var(--text-mute); font-weight: 500; font-size: 0.8rem; margin-right: 5px; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-mute);
}
.tag-hot { background: var(--brand-soft); color: var(--brand); }
.tag-off { background: var(--danger-soft); color: #fca5a5; }

.add-btn {
  align-self: center; flex: none;
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--brand-2, #111827)));
  color: #04121f; border: 0;
}
.add-btn:hover { filter: brightness(1.1); }
.add-btn:active { transform: scale(0.94); }

/* ── Formulario de contacto ────────────────────────────────── */
.cform { display: flex; flex-direction: column; gap: 10px; }
.cform textarea { min-height: 88px; }
.form-msg { margin: 0; font-size: 0.85rem; min-height: 1.1em; }
.form-msg.ok { color: #86efac; }
.form-msg.error { color: #fca5a5; }

/* ── Reseñas ───────────────────────────────────────────────── */
.review { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stars { color: var(--text-mute); letter-spacing: 2px; font-size: 1.05rem; }
.stars .on { color: #fbbf24; }
.review blockquote { margin: 8px 0 6px; font-size: 0.95rem; color: var(--text-dim); font-style: italic; }
.review cite { font-size: 0.8rem; color: var(--text-mute); font-style: normal; }

/* ── Tarjeta de avisos ─────────────────────────────────────── */
.notify-card {
  display: flex; align-items: center; gap: 13px;
  margin: 30px 0 20px; padding: 15px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent);
}
.notify-ico { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.notify-card .grow { display: flex; flex-direction: column; }
.notify-card strong { font-size: 0.95rem; }
.notify-card small { color: var(--text-dim); font-size: 0.82rem; line-height: 1.45; }
.notify-card.is-on { border-color: rgba(34, 197, 94, 0.4); background: linear-gradient(135deg, var(--ok-soft), var(--surface)); }
.notify-card.is-on .notify-ico { background: var(--ok-soft); color: #86efac; }

.pfoot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; gap: 4px; }
.pfoot a { color: var(--text-mute); text-decoration: none; }
.pfoot a:hover { color: var(--brand); }

/* ── Barra del carrito ─────────────────────────────────────── */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.cart-open {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: var(--r); border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--brand-2, #111827)));
  color: #04121f; font: inherit; font-weight: 750;
}
.cart-count { background: rgba(4, 18, 31, 0.22); border-radius: var(--r-full); padding: 1px 9px; font-size: 0.85rem; }
.cart-total { font-weight: 750; color: var(--brand); }

.cart-modal .modal-body { max-height: 62vh; }
.citem { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.citem:last-child { border-bottom: 0; }
.citem .cname { flex: 1; min-width: 0; font-size: 0.9rem; }
.citem .cprice { font-size: 0.85rem; color: var(--text-mute); white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; line-height: 1; }
.qty span { min-width: 20px; text-align: center; font-size: 0.9rem; font-weight: 650; }

/* ── Lightbox ──────────────────────────────────────────────── */
.lightbox { width: min(96vw, 900px); background: transparent; border: 0; padding: 0; }
.lightbox::backdrop { background: rgba(2, 6, 23, 0.9); }
.lightbox img { width: 100%; height: auto; max-height: 86vh; object-fit: contain; border-radius: var(--r); }
.lightbox p { text-align: center; color: #cbd5f5; margin-top: 10px; font-size: 0.85rem; }
.lb-close { position: absolute; top: -46px; right: 0; }

@media (min-width: 700px) {
  .hero { margin: 0 0 26px; border-radius: 0 0 var(--r-xl) var(--r-xl); overflow: hidden; }
  .cover { height: 176px; }
  .avatar { width: 108px; height: 108px; }
  .hero-txt h1 { font-size: 1.85rem; }
}

@media print {
  .cartbar, .notify-card, .hero-actions, .preview-flag { display: none !important; }
}
