/* ==================================================================
   DIGITAL CARD STYLES — premium, mobile-first, light + dark, RTL/LTR.
   --c-primary / --c-primary-deep / --c-on-primary / --c-primary-soft /
   --c-primary-glow are set at runtime by card.js from
   siteConfig.theme.primary. Everything else lives here.
================================================================== */
:root {
  --c-primary: #1cb9b1;
  --c-primary-deep: #137e78;
  --c-on-primary: #ffffff;
  --c-primary-soft: rgba(28, 185, 177, 0.12);
  --c-primary-glow: rgba(28, 185, 177, 0.35);
  --c-accent-ink: var(--c-primary-deep);
  --c-bg: #e9eef4;
  --c-page: #f4f6fa;
  --c-surface: #ffffff;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-border: #e6eaf0;
  --c-chip: #f1f5f9;
  --c-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.35);
  --c-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -16px rgba(15, 23, 42, 0.18);
  --c-ok: #15803d;
  --c-ok-bg: rgba(34, 197, 94, 0.14);
  --c-bad: #be123c;
  --c-bad-bg: rgba(244, 63, 94, 0.12);
  --radius: 20px;
  color-scheme: light;
}
[data-theme="dark"] {
  --c-accent-ink: color-mix(in srgb, var(--c-primary) 70%, #ffffff);
  --c-bg: #060a13;
  --c-page: #0b111d;
  --c-surface: #131b2b;
  --c-text: #e6edf7;
  --c-muted: #93a1b5;
  --c-border: rgba(255, 255, 255, 0.08);
  --c-chip: rgba(255, 255, 255, 0.05);
  --c-shadow: 0 30px 90px -30px rgba(0, 0, 0, 0.8);
  --c-card-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
  --c-ok: #4ade80;
  --c-ok-bg: rgba(74, 222, 128, 0.12);
  --c-bad: #fb7185;
  --c-bad-bg: rgba(251, 113, 133, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-page);
  color: var(--c-text);
  font-family: "Inter", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: "Tajawal", "Inter", system-ui, sans-serif; }
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

/* ---------- frame ---------- */
#cardRoot { min-height: 100vh; }
.dc {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--c-page);
  overflow: hidden;
}
@media (min-width: 560px) {
  body {
    padding: 36px 16px;
    background:
      radial-gradient(90% 60% at 50% -10%, var(--c-primary-soft), transparent 70%),
      radial-gradient(60% 50% at 100% 100%, var(--c-primary-soft), transparent 70%),
      var(--c-bg);
  }
  #cardRoot { min-height: 0; }
  .dc {
    min-height: 0;
    border-radius: 32px;
    box-shadow: var(--c-shadow);
    border: 1px solid var(--c-border);
  }
}

/* ---------- header ---------- */
.dc-hero {
  --hero-ink: var(--c-on-primary);
  position: relative;
  isolation: isolate;
  padding: 14px 18px 70px;
  text-align: center;
  color: var(--hero-ink);
  background: linear-gradient(155deg, var(--c-primary) 0%, var(--c-primary-deep) 100%);
  overflow: hidden;
}
.dc-hero.no-quick { padding-bottom: 32px; }
.dc-hero::before,
.dc-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.dc-hero::before { width: 260px; height: 260px; top: -120px; inset-inline-end: -90px; }
.dc-hero::after { width: 180px; height: 180px; bottom: -90px; inset-inline-start: -60px; background: rgba(255, 255, 255, 0.07); }
.dc-pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.6px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}
.dc-hero.has-cover { --hero-ink: #ffffff; background: #0f172a; }
.dc-hero.has-cover::before,
.dc-hero.has-cover::after { display: none; }
.dc-cover {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
}
.dc-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.35) 0%, rgba(2, 6, 23, 0.55) 50%, rgba(2, 6, 23, 0.82) 100%);
}

.dc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dc-top-end { display: flex; gap: 8px; }
.dc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--hero-ink);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.dc-chip:hover { background: rgba(255, 255, 255, 0.26); }
.dc-chip:active { transform: scale(0.96); }
.dc-chip svg { width: 17px; height: 17px; }
.dc-icon { width: 38px; padding: 0; }

