/* --- VARIÁVEIS E RESET BÁSICO --- */
:root {
    --primary-color: #0056b3;
    /* Azul principal para CTAs */
    --secondary-color: #333;
    /* Cor do texto principal */
    --light-bg: #f4f4f9;
    /* Fundo claro */
    --white: #ffffff;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    color: var(--secondary-color);
    background-color: var(--white);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    flex-wrap: wrap;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

/* --- HEADER / NAVEGAÇÃO --- */
header {
    background: white;
    color: var(--secondary-color);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #5C271C;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 20px;
    transition: color 0.3s;
    color: black;
}

nav ul li a:hover {

    color: #5C271C;
}

.cta-button {
    background: #a72828;
    /* Verde para CTA secundário */
    color: var(--white);
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #1e7e34;
}

/* --- HERO SECTION E PESQUISA --- */
.hero {
    background: #943E2E;
    height: 200px;
    /* Altura definida para destaque */
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
    position: relative;
    z-index: 3;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* Sobreposição escura para o texto ser legível */
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* BARRA DE PESQUISA */
.search-bar {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#property-search {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    align-items: flex-end;
}

.search-group {
    flex-grow: 1;
    min-width: 150px;
    text-align: left;
}

/*
.search-group label {
    display: block;
    font-size: 0.85em;
    margin-bottom: 5px;
    color: var(--secondary-color);
    font-weight: bold;


.search-group select,
.search-group input[type="text"],
.search-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
}*/

.location-input {
    flex-grow: 2;
    /* Dá mais espaço para a localização */
}

.price-range input {
    width: calc(50% - 5px);
    display: inline-block;
}

.search-button {
    background: #943E2E;
    color: var(--white);
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.search-button:hover {
    background: #5C271C;
}

/* --- IMÓVEIS EM DESTAQUE --- */
.featured-properties {
    padding: 60px 0;
    background-color: var(--light-bg);
    text-align: center;
    flex-wrap: wrap;
}

.featured-properties h2 {
    margin-bottom: 40px;
    font-size: 2em;
}

.property-grid {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Cor de fundo especial para o card de destaque */
.property-card.card-destaque-bg {
    background-color: #FFF9F2;
    border: 1px solid #E3D3C8;
    /* Borda cor de areia */
    /* Uma borda fina que lembra o tom Atriumstar */
    box-shadow: 0 4px 15px rgba(93, 43, 26, 0.1);
    /* Uma sombra com o tom da marca */
}

/* Opcional: mudar a cor do texto do título apenas nos destaques */
.card-destaque-bg h3 {
    color: #5d2b1a;
}

.property-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;

    /* MUDANÇA PARA 3 POR LINHA */
    flex: 0 1 calc(33.33% - 17px);
    /* 33.33% menos a distribuição do gap de 25px */
    max-width: 400px;
    /* Garante que os cartões não fiquem muito grandes em ecrãs vastos */
    /* FIM DA MUDANÇA */

    transition: transform 0.3s;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.property-card img {
    width: 100%;
    /* Ocupa a largura total do card */
    height: 200px;
    /* Define uma altura padrão para todos os cards */
    object-fit: cover;
    /* Garante que a foto não fique esticada */
    display: block;
}

.card-content {
    padding: 15px;
}

.card-content h3 {
    font-size: 1.3em;
    margin-bottom: 8px;
}

.price {
    color: #af5353;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.location {
    color: #403f3f;
    margin-bottom: 15px;
}

.location2 {
    color: #1f0404;
    margin-bottom: 15px;
    font-size: 8px;
}

.specs span {
    display: inline-block;
    margin-right: 15px;
    font-size: 0.9em;
    color: #555;
}

.view-details {
    display: block;
    text-align: center;
    background: #5C271C;
    color: var(--white);
    padding: 10px;
    margin-top: 10px;
    border-radius: 0 0 8px 8px;
    font-weight: bold;
}

/* --- RODAPÉ --- */
footer {
    background: #5C271C;
    color: var(--light-bg);
    padding: 25px 0;
    text-align: center;

}

footer .container {
    display: flex;
    justify-content: center;
    align-items: center;

}

.social-links a {
    /*color: var(--light-bg);*/
    color: #5C271C;
    font-size: 1.2em;
    margin: 0 10px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* --- RESPONSIVIDADE BÁSICA --- */
@media (max-width: 900px) {
    .property-grid {
        flex-direction: column;
        align-items: center;
    }

    .property-card {
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        padding: 10px 0;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }

    .cta-button {
        margin-top: 10px;
    }

    .hero {
        height: 550px;
    }

    .search-bar {
        padding: 15px;
    }

    #property-search {
        flex-direction: column;
        align-items: stretch;
    }

    /*.search-group {
        min-width: 100%;
    }*/

    .search-button {
        width: 100%;
    }

    footer .container {
        flex-direction: column;
    }

    .social-links {
        margin-top: 15px;
    }
}


.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Divide em 2 colunas iguais */
    gap: 20px;
}

.main-img {
    width: 100%;
    border-radius: 5px;
    object-fit: cover;
}

.thumb-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 3px;
}

.modal-price {
    font-size: 1.5rem;
    color: #8b4513;
    /* Cor castanha do seu botão */
    font-weight: bold;
}

.modal-features ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.btn-contact {
    background-color: #5d2b1a;
    color: white;
    border: none;
    padding: 12px 20px;
    width: 100%;
    /*margin-top: 20px;*/
    margin-top: auto;
    cursor: pointer;
    border-radius: 4px;
}

/* Responsividade: em telemóveis, passa para 1 coluna */
@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}


/* Fundo do Modal (Overlay) */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    /* Garante que fica por cima de tudo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    /* Fundo preto semi-transparente */
}

