/* ============================================
   BARREIRO RIO - IMOBILIÁRIA
   Folha de Estilos Principal
   Cores: Verde (#094136) e Branco (#ffffff)
   ============================================ */

/* Importação da fonte Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* ============================================
   VARIÁVEIS GLOBAIS
   ============================================ */
:root {
  --primary: #094136;          /* Verde escuro - cor principal */
  --primary-light: #0e6352;    /* Verde mais claro para gradientes */
  --white: #ffffff;            /* Branco */
  --gray-50: #f9fafb;          /* Cinza muito claro - fundos */
  --gray-100: #f3f4f6;         /* Cinza claro - hover */
  --gray-300: #d1d5db;         /* Cinza médio - bordas */
  --gray-500: #6b7280;         /* Cinza - textos secundários */
  --gray-700: #374151;         /* Cinza escuro - textos */
  --gray-900: #111827;         /* Quase preto - títulos */
  --scrollbar-bg: transparent;
  --scrollbar-thumb: rgba(9, 65, 54, 1);
  --scrollbar-thumb-hover: rgba(12, 85, 71, 1);
}

/* ============================================
   SCROLLBAR PERSONALIZADA (igual ao grupobarreirorio.pt)
   ============================================ */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  background: var(--white);
  padding-top: 88px;
  overflow-x: hidden; /* nunca há scroll horizontal */
}

a {
  text-decoration: none;
  color: inherit;
}

/* Container centralizado */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   HEADER (barra do topo) - fundo branco
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 12px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

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

/* Logótipo (imagem) */
.logo {
  display: flex;
  align-items: center;
}

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

/* Agrupa o seletor de idioma e o botão de contacto no header */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Seletor de idioma (globo + PT/EN/ES) */
.nav-lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-lang:hover,
.nav-lang[aria-expanded="true"] {
  background: var(--gray-100);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(9, 65, 54, 0.18);
}

.nav-lang svg {
  width: 22px;
  height: 22px;
}

/* Etiqueta PT/EN/ES escondida - no desktop mostra-se apenas o ícone do globo, tal como no site oficial */
.nav-lang-label {
  display: none;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: 1200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

.lang-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-menu button:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.lang-menu button.active {
  background: rgba(9, 65, 54, 0.08);
  color: var(--primary);
  font-weight: 700;
}

/* Botão "Contacto" no header - estilo do site de referência */
.btn-contact-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: transparent;
  color: var(--primary);
  padding: 0 24px;
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-contact-header:hover {
  background: var(--gray-100);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(9, 65, 54, 0.18);
}

/* ============================================
   HERO (secção de boas-vindas)
   ============================================ */
.hero {
  position: relative;
  color: var(--white);
  text-align: center;
  padding: 80px 0 70px;
  overflow: hidden;
  min-height: 50vh;
  display: flex;
  align-items: center;
  background: var(--primary);
}

/* Vídeo de fundo do hero */
.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Overlay com tom escuro para o texto ficar legível sobre o vídeo */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 65, 54, 0.55);
  z-index: 1;
}

/* Container do hero fica acima do overlay */
.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 32px;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero h1 span {
  background: linear-gradient(135deg, #a7d4c8, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.95;
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
  font-weight: 400;
}

/* Botão do WhatsApp */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366; /* Verde do WhatsApp */
  color: var(--white);
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:hover {
  transform: scale(1.05);
}

/* Botão para o site oficial (abaixo do WhatsApp), mesmo tamanho do botão do WhatsApp */
.btn-official-site {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--white);
  padding: 16px 36px;
  border-radius: 50px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-official-site:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}

/* Empilha o botão do WhatsApp e o do site oficial, sempre um por baixo do outro */
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ============================================
   CARROSSEL DE IMÓVEIS
   ============================================ */
.carousel-section {
  padding: 80px 0;
}

/* Wrapper do carrossel */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* Faixa que contém todos os slides */
.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

/* Cada slide individual */
.carousel-slide {
  min-width: 100%;
  color: var(--white);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 360px;
  position: relative;
}

