/* ═══════════════════════════════════════════════════════
   PROID Digital Card v2 — main.css
═══════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Montserrat', sans-serif; background: #f0f0f0; color: #222; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img  { display: block; max-width: 100%; }
a    { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }
* { -webkit-tap-highlight-color: transparent; }

/* ── Tokens ── */
:root {
  --gold:       #995e01;
  --gold-btn:   #995e01;
  --gold-light: #c8a84b;
  --border:     #e5e5e5;
  --text:       #222222;
  --text-sub:   #555555;
  --text-muted: #888888;
  --card-max:   500px;
  --radius:     20px;
  --radius-sm:  10px;
}

#app { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding-bottom: 40px; }

/* ═══════════════════════════════════════════════════════
   CARD
═══════════════════════════════════════════════════════ */
.card { width: 100%; max-width: var(--card-max); background: #fff; }

/* ═══════════════════════════════════════════════════════
   NAV TABS
═══════════════════════════════════════════════════════ */
.nav-tabs {
  display: flex; background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-tab {
  flex: 1; padding: 12px 4px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  text-align: center; color: #444;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer; user-select: none;
}
.nav-tab.active { color: var(--gold); border-bottom-color: var(--gold); background: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════
   HOME
═══════════════════════════════════════════════════════ */
.banner { position: relative; height: 180px; overflow: hidden; background: #ccc; }
.banner img { width: 100%; height: 100%; object-fit: cover; }

.avatar-row { display: flex; justify-content: center; margin-top: -85px; position: relative; z-index: 2; }
.avatar { width: 170px; height: 170px; border-radius: 50%; border: 4px solid #fff; object-fit: cover; box-shadow: 0 2px 12px rgba(0,0,0,0.18); background: #ddd; }

.identity { text-align: center; padding: 10px 16px 4px; }
.identity-name { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; justify-content: center; gap: 6px; text-transform: uppercase;}
.verified-badge { width: 18px; height: 18px; flex-shrink: 0; }
.identity-title   { font-size: 0.82rem; color: var(--text-sub); margin-top: 2px; line-height: 26px;}
.identity-company { font-size: 0.82rem; color: var(--text-sub); }
.identity-dept    { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; font-style: italic; }

.quick-actions { display: flex; gap: 10px; padding: 14px 16px; justify-content: center; }
.btn-action { display: inline-flex; align-items: center; gap: 3px; padding: 13px 20px; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; transition: opacity 0.15s, transform 0.12s; }
.btn-action:active { opacity: 0.8; transform: scale(0.96); }
.btn-action.gold    { background: var(--gold-btn); color: #fff; }
.btn-action.outline { background: #fff; color: var(--gold-btn); border: 1.5px solid var(--gold-btn); }
.btn-action svg { width: 16px; height: 16px; }

.contact-list { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.contact-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: var(--radius-sm);
  padding: 11px 14px; border: 1px solid var(--border);
  transition: border-color 0.15s; min-height: 50px;
  width: 100%; text-align: left;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15);
}
.contact-row:active { border-color: var(--gold-light); }
.cr-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.cr-icon svg { width: 20px; height: 20px; }
.cr-icon.rounded { border-radius: 50%; }
.cr-icon img { width: 40px; height: 40px; object-fit: contain; display: block; }
.cr-text { flex: 1; font-size: 0.88rem; font-weight: 300; color: #54595f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ic-phone { background: #2DC84B; }
.ic-email { background: #EA4335; }
.ic-web   { background: #1A73E8; }
.ic-map   { background: #FF6B35; }
.ic-bank  { background: #3F51B5; }
.ic-tax   { background: #FF9800; }
.ic-lang  { background: #607D8B; }

/* ═══════════════════════════════════════════════════════
   INTRODUCE
═══════════════════════════════════════════════════════ */
.intro-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-bottom: 16px; }
.intro-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.intro-company-banner { background: var(--gold-btn); color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-align: center; padding: 12px 16px; margin: 0 12px 14px; border-radius: 4px; }
.intro-bio { padding: 0 16px 24px; font-size: 0.88rem; line-height: 1.75; color: var(--text-sub); }
.intro-bio p { margin-bottom: 12px; }
.intro-bio strong { color: var(--text); font-weight: 700; }

/* ═══════════════════════════════════════════════════════
   VIDEO
═══════════════════════════════════════════════════════ */
.video-list { display: flex; flex-direction: column; gap: 16px; padding: 16px 12px; }
.video-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.video-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; padding: 12px 14px 10px; color: var(--text); line-height: 1.35; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ═══════════════════════════════════════════════════════
   SHOP
═══════════════════════════════════════════════════════ */
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px 12px 24px; }
.product-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow 0.15s, transform 0.12s;     box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15);}
.product-card:active { box-shadow: 0 2px 12px rgba(0,0,0,0.12); transform: scale(0.98); }
.product-img  { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f5f5f5; }
.product-name { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; text-align: center; padding: 10px 10px 12px; color: var(--text); line-height: 1.3; }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.card-footer { text-align: center; padding: 18px 16px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; color: #888; border-top: 1px solid var(--border); }
.footer-link { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--gold); font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   MODAL OVERLAY
═══════════════════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; backdrop-filter: blur(3px); }
.modal-overlay[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════
   MODALS — slide up, scroll content
═══════════════════════════════════════════════════════ */
.modal {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--card-max);
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 20px 20px 36px;
  z-index: 300; max-height: 88vh; overflow-y: auto;
}
.modal[hidden] { display: none; }

/* Floating close X — rendered outside .modal so it's never clipped */
#global-close-btn {
  position: fixed;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.72);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  z-index: 600;
  cursor: pointer; border: none;
  transition: background 0.15s;
}
#global-close-btn[hidden] { display: none; }
#global-close-btn:active { background: rgba(0,0,0,0.9); }
#global-close-btn svg { width: 18px; height: 18px; }

.modal-handle { width: 36px; height: 4px; background: #ddd; border-radius: 2px; margin: 0 auto 16px; }
.modal-title  { font-size: 0.95rem; font-weight: 700; text-align: center; margin-bottom: 16px; color: var(--text); }

/* ── QR modal buttons ── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; }
.qr-wrap canvas, .qr-wrap img { border-radius: 6px; margin-bottom: 16px; }
.qr-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 16px;
  border: 1.5px solid #ccc; border-radius: 30px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text); background: #fff; margin-bottom: 10px;
  text-transform: uppercase; transition: border-color 0.15s;
}
.qr-action-btn:active { background: #f5f5f5; border-color: var(--gold); }
.qr-action-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Bank modal ── */
.bank-qr-img { width: 100%; border-radius: var(--radius); margin-bottom: 14px; }
.bank-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bank-label { font-size: 0.78rem; color: var(--text-muted); }
.bank-value { font-size: 0.88rem; font-weight: 600; }
.btn-copy { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-btn); color: #fff; border-radius: var(--radius-sm); padding: 10px 16px; font-size: 0.82rem; font-weight: 600; margin-top: 14px; width: 100%; justify-content: center; transition: opacity 0.15s; }
.btn-copy:active { opacity: 0.8; }
.btn-copy svg { width: 16px; height: 16px; }

/* ── Tax modal ── */
.tax-info { font-size: 0.88rem; line-height: 1.7; color: var(--text-sub); }
.tax-info strong { color: var(--text); display: block; margin-bottom: 4px; }
.tax-row { margin-bottom: 8px; }

/* ── Zalo modal ── */
.zalo-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-zalo-action { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--radius-sm); background: #0068FF; color: #fff; font-size: 0.88rem; font-weight: 600; transition: opacity 0.15s; }
.btn-zalo-action:active { opacity: 0.8; }
.btn-zalo-action.outline { background: #fff; color: #0068FF; border: 1.5px solid #0068FF; }
.btn-zalo-action svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════════════════
   PRODUCT DETAIL MODAL
═══════════════════════════════════════════════════════ */
.modal-product {
  padding: 0 0 40px;
  border-radius: 0;
  max-height: 100vh;
  top: 0; bottom: auto;
  overflow-y: auto;
}

/* Hero image */
.pd-hero {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f0ede8;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.2s;
}

/* Thumbnail strip */
.pd-thumbs { display: flex; gap: 8px; padding: 10px 14px; background: #fff; overflow-x: auto; scrollbar-width: none; }
.pd-thumbs::-webkit-scrollbar { display: none; }
.pd-thumb { width: 78px; height: 78px; flex-shrink: 0; border-radius: 6px; overflow: hidden; border: 2.5px solid transparent; cursor: pointer; transition: border-color 0.15s; }
.pd-thumb.active { border-color: var(--gold); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Product link button */
.pd-link-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 14px;
  padding: 11px 20px;
  background:#995e01; border: 1.5px solid #bbb; border-radius: 30px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  color: #fff; text-transform: uppercase;
  transition: border-color 0.15s;
}
.pd-link-btn:active { border-color: var(--gold); }
.pd-link-btn svg { width: 15px; height: 15px; }

/* Product body */
.pd-body { padding: 4px 14px 16px; }
.pd-title { font-size: 0.98rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; line-height: 1.35; }
.pd-price { font-size: 0.95rem; font-weight: 700; color: var(--gold); margin-bottom: 10px; }
.pd-desc  { font-size: 0.87rem; line-height: 1.7; color: var(--text-sub); }

/* ═══════════════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }

.lb-counter { position: absolute; top: 18px; left: 18px; color: rgba(255,255,255,0.75); font-size: 0.82rem; font-weight: 600; }

.lb-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; transition: background 0.15s;
}
.lb-close:active { background: rgba(255,255,255,0.3); }
.lb-close svg { width: 20px; height: 20px; }

.lb-img-wrap { width: 100%; max-width: 600px; display: flex; align-items: center; justify-content: center; padding: 60px 60px; }
.lb-img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 6px; display: block; }

.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; transition: background 0.15s;
}
.lb-prev:active, .lb-next:active { background: rgba(255,255,255,0.35); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-prev svg, .lb-next svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════════════════════
   LANGUAGE MODAL
═══════════════════════════════════════════════════════ */
.lang-radio-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}
.lang-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.lang-radio-input {
  width: 18px; height: 18px;
  accent-color: #2563EB;   /* blue radio dot matching screenshot */
  cursor: pointer;
}
.btn-change-lang {
  display: block;
  width: 100%;
  padding: 16px;
  background: #E63028;     /* red button from screenshot */
  color: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-change-lang:active { opacity: 0.85; transform: scale(0.98); }

/* ═══════════════════════════════════════════════════════
   SKELETON
═══════════════════════════════════════════════════════ */
@keyframes shimmer { 0%{background-position:-500px 0} 100%{background-position:500px 0} }
#skeleton { width: 100%; max-width: var(--card-max); }
.sk-banner { height: 180px; }
.sk-avatar { width: 105px; height: 105px; border-radius: 50%; margin: -52px auto 0; border: 4px solid #f0f0f0; }
.sk-banner, .sk-avatar { background: linear-gradient(90deg,#e0e0e0 25%,#ebebeb 50%,#e0e0e0 75%); background-size:1000px 100%; animation: shimmer 1.3s infinite linear; }
.sk-line { height: 14px; border-radius: 7px; margin: 12px auto 0; background: linear-gradient(90deg,#e0e0e0 25%,#ebebeb 50%,#e0e0e0 75%); background-size:1000px 100%; animation: shimmer 1.3s infinite linear; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (min-width: 481px) {
  body { padding-top: 20px; }
  .modal         { border-radius: 18px; bottom: auto; top: 50%; transform: translate(-50%, -50%); max-height: 90vh; }
  .modal-product { border-radius: 18px; bottom: auto; top: 50%; transform: translate(-50%, -50%); max-height: 92vh; }
}
@media (max-width: 480px) {
  :root { --card-max: 100%; }
}
