.contact-section {
  position: relative;
  padding: 200px 20px;
  color: var(--cararra);
  overflow: hidden;
  background-color: white;
}

/* Conteúdo acima do background */
.contact-container {
  position: relative;
  z-index: 2;
  max-width: 1200px; /* constrain content */
  margin: 0 auto;
}

#contact-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* atrás do conteúdo */
}

@keyframes glowShift {
  0% {
    opacity: 0.1;
    background-position: 0 0;
  }

  100% {
    opacity: 0.3;
    background-position: 100% 100%;
  }
}

.contact-section h2 {
  font-size: 3rem;
  margin-bottom: 50px;
  text-align: center;
  background: linear-gradient(90deg, var(--pomegranate), var(--dtim-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contact-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* Cards area: responsive grid */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)); /* stable 2x2 */
  gap: 25px; /* espaço entre os cards */
  flex: 1 1 480px;
  min-width: 0;
  max-width: 900px; /* ajusta conforme necessidade */
  margin: 0 auto;
}

/* JS-driven force: when .stack-cards is present ensure single column */
.contact-cards.stack-cards {
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

/* Force single-column on narrower tablets/large phones to avoid 2x2 being shown */
@media (max-width: 992px) {
  .contact-cards {
    grid-template-columns: 1fr !important;
    gap: 16px;
    width: 100%;
    max-width: 820px;
  }
}

/* Fail-safe: force single column up to 1024px to avoid 2x2 on many mobile/tablet devices */
@media (max-width: 1024px) {
  .contact-section .contact-wrapper .contact-cards,
  .contact-section .contact-wrapper .contact-cards.stack-cards {
    grid-template-columns: 1fr !important;
    grid-auto-flow: row !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 820px !important;
  }
}

/* Improved Contact Card Visuals */
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 16px;
  padding: 18px 20px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
  position: relative;
  overflow: visible;
  background: linear-gradient(180deg,
    rgba(31,43,59,0.8), /* var(--mirage) tint */
    rgba(31,43,59,0.97));
  border: 1px solid rgba(31,43,59,0.14);
  box-shadow: 0 10px 30px rgba(31,43,59,0.12);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(31,43,59,0.18);
}

.contact-card:hover::before {
  width: 10px;
}

/* Icon: layered circle with highlight ring */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(249,79,27,0.95), rgba(252,188,116,0.95));
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 6px 18px rgba(239,54,45,0.18), inset 0 -6px 10px rgba(0,0,0,0.06);
  transform: translateZ(0);
}

/* inner white badge for contrast */
.icon-circle i {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  color: var(--pomegranate);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(31,43,59,0.06);
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 6px; /* space from accent */
}

.contact-info h3 {
  font-size: 1.1rem;
  color: var(--cararra); /* light text on mirage background */
  margin: 0 0 6px 0;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.contact-info p {
  margin: 0;
  color: rgba(244,243,240,0.9); /* softer light text */
  font-size: 0.98rem;
  line-height: 1.45;
}

/* subtle divider for address lines when needed */
.contact-info p + p {
  margin-top: 6px;
  opacity: 0.95;
}

/* Make link styles legible on the mirage cards */
.contact-card a {
  color: var(--macaroni-and-cheese);
  text-decoration: none;
  font-weight: 600;
}

.contact-card a:hover {
  text-decoration: underline;
  color: var(--pomegranate);
}

/* Mapa à direita - make flexible and remove hard min-width */
.map-container {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
  max-width: 1200px; /* wider map */
  margin: 28px auto 0 auto;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  max-width: 100%;
  border-radius: 20px;
  transition: transform 0.4s;
}

.map-container iframe:hover {
  transform: scale(1.02);
}

/* Círculos animados no fundo */
.contact-section::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: linear-gradient(to right, #f73222, #ed6b13);
  top: -100px;
  left: -100px;
  animation: float 10s linear infinite;
  z-index: 1;
  opacity: 0.4;
}

.contact-section::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(to right, #f73222, #ed6b13);
  bottom: -80px;
  right: -80px;
  animation: float2 12s linear infinite;
  z-index: 2;
  opacity: 0.4;

}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(30px) rotate(180deg);
  }

  100% {
    transform: translateY(0) rotate(360deg);
  }
}

@keyframes float2 {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(-180deg);
  }

  100% {
    transform: translateY(0) rotate(-360deg);
  }
}

/* Responsividade */
@media (max-width: 900px) {
  .contact-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 0 16px;
  }

  .contact-cards {
    grid-template-columns: 1fr; /* single column for mobile/tablet widths */
    gap: 18px;
    max-width: 720px;
    width: 100%;
  }

  .map-container iframe {
    min-height: 420px;
  }
}

@media (max-width: 768px) {
  .contact-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .icon-circle i {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 0.95rem;
  }

  .contact-info h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }

  .contact-info p {
    font-size: 1rem;
  }

  .map-container iframe {
    min-height: 380px;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .contact-section {
    padding: 120px 12px 40px; /* reduce top padding on small screens */
  }

  .contact-wrapper {
    padding: 0 12px 24px 12px;
  }

  .contact-cards {
    gap: 12px;
  }

  .contact-card {
    flex-direction: column; /* stack icon above text on very small screens */
    align-items: center;
    text-align: center;
    padding: 12px;
  }

  .contact-card::before { left: 10px; top: 10px; bottom: auto; height: 6px; width: 40px; right: 10px; border-radius: 8px; transform: none; }

  .icon-circle { margin-bottom: 10px; }

  .contact-info { margin-left: 0; }
}
