/* ==========================================================================
   1. RESET, LAYOUT BASE & VARIÁVEIS GLOBAIS
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
  color: var(--text-primary, #1e293b);
  background-color: var(--bg-page, #f8fafc);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  overflow-wrap: break-word;
}

.section-padding {
  padding-top: 80px;
  padding-bottom: 80px;
}

section[id],
div[id],
header[id] {
  scroll-margin-top: 100px;
}

/* ==========================================================================
   2. HEADER FIXO
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 70px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  text-decoration: none;
  color: var(--text-primary, #1e293b);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--purple, #6b4c82);
}

/* ==========================================================================
   3. BOTÕES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--purple, #6b4c82);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 76, 130, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(107, 76, 130, 0.35);
  background-color: #5d4172;
}

.btn-secondary {
  background-color: #fff;
  color: var(--text-primary, #1e293b);
  border: 1px solid var(--border, #e2e8f0);
}

.btn-secondary:hover {
  background-color: #f8fafc;
}

.btn-light {
  background: #fff;
  color: var(--purple, #6b4c82);
  font-weight: 700;
}

.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero {
  padding: 60px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: var(--purple-light, #f4f0f8);
  color: var(--purple, #6b4c82);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.tag-pill .dot {
  width: 8px;
  height: 8px;
  background-color: var(--purple, #6b4c82);
  border-radius: 50%;
}

.hero-text h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  word-wrap: break-word;
}

.hero-text h1 em {
  font-family: var(--font-serif, Georgia, serif);
  font-style: italic;
  font-weight: 400;
  color: var(--purple, #6b4c82);
}

.hero-text p {
  font-size: 17px;
  color: var(--text-muted, #64748b);
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.hero-card .ph-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border: 4px solid #fff;
  height: 420px;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(250, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 16px;
  border-radius: 16px;
}

.card-caption b {
  display: block;
  font-size: 15px;
}

.card-caption span {
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

/* ==========================================================================
   5. CABEÇALHO DAS SEÇÕES
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.sub-title {
  color: var(--purple, #6b4c82);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.section-header h2 {
  font-size: 32px;
  margin-top: 6px;
}

.section-header .lead {
  color: var(--text-muted, #64748b);
  margin-top: 8px;
}

/* ==========================================================================
   6. BENTO GRID DE ESPECIALIDADES
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.flip-card {
  background-color: transparent;
  min-height: 280px;
  height: auto;
  perspective: 1000px;
}

.card-big {
  grid-column: span 2;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: relative;
  width: 100%;
  min-height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  padding: 28px 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.flip-card-front {
  background-color: var(--bg-white, #ffffff);
}

.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #faf8fc;
  transform: rotateY(180deg);
  border-color: rgba(107, 76, 130, 0.2);
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.card-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--purple-light, #f4f0f8);
  color: var(--purple, #6b4c82);
  padding: 4px 12px;
  border-radius: 99px;
}

.flip-card-front h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin-bottom: 12px;
}

.flip-card-front p {
  color: var(--text-muted, #64748b);
  font-size: 15px;
  line-height: 1.6;
}

.flip-card-back h3 {
  font-size: 18px;
  color: var(--purple, #6b4c82);
  margin-bottom: 12px;
  font-weight: 700;
}

.flip-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flip-list li {
  font-size: 13px;
  color: var(--text-primary, #1e293b);
  line-height: 1.5;
  margin-bottom: 8px;
}

.flip-list li strong {
  color: var(--purple, #6b4c82);
}

.btn-flip-trigger {
  background: none;
  border: none;
  color: var(--purple, #6b4c82);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.flip-back-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 10px;
  width: 100%;
}

.btn-card-action {
  background-color: var(--purple, #6b4c82);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 99px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-card-action:hover {
  opacity: 0.9;
}

.btn-flip-close {
  background: none;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-flip-close:hover {
  color: var(--text-primary, #1e293b);
}

/* ==========================================================================
   7. SEÇÃO INSTITUCIONAL / NOSSO PROPÓSITO (DARK)
   ========================================================================== */
