/* =====================================================================
   contact-v2.css  —  Modern QR contact-card design system
   Mirrors the web-portal-v2 visual language (Plus Jakarta Sans, soft
   rounded cards, gentle shadows, gradient header, pill chips) but is
   BRAND-DRIVEN: accent colours come from the org's hex colorTheme,
   injected into --qr-primary / --qr-text-theme inline on the page.
   ===================================================================== */

:root {
  --qr-font-display: 'Plus Jakarta Sans', sans-serif;
  --qr-font-body:    'Open Sans', sans-serif;

  /* Overridden inline from the org's branding; sensible default. */
  --qr-primary:      #003366;
  --qr-text-theme:   #ffffff;

  /* Derived shades (modern browsers — graceful fallback to --qr-primary). */
  --qr-primary-dark:  color-mix(in srgb, var(--qr-primary) 76%, #000);
  --qr-primary-soft:  color-mix(in srgb, var(--qr-primary) 12%, #fff);
  --qr-primary-tint:  color-mix(in srgb, var(--qr-primary) 8%,  #fff);
  --qr-gradient:      linear-gradient(160deg, var(--qr-primary) 0%, var(--qr-primary-dark) 100%);

  /* Neutral palette */
  --qr-ink:    #1f2733;
  --qr-muted:  #6b7785;
  --qr-line:   #eef1f5;
  --qr-bg:     #f4f6fa;

  /* Per-action accents (preserve the original semantic colours) */
  --qr-whatsapp: #25d366;
  --qr-call:     #16a34a;
  --qr-email:    #e4572e;
  --qr-location: #ef4444;
  --qr-save:     #0ea5e9;
  --qr-share:    var(--qr-primary);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--qr-bg);
  font-family: var(--qr-font-body);
  color: var(--qr-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--qr-font-display); margin: 0; }
a { color: var(--qr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Shell: phone-width column centred on larger screens ---- */
.qr-shell {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 130px;           /* room for the fixed footer */
  min-height: 100vh;
  background: var(--qr-bg);
  position: relative;
}

/* ---- Demo ribbon ---- */
.qr-demo-tag {
  position: fixed;
  top: 16px; left: 0;
  background: var(--qr-primary);
  color: #fff;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  z-index: 1200;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

/* =====================================================================
   HERO  (two layouts: --banner / --color, mirroring contactTheme 1/2)
   ===================================================================== */
.qr-hero {
  position: relative;
  border-radius: 0 0 22px 22px;
  background: var(--qr-gradient);
  color: #fff;
  overflow: hidden;
}

/* Layout 1: tall banner/colour strip; avatar floats below it */
.qr-hero--banner { min-height: 168px; }
.qr-hero--banner.has-image {
  background-size: cover;
  background-position: center;
}
.qr-hero--banner.has-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.28) 100%);
}

.qr-hero-logo {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 3;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 6px;
}
.qr-hero-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Layout 2: coloured header block carrying name/logo/org/title */
.qr-hero--color {
  text-align: center;
  padding: 26px 20px 22px;
}
.qr-hero--color .qr-hero-name,
.qr-hero--color .qr-hero-org,
.qr-hero--color .qr-hero-title { color: var(--qr-text-theme); }
.qr-hero--color .qr-hero-name  { font-size: 24px; font-weight: 800; }
.qr-hero--color .qr-hero-org   { font-size: 16px; font-weight: 700; margin-top: 4px; opacity: .95; }
.qr-hero--color .qr-hero-title { font-size: 13px; font-weight: 600; margin-top: 2px; opacity: .85; }
.qr-hero--color .qr-hero-logo-inline {
  width: 84px; height: 84px;
  margin: 14px auto 6px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 8px; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.qr-hero-logo-inline img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---- Floating avatar (used by layout 1, and below header in layout 2) ---- */
.qr-avatar-wrap { text-align: center; }
.qr-avatar-wrap.is-float { margin-top: -52px; position: relative; z-index: 4; }
.qr-avatar {
  width: 116px; height: 116px;
  border-radius: 24px;
  object-fit: cover;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
}
.qr-avatar.is-wide {            /* layout 2 photo below the header */
  width: 78%;
  height: auto;
  border-radius: 18px;
  margin-top: 16px;
}

.qr-identity { text-align: center; padding: 14px 20px 4px; }
.qr-identity .qr-name  { font-size: 22px; font-weight: 800; color: var(--qr-ink); }
.qr-identity .qr-org   { font-size: 15px; font-weight: 700; color: var(--qr-muted); margin-top: 3px; }
.qr-identity .qr-title { font-size: 13px; font-weight: 600; color: var(--qr-muted); margin-top: 2px; }

/* =====================================================================
   SECTION LABELS
   ===================================================================== */
.qr-section-label {
  display: block;
  text-align: center;
  font-family: var(--qr-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--qr-primary);
  margin: 18px 0 12px;
}

.qr-body { padding: 0 16px; }

/* =====================================================================
   ACTION BUTTONS
   ===================================================================== */

/* Theme 1 — clean pill action row */
.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.qr-action {
  flex: 1 1 0;
  min-width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px;
  border: none; border-radius: 16px;
  background: var(--qr-gradient);
  color: #fff !important;
  font-family: var(--qr-font-display);
  font-size: 12px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.qr-action i { font-size: 19px; }
.qr-action:hover { transform: translateY(-2px); text-decoration: none; color: #fff !important; }
.qr-action:disabled, .qr-action.is-disabled { opacity: .5; pointer-events: none; }

/* Theme 2 — circular icon grid */
.qr-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 10px;
  justify-items: center;
}
.qr-icon-btn {
  width: 60px; height: 60px;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff !important;
  font-size: 24px;
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
  cursor: pointer;
  transition: transform .12s ease;
}
.qr-icon-btn:hover { transform: translateY(-3px) scale(1.04); text-decoration: none; color: #fff !important; }
.qr-icon-btn.is-disabled, .qr-icon-btn:disabled { opacity: .5; pointer-events: none; }

/* Theme 3 — labelled rounded buttons */
.qr-label-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.qr-label-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 6px;
  border: none; border-radius: 14px;
  color: #fff !important;
  font-family: var(--qr-font-display);
  font-size: 12px; font-weight: 700;
  box-shadow: 0 5px 14px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .12s ease;
}
.qr-label-btn i { font-size: 18px; }
.qr-label-btn:hover { transform: translateY(-2px); text-decoration: none; color: #fff !important; }
.qr-label-btn.is-disabled, .qr-label-btn:disabled { opacity: .5; pointer-events: none; }

/* Per-action colour helpers (themes 2 & 3) */
.act-whatsapp { background: var(--qr-whatsapp); }
.act-call     { background: var(--qr-call); }
.act-email    { background: var(--qr-email); }
.act-location { background: var(--qr-location); }
.act-save     { background: var(--qr-save); }
.act-share    { background: var(--qr-primary); }

/* =====================================================================
   DETAIL CARD
   ===================================================================== */
.qr-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  padding: 6px 16px;
  margin-top: 18px;
}
.qr-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--qr-line);
}
.qr-detail:last-child { border-bottom: none; }
.qr-detail-ic {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--qr-primary-tint);
  color: var(--qr-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.qr-detail-body { min-width: 0; flex: 1; }
.qr-detail-label {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; color: var(--qr-muted);
}
.qr-detail-value {
  font-size: 15px; font-weight: 600; color: var(--qr-ink);
  margin-top: 2px; word-break: break-word;
}
.qr-detail-value a { color: var(--qr-primary); font-weight: 700; }

/* =====================================================================
   FULL-WIDTH CTA BUTTONS  (promo / product / service / website)
   ===================================================================== */
.qr-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px 16px;
  margin-top: 12px;
  border: none; border-radius: 14px;
  font-family: var(--qr-font-display);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(0,0,0,.10);
  transition: transform .12s ease;
}
.qr-cta:hover { transform: translateY(-1px); text-decoration: none; }
.qr-cta--primary { background: var(--qr-gradient); color: #fff !important; }
.qr-cta--soft    { background: var(--qr-primary-soft); color: var(--qr-primary) !important; }
.qr-cta--promo   { background: linear-gradient(160deg,#f59e0b,#ea580c); color:#fff !important; }

/* Collapsible bio / video panel */
.qr-collapse-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  padding: 14px 16px;
  margin-top: 10px;
  font-size: 14px; line-height: 1.55; color: var(--qr-ink);
}
.qr-collapse-panel video { width: 100%; border-radius: 10px; display: block; }

/* =====================================================================
   SOCIAL
   ===================================================================== */
.qr-social {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 16px;
}
.qr-social a {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.qr-social a:hover { transform: translateY(-2px); }
.qr-social img { width: 26px; height: 26px; object-fit: contain; }

.qr-powered {
  text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--qr-muted);
  margin: 26px 0 8px;
}
.qr-powered a {
  color: inherit;
  text-decoration: none;
}
.qr-powered a:hover {
  text-decoration: underline;
}

/* =====================================================================
   FIXED FOOTER + BOTTOM SHEETS
   ===================================================================== */
.qr-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1100;
  pointer-events: none;            /* let the sheets/buttons opt back in */
}
.qr-footer-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 14px;
  position: relative;
}
.qr-footer-bar { display: flex; gap: 10px; align-items: flex-end; }
.qr-send-btn {
  pointer-events: auto;
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px;
  border: none; border-radius: 16px;
  background: var(--qr-gradient);
  color: #fff;
  font-family: var(--qr-font-display);
  font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
  cursor: pointer;
}
.qr-promo-x {
  pointer-events: auto;
  width: 48px; height: 48px;
  flex: 0 0 48px;
  border: none; border-radius: 14px;
  background: #ef4444; color: #fff;
  font-size: 18px; font-weight: 900;
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
  cursor: pointer;
}

/* The Bootstrap collapse panels styled as bottom sheets */
.qr-sheet {
  position: relative;
  pointer-events: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
  padding: 18px 16px 16px;
  margin: 0 -16px;                 /* full-width within footer-inner padding */
  touch-action: none;             /* let the drag gesture own vertical motion */
}
.qr-sheet::before {
  content: '';
  display: block;
  width: 42px; height: 4px;
  border-radius: 999px;
  background: #d7dce3;
  margin: -6px auto 14px;
}
/* Drag-to-dismiss helpers (shared by both drawers) */
.qr-sheet.qr-dragging { transition: none !important; user-select: none; }
.qr-sheet.qr-snapback { transition: transform .22s cubic-bezier(.22,.61,.36,1); }
.qr-sheet h6 {
  font-family: var(--qr-font-display);
  font-size: 15px; font-weight: 800;
  margin-bottom: 12px;
}

.qr-field { margin-bottom: 12px; }
.qr-field label {
  display: block;
  font-size: 12px; font-weight: 700; color: var(--qr-muted);
  margin-bottom: 5px;
}
.qr-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--qr-line);
  border-radius: 12px;
  font-family: var(--qr-font-body);
  font-size: 15px;
  background: #fbfcfe;
}
.qr-field input:focus {
  outline: none;
  border-color: var(--qr-primary);
  box-shadow: 0 0 0 3px var(--qr-primary-soft);
}
.qr-row-2 { display: flex; gap: 10px; }
.qr-row-2 > * { flex: 1; }

