/* =========================================================
   Public profile — creative layout
   ========================================================= */
.public-body {
  --profile-bg: #e8edf5;
  --name-color: #0b1220;
  --pf-ink: #0c1220;
  --pf-muted: #64748b;
  --pf-line: rgba(15, 23, 42, 0.1);
  --pf-accent: #0f766e;
  --pf-accent-2: #1d4ed8;
  --pf-card: rgba(255, 255, 255, 0.92);
  --pf-sheet: rgba(255, 255, 255, 0.78);
  --pf-shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
  --pf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  min-height: 100vh;
  background: var(--profile-bg);
  color: var(--pf-ink);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  font-family: "Cairo", "DM Sans", sans-serif;
}

html[dir="ltr"] .public-body {
  font-family: "DM Sans", "Cairo", sans-serif;
}

.public-body--dark {
  --pf-ink: #f1f5f9;
  --pf-muted: rgba(241, 245, 249, 0.72);
  --pf-line: rgba(241, 245, 249, 0.14);
  --pf-accent: #5eead4;
  --pf-accent-2: #93c5fd;
  --pf-card: rgba(18, 24, 36, 0.9);
  --pf-sheet: rgba(10, 14, 22, 0.72);
  --pf-shadow: 0 24px 56px rgba(0, 0, 0, 0.4);
}

.public-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 65% 42% at 10% -8%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 38% at 95% 12%, rgba(29, 78, 216, 0.14), transparent 50%),
    radial-gradient(ellipse 45% 35% at 50% 100%, rgba(15, 23, 42, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 40%),
    linear-gradient(180deg, var(--profile-bg) 0%, var(--profile-bg) 100%);
}

.public-body--dark .public-atmosphere {
  background:
    radial-gradient(ellipse 65% 42% at 10% -8%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 38% at 95% 12%, rgba(59, 130, 246, 0.18), transparent 50%),
    linear-gradient(180deg, #070b14 0%, var(--profile-bg, #0c1220) 100%);
}

.profile-preview-wrap {
  background: var(--profile-bg, #e8edf5);
  position: relative;
  padding: 1rem;
  border-radius: 18px;
  overflow: hidden;
}

/* Full-page cover (pay/menu pages only) */
.public-body.public-body--cover {
  background-color: var(--profile-bg, #0f172a);
  background-image:
    linear-gradient(180deg, rgba(15, 23, 42, 0.32) 0%, rgba(15, 23, 42, 0.48) 100%),
    var(--profile-cover);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.public-body.public-body--cover .public-atmosphere {
  background:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(15, 118, 110, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.2), rgba(8, 12, 20, 0.35));
}

.public-body--cover .site-footer .footer-tagline,
.public-body--cover .site-footer .footer-copy {
  text-shadow: 0 1px 8px rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
}

/* Live preview: cover stays inside hero banner only */
.profile-preview-wrap .public-hero {
  margin-bottom: 0.95rem;
}

.profile-preview-wrap .public-hero-banner {
  border-radius: 20px;
  padding: 1.1rem 0.9rem 1rem;
  min-height: 0;
}

.profile-preview-wrap .public-hero--cover .public-hero-media {
  background-image:
    linear-gradient(180deg, rgba(8, 12, 20, 0.42) 0%, rgba(8, 12, 20, 0.58) 100%),
    linear-gradient(125deg, rgba(15, 118, 110, 0.22), transparent 55%),
    var(--profile-cover);
  background-size: cover;
  background-position: center;
}

.profile-preview-wrap .public-avatar-wrap {
  width: 88px;
  height: 88px;
  margin-bottom: 0.65rem;
}

.profile-preview-wrap .public-name {
  font-size: 1.35rem;
}

.profile-preview-wrap .public-bio {
  font-size: 0.86rem;
}

.profile-preview-wrap .public-links {
  gap: 0.55rem;
}

.profile-preview-wrap .public-link {
  min-height: 56px;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
}

.profile-preview-wrap .public-link .icon {
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

/* Footer */
.public-body .site-footer {
  position: relative;
  z-index: 1;
  margin-top: 0.25rem;
  background: transparent;
  border-top-color: rgba(100, 116, 139, 0.28);
}

.public-body .site-footer .footer-tagline,
.public-body .site-footer .footer-copy {
  color: #475569;
}

.public-body--dark .site-footer {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.public-body--dark .site-footer .footer-tagline,
.public-body--dark .site-footer .footer-copy {
  color: #e2e8f0;
}

.public-body--dark .site-footer .footer-copy {
  color: #cbd5e1;
}

.public-wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 1.25rem, 440px);
  margin: 0 auto;
  padding: 1.5rem 0 1.75rem;
  text-align: center;
}

/* Hero + cover banner */
.public-hero {
  margin-bottom: 1.25rem;
  animation: pfRise 0.65s var(--pf-ease) both;
}

.public-hero-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
  padding: 1.5rem 1.15rem 1.35rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.48)),
    linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.public-body--dark .public-hero-banner {
  background:
    linear-gradient(160deg, rgba(18, 24, 36, 0.88), rgba(12, 18, 32, 0.78));
  border-color: rgba(255, 255, 255, 0.08);
}

.public-hero-media {
  display: none;
}

.public-hero--cover .public-hero-media {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(8, 12, 20, 0.45) 0%, rgba(8, 12, 20, 0.55) 100%),
    linear-gradient(125deg, rgba(15, 118, 110, 0.28), transparent 55%),
    var(--profile-cover);
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  animation: pfCoverDrift 16s ease-in-out infinite alternate;
}