.section-dark {
  background-color: var(--dark-bg, #1a1823);
  color: #fff;
  padding: 90px 0;
  margin-top: 40px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.sub-title-light {
  color: var(--gold, #d4af37);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.about-text h2 {
  font-size: 34px;
  margin-top: 8px;
  margin-bottom: 16px;
  line-height: 1.25;
}

.about-text p {
  color: #a0aec0;
  font-size: 17px;
}

.feats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  border-radius: 16px;
}

.feat-card b {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: #fff;
}

.feat-card p {
  font-size: 13px;
  color: #a0aec0;
}

/* ==========================================================================
   8. GRELHA DA EQUIPE / CORPO CLÍNICO
   ========================================================================== */
.team-grid,
.equipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.team-card,
.equipe-card {
  background-color: transparent;
  height: 520px;
  perspective: 1000px;
}

.team-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.team-card.is-flipped .team-card-inner {
  transform: rotateY(180deg);
}

.team-front,
.team-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-white, #ffffff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
}

.team-front {
  z-index: 2;
}

.team-back {
  transform: rotateY(180deg);
  padding: 24px;
  background: linear-gradient(135deg, #faf8fc 0%, #ffffff 100%);
  overflow: hidden;
}

.team-img-wrapper {
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.team-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.4s ease;
}

.team-card:hover .team-img-wrapper img {
  transform: scale(1.04);
}

.team-info {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-grow: 1;
}

.team-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple, #6b4c82);
  background-color: rgba(107, 76, 130, 0.1);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.team-info h3 {
  font-size: 18px;
  color: var(--text-primary, #1e293b);
  margin-bottom: 2px;
  font-weight: 700;
}

.team-role {
  font-size: 13px;
  color: var(--text-muted, #64748b);
  margin-bottom: 2px;
}

.team-crp {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.btn-team-flip {
  background: none;
  border: none;
  color: var(--purple, #6b4c82);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Área interna do verso com rolagem --- */
.team-back-content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin-bottom: 12px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.team-back-content::-webkit-scrollbar {
  width: 4px;
}

.team-back-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.team-back-content::-webkit-scrollbar-thumb {
  background: var(--purple, #6b4c82);
  border-radius: 10px;
}

.team-bio {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-top: 4px;
  margin-bottom: 14px;
}

.team-courses h4 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #1e293b;
  letter-spacing: 0.03em;
}

.team-courses ul,
.team-back-content ul {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

.team-courses li,
.team-back-content ul li {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.team-back-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.btn-team-action {
  background-color: var(--purple, #6b4c82);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: opacity 0.2s;
}

.btn-team-action:hover {
  opacity: 0.9;
}

.btn-team-close {
  background: transparent !important;
  border: none !important;
  color: #718096 !important;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
}

/* ==========================================================================
   9. ESPAÇO / CLÍNICA & GALERIA LIGHTBOX
   ========================================================================== */
.clinic-about-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clinic-flip-card {
  background-color: transparent;
  perspective: 1000px;
  min-height: 480px;
}

.clinic-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.clinic-flip-card.is-flipped .clinic-flip-inner {
  transform: rotateY(180deg);
}

.clinic-card-front,
.clinic-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.clinic-card-back {
  transform: rotateY(180deg);
}

.clinic-img-wrapper {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
}

.clinic-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.clinic-img-wrapper:hover .clinic-img {
  transform: scale(1.03);
}

.clinic-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.gallery-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border: 1px solid #e5e7eb;
}

.gallery-thumb:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

.gallery-instruction {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}

.btn-flip {
  background: #6b21a8;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  align-self: flex-start;
  transition: background 0.3s ease;
}

.btn-flip:hover {
  opacity: 0.9;
}

.back-btn {
  background: #4b5563;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin: auto;
  display: block;
  width: 80%;
  text-align: center;
  color: #ffffff;
  padding: 12px 0;
  font-size: 1rem;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* ==========================================================================
   10. PASSO A PASSO, LOCALIZAÇÃO, FAQ, CTA E FOOTER
   ========================================================================== */
.section-sand {
  background-color: var(--sand-bg, #fdfbf7);
  padding: 80px 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step-card {
  background: #fff;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.step-number,
.step-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--purple, #6b4c82);
  margin-bottom: 12px;
  display: block;
}

.step-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

.location-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.location-info h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: #2d2342;
}

.location-desc {
  color: #6b7280;
  margin-bottom: 24px;
}

.location-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.location-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.location-icon {
  font-size: 1.4rem;
  background: #f4f0f8;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.location-item strong {
  display: block;
  color: #2d2342;
  font-size: 1rem;
}

.location-item p {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 2px 0 0 0;
}

.btn-location {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--purple, #6b4c82);
  color: #ffffff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-location:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.location-map {
  width: 100%;
  height: 380px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.split-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
}

.quote-card {
  background: var(--purple-light, #f4f0f8);
  padding: 30px;
  border-radius: 20px;
  margin-top: 20px;
  border-left: 4px solid var(--purple, #6b4c82);
}

.quote-card p {
  font-style: italic;
  font-size: 16px;
  margin-bottom: 16px;
}

.quote-card footer b {
  display: block;
  font-size: 14px;
}

.quote-card footer span {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 16px 20px;
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.faq-item p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted, #64748b);
}

.cta-banner {
  background: linear-gradient(135deg, var(--purple, #6b4c82) 0%, #4a325d 100%);
  color: #fff;
  padding: 60px 40px;
  border-radius: 28px;
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 30px;
  margin-bottom: 12px;
}

.cta-content p {
  opacity: 0.9;
  margin-bottom: 24px;
  font-size: 16px;
}

.footer {
  background: #fff;
  border-top: 1px solid var(--border, #e2e8f0);
  padding: 30px 0;
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand b {
  color: var(--text-primary, #1e293b);
  font-size: 15px;
}

.copy {
  margin-top: 4px;
  font-size: 12px;
}

/* ==========================================================================
   11. ANIMAÇÕES SCROLL REVEAL
   ========================================================================== */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.reveal-left.active,
.reveal-right.active,
.reveal-up.active {
  opacity: 1;
  transform: translate(0, 0);
}

/* ==========================================================================
   12. MEDIA QUERIES (RESPONSIVIDADE)
   ========================================================================== */

/* Tablet (até 992px) */
@media (max-width: 992px) {
  .team-grid,
  .equipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Menor (até 900px) */
@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .split-grid,
  .bento-grid,
  .steps-grid,
  .location-container {
    grid-template-columns: 1fr;
  }

  .card-big {
    grid-column: span 1;
  }

  .nav {
    display: none;
  }

  /* Localização compacta e alinhada */
  .location-container {
    padding: 28px 20px;
    gap: 28px;
    border-radius: 20px;
  }

  .location-map {
    height: 300px;
    border-radius: 16px;
  }

  .location-info h2 {
    font-size: 1.75rem;
  }

  .location-item {
    gap: 12px;
  }

  .location-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  .btn-location {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   MOBILE (até 768px) — Modal bottom-sheet para equipe
   ============================================================ */
@media (max-width: 768px) {
  /* --- Carrossel horizontal do time --- */
  .team-grid,
  .equipe-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 10px 16px 20px 16px !important;
    margin: 0 -16px !important;
    width: calc(100% + 32px) !important;
  }

  /* --- Card do time: SEM 3D, só a frente visível --- */
  .team-card,
  .equipe-card {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    min-width: 85% !important;
    scroll-snap-align: center;
    height: 520px !important;
    min-height: 520px !important;
    max-height: 520px !important;
    perspective: none !important;
    -webkit-perspective: none !important;
  }

  .team-card-inner {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    -webkit-transform: none !important;
    transform-style: flat !important;
    -webkit-transform-style: flat !important;
  }

  /* Frente fica visível normalmente */
  .team-front {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    -webkit-transform: none !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Verso nem existe no mobile (é o modal que faz o papel) */
  .team-back {
    display: none !important;
  }

  /* --- Especialidades (flip-card) continua funcionando em 3D normal --- */
  .flip-card {
    perspective: 1000px;
  }

  /* --- Clínica (galeria) continua com 3D também --- */
  .clinic-flip-card {
    perspective: 1000px;
  }
}

/* Smartphones Menores (até 640px) */
@media (max-width: 640px) {
  .header-inner {
    padding: 10px 16px;
  }

  .logo img {
    height: 52px;
  }

  .header .btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .hero {
    padding: 30px 0;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 15px;
    white-space: normal;
    word-break: break-word;
  }

  .flip-card {
    min-height: 320px;
  }

  .flip-card-front,
  .flip-card-back {
    padding: 24px 20px;
  }

  .flip-back-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .btn-card-action,
  .btn-flip-close {
    width: 100%;
    text-align: center;
  }

  .feats-grid {
    grid-template-columns: 1fr;
  }

  .cta-banner {
    padding: 40px 20px;
  }
}

/* ============================================================
   MODAL BOTTOM-SHEET DA EQUIPE (mobile)
   ============================================================ */
.team-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  /* Animação de fade do fundo escuro */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.team-modal.is-open {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
}

/* Quando o usuário fecha, aplicamos essa classe temporária */
.team-modal.is-closing {
  opacity: 0;
}

.team-modal.is-closing .team-modal-content {
  transform: translateY(100%);
}

.team-modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 90vh;
  max-height: 90vh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  /* ESSENCIAL: transição de saída */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.team-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CORPO DO MODAL — scroll nativo com altura controlada */
.team-modal-body {
  flex: 1 1 auto;
  min-height: 0;              /* ESSENCIAL: permite o filho encolher e rolar */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  /* scrollbar bonitinha */
  scrollbar-width: thin;
  scrollbar-color: #6b4c82 #f1f1f1;
}

.team-modal-body::-webkit-scrollbar {
  width: 4px;
}
.team-modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.team-modal-body::-webkit-scrollbar-thumb {
  background: #6b4c82;
  border-radius: 10px;
}

/* Quando a modal está aberta, bloqueia scroll do body por trás */
body.team-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  /* top é definido via JS, não via CSS */
}

/* No desktop, esconde a modal (usa o flip normal) */
@media (min-width: 769px) {
  .team-modal { display: none !important; }
}

/* Reforço extra: impede iOS Safari de transformar CRP em link azul */
.team-info a,
.team-crp a,
.team-role a {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
  cursor: default;
}