﻿/* ========================================
   MORADIA CASA E CONSTRUÇÃO - ESTILOS OTIMIZADOS
   Cores: Azul (#1e3a8a) + Cinza (#374151) + Preto (#111827)
   ======================================== */

/* PALETA DE CORES */
:root {
    --moradia-azul-primary: #1e3a8a;
    --moradia-azul-light: #3b82f6;
    --moradia-azul-dark: #1e40af;
    --moradia-cinza-primary: #374151;
    --moradia-cinza-light: #6b7280;
    --moradia-cinza-dark: #1f2937;
    --moradia-preto: #111827;
    --moradia-branco: #ffffff;
    --moradia-off-white: #f9fafb;
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--moradia-azul-primary) 0%, var(--moradia-cinza-primary) 100%);
    --gradient-hover: linear-gradient(135deg, var(--moradia-azul-light) 0%, var(--moradia-azul-primary) 100%);
    --gradient-dark: linear-gradient(135deg, var(--moradia-preto) 0%, var(--moradia-cinza-dark) 100%);
    /* Sombras */
    --shadow-subtle: 0 2px 4px rgba(17, 24, 39, 0.1);
    --shadow-medium: 0 4px 12px rgba(17, 24, 39, 0.15);
    --shadow-strong: 0 8px 25px rgba(17, 24, 39, 0.2);
    --shadow-intense: 0 12px 40px rgba(17, 24, 39, 0.3);
}

/* RESET E BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--moradia-cinza-dark);
    background-color: var(--moradia-off-white);
}

/* ========================================
   HEADER/NAVEGAÇÃO ESTILO ROLEX
   ======================================== */

.rolex-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: navSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

    .rolex-header.scrolled {
        background: rgba(17, 24, 39, 0.98);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

.rolex-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    height: 70px;
}

/* Logo Section */
.rolex-logo-section {
    flex: 0 0 auto;
}

.rolex-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--moradia-branco);
    transition: all 0.3s ease;
}

    .rolex-logo-link:hover {
        transform: scale(1.05);
    }

.rolex-nav-logo {
    height: 40px;
    width: auto;
    margin-right: 12px;
    filter: brightness(1.1);
}

.rolex-brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--moradia-azul-light), var(--moradia-branco));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Menu Desktop */
.rolex-nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex: 1;
    justify-content: center;
}

.rolex-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

    .rolex-nav-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        transition: left 0.5s ease;
    }

    .rolex-nav-item:hover::before {
        left: 100%;
    }

    .rolex-nav-item:hover {
        color: var(--moradia-branco);
        background: rgba(59, 130, 246, 0.15);
        transform: translateY(-1px);
    }

    .rolex-nav-item i {
        font-size: 1rem;
        opacity: 0.8;
    }

    .rolex-nav-item:hover i {
        opacity: 1;
        color: var(--moradia-azul-light);
    }

    .rolex-nav-item.active {
        color: var(--moradia-branco);
        background: var(--moradia-azul-primary);
        box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    }

        .rolex-nav-item.active i {
            color: var(--moradia-branco);
            opacity: 1;
        }

/* Toggle Mobile */
.rolex-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

    .rolex-mobile-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

.toggle-line {
    width: 24px;
    height: 2px;
    background: var(--moradia-branco);
    margin: 2px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

/* Menu Mobile */
.rolex-mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

    .rolex-mobile-menu.expanded {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

.rolex-mobile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    font-weight: 500;
}

    .rolex-mobile-item:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--moradia-branco);
        padding-left: 2.5rem;
    }

    .rolex-mobile-item i {
        font-size: 1.1rem;
        width: 20px;
        opacity: 0.7;
    }

    .rolex-mobile-item:hover i {
        opacity: 1;
        color: var(--moradia-azul-light);
    }

/* ========================================
   HERO SECTION - CORRIGIDO PARA MOBILE
   ======================================== */

.hero-institucional {
    min-height: 100vh;
    background-image: linear-gradient(0deg, rgba(17, 24, 39, 0.55) 0%, rgba(17, 24, 39, 0.35) 45%, rgba(17, 24, 39, 0.4) 100%), url('/images/hero-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .hero-institucional::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
        opacity: 0.3;
    }

    /* Fallback caso a imagem hero não carregue */
    .hero-institucional::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--gradient-primary);
        z-index: -1;
    }

.hero-content-institucional {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--moradia-branco);
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero-logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: logoFadeIn 1.5s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: titleSlideUp 1s ease-out 0.3s both;
}

.hero-slogan {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    animation: sloganFadeIn 1s ease-out 0.6s both;
}

.hero-cta {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--moradia-azul-primary);
    color: var(--moradia-branco);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
    transition: all 0.3s ease;
    animation: ctaSlideUp 1s ease-out 0.9s both;
}

    .hero-cta:hover {
        background: var(--moradia-azul-light);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
        color: var(--moradia-branco);
    }

/* ========================================
   NOSSA HISTÓRIA
   ======================================== */

.historia-section {
    background: var(--gradient-dark);
    padding: 7rem 2rem;
    display: flex;
    justify-content: center;
}

.historia-content {
    max-width: 760px;
    text-align: center;
}