.dc-id { margin-top: 10px; }
.dc-avatar {
  width: 116px;
  height: 116px;
  margin: 0 auto 14px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.55));
  box-shadow: 0 14px 34px -10px rgba(2, 6, 23, 0.45);
}
.dc-avatar img,
.dc-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
}
.dc-avatar.is-logo img { object-fit: contain; padding: 16px; }
.dc-avatar span {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--c-primary-deep);
  background: linear-gradient(145deg, #ffffff, #eef2f7);
}
.dc-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
html[lang="ar"] .dc-name { letter-spacing: 0; }
.dc-verified {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: #1d9bf0;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.dc-verified svg { width: 13px; height: 13px; }
.dc-headline {
  display: inline-block;
  margin: 10px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.16);
  font-weight: 600;
  font-size: 0.92rem;
}
.dc-bio {
  margin: 12px auto 0;
  max-width: 38ch;
  font-size: 0.95rem;
  line-height: 1.75;
  opacity: 0.92;
}

/* ---------- quick actions (overlap the header) ---------- */
.dc-quick {
  position: relative;
  z-index: 2;
  margin: -46px 14px 0;
  padding: 14px 8px 12px;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 4px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  box-shadow: 0 22px 40px -24px rgba(15, 23, 42, 0.45);
}
.dc-qa,
.dc-sa {
  --tile: var(--c-primary);
  --tile-ink: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dc-qa .ic,
.dc-sa .ic {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: var(--tile);
  color: var(--tile-ink);
  box-shadow: 0 12px 22px -12px var(--tile);
  transition: transform 0.2s ease;
}
.dc-qa .ic svg { width: 24px; height: 24px; }
.dc-qa:hover .ic, .dc-sa:hover .ic { transform: translateY(-2px); }
.dc-qa:active .ic, .dc-sa:active .ic { transform: scale(0.94); }
.is-wa { --tile: #22c55e; }
.is-call { --tile: #3b82f6; }
.is-dir { --tile: #f43f5e; }
.is-mail { --tile: #8b5cf6; }
.is-share { --tile: #64748b; }
.is-save { --tile: var(--c-primary); --tile-ink: var(--c-on-primary); }

/* ---------- body ---------- */
.dc-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px calc(104px + env(safe-area-inset-bottom));
}
.dc-sec,
.dc-stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--c-card-shadow);
}
.dc-sec { position: relative; padding: 16px; }
.dc-h {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}
.dc-h::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--c-primary);
}

/* highlights */
.dc-stats {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 10px;
}
.dc-stat {
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dc-stat strong {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--c-accent-ink);
}
.dc-stat span { font-size: 0.78rem; color: var(--c-muted); font-weight: 600; }

/* services */
.dc-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dc-tags li {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--c-primary-soft);
  border: 1px solid color-mix(in srgb, var(--c-primary) 22%, transparent);
  font-size: 0.86rem;
  font-weight: 600;
}

/* contact rows */
.dc-rows { display: flex; flex-direction: column; }
.dc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  margin: 0 -6px;
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.dc-row + .dc-row { border-top: 1px solid var(--c-border); }
.dc-row:hover { background: var(--c-chip); }
.dc-row-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--c-primary-soft);
  color: var(--c-accent-ink);
}
.dc-row-ic svg { width: 20px; height: 20px; }
.dc-row.is-wa .dc-row-ic { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
[data-theme="dark"] .dc-row.is-wa .dc-row-ic { color: #4ade80; }
.dc-row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dc-row-lb { font-size: 0.75rem; color: var(--c-muted); font-weight: 600; }
.dc-row-val { font-weight: 700; overflow-wrap: anywhere; }
[dir="rtl"] .dc-row-val[dir="ltr"] { text-align: right; }
.dc-row-go { flex: none; color: var(--c-muted); display: grid; }
.dc-row-go svg { width: 18px; height: 18px; }

/* opening hours */
.dc-open {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}
.dc-open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dc-open.is-open { color: var(--c-ok); background: var(--c-ok-bg); }
.dc-open.is-closed { color: var(--c-bad); background: var(--c-bad-bg); }
.dc-hours { margin: 0; display: flex; flex-direction: column; }
.dc-hours div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--c-border);
}
.dc-hours div:last-child { border-bottom: 0; padding-bottom: 0; }
.dc-hours dt { color: var(--c-muted); font-weight: 600; }
.dc-hours dd { margin: 0; font-weight: 700; white-space: nowrap; }
.dc-hours .closed dd { color: var(--c-bad); }

