html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

:root {
  --cor-inicio: #1e1e1e;
  --cor-sobre: #2c2c2c;
  --cor-servicos: #1a1a1a;
  --cor-orcamento: #2e2e2e;
  --cor-contato: #242424;
  --cor-primaria: #1f1f1f;
  --cor-secundaria: #333333;
  --cor-fundo: #121212;
  --cor-texto: #f0f0f0;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: var(--cor-fundo);
  color: var(--cor-texto);
  width: 100%;
  max-width: 100vw;
}

header {
  background-color: var(--cor-primaria);
  color: white;
  padding: 1rem 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo img {
  height: 40px;
  width: auto;
}

/* Menu Desktop */
.nav-desktop {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.nav-desktop a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-desktop a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* Menu Hamburger */
.menu-hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
  flex-shrink: 0;
}

.menu-hamburger span {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

/* Animação do hamburger quando ativo */
.menu-hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.menu-hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Menu Mobile */
.nav-mobile {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100vh;
  width: 280px;
  max-width: 80vw;
  background-color: var(--cor-primaria);
  display: flex;
  flex-direction: column;
  padding-top: 80px;
  transition: right 0.3s ease;
  z-index: 999;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.nav-mobile.active {
  right: 0;
}

.nav-mobile a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease;
}

.nav-mobile a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Overlay para fechar o menu */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Media Queries */
@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }

  .menu-hamburger {
    display: flex;
  }

  header {
    padding: 1rem 3%;
  }

  .logo strong {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .nav-mobile {
    width: 100%;
    right: -100%;
  }

  .nav-mobile.active {
    right: 0;
  }

  .logo strong {
    display: none;
  }

  header {
    padding: 1rem 2%;
  }
}

.banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 600px;
  background: url('imagens/banner.jpg') no-repeat center center;
  background-size: cover;
  padding-right: 5%;
  color: white;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.banner-texto {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  font-size: 1.8rem;
  font-weight: bold;
  text-align: right;
  word-wrap: break-word;
}

@media (max-width: 768px) {
  .banner {
    justify-content: center;
    padding: 2rem;
    min-height: 500px;
  }

  .banner-texto {
    font-size: 1.4rem;
    text-align: center;
    max-width: 90%;
    padding: 1.5rem;
  }
}

section {
  padding: 3rem 2rem;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

#inicio {
  background-color: var(--cor-inicio);
}

#sobre {
  background-color: var(--cor-sobre);
}

#servicos {
  background-color: var(--cor-servicos);
}

#orcamento {
  background-color: var(--cor-orcamento);
}

#contato {
  background-color: var(--cor-contato);
}

.sobre-nos h2,
.servicos h2,
.orcamento h2,
.contato h2 {
  color: white;
  margin-bottom: 1rem;
}

.sobre-nos p,
.contato p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.6;
}

.galeria {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  width: 100%;
}

.galeria img {
  width: 400px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeria img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

/* Formulário e Validação */
form {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

form input,
form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background-color: #fff;
  max-width: 100%;
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(0, 64, 128, 0.1);
}

/* Estados de validação */
form input.valid,
form textarea.valid {
  border-color: #28a745;
  background-color: #f8fff9;
}

form input.invalid,
form textarea.invalid {
  border-color: #dc3545;
  background-color: #fff8f8;
}

/* Mensagens de erro */
.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.error-message.show {
  display: block;
}

/* Mensagens de sucesso */
.success-message {
  color: #28a745;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.success-message.show {
  display: block;
}

/* Ícones de validação */
.form-group::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-group.valid::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2328a745' viewBox='0 0 16 16'%3E%3Cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3E%3C/svg%3E");
  opacity: 1;
}

.form-group.invalid::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z'/%3E%3C/svg%3E");
  opacity: 1;
}

/* Ajuste para textarea */
.form-group.textarea-group::after {
  top: 20px;
  transform: none;
}

/* Botão do formulário */
form button {
  background-color: var(--cor-primaria);
  color: white;
  padding: 0.875rem 2.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
}

form button:hover:not(:disabled) {
  background-color: #003366;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 64, 128, 0.3);
}

form button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading spinner */
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.loading-spinner.show {
  display: block;
}

/* Notificação de sucesso */
.form-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  z-index: 1001;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-notification.success {
  background-color: #28a745;
}

.form-notification.error {
  background-color: #dc3545;
}

.form-notification.show {
  transform: translateX(0);
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Ajustes mobile */
@media (max-width: 768px) {
  .form-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }

  .form-notification.show {
    transform: translateY(0);
  }

  .galeria img {
    width: 350px;
  }
  
  section {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .galeria img {
    width: 280px;
  }
  
  section {
    padding: 1.5rem 1rem;
  }
}

.whatsapp-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  max-width: calc(100vw - 40px);
}

.whatsapp-fixed a {
  display: flex;
  align-items: center;
  background-color: #25D366;
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  transition: background-color 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  max-width: 100%;
}

.whatsapp-fixed a:hover {
  background-color: #128C7E;
}

.whatsapp-fixed img {
  width: 20px;
  height: 20px;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

/* Ajustes para WhatsApp mobile */
@media (max-width: 480px) {
  .whatsapp-fixed {
    bottom: 15px;
    right: 15px;
    max-width: calc(100vw - 30px);
  }
  
  .whatsapp-fixed a {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

/* Seção de contato com iframe */
#contato > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
}

#contato > div > div:first-child {
  flex: 3;
  min-width: 300px;
  max-width: 100%;
}

#contato > div > div:last-child {
  flex: 1;
  min-width: 200px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.4;
}

iframe {
  width: 100%;
  height: 300px;
  border: 0;
  margin-top: 1rem;
  max-width: 100%;
}

@media (max-width: 768px) {
  #contato > div > div:first-child {
    min-width: 100%;
  }
  
  #contato > div > div:last-child {
    min-width: 100%;
    text-align: center;
  }
  
  iframe {
    height: 250px;
  }
}

footer {
  background-color: var(--cor-secundaria);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

/* Ícone de envio no botão */
form button svg {
  width: 18px;
  height: 18px;
  fill: white;
  flex-shrink: 0;
}

/* Animação dos ícones de validação */
.form-group.valid::after,
.form-group.invalid::after {
  animation: popIcon 0.3s ease;
}

@keyframes popIcon {
  0% { transform: scale(0.8) translateY(-50%); opacity: 0; }
  50% { transform: scale(1.2) translateY(-50%); opacity: 1; }
  100% { transform: scale(1) translateY(-50%); opacity: 1; }
}

/* WhatsApp pulse */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-fixed a {
  animation: pulse 2.5s infinite;
}

.projeto {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 400px;
  width: 100%;
}

.titulo-projeto {
  color: white;
  font-weight: bold;
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  text-align: center;
}

.contato-com-banner {
  background: url('imagens/banner_whats.jpg') no-repeat center center;
  background-size: cover;
}