/* ==========================================================================
   Premium viewer additions — header actions, CTA bar, share modal,
   materials panel, address line
   ========================================================================== */

/* ----- Header: layout flex com ações à direita ----- */
.vg-topo {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 20px !important;
  background: rgba(0, 0, 0, .92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  color: #fff !important;
}

/* ----- Endereço no título ----- */
.vg-endereco {
  display: block;
  font-size: .78rem;
  color: rgba(255, 255, 255, .5);
  font-weight: 400;
  margin-top: 1px;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- Ações do topo (compartilhar, fullscreen, WhatsApp) ----- */
.vg-acoes-topo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.vg-acao-topo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.vg-acao-topo:hover {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
}
.vg-acao-topo svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* WhatsApp button (header) — green accent */
.vg-whats-topo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: #25d366;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.vg-whats-topo:hover {
  background: #20bd5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 211, 102, .35);
}
.vg-whats-topo svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ----- Abas: ícone + rótulo ----- */
.vg-aba {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.vg-aba svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ----- Barra CTA inferior ----- */
.vg-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0, 0, 0, .95);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.vg-cta-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.vg-cta-info span {
  font-size: .78rem;
  color: rgba(255, 255, 255, .5);
}
.vg-cta-info strong {
  font-size: .92rem;
  color: #fff;
  font-weight: 600;
}
.vg-cta-whats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  background: #25d366;
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.vg-cta-whats:hover {
  background: #20bd5a;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, .4);
}
.vg-cta-whats svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* ----- Share modal overlay ----- */
.vg-share-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s ease;
}
.vg-share-overlay[hidden] { display: none !important; }
.vg-share-overlay.aberta { opacity: 1; }

.vg-share-modal {
  background: #fff;
  border-radius: 18px;
  width: min(380px, 92vw);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  overflow: hidden;
  transform: scale(.95);
  transition: transform .2s ease;
}
.vg-share-overlay.aberta .vg-share-modal { transform: scale(1); }

.vg-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0ecf4;
}
.vg-share-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--roxo, #3c004f);
}
.vg-share-header button {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: #f5f1f8; border-radius: 50%;
  cursor: pointer; color: #6b5b77; transition: background .15s;
}
.vg-share-header button:hover { background: #ece6f2; }
.vg-share-header button svg { width: 16px; height: 16px; }

.vg-share-body {
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vg-share-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--roxo, #3c004f);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.vg-share-opt:hover { background: #f8f5fb; }
.vg-share-opt svg { width: 20px; height: 20px; flex: 0 0 auto; color: inherit; }

/* ----- Materials panel ----- */
.vg-media-materiais {
  overflow-y: auto !important;
  padding: 0 !important;
}
.vg-materiais-grid {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}
.vg-materiais-titulo {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}
.vg-materiais-sub {
  margin: 0 0 24px;
  font-size: .88rem;
  color: rgba(255, 255, 255, .5);
}
.vg-materiais-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vg-material-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
  transition: all .2s ease;
}
.vg-material-item:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .2);
  transform: translateY(-1px);
}
.vg-material-ico {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(255, 102, 51, .2);
  color: var(--laranja, #ff6633);
}
.vg-material-ico svg { width: 20px; height: 20px; }
.vg-material-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vg-material-info strong {
  font-size: .92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vg-material-info small {
  font-size: .75rem;
  color: rgba(255, 255, 255, .45);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vg-material-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--laranja, #ff6633);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s;
}
.vg-material-item:hover .vg-material-btn { background: #e5551f; }
.vg-material-btn svg { width: 14px; height: 14px; }

/* ----- Grid with CTA bar: adjust template rows ----- */
.vg:has(.vg-cta-bar) {
  grid-template-rows: auto 1fr auto auto !important;
}

/* ==========================================================================
   Responsive overrides for new elements
   ========================================================================== */
@media (max-width: 1024px) {
  .vg-acao-topo span,
  .vg-whats-topo span { display: none; }
  .vg-acao-topo { padding: 8px 10px; }
  .vg-whats-topo { padding: 8px 10px; }
  .vg-endereco { max-width: 200px; }
}

@media (max-width: 700px) {
  .vg-topo {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 14px !important;
  }
  .vg-abas {
    order: 3 !important;
    width: 100% !important;
    margin-left: 0 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .vg-abas::-webkit-scrollbar { display: none; }
  .vg-acoes-topo { order: 2; }
  .vg-acao-topo span,
  .vg-whats-topo span { display: none; }
  .vg-acao-topo { padding: 8px 10px; border-radius: 8px; }
  .vg-whats-topo { padding: 8px 10px; border-radius: 8px; }
  .vg-endereco { display: none; }

  .vg-aba svg { display: none; }

  .vg-cta-bar { padding: 10px 14px; }
  .vg-cta-info span { font-size: .72rem; }
  .vg-cta-info strong { font-size: .84rem; }
  .vg-cta-whats { padding: 9px 16px; font-size: .82rem; border-radius: 10px; }

  .vg-materiais-grid { padding: 24px 14px; }
  .vg-materiais-titulo { font-size: 1.1rem; }
  .vg-material-item { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .vg-material-btn { width: 100%; justify-content: center; margin-top: 4px; }
}

@media (max-width: 480px) {
  .vg-cta-bar { flex-direction: column; gap: 8px; text-align: center; }
  .vg-cta-info { align-items: center; }
  .vg-cta-whats { width: 100%; justify-content: center; }
}
