/* ==========================================================================
   B3 AGENCY - SISTEMA DE E-CARDS (TEMA CLARO / LIGHT THEME PADRÃO)
   Design System, CSS Variables, Responsividade e Efeitos Visuais
   ========================================================================== */

:root {
  --primary-color: #232FE7;
  --bg-page: #f1f4f8;
  --bg-card: #ffffff;
  --border-card: rgba(0, 0, 0, 0.08);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-gold: #b45309;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Container Centralizador */
.main-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Canvas do Cartão 9:16 */
.card-container {
  position: relative;
  width: 100%;
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  background-color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(100deg, #e6edf5 28%, #f8fafc 50%, #e6edf5 72%);
  background-size: 220% 100%;
  animation: card-shimmer 1.15s ease-in-out infinite;
  transition: opacity 0.28s ease;
}

.card-container.is-ready::before,
.card-container.is-failed::before {
  opacity: 0;
  animation: none;
}

.card-container.is-instant::before {
  transition: none;
}

.card-container svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

@keyframes card-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .card-container::before { animation: none; transition: none; }
}

.card-actions-row {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.btn-add-contact,
.btn-share {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #245fff;
  color: #ffffff;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 10px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(36, 95, 255, 0.25);
  cursor: pointer;
  white-space: nowrap;
}

.btn-add-contact:hover {
  opacity: 0.94;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(35, 47, 231, 0.35);
}

.btn-add-contact svg,
.btn-share svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.share-modal {
  border: none;
  padding: 0;
  margin: auto;
  background: transparent;
  width: min(360px, calc(100vw - 32px));
  width: min(360px, calc(100dvw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.share-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.share-modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 16px 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
}

.share-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.share-modal-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.share-close {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.share-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 6px;
}

.share-icon span {
  max-width: 100%;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.share-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.share-icon[data-share="whatsapp"] { color: #128c7e; }
.share-icon[data-share="facebook"] { color: #1877f2; }
.share-icon[data-share="telegram"] { color: #229ed9; }
.share-icon[data-share="email"] { color: #334155; }
.share-icon[data-share="copy"] { color: #245fff; }
.share-icon[data-share="more"] { color: #245fff; }

/* ==========================================================================
   MÓDULOS EXTRAS (TEMA CLARO / WHITE CARD)
   ========================================================================== */

.extra-modal {
  border: none;
  padding: 0;
  margin: auto;
  background: transparent;
  width: min(440px, calc(100vw - 32px));
  width: min(440px, calc(100dvw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.extra-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.extra-modal-card {
  position: relative;
  height: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.extra-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.extra-modal-body {
  height: 100%;
  overflow: auto;
  padding: 56px 16px 24px;
  color: var(--text-main);
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
}

.extra-modal-body * {
  min-width: 0;
  max-width: 100%;
}

.extra-modal-body img,
.extra-modal-body video,
.extra-modal-body iframe {
  max-width: 100%;
  height: auto;
}

.extra-modal-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.extra-modal-body pre {
  white-space: pre-wrap;
}

.extra-open-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.btn-extra {
  width: 100%;
  background-color: #245fff;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(36, 95, 255, 0.25);
  cursor: pointer;
}

.extra-card-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 24px 22px;
  margin-bottom: 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  color: var(--text-main);
  animation: fadeInUp 0.6s ease-out both;
}

.extra-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0f172a;
  margin: 0 0 18px 0;
}

.extra-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: -10px 0 18px 0;
}

.extra-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,0.04);
}

.extra-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 480px) {
  .extra-grid-2 {
    grid-template-columns: 1fr;
  }

  .btn-add-contact,
  .btn-share,
  .btn-extra {
    font-size: 13px;
    padding: 12px 8px;
  }
}

/* Menus e Listas de Preços */
.menu-cat-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 25px 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 6px;
}

.menu-item {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.menu-name {
  font-weight: 600;
  font-size: 1rem;
  color: #0f172a;
  min-width: 0;
  overflow-wrap: anywhere;
}

.menu-dots {
  flex-grow: 1;
  border-bottom: 1px dotted #cbd5e1;
  margin: 0 8px;
  position: relative;
  top: -4px;
}

.menu-price {
  font-weight: 700;
  color: #059669;
  font-size: 1rem;
  white-space: nowrap;
}

.menu-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 4px 0 0 0;
  line-height: 1.4;
}

/* Botão Voltar ao Topo */
.back-to-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 10px auto;
  padding: 10px 24px;
  background: #e2e8f0;
  color: #334155;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid #cbd5e1;
}

.back-to-card:hover {
  background: #cbd5e1;
  color: #0f172a;
  transform: translateY(-2px);
}

.extra-video {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Rodapé B3 Agency */
.footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 10px;
  animation: bounceIn 1.2s both;
}

.footer-logo img {
  max-width: 160px;
  height: auto;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.footer-logo img:hover {
  opacity: 1;
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  left: 50%;
  bottom: max(25px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  max-width: calc(100dvw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  text-align: center;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Animações */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 25px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bounceIn {
  from { opacity: 0; transform: scale3d(0.85, 0.85, 0.85); }
  to { opacity: 1; transform: scale3d(1, 1, 1); }
}