.qr-submit {
  width: 100%;
  padding: 14px;
  border: none; border-radius: 14px;
  background: var(--qr-gradient);
  color: #fff;
  font-family: var(--qr-font-display);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.qr-submit:disabled { opacity: .6; }

/* Promotion drops down from the TOP of the screen */
.qr-topdrawer {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1200;
  pointer-events: none;            /* let the sheet opt back in */
}
.qr-topdrawer-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px 0;
  pointer-events: auto;
}
/* Re-skin the shared sheet for a top anchor: rounded/shadowed downward */
.qr-topdrawer .qr-promo-sheet {
  position: relative;
  margin: 0;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  padding: 16px 16px 18px;
}
.qr-topdrawer .qr-promo-sheet::before {
  display: none;                   /* no "pull-up" handle at the top */
}
/* Pull-up grab handle pinned to the bottom edge of the top drawer */
.qr-topdrawer .qr-promo-sheet::after {
  content: '';
  display: block;
  width: 42px; height: 4px;
  border-radius: 999px;
  background: #d7dce3;
  margin: 14px auto -6px;
}

/* Standout close button, shared by both sheets */
.qr-sheet-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; border-radius: 999px;
  background: var(--qr-primary);
  color: var(--qr-text-theme, #fff);
  font-size: 22px; font-weight: 800; line-height: 1;
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
  cursor: pointer;
  z-index: 2;
  transition: transform .12s ease;
}
.qr-sheet-close:hover { filter: brightness(1.08); }
.qr-sheet-close:active { transform: scale(.92); }

.qr-promo-sheet img {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  margin: 0 auto 12px;
  border-radius: 12px;
}

/* Wider screens: keep the card feel, add breathing room */
@media (min-width: 540px) {
  .qr-shell { box-shadow: 0 0 60px rgba(0,0,0,.06); }
}