@keyframes pfCoverDrift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-1.2%, -0.8%, 0); }
}

.public-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}

.public-hero--cover .public-hero-banner {
  background: linear-gradient(145deg, #111827 0%, #1e293b 55%, #0f172a 100%);
  border-color: rgba(255, 255, 255, 0.1);
  min-height: 220px;
}

.public-hero--cover .public-name {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.public-hero--cover .public-bio {
  color: rgba(248, 250, 252, 0.9);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.public-hero-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.15rem 0 0.35rem;
  flex-wrap: wrap;
}

.public-avatar-wrap {
  width: 118px;
  height: 118px;
  margin: 0 auto 0.85rem;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  padding: 3px;
  background: conic-gradient(from 200deg, #0f766e, #1d4ed8, #ea580c, #0f766e);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
  border: 0;
  animation: pfAvatarIn 0.7s var(--pf-ease) both;
}

.public-hero--cover .public-avatar-wrap {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

@keyframes pfAvatarIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.public-avatar {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  margin: 0;
  border: 3px solid #fff;
  box-shadow: none;
  background: #e2e8f0;
  display: block;
}

.public-hero--cover .public-avatar,
.public-body--dark .public-avatar {
  border-color: rgba(255, 255, 255, 0.92);
  background: #1e293b;
}

.public-avatar--sm {
  width: min(100%, 120px);
  border-radius: 50%;
}

.public-name {
  margin: 0;
  font-family: "Zain", "Outfit", "Cairo", sans-serif;
  font-size: clamp(1.55rem, 5.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--name-color, var(--pf-ink));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

html[dir="ltr"] .public-name {
  font-family: "Outfit", "DM Sans", sans-serif;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.35));
}

.public-username {
  display: none;
}

.public-bio {
  margin: 0 auto;
  color: var(--pf-muted);
  max-width: 26rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.public-body--dark .public-bio,
.profile-preview-wrap.public-body--dark .public-bio {
  color: #e2e8f0;
}

.save-contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--pf-accent);
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  transition: transform 0.25s var(--pf-ease), box-shadow 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
}

.public-hero--cover .save-contact-icon {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(8px);
}

.save-contact-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.2);
  color: #0f766e;
}

.public-hero--cover .save-contact-icon:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.save-contact-icon:active {
  transform: translateY(0);
}

/* Links */
.public-links {
  display: grid;
  gap: 0.7rem;
}

.category-title {
  margin: 1.15rem 0 0.15rem;
  padding: 0 0.2rem 0.45rem;
  font-family: "Zain", "Outfit", "Cairo", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pf-muted);
  text-align: start;
  border-bottom: 1px solid var(--pf-line);
}

html[dir="ltr"] .category-title {
  font-family: "Outfit", "DM Sans", sans-serif;
}

.public-body--dark .category-title {
  color: rgba(241, 245, 249, 0.55);
}

.public-links > * {
  animation: pfRise 0.55s var(--pf-ease) both;
}

.public-links > *:nth-child(1) { animation-delay: 0.04s; }
.public-links > *:nth-child(2) { animation-delay: 0.08s; }
.public-links > *:nth-child(3) { animation-delay: 0.12s; }
.public-links > *:nth-child(4) { animation-delay: 0.16s; }
.public-links > *:nth-child(5) { animation-delay: 0.2s; }
.public-links > *:nth-child(6) { animation-delay: 0.24s; }
.public-links > *:nth-child(n+7) { animation-delay: 0.28s; }

@keyframes pfRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.public-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
  background: var(--pf-card);
  border: 1px solid var(--pf-line);
  border-radius: 18px;
  padding: 0.85rem 0.95rem;
  color: var(--pf-ink);
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  min-height: 68px;
  min-width: 0;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 0.25s var(--pf-ease),
    box-shadow 0.25s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.public-link::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pf-accent), var(--pf-accent-2));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.public-link:hover {
  border-color: rgba(15, 118, 110, 0.28);
  color: var(--pf-ink);
  background: #fff;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.public-link:hover::before {
  opacity: 1;
}

.public-body--dark .public-link:hover {
  background: rgba(30, 41, 59, 0.95);
}

