* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f6f4f2;
  font-family: Arial, sans-serif;
  color: #111;
}

/* ── Layout geral ─────────────────────────────── */
.perfil-page {
  --perfil-suave: color-mix(in srgb, var(--cor-primaria, #ff5b00) 12%, #fff);
  --perfil-borda: #efebe7;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f6f4f2;
  padding-bottom: 90px;
}

/* ── Topo com a logo ──────────────────────────── */
.perfil-topo {
  position: relative;
  text-align: center;
  padding: 30px 16px 58px;
  background: #fff;
  border-radius: 0 0 32px 32px;
}

.perfil-topo .logo {
  width: 190px !important;
  height: auto !important;
  max-width: 75% !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  display: block !important;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.12));
}

.perfil-topo .logo.logo-oculta,
.perfil-topo .logo:not([src]),
.perfil-topo .logo[src=""] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
}

/* ── Container do conteúdo ────────────────────── */
.perfil-container {
  position: relative;
  margin-top: -40px;
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* As seções são mostradas pelo JS com display:block, então o respiro vem das margens */
#viewLogado > * + *,
#viewVisitante > * + *,
.contato-loja-card > * + * {
  margin-top: 12px;
}

#viewLogado > .titulo-secao-perfil + *,
.contato-loja-card > .titulo-contato-loja + * {
  margin-top: 8px;
}

/* ── Card do usuário (sobrepõe o topo) ────────── */
.card-perfil {
  background: #fff;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 32px -18px rgba(0, 0, 0, 0.25);
}

.topo-perfil {
  display: flex;
  align-items: center;
  gap: 14px;
}

.foto-perfil {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--cor-primaria, #ff5b00), color-mix(in srgb, var(--cor-primaria, #ff5b00) 70%, #000));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 10px 20px -10px var(--cor-primaria, #ff5b00);
}

.info-perfil {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.info-perfil h2 {
  margin: 0;
  max-width: 100%;
  font-size: 18px;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-perfil p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b6b6b;
  line-height: 1.4;
}

.info-perfil p i {
  font-size: 11px;
  color: #a8a29e;
}

.selo-perfil {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
}

.btn-editar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--perfil-borda);
  background: #fff;
  color: var(--cor-primaria);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease, transform .1s ease;
}

.btn-editar:active { transform: scale(0.94); }

/* ── Título das seções ────────────────────────── */
.titulo-secao-perfil,
.titulo-contato-loja {
  font-size: 11px;
  font-weight: 800;
  color: #a8a29e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 0 6px;
}

/* ── Listas de opções ─────────────────────────── */
.acoes-perfil,
.contato-loja-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -20px rgba(0, 0, 0, 0.3);
}

/* "Fale conosco": título fora e itens num cartão branco */
.contato-loja-card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.lista-contato-loja {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -20px rgba(0, 0, 0, 0.3);
}

.item-perfil,
.contato-loja-item,
.seguranca-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: #fff;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  color: #111;
  font-family: inherit;
  transition: background .15s ease;
}

.item-perfil,
.contato-loja-item {
  border-bottom: 1px solid #f4f1ee;
}

.item-perfil:last-child,
.contato-loja-item:last-child { border-bottom: none; }

.item-perfil:active,
.contato-loja-item:active,
.seguranca-card:active { background: #faf8f6; }

/* Ícone dentro de um quadradinho suave */
.icone-acao,
.contato-loja-item > i:first-child {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex !important; /* o Font Awesome carrega depois e força inline-block */
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--perfil-suave);
  color: var(--cor-primaria);
  font-size: 16px;
}

.contato-loja-item > i.fa-whatsapp:first-child {
  background: #e9f9ef;
  font-size: 19px;
}

