/* ===== VARIÁVEIS CSS ===== */
:root {
    --primary-color: #d4a574;
    --secondary-color: #f0e6d6;
    --dark-color: #1a1a1a;
    --light-color: #ffffff;
    --text-muted: #6c757d;
    --font-family: 'Poppins', sans-serif;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /*outline: 1px solid red;*/
}

html {
    scroll-behavior: smooth;
    /* CRÍTICO: Previne overflow horizontal */
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    /* CRÍTICO: Garante que o body não cause overflow */
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ===== CORREÇÃO GLOBAL PARA CONTAINERS ===== */
.container,
.container-fluid {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* ===== CLASSES UTILITÁRIAS ===== */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--dark-color);
    font-weight: 600;
    transition: var(--transition);
    /* CORREÇÃO: Garante que botões não quebrem em mobile */
    max-width: 100%;
    word-wrap: break-word;
}

.btn-primary-custom:hover {
    background-color: #c19660;
    border-color: #c19660;
    color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

/* ===== NAVBAR - CORREÇÕES CRÍTICAS ===== */
.navbar {
    backdrop-filter: blur(10px);
    transition: var(--transition);
    /* CRÍTICO: Força a navbar a não exceder a largura da tela */
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden;
}

.navbar .container {
    /* CRÍTICO: Garante que o container da navbar seja responsivo */
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.navbar-brand {
    font-size: 1.5rem;
    transition: var(--transition);
    /* CORREÇÃO: Limita o tamanho da marca em mobile */
    max-width: 60%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* CRÍTICO: Logo responsivo */
.navbar-brand img {
    max-width: 100%;
    height: auto;
    max-height: 45px;
    display: block;
}

.navbar-brand span {
    /* CORREÇÃO: Texto da marca responsivo */
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* CORREÇÃO: Botão do menu hambúrguer */
.navbar-toggler {
    border: none !important;
    padding: 4px 8px !important;
    font-size: 1rem !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

/* CORREÇÃO: Links da navegação */
.nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    /* CRÍTICO: Garante que os links não quebrem o layout */
    word-wrap: break-word;
    max-width: 100%;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* ===== CORREÇÕES ESPECÍFICAS PARA MOBILE ===== */
@media (max-width: 991.98px) {
    /* CRÍTICO: Ajustes para o menu colapsado */
    .navbar-collapse {
        width: 100% !important;
        max-width: 100% !important;
    }

    .navbar-nav {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
        text-align: center;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-nav .nav-link {
        padding: 12px 15px !important;
        display: block;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    /* CRÍTICO: Ajuste da marca em mobile */
    .navbar-brand {
        font-size: 1.2rem !important;
        max-width: 70% !important;
    }

    .navbar-brand span {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 576px) {
    /* CORREÇÕES EXTRAS para telas muito pequenas */
    .navbar .container {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .navbar-brand {
        font-size: 1rem !important;
        max-width: 75% !important;
    }

    .navbar-brand img {
        max-height: 35px !important;
    }

    .navbar-brand span {
        font-size: 0.8rem !important;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2c2c2c 100%);
    position: relative;
    overflow: hidden;
    /* CORREÇÃO: Garante que a hero section seja responsiva */
    width: 100%;
    max-width: 100vw;
}

.hero-section .container {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

.hero-section::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 1000 1000"><polygon fill="%23d4a574" fill-opacity="0.1" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ===== CORREÇÕES PARA TEXTOS E BOTÕES ===== */
.display-3,
.display-4,
.display-5 {
    /* CORREÇÃO: Títulos responsivos */
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.lead {
    /* CORREÇÃO: Texto lead responsivo */
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.btn {
    /* CORREÇÃO: Botões responsivos */
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.btn-lg {
    /* CORREÇÃO: Botões grandes em mobile */
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* ===== CARDS E COMPONENTES ===== */
.card-hover {
    transition: var(--transition);
    border-radius: 15px;
    overflow: hidden;
    /* CORREÇÃO: Cards responsivos */
    max-width: 100%;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color), #c19660);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.card-hover:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

/* ===== SERVICE CARDS ===== */
.service-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    /* CORREÇÃO: Service cards responsivos */
    max-width: 100%;
    overflow: hidden;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), #c19660);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.service-icon i {
    font-size: 2rem;
    color: white;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* ===== CONTACT CARDS ===== */
.contact-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #f8f9fa;
    /* CORREÇÃO: Contact cards responsivos */
    max-width: 100%;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.contact-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), #c19660);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.contact-icon i {
    font-size: 2rem;
    color: white;
}

.contact-card:hover .contact-icon {
    transform: scale(1.1);
}

/* ===== WHATSAPP FLOAT BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.whatsapp-btn {
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
}

.whatsapp-btn i {
    font-size: 1.5rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

/* ===== SOCIAL LINKS ===== */
.social-links a {
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-3px);
}

/* ===== RESPONSIVE DESIGN ADICIONAL ===== */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 100px;
    }
    
    .display-3 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    .display-4 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }
    
    .display-5 {
        font-size: 1.6rem !important;
        line-height: 1.2 !important;
    }
    
    .lead {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
    }
    
    .service-card,
    .contact-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-btn {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-btn i {
        font-size: 1.2rem;
    }

    /* CORREÇÃO: Botões em mobile */
    .btn-lg {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* CORREÇÃO: Containers em mobile */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding-top: 80px;
    }
    
    .display-3 {
        font-size: 1.8rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    .btn-lg {
        padding: 0.65rem 1rem !important;
        font-size: 0.9rem !important;
    }

    /* CORREÇÃO: Espaçamento em telas muito pequenas */
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .service-card,
    .contact-card {
        padding: 1rem !important;
    }
}

/* ===== CORREÇÃO CRÍTICA PARA OVERFLOW ===== */
/* Esta regra garante que NENHUM elemento cause overflow horizontal */
* {
    max-width: 100%;
}

/* Exceções para elementos que precisam de largura específica */
.navbar-toggler,
.btn,
.icon-box,
.service-icon,
.contact-icon,
.whatsapp-btn {
    max-width: none;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.card,
.service-card,
.contact-card {
    will-change: transform;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .whatsapp-float,
    .scroll-indicator {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
}