/* Tag de "Destaque" no slide */
.carousel-slide .tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  align-self: flex-start;
}

.carousel-slide h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.carousel-slide .location {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.carousel-slide .desc {
  opacity: 0.9;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 480px;
}

.carousel-slide .details {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  border-radius: 12px;
  align-self: flex-start;
  backdrop-filter: blur(4px);
}

.carousel-slide .details span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.carousel-slide .price {
  font-size: 2rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 24px;
  border-radius: 12px;
  align-self: flex-start;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Botões de navegação (anterior / próximo) */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
  z-index: 2;
}

.carousel-btn:hover {
  background: var(--gray-100);
}

.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

/* Indicadores (bolinhas) do carrossel */
.dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gray-300);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.dot.active {
  background: var(--primary);
  width: 32px;
  border-radius: 6px;
}

/* ============================================
   SECÇÃO DE PROCURA DE IMÓVEL
   ============================================ */
.search-section {
  background: var(--white);
  padding: 80px 0;
}

.search-section h2 {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}

.search-section > .container > p {
  text-align: center;
  color: var(--gray-500);
  font-size: 1.1rem;
  margin-bottom: 44px;
}

/* Cartão do formulário de procura
   Ocupa toda a largura do container para alinhar com o carrossel */
.search-card {
  width: 100%;
  margin: 0 auto;
  background: var(--gray-50);
  padding: 48px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-100);
}

.search-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.search-card input,
.search-card textarea {
  padding: 16px 20px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  background: var(--white);
  color: var(--gray-900);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-card input:focus,
.search-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 65, 54, 0.1);
}

.search-card textarea {
  min-height: 110px;
  resize: vertical;
}

/* ============================================
   DROPDOWN CUSTOMIZADO (estilo grupobarreirorio.pt)
   ============================================ */
.dropdown {
  position: relative;
  width: 100%;
}

.dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  color: var(--gray-900);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dropdown-toggle .dropdown-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  flex: 0 0 auto;
  margin-left: 8px;
  color: var(--gray-500);
  transition: transform 0.25s;
}

.dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-toggle:hover {
  border-color: var(--primary);
}

.dropdown-toggle:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 65, 54, 0.1);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(9, 65, 54, 0.18);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-height: 240px;
  overflow-y: auto;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-900);
  transition: background 0.15s, color 0.15s;
}

.dropdown-menu li:hover {
  background: rgba(9, 65, 54, 0.08);
  color: var(--primary);
}

.dropdown-menu li.selected {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.dropdown-menu li.selected:hover {
  background: var(--primary-light);
}

/* Variante estreita usada no seletor de indicativo de telefone */
.dropdown-tel {
  flex: 0 0 auto;
  width: 118px;
}

.dropdown-tel .dropdown-toggle {
  border-radius: 8px 0 0 8px;
  border-right: none;
  padding-right: 10px;
}

.dropdown-tel .dropdown-menu {
  min-width: 150px;
}

/* Botões de ação do formulário de procura */
.search-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}

.btn-search {
  background: var(--white);
  color: var(--primary);
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-search:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-search:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Caixa de resultado da procura */
.search-resultado {
  margin-top: 8px;
  padding: 18px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.search-resultado p {
  margin: 0 0 4px;
  font-weight: 600;
}

.search-resultado.found {
  background: rgba(9, 65, 54, 0.08);
  color: var(--primary);
  border: 1px solid rgba(9, 65, 54, 0.2);
}

.search-resultado.notfound {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

/* Lista de imóveis encontrados */
.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.search-result-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--gray-100);
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.2s;
}

.search-result-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.search-result-item .sri-title {
  color: var(--gray-900);
  font-weight: 700;
  flex: 1 1 100%;
}

.search-result-item .sri-location {
  color: var(--gray-500);
  font-weight: 400;
}

.search-result-item .sri-price {
  color: var(--primary);
  font-weight: 700;
}

/* Campo de telefone com seletor de indicativo de país */
.phone-input-wrap {
  display: flex;
  gap: 0;
}

.phone-input-wrap input[type="tel"] {
  flex: 1 1 auto;
  border-radius: 0 8px 8px 0;
  min-width: 0;
}

/* Botão de envio do formulário */
.btn-submit {
  background: var(--primary);
  color: var(--white);
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: var(--primary-light);
}

/* Linha de informações de contacto (morada + telefone)
   Alinhada com as bordas do retângulo do formulário de procura */
.info-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray-700);
  font-size: 1rem;
  background: var(--white);
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--gray-100);
  transition: transform 0.2s, box-shadow 0.2s;
  flex: 1 1 0;
}