/* social */
.dc-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.dc-soc {
  flex: 0 0 calc((100% - 20px) / 3);
  --brand: #334155;
  --brand-ink: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--c-chip);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.dc-soc:hover { transform: translateY(-2px); }
.dc-soc .ic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--brand);
  color: var(--brand-ink);
}
.dc-soc .ic svg { width: 21px; height: 21px; }
.dc-soc.is-instagram .ic { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.dc-soc.is-facebook { --brand: #1877f2; }
.dc-soc.is-tiktok { --brand: #111111; }
.dc-soc.is-twitter { --brand: #0f1419; }
.dc-soc.is-linkedin { --brand: #0a66c2; }
.dc-soc.is-youtube { --brand: #ff0000; }
.dc-soc.is-telegram { --brand: #229ed9; }
.dc-soc.is-snapchat { --brand: #fffc00; --brand-ink: #111111; }
[data-theme="dark"] .dc-soc.is-tiktok .ic,
[data-theme="dark"] .dc-soc.is-twitter .ic { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }

/* map */
.dc-map {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: var(--c-chip);
}
.dc-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dc-map-open {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.5);
}
.dc-map-open svg { width: 16px; height: 16px; color: #f43f5e; }

/* QR */
.dc-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dc-qr img {
  width: 180px;
  height: 180px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--c-border);
}
.dc-btn-soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--c-primary-soft);
  color: var(--c-accent-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}
.dc-btn-soft svg { width: 16px; height: 16px; }

/* full website + footer */
.dc-fullsite {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 18px;
  border-radius: 18px;
  background: var(--c-primary);
  color: var(--c-on-primary);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 16px 30px -16px var(--c-primary-glow);
  transition: transform 0.2s ease;
}
.dc-fullsite:hover { transform: translateY(-1px); }
.dc-fullsite svg { width: 18px; height: 18px; }
.dc-foot { margin: 4px 0 0; text-align: center; color: var(--c-muted); font-size: 0.8rem; }

/* ---------- sticky action bar ---------- */
.dc-sticky {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(452px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 2px;
  padding: 10px 8px 8px;
  border-radius: 24px;
  border: 1px solid var(--c-border);
  background: color-mix(in srgb, var(--c-surface) 92%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 20px 44px -18px rgba(15, 23, 42, 0.5);
  transform: translate(-50%, calc(100% + 24px));
  opacity: 0;
  visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease, visibility 0s linear 0.38s;
}
.dc-sticky.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease, visibility 0s;
}
/* same tiles as the quick actions, slightly smaller */
.dc-sa { gap: 5px; padding: 2px; font-size: 0.72rem; }
.dc-sa .ic { width: 46px; height: 46px; border-radius: 15px; box-shadow: 0 10px 18px -12px var(--tile); }
.dc-sa .ic svg { width: 22px; height: 22px; }

/* ---------- toast ---------- */
.dc-toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.dc-toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .dc-toast { background: #e6edf7; color: #0f172a; }

/* ---------- entrance (first paint only) ---------- */
@keyframes dc-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dc.is-first .dc-id { animation: dc-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.dc.is-first .dc-quick { animation: dc-rise 0.6s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.dc.is-first .dc-body > * { animation: dc-rise 0.6s 0.14s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@media (min-width: 420px) {
  .dc-soc { flex-basis: calc((100% - 30px) / 4); }
}
@media (max-width: 360px) {
  .dc-qa .ic { width: 48px; height: 48px; border-radius: 15px; }
  .dc-qa { font-size: 0.72rem; }
  .dc-name { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .dc-sticky, .dc-top, .dc-toast { display: none !important; }
  body { background: #ffffff; padding: 0; }
  .dc { box-shadow: none; border: 0; }
}