.historia-eyebrow {
    display: inline-block;
    color: var(--moradia-azul-light);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.historia-title {
    color: var(--moradia-branco);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

.historia-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
    line-height: 1.9;
    font-weight: 300;
}

@media (max-width: 768px) {
    .historia-section {
        padding: 4.5rem 1.5rem;
    }

    .historia-title {
        font-size: 2rem;
    }

    .historia-text {
        font-size: 1rem;
        line-height: 1.8;
    }
}

/* ========================================
   SEÇÕES DE CARDS
   ======================================== */

.rolex-main-content {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

.sections-container {
    padding: 5rem 0;
    background: var(--moradia-branco);
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 1100px) {
    .sections-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.section-card {
    background: var(--moradia-branco);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-subtle);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--moradia-branco);
}

    .section-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(0deg, rgba(17, 24, 39, 0.75) 0%, rgba(17, 24, 39, 0.15) 55%, rgba(17, 24, 39, 0.05) 100%);
        border-radius: 20px;
        transition: all 0.4s ease;
        z-index: 1;
    }

    .section-card:hover::before {
        background: linear-gradient(0deg, rgba(17, 24, 39, 0.85) 0%, rgba(17, 24, 39, 0.25) 55%, rgba(17, 24, 39, 0.1) 100%);
    }

    .section-card:hover {
        transform: translateY(-12px) scale(1.03);
        box-shadow: 0 20px 50px rgba(17, 24, 39, 0.4);
    }

.section-card-content {
    position: relative;
    z-index: 2;
}

.section-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--moradia-branco);
    transition: all 0.3s ease;
}

.section-card:hover .section-icon {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(5deg);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--moradia-branco);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.7;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Cards específicos */
.section-card.sonhar {
    background-image: url('/images/sonhar-background.jpg');
}

.section-card.historias {
    background-image: url('/images/historias-background.jpg');
}

.section-card.essencia {
    background-image: url('/images/essencia-background.jpg');
}

.section-card.conhecer {
    background-image: url('/images/loja-background.jpg');
}

.section-card.cafe {
    background-image: url('/images/cafe-background.jpg');
}

.section-card.estacionamento {
    background-image: url('/images/estacionamento-background.jpg');
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes navSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes titleSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sloganFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

@keyframes ctaSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animate {
    opacity: 0;
    transform: translateY(40px);
    animation: cardSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

    .card-animate:nth-child(1) {
        animation-delay: 0.1s;
    }

    .card-animate:nth-child(2) {
        animation-delay: 0.2s;
    }

    .card-animate:nth-child(3) {
        animation-delay: 0.3s;
    }

    .card-animate:nth-child(4) {
        animation-delay: 0.4s;
    }

    .card-animate:nth-child(5) {
        animation-delay: 0.5s;
    }

    .card-animate:nth-child(6) {
        animation-delay: 0.6s;
    }

/* ========================================
   RESPONSIVIDADE - CORRIGIDA PARA MOBILE
   ======================================== */

/* Tablets */
@media (max-width: 1024px) {
    .hero-institucional {
        background-attachment: scroll;
    }

    .rolex-nav-container {
        padding: 0.75rem 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .rolex-nav-container {
        padding: 0.75rem 1rem;
    }

    .rolex-nav-menu {
        display: none;
    }

    .rolex-mobile-toggle {
        display: flex;
    }

    .rolex-brand-text {
        font-size: 1.2rem;
    }

    .rolex-nav-logo {
        height: 35px;
        margin-right: 8px;
    }

    .hero-institucional {
        /* Desabilita parallax no mobile */
        background-attachment: scroll;
        /* Garante altura total da tela incluindo barras do navegador */
        min-height: 100vh;
        min-height: 100dvh;
        /* Ajusta posicionamento da imagem para mobile */
        background-position: center center;
        background-size: cover;
        /* Remove padding que pode causar overflow */
        padding: 0;
        /* Garante que não haja corte nas bordas */
        background-repeat: no-repeat;
    }

    .hero-content-institucional {
        /* Ajusta o conteúdo para não ser cortado */
        padding: 2rem 1rem;
        width: 100%;
        max-width: none;
        /* Garante que o conteúdo não ultrapasse as bordas */
        box-sizing: border-box;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    .hero-slogan {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }

    .hero-logo {
        max-width: 250px;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .sections-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .section-card {
        padding: 2rem 1.5rem;
        background-attachment: scroll;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .rolex-nav-container {
        height: 60px;
        padding: 0.5rem 1rem;
    }

    .rolex-main-content {
        margin-top: 60px;
    }

    .rolex-brand-text {
        font-size: 1.1rem;
    }

    .rolex-nav-logo {
        height: 30px;
    }

    .hero-institucional {
        /* Altura específica para mobile pequeno */
        min-height: 100vh;
        min-height: 100dvh;
        /* Posicionamento mais preciso para telas pequenas */
        background-position: center 30%;
        /* Se a imagem ainda cortar, descomente a linha abaixo */
        /* background-size: contain; */
    }

    .hero-content-institucional {
        padding: 1rem 0.75rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .hero-slogan {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }

    .hero-logo {
        max-width: 200px;
        margin-bottom: 1.25rem;
    }

    .hero-cta {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .section-card {
        padding: 1.5rem;
    }

    .section-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* ========================================
   SUPORTE AVANÇADO PARA iOS SAFARI
   ======================================== */

@supports (-webkit-touch-callout: none) {
    .hero-institucional {
        min-height: -webkit-fill-available;
    }
}

/* Fallback para navegadores antigos */
@supports not (height: 100dvh) {
    @media (max-width: 768px) {
        .hero-institucional {
            min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        }
    }
}