.info-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

/* ============================================
   FOOTER (rodapé)
   ============================================ */
footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 28px 0;
  font-size: 0.9rem;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablet - título do hero com quebra de linha precisa de menos tamanho */
@media (max-width: 900px) {
  .hero h1 { font-size: 2rem; }
}

/* Telemóvel */
@media (max-width: 600px) {
  .hero { padding: 60px 0 50px; min-height: 55vh; }
  .hero h1 { font-size: 1.7rem; margin-bottom: 24px; }

  /* Botões do hero mais compactos para não transbordar */
  .btn-whatsapp,
  .btn-official-site {
    padding: 12px 22px;
    font-size: 0.95rem;
    max-width: 100%;
    white-space: normal;
  }

  .carousel-slide { padding: 32px 24px; min-height: 280px; }
  .carousel-slide h2 { font-size: 1.6rem; }
  .carousel-slide .details { flex-wrap: wrap; gap: 12px; }
  .carousel-slide .price { font-size: 1.5rem; }
  .info-row { gap: 10px; }
  .info-item { flex: 1 1 100%; justify-content: center; padding: 12px 16px; flex-wrap: wrap; }
  .carousel-btn { width: 40px; height: 40px; }
  .search-card { padding: 28px; }
  .search-section { padding: 60px 0; }
  .search-section h2 { font-size: 1.8rem; }
  .search-grid { grid-template-columns: 1fr; }

  /* Campos do formulário nunca ultrapassam o ecrã */
  .search-grid > * { min-width: 0; }
  .search-card input,
  .search-card textarea { width: 100%; }
  .phone-input-wrap .dropdown-tel { width: 108px; flex: 0 0 108px; }

  .search-actions { grid-template-columns: 1fr; }
  .dropdown-menu { max-height: 200px; }

  /* Header cabe sempre no ecrã */
  .logo-img { height: 40px; max-width: 45vw; object-fit: contain; }
  .nav-actions { gap: 8px; }
  .btn-contact-header { height: 42px; padding: 0 16px; font-size: 0.9rem; }

  body { padding-top: 68px; }
  header { padding: 10px 0; }
}

/* Ecrãs muito estreitos - header cabe sem cortes */
@media (max-width: 380px) {
  .logo-img { height: 34px; }
  .nav-lang { width: 38px; height: 38px; }
  .nav-lang svg { width: 19px; height: 19px; }
  .btn-contact-header { height: 38px; padding: 0 14px; font-size: 0.85rem; }
  body { padding-top: 62px; }
}

/* ============================================
   MENSAGEM DE SUCESSO (formulário)
   ============================================ */
.form-success {
  background: var(--primary);
  color: var(--white);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

/* ============================================
   MODAL DE ESCOLHA DO WHATSAPP (App / Web)
   ============================================ */
.wa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.wa-popup {
  background: var(--white);
  border-radius: 1.25rem;
  padding: 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.wa-popup-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.3rem;
}

.wa-popup-text {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}

.wa-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border: none;
}

.wa-btn:active {
  transform: scale(0.97);
}

.wa-btn-app {
  background: #25D366;
  color: var(--white);
}

.wa-btn-app:hover {
  background: #1ebe5a;
}

.wa-btn-web {
  background: var(--gray-100);
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
}

.wa-btn-web:hover {
  background: var(--gray-50);
}

.wa-popup-close {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem;
}