.public-link .icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  font-size: 1.1rem;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.public-link .label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: start;
  font-size: 1rem;
  line-height: 1.3;
}

.public-link .label small {
  display: block;
  margin-top: 0.18rem;
  color: var(--pf-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-link .chev {
  color: #94a3b8;
  transition: transform 0.25s ease, color 0.2s ease;
  font-size: 0.85rem;
}

.public-link:hover .chev {
  color: var(--pf-accent);
  transform: translateX(-3px);
}

html[dir="ltr"] .public-link:hover .chev {
  transform: translateX(3px);
}

button.public-link {
  width: 100%;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.public-link--info {
  cursor: default;
}

.public-link--info:hover {
  transform: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  border-color: var(--pf-line);
}

.public-link--info:hover::before {
  opacity: 0.55;
}

.public-link .copy-hint {
  color: var(--pf-accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.1);
}

.smart-menu-link {
  background:
    linear-gradient(135deg, rgba(194, 65, 12, 0.1), rgba(15, 118, 110, 0.08)),
    var(--pf-card);
  border-color: rgba(194, 65, 12, 0.22);
}

.smart-menu-link:hover {
  border-color: rgba(194, 65, 12, 0.4);
  box-shadow: 0 16px 34px rgba(194, 65, 12, 0.16);
}

.smart-menu-link::before {
  background: linear-gradient(180deg, #ea580c, #c2410c);
  opacity: 1;
}

.empty {
  background: var(--pf-card);
  border: 1px dashed var(--pf-line);
  border-radius: 16px;
  padding: 1.1rem;
  color: var(--pf-muted);
  margin: 0;
}

/* Pay helpers */
.pay-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--pf-accent-2);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.public-body--dark .pay-eyebrow {
  color: #93c5fd;
}

.pay-back {
  margin-top: 1.1rem;
}

.pay-back a {
  color: var(--pf-accent-2);
  font-weight: 700;
  text-decoration: none;
}

.public-body--dark .pay-back a {
  color: #93c5fd;
}

/* Menu card */
.menu-card {
  display: block;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--pf-card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  padding: 0;
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: inherit;
  transition: transform 0.25s var(--pf-ease), box-shadow 0.25s ease, border-color 0.2s ease;
}

.menu-card:hover {
  border-color: rgba(29, 78, 216, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(29, 78, 216, 0.14);
}

.menu-card-media {
  position: relative;
  min-height: 170px;
  background: #f1f5f9;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.menu-card-media img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  background: #fff;
  transition: transform 0.45s var(--pf-ease);
}

.menu-card:hover .menu-card-media img {
  transform: scale(1.03);
}

.menu-card-badge {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-end: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(12, 18, 32, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.menu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  font-weight: 800;
  color: #0f766e;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06) 0%, transparent 100%);
}

.menu-card-footer i {
  color: #0f766e;
}

.menu-viewer.open {
  display: grid;
}

.menu-viewer-box {
  width: min(100%, 720px);
  max-height: min(92vh, 900px);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow, 0 20px 50px rgba(15, 23, 42, 0.2));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text, #0f172a);
}

.menu-viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.menu-viewer-top h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text, #0f172a);
}

.menu-viewer-top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.menu-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
}

.menu-viewer-body {
  position: relative;
  overflow: hidden;
  background: #0f172a;
  padding: 0.75rem;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.menu-viewer-body img {
  width: 100%;
  max-height: min(70vh, 640px);
  height: auto;
  border-radius: 10px;
  margin: 0 auto;
  object-fit: contain;
}

.menu-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.menu-nav:hover {
  background: #fff;
}

.menu-nav-prev {
  inset-inline-start: 10px;
}

.menu-nav-next {
  inset-inline-end: 10px;
}

/* Dashboard preview */
.panel .public-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.panel .public-wrap .public-avatar {
  max-width: none;
}

@media (max-width: 520px) {
  .public-wrap {
    width: min(100% - 0.9rem, 440px);
    padding: 1rem 0 1.35rem;
  }

  .public-hero-banner {
    border-radius: 22px;
    padding: 1.2rem 0.95rem 1.15rem;
  }

  .public-avatar-wrap {
    width: 104px;
    height: 104px;
  }

  .public-name {
    font-size: clamp(1.4rem, 7vw, 1.75rem);
  }

  .public-link {
    min-height: 60px;
    padding: 0.75rem 0.8rem;
    border-radius: 16px;
    gap: 0.7rem;
  }

  .public-link .icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .public-link .label {
    font-size: 0.94rem;
  }

  .menu-viewer-box {
    width: min(100% - 0.75rem, 720px);
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-hero,
  .public-avatar-wrap,
  .public-links > *,
  .public-hero--cover .public-hero-media {
    animation: none !important;
  }

  .public-link:hover,
  .menu-card:hover {
    transform: none;
  }
}
