:root {
  --bg: #0b0b0f;
  --card: rgba(18, 18, 24, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --btn: rgba(255, 255, 255, 0.08);
  --btn-hover: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --max: 680px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(120, 70, 255, 0.25), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(255, 90, 160, 0.18), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(40, 120, 255, 0.15), transparent 40%),
    linear-gradient(180deg, #101018 0%, #07070b 100%);
  z-index: 0;
}

.nav-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px 120px;
}

.nav-card {
  width: 100%;
  max-width: var(--max);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 18px 18px 28px;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.profile {
  text-align: center;
  padding: 8px 12px 22px;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.profile h1 {
  margin: 0;
  font-size: clamp(20px, 3.5vw, 26px);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0;
}

.page-desc {
  margin: 14px auto 0;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  white-space: pre-line;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-item {
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--btn);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.link-item:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.link-item.is-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.25);
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-empty {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
}

.label {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dots {
  opacity: 0.55;
  font-size: 18px;
  text-align: center;
}

.wa-footer {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.wa-footer img {
  width: 34px;
  height: 34px;
}

.qr-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  border-radius: 16px;
  padding: 12px 12px 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.qr-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.qr-float img {
  width: 120px;
  height: 120px;
  display: block;
}

@media (max-width: 768px) {
  .nav-shell {
    padding: 12px 12px 90px;
  }

  .nav-card {
    border-radius: 24px;
    padding: 14px 14px 24px;
  }

  .avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
  }

  .profile {
    padding: 6px 8px 16px;
  }

  .profile h1 {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
  }

  .links {
    gap: 10px;
  }

  .link-item {
    grid-template-columns: 48px 1fr 20px;
    gap: 10px;
    min-height: 60px;
    padding: 8px 12px;
  }

  .thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .label {
    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.78);
    -webkit-line-clamp: 4;
  }

  .dots {
    font-size: 14px;
  }

  .qr-float {
    right: 12px;
    bottom: 12px;
    padding: 8px;
  }

  .qr-label {
    display: none;
  }

  .qr-float img {
    width: 88px;
    height: 88px;
  }
}

@media (min-width: 900px) {
  .nav-shell {
    padding-top: 48px;
  }
}

/* Admin iframe preview: hide QR overlay and tighten spacing */
body.preview-mode .qr-float {
  display: none !important;
}

body.preview-mode .nav-shell {
  min-height: auto;
  padding-bottom: 28px;
}

body.preview-mode .nav-card {
  box-shadow: none;
}

.link-group-title {
  margin: 18px 0 8px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.links .link-group-title:first-child {
  margin-top: 4px;
}