/* Caixa Branca (Conteúdo) */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    /* 5% do topo e centralizado */
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Botão Fechar (X) */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}


/* DESTAQUE */
/* 1. O Contentor (Mantém-se igual) */
.card-image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    background-color: #000;
}

/* 2. Efeito de Zoom na Imagem */
.card-image-container img {
    width: 100%;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-image-container:hover img {
    transform: scale(1.1);
}

/* 3. O Selo de Destaque (MAIS LARGO) */
.badge-destaque {
    position: absolute;
    /* Ajustamos a posição para acomodar a largura maior */
    top: 25px;
    left: -35px;
    width: 170px;
    /* Aumentei a largura total da fita */

    background: linear-gradient(135deg, #4a2215 0%, #5d2b1a 50%, #7d3b25 100%);
    color: white;
    text-align: center;

    /* Aumentei o padding e o tamanho da letra */
    padding: 12px 0;
    /* Mais largo (antes era 8px) */
    font-size: 13px;
    /* Letra ligeiramente maior */

    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(-45deg);
    z-index: 10;
    letter-spacing: 2px;

    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);

    overflow: hidden;
    pointer-events: none;
}

/* 4. Animação de Brilho (Mantém-se igual) */
.badge-destaque::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: flash-brilho 4s infinite;
}

@keyframes flash-brilho {
    0% {
        left: -100%;
    }

    20% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

/* FILTRO */
/* Fundo castanho largo (área da Atriumstar) */
.search-container-wrapper {
    background-color: #5d2b1a;
    /* Castanho oficial */
    padding: 40px 20px;
    margin-bottom: 30px;
}

/* Caixa branca da pesquisa */
.search-bar-container {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.search-form {
    display: flex;
    align-items: flex-end;
    /* Mantém o alinhamento dos campos */
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    /* Adiciona isto */
    overflow: visible !important;
    /* Adiciona isto para não cortar a lista */
}

/* Grupos de inputs */
.search-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Faz os selects crescerem igualmente */
    min-width: 150px;
}

/* Localização ocupa mais espaço */
.location-group {
    flex: 2;
}

.search-group label {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.search-group select,
.search-group input {
    height: 45px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.search-group input:focus {
    border-color: #5d2b1a;
}

/* Botão Buscar */
.btn-buscar {
    background-color: #5d2b1a;
    color: white;
    border: none;
    height: 45px;
    padding: 0 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-buscar:hover {
    background-color: #4a2215;
}

/* Ajuste para Telemóveis */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-buscar {
        width: 100%;
        justify-content: center;
    }
}


/* */

/* 1. O fundo castanho que ocupa 100% da largura do browser */
.full-width-search {
    background-color: #4b2c20;
    /* O seu castanho */
    width: 100vw;
    /* 100% da largura da janela visual */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 40px 0;
    /* Espaçamento vertical */
    box-sizing: border-box;
}

/* 2. Contentor interno para alinhar a barra com o resto do site */
.search-content-wrapper {
    max-width: 1200px;
    /* Ou a largura máxima do seu site */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    /* Coloca os links em cima da barra */
}

/* 3. A barra de pesquisa branca (Moderna) */
.modern-search-box {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 15px 25px;
    border-radius: 50px;
    /* Estilo pílula */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.modern-search-box .search-icon {
    color: #4b2c20;
    margin-right: 15px;
    font-size: 1.2rem;
}

.modern-search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1.2rem;
    background: transparent;
    color: #333;
}

.modern-search-box:focus-within {
    transform: scale(1.01);
}


/* Alinhamento da NAV à direita */
.top-nav-actions {
    display: flex;
    justify-content: flex-end;
    /* Alinha os itens à direita */
    align-items: center;
    /* Alinha verticalmente links e botão */
    gap: 25px;
    /* Espaçamento entre os links */
    margin-bottom: 20px;
}

/* Links Comprar e Alugar */
.nav-item {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    transition: opacity 0.3s;
}

.nav-item:hover {
    opacity: 0.7;
}

/* Botão Login Vermelho */
.btn-login-red {
    background-color: #e74c3c;
    /* Vermelho moderno */
    color: white;
    padding: 8px 22px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-login-red:hover {
    background-color: #c0392b;
}

/* Contactos */
.contact-section {
    background-color: #1c1f26;
    /* Fundo cinza escuro da imagem */
    padding: 80px 0;
    color: #ffffff;
    font-family: sans-serif;
}

.contact-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 50px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.contact-icon {
    background-color: #2a2f3a;
    /* Fundo do ícone ligeiramente mais claro */
    width: 55px;
    height: 55px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #3498db;
    /* Azul dos ícones */
    margin-right: 20px;
}

.contact-details span {
    display: block;
    font-size: 11px;
    color: #9da3af;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.contact-details p {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.contact-details a {
    color: inherit;
    text-decoration: none;
}

.contact-map {
    flex: 1.2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Ajuste para ecrãs pequenos */
@media (max-width: 900px) {
    .contact-wrapper {
        flex-direction: column;
        padding: 0 20px;
    }

    .contact-map {
        width: 100%;
    }
}