.fa-whatsapp { color: #25d366 !important; }

.item-perfil-texto {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-perfil-titulo {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.item-perfil-sub {
  font-size: 12px;
  color: #9a948f;
  font-weight: 400;
}

.seta {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: #f6f4f2;
  font-size: 11px;
  color: #a8a29e;
  flex-shrink: 0;
}

/* Horários e fidelidade: cartões soltos */
.seguranca-card {
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -20px rgba(0, 0, 0, 0.3);
}

/* ── Botão sair (discreto, no fim da página) ──── */
.btn-sair {
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border: 1px solid #f5d0cc;
  border-radius: 16px;
  background: #fff;
  color: #dc2626;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease;
}

.btn-sair:active { background: #fef2f2; }

/* ── Copyright ────────────────────────────────── */
.copyright-rodape {
  text-align: center;
  font-size: 12px;
  color: #b8b2ad;
  padding: 6px 0 0;
}

.copyright-rodape a {
  color: var(--cor-primaria);
  text-decoration: none;
  font-weight: 600;
}

/* ── Modo escuro ──────────────────────────────── */
html.dark body,
body.dark {
  background: #000 !important;
}

html.dark .perfil-page,
body.dark .perfil-page {
  background: #000 !important;
}

html.dark .perfil-topo,
body.dark .perfil-topo {
  background: linear-gradient(180deg, #1a1a1a 0%, #111 70%, #000 100%) !important;
}

html.dark .card-perfil,
html.dark .contato-loja-card,
html.dark .seguranca-card,
body.dark .card-perfil,
body.dark .contato-loja-card,
body.dark .seguranca-card {
  background: #17181d !important;
  box-shadow: none !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
}

html.dark .acoes-perfil,
body.dark .acoes-perfil {
  background: #17181d !important;
  box-shadow: none !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
}

html.dark .item-perfil,
html.dark .contato-loja-item,
body.dark .item-perfil,
body.dark .contato-loja-item {
  background: #17181d !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
  color: #fff !important;
}

html.dark .item-perfil-titulo,
html.dark .contato-loja-item .item-perfil-titulo,
body.dark .item-perfil-titulo,
body.dark .contato-loja-item .item-perfil-titulo {
  color: #fff !important;
}

html.dark .item-perfil-sub,
html.dark .contato-loja-item .item-perfil-sub,
body.dark .item-perfil-sub,
body.dark .contato-loja-item .item-perfil-sub {
  color: #666 !important;
}

html.dark .info-perfil h2,
body.dark .info-perfil h2 { color: #fff !important; }

html.dark .titulo-contato-loja,
body.dark .titulo-contato-loja { color: #555 !important; }

html.dark .copyright-rodape,
body.dark .copyright-rodape { color: #444 !important; }

html.dark .foto-perfil,
body.dark .foto-perfil {
  background: #2a1a1a !important;
}

html.dark .menu-bottom,
body.dark .menu-bottom {
  background: #0f0f12 !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}

/* ── Horários modal ───────────────────────────── */
.horarios-modal {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  margin-top: 4px;
}

.horario-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.horario-linha:last-child { border-bottom: none; }

.horario-hoje {
  background: rgba(255, 91, 0, 0.06);
  border-radius: 8px;
  padding: 10px 8px;
}

.horario-dia {
  font-weight: 500;
  color: #333;
}

.horario-dia em {
  font-style: normal;
  font-size: 11px;
  color: var(--cor-primaria, #ff5b00);
  font-weight: 600;
}

.horario-aberto {
  color: #2e7d32;
  font-weight: 600;
  font-size: 13px;
}

.horario-fechado {
  color: #c62828;
  font-size: 13px;
}

html.dark .horario-linha,
body.dark .horario-linha {
  border-bottom-color: rgba(255,255,255,0.07);
}

html.dark .horario-dia,
body.dark .horario-dia { color: #ccc; }

/* ── Desktop ──────────────────────────────────── */
@media (min-width: 768px) {
  .perfil-page {
    max-width: 480px;
    box-shadow: 0 0 40px rgba(0,0,0,0.12);
  }

  footer.menu-bottom {
    max-width: 480px;
  }
}
