/* ========================================
   RESET E VARIÁVEIS
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
}

.container,
.imovel-container,
.imovel-detalhes,
.galeria-grid,
.caracteristicas-grid {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    /* Cores baseadas no logo */
    --color-primary: #1e3a5f;
    --color-primary-dark: #152b47;
    --color-primary-light: #2a4d7a;
    --color-secondary: #e67e22;
    --color-secondary-dark: #d35400;
    --color-secondary-light: #f39c12;
    
    /* Cores neutras */
    --color-dark: #2c3e50;
    --color-gray: #7f8c8d;
    --color-light-gray: #ecf0f1;
    --color-white: #ffffff;
    --color-off-white: #f8f9fa;
    
    /* Cores de status */
    --color-success: #27ae60;
    --color-error: #e74c3c;
    --color-warning: #f39c12;
    --color-info: #3498db;
    
    /* Tipografia */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 16px;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Espaçamentos */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Bordas */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transições */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Container */
    --container-max-width: 1200px;
    --container-padding: 1.5rem;
}

/* ========================================
   ESTILOS GLOBAIS
   ======================================== */

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ========================================
   UTILITÁRIOS
   ======================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    overflow: visible;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    overflow: visible;
}

.logo img {
    height: 50px;
    width: auto;
    transition: transform var(--transition-base);
}

.logo:hover img {
    transform: scale(1.05);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    overflow: visible;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: var(--color-dark);
    font-weight: var(--font-weight-medium);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    background: var(--color-off-white);
}

.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-md);
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 9999;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--color-dark);
    transition: all var(--transition-fast);
}

.dropdown-menu li a:hover {
    background: var(--color-off-white);
    color: var(--color-primary);
    padding-left: 1.5rem;
}

.favoritos-link {
    position: relative;
}

.favoritos-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-secondary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/assets/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-white);
    max-width: 900px;
    padding: var(--spacing-xl) var(--spacing-md);
}

.hero h1 {
    font-size: 2.1rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ========================================
   FORMULÁRIO DE BUSCA
   ======================================== */

.search-form {
    position: relative;
    z-index: 2;
    background: rgba(240, 240, 240, 0.92);
    backdrop-filter: blur(10px);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.search-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.search-form-grid > button {
    align-self: end;
    height: fit-content;
    margin-top: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--color-dark);
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
}

.form-control {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--color-light-gray);
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    transition: all var(--transition-base);
    background: var(--color-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* ========================================
   BOTÕES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-white);
}

.btn-secondary:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
}

/* ========================================
   SEÇÕES
   ======================================== */

.section {
    padding: var(--spacing-xxl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.section-title p {
    font-size: 1.125rem;
    color: var(--color-gray);
}

/* ========================================
   CARDS DE IMÓVEIS
   ======================================== */

.imoveis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.imovel-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
}

.imovel-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.imovel-card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.imovel-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.imovel-card:hover .imovel-card-image img {
    transform: scale(1.1);
}

.imovel-card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--color-secondary);
    color: var(--color-white);
    padding: 0.375rem 0.875rem;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
}

.imovel-card-favorito {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.imovel-card-favorito:hover {
    transform: scale(1.1);
}

.imovel-card-favorito.active {
    background: var(--color-secondary);
    color: var(--color-white);
}

.imovel-card-favorito svg {
    width: 20px;
    height: 20px;
}

.imovel-card-content {
    padding: var(--spacing-md);
}

.imovel-card-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-gray);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.imovel-card-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.imovel-card-codigo {
    font-size: 0.875rem;
    color: var(--color-gray);
    margin-bottom: var(--spacing-sm);
}

.imovel-card-price {
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.imovel-card-features {
    display: flex;
    gap: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-light-gray);
}

.imovel-card-feature {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-gray);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-xxl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-logo {
    height: 50px;
    margin-bottom: var(--spacing-md);
    filter: brightness(0) invert(1);
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--color-secondary);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-base);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--color-white);
    padding-left: 0.5rem;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact li i {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-base);
    word-break: break-all;
    overflow-wrap: break-word;
    flex: 1;
}

.footer-contact a:hover {
    color: var(--color-white);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.footer-dev {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

/* ========================================
   WHATSAPP FLUTUANTE
   ======================================== */

.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    z-index: 999;
    transition: all var(--transition-base);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--color-white);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        transition: max-height var(--transition-base);
    }
    
    .nav.active {
        max-height: calc(100vh - 70px);
    }
    
    .nav-list {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--color-light-gray);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding: 0;
        margin: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background: var(--color-off-white);
    }
    
    .nav-item.dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .dropdown-menu li:last-child {
        border-bottom: none;
    }
    
    .dropdown-menu li a {
        padding: 0.625rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .search-form-grid {
        grid-template-columns: 1fr;
    }
    
    .imoveis-grid {
        grid-template-columns: 1fr;
    }
    
    .whatsapp-float {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
    
    /* Página de detalhes do imóvel */
    .imovel-detalhes {
        padding: 1rem;
    }
    
    .imovel-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .imovel-sidebar {
        order: -1;
    }
    
    .price-card,
    .contact-card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }
    
    .price-main {
        font-size: 1.75rem;
        word-break: break-word;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        white-space: normal;
        text-align: center;
    }
    
    .contact-card {
        padding: 1rem;
    }
    
    .contact-card h3 {
        font-size: 1.25rem;
    }
    
    .contact-info {
        font-size: 0.9rem;
        word-break: break-word;
    }
    
    .imovel-section {
        padding: 1rem;
    }
    
    .imovel-section h2 {
        font-size: 1.25rem;
    }
    
    .destaque-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .destaque-buttons .btn-outline {
        margin-right: 0 !important;
        width: 100%;
        max-width: 300px;
    }
}
