/* ================================================================
   HEADER STYLES - Estilos reutilizáveis para o header de todas as páginas
   Inclui: Quick Actions, Navbar, Mobile Navigation, Carousel, etc.
   ================================================================ */

/* ===== QUICK ACTIONS ===== */
.quick-actions .btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-caption .quick-actions .btn {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    border: 2px solid rgba(255,255,255,0.8) !important;
    background-color: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
}

.carousel-caption .quick-actions .btn i {
    color: #fff !important;
}

.quick-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ===== QUICK ACTIONS BUTTONS OVERRIDE ===== */
#header-carousel .carousel-caption .quick-actions .btn,
#header-carousel-mobile .carousel-caption .quick-actions .btn {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    background-color: transparent !important;
}

/* Quick actions buttons hover */
#header-carousel .carousel-caption .quick-actions .btn:hover,
#header-carousel .carousel-caption .quick-actions .btn:focus,
#header-carousel-mobile .carousel-caption .quick-actions .btn:hover,
#header-carousel-mobile .carousel-caption .quick-actions .btn:focus {
    background-color: rgba(255,255,255,0.2) !important;
    color: white !important;
    border-color: rgba(255,255,255,1) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* Icons color on hover */
#header-carousel .carousel-caption .quick-actions .btn:hover i,
#header-carousel .carousel-caption .quick-actions .btn:focus i,
#header-carousel-mobile .carousel-caption .quick-actions .btn:hover i,
#header-carousel-mobile .carousel-caption .quick-actions .btn:focus i {
    color: white !important;
}

/* ===== NAVBAR BUTTONS ===== */
.navbar-dark .btn i.fa-search {
    color: white !important;
}

.navbar-dark .btn.text-primary {
    color: white !important;
}

.navbar-dark .btn.text-primary i {
    color: inherit !important;
}

.navbar-dark .btn-outline-light {
    border-color: rgba(255,255,255,0.85) !important;
    color: #fff !important;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.navbar-dark .btn-outline-light i {
    color: #fff !important;
    transition: color 0.3s ease;
}

.navbar-dark .btn-outline-light:hover {
    background-color: rgba(255,255,255,0.12) !important;
    color: #fff !important;
}

.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-nav .nav-link:focus,
.navbar-dark .navbar-nav .nav-link:active {
    color: white !important;
    transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255,255,255,0.85) !important;
}

/* ===== CAROUSEL/SLIDER OVERLAYS AND LAYOUT ===== */
#header-carousel .carousel-item,
#header-carousel-mobile .carousel-item {
    position: relative;
    overflow: visible;
    min-height: 100vh; /* Mantém uniformidade visual sem clipar a página */
}

#header-carousel .carousel-item img,
#header-carousel-mobile .carousel-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay para melhorar legibilidade do texto */
#header-carousel .carousel-item::before,
#header-carousel-mobile .carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
    pointer-events: none;
}

#header-carousel .carousel-caption,
#header-carousel-mobile .carousel-caption {
    position: relative;
    z-index: 2000;
    background: none !important;
    pointer-events: auto !important;
}

#header-carousel .carousel-caption .btn,
#header-carousel-mobile .carousel-caption .btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 3000 !important;
    display: inline-block !important;
    text-decoration: none !important;
    border: 1px solid rgba(255,255,255,0.8) !important;
    background-color: rgba(255,255,255,0.15) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    min-height: 48px !important;
    line-height: 1.5 !important;
}

#header-carousel .carousel-caption .btn:hover,
#header-carousel .carousel-caption .btn:focus,
#header-carousel .carousel-caption .btn:active,
#header-carousel-mobile .carousel-caption .btn:hover,
#header-carousel-mobile .carousel-caption .btn:focus,
#header-carousel-mobile .carousel-caption .btn:active {
    background-color: rgba(255,255,255,0.35) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

#header-carousel-mobile .carousel-caption .btn,
#header-carousel-mobile .carousel-caption a {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* ===== MOBILE HEADER CONTACTS ===== */
.mobile-header-contacts {
    position: relative;
    z-index: 1000;
    padding: 1rem 1.5rem;
}

.mobile-contacts {
    line-height: 1.2;
}

.contact-line {
    margin-bottom: 0.1rem;
    font-size: 0.85rem;
    line-height: 1.1;
}

.contact-line:last-child {
    margin-bottom: 0;
}

.contact-line strong {
    color: #fff;
}

    /* MODERN DESKTOP DROPDOWN (Approved Version) */
    @media (min-width: 992px) {
        /* Remover sublinhado no hover, manter apenas no active */
        .navbar-dark .navbar-nav .nav-link::before {
            display: none !important;
        }
        
        .navbar-dark .navbar-nav .nav-link.active::before {
            display: block !important;
            position: absolute;
            content: "";
            width: 100%;
            height: 2px;
            bottom: 25px; /* Ajustado para ficar por cima do link como no print */
            left: 0;
            background: #B1A276;
            transition: .5s;
        }

        .navbar-expand-lg .navbar-nav .dropdown-menu {
            display: block;
            visibility: hidden;
            opacity: 0;
            left: 50% !important;
            right: auto !important;
            transform: translateX(-50%) translateY(10px) !important;
            transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
            background: rgba(255, 255, 255, 0.98) !important;
            backdrop-filter: blur(10px);
            border: none !important;
            border-radius: 12px !important;
            padding: 1rem;
            box-shadow: 0 15px 45px rgba(0,0,0,0.12) !important;
            margin-top: -10px !important; 
            min-width: 240px;
        }

        /* TRIANGLE INDICATOR - Centered */
        .navbar-expand-lg .navbar-nav .dropdown-menu::after {
            content: '';
            position: absolute;
            top: -10px;
            left: 50% !important;
            right: auto !important;
            transform: translateX(-50%);
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 10px solid rgba(255, 255, 255, 0.98);
        }

        .navbar-expand-lg .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
            visibility: visible;
            opacity: 1;
            transform: translateX(-50%) translateY(0) !important;
        }

        .navbar-expand-lg .navbar-nav .dropdown-item {
            color: #444 !important;
            padding: 0.7rem 1.2rem;
            font-weight: 700 !important; /* NEGRETADO */
            font-size: 0.95rem;
            transition: all 0.2s ease;
            position: relative;
            border-radius: 8px;
            margin-bottom: 2px;
        }

        .navbar-expand-lg .navbar-nav .dropdown-item:hover {
            background-color: rgba(177, 162, 118, 0.08) !important;
            color: #B1A276 !important;
        }
    }

/* ===== MOBILE NAVBAR WRAPPER ===== */
.mobile-navbar-wrapper {
    position: relative;
    left: 0;
    right: 0;
    margin-top: 1rem;
    padding: 0;
    z-index: 5;
    width: 100%;
    pointer-events: none;
}

.mobile-navbar-wrapper .navbar-brand,
.mobile-navbar-wrapper .navbar-toggler {
    pointer-events: auto;
}

.mobile-navbar-wrapper .navbar {
    width: 100%;
    flex-direction: column !important;
    align-items: center !important;
    overflow: visible !important;
    padding: 0 !important;
}

.mobile-navbar-wrapper .navbar-brand {
    width: 100%;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
    margin: 0 auto 1rem !important;
    padding: 0 !important;
    position: relative;
    z-index: 1010;
    line-height: 0;
    min-height: 100px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .quick-actions {
        margin-top: 1rem !important;
    }

    .quick-actions .btn {
        width: 35px;
        height: 35px;
        margin: 0.2rem !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    .carousel-caption .quick-actions .btn {
        width: 35px !important;
        height: 35px !important;
        min-height: 35px !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        line-height: 1 !important;
        background-color: transparent !important;
    }

    #header-carousel-mobile .carousel-caption .quick-actions .btn {
        width: 35px !important;
        height: 35px !important;
        min-height: 35px !important;
    }
}

/* ===== MOBILE NAVBAR STYLING (up to 991.98px) ===== */
@media (max-width: 991.98px) {
    #header-carousel-mobile .carousel-item {
        min-height: 110vh;
    }

    #header-carousel-mobile .carousel-caption {
        bottom: 10% !important;
        padding: 0 3.5rem;
        z-index: 1040;
    }

    #header-carousel-mobile .carousel-caption .btn {
        position: relative;
        z-index: 1050;
    }

    /* Ajustar posição das setas do slider no mobile para ficarem alinhadas ao texto */
    #header-carousel-mobile .carousel-control-prev,
    #header-carousel-mobile .carousel-control-next {
        top: 72% !important; /* Posição estável preferida pelo utilizador */
        bottom: auto !important;
        height: 60px !important;
        width: 15% !important;
        z-index: 1070 !important; /* Visibilidade prioritária */
    }

    .mobile-navbar-wrapper .navbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 3.5rem 1rem 1rem !important;
        background: transparent !important;
    }

    .mobile-navbar-wrapper .navbar-brand {
        margin: 0 auto 1rem !important;
        order: 1;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: 100px;
    }

    .mobile-navbar-wrapper .navbar-brand .oagb-logo {
        width: 220px !important;
        max-width: 90% !important;
        height: auto !important;
        padding: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-navbar-wrapper .navbar-toggler {
        order: 2;
        margin: 4.5rem auto 2rem !important;
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        color: white !important;
        border: 2px solid #B1A276 !important;
        background: rgba(255, 255, 255, 0.15) !important;
        padding: 0.5rem 1.2rem !important;
        border-radius: 20px !important;
        transition: background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out;
    }
    
    .mobile-pill-btn {
        border-radius: 20px !important;
        border: 1px solid rgba(255,255,255,0.8) !important;
        background: rgba(255,255,255,0.15) !important;
        transition: background-color 0.3s ease, border-color 0.3s ease !important;
        font-size: 0.70rem !important;
        letter-spacing: 0.5px !important;
        color: white !important;
    }

    .mobile-pill-btn i {
        color: white !important;
    }
    
    .mobile-pill-btn:hover, .mobile-pill-btn:active, .mobile-pill-btn:focus {
        background: rgba(255,255,255,0.35) !important;
        color: white !important;
    }

    .mobile-pill-btn:hover i, .mobile-pill-btn:active i, .mobile-pill-btn:focus i {
        color: white !important;
    }

    .mobile-navbar-wrapper .navbar-toggler i {
        color: white !important;
        font-size: 18px !important;
    }

    .mobile-navbar-wrapper .navbar-toggler::after {
        content: ' MENU';
        margin-left: 0;
        font-family: 'Open Sans', sans-serif;
        font-weight: 600;
        font-size: 14px;
        color: white !important;
    }

    .header-light-page .mobile-navbar-wrapper .navbar-toggler::after {
        color: white !important;
    }

    .mobile-navbar-wrapper .navbar-collapse {
        order: 3;
        position: static !important;
        width: 100% !important;
        margin-top: 1.5rem;
        padding: 1.25rem 1.5rem;
        border-top: 1px solid rgba(255,255,255,0.2);
        background: rgba(0, 0, 0, 0.9) !important;
        border-radius: 14px !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 16px 35px rgba(0,0,0,0.4);
        transition: none !important;
        pointer-events: auto;
    }

    .mobile-navbar-wrapper .navbar-nav {
        margin-bottom: 2rem;
        text-align: center;
        pointer-events: auto;
    }

    .mobile-navbar-wrapper .navbar-nav .nav-link {
        color: white !important;
        font-size: 1.1rem;
        font-weight: 600;
        padding: 1rem !important;
        margin: 0.5rem 0;
        text-align: center;
        transition: color 0.3s ease-out, opacity 0.3s ease-out;
        pointer-events: auto;
    }

    .mobile-navbar-wrapper .navbar-nav .dropdown-menu {
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        text-align: center;
        margin: 0 auto !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transition: none !important;
        pointer-events: auto;
    }

    .mobile-navbar-wrapper .navbar-nav .dropdown-menu .dropdown-item {
        color: #091E3E;
        padding: 0.8rem 1.5rem;
        font-weight: 500;
        transition: background-color 0.3s ease-out, color 0.3s ease-out;
        pointer-events: auto;
    }

    .mobile-navbar-wrapper .navbar-nav .dropdown-menu .dropdown-item:hover {
        background-color: var(--primary);
        color: white;
        transition: background-color 0.3s ease-out, color 0.3s ease-out;
    }

    .mobile-navbar-wrapper .navbar .btn {
        display: none !important;
    }
}

/* ===== DESKTOP NAVBAR WITH SCROLL EFFECT (from 992px) ===== */
@media (min-width: 992px) {
    /* Topbar fixa */
    .bg-dark {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1040 !important;
        transition: all 0.3s ease !important;
    }

    /* Fazer o navbar fixo no topo com posicionamento consistente */
    .navbar-dark {
        position: fixed !important;
        top: 40px !important; /* Altura exata do topbar = 40px */
        left: 0 !important;
        right: 0 !important;
        z-index: 1030 !important;
        width: 100% !important;
        transition: all 0.3s ease !important;
        background: transparent !important;
        padding: 15px 0 !important;
    }

    /* Garantir estrutura Bootstrap consistente */
    .navbar-dark.navbar-expand-lg {
        flex-wrap: nowrap !important;
    }

    .navbar-dark .navbar-collapse {
        flex-basis: auto !important;
    }

    /* Manter padding lateral consistente */
    .navbar-dark.px-5 {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }

    /* Logo padrão - posicionamento consistente */
    .navbar-dark .navbar-brand {
        padding: 0 !important;
    }

    .navbar-dark .navbar-brand img {
        width: 70% !important;
        height: auto !important;
        padding-top: 5% !important;
        transition: all 0.3s ease !important;
    }

    /* Navbar mais compacto durante scroll */
    .navbar-scrolled {
        background-color: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        top: 40px !important;
        padding: 8px 0 !important;
    }

    /* Logo menor durante scroll */
    .navbar-scrolled .navbar-brand {
        padding: 0 !important;
    }

    .navbar-scrolled .navbar-brand img {
        width: 50% !important;
        height: auto !important;
        padding-top: 2% !important;
        transition: all 0.3s ease !important;
        filter: none !important;
    }

    /* Remover o espaçamento do container do navbar */
    .container-fluid.position-relative.p-0.d-none.d-lg-block {
        margin-bottom: 0 !important;
    }

    /* Ajustar o conteúdo principal para começar logo após o navbar fixo */
    .bg-header {
        margin-top: 0 !important;
        position: relative;
        top: 0 !important;
    }

    /* Cores douradas #B1A276 para links do navbar quando scrolled */
    .navbar-scrolled .navbar-nav .nav-link {
        color: #B1A276 !important;
    }

    .navbar-scrolled .navbar-nav .nav-link:hover {
        color: #9d8f64 !important;
    }

    .navbar-scrolled .navbar-nav .nav-link.active {
        color: #B1A276 !important;
        font-weight: 600;
    }

    /* Garantir que todos os itens do menu principal tenham a cor dourada */
    .navbar-scrolled .navbar-nav .nav-item .nav-link {
        color: #B1A276 !important;
    }

    .navbar-scrolled .navbar-nav .dropdown .nav-link {
        color: #B1A276 !important;
    }

    .navbar-scrolled .navbar-nav .dropdown-toggle {
        color: #B1A276 !important;
    }

    /* Botão de pesquisa também dourado #B1A276 quando scrolled */
    .navbar-scrolled .btn {
        color: #B1A276 !important;
    }

    .navbar-scrolled .btn:hover {
        color: #9d8f64 !important;
    }

    .navbar-scrolled .btn.text-primary {
        color: #B1A276 !important;
    }

    .navbar-scrolled .btn-outline-light {
        border-color: #B1A276 !important;
        color: #B1A276 !important;
        background-color: transparent !important;
    }

    .navbar-scrolled .btn-outline-light:hover {
        background-color: #B1A276 !important;
        border-color: #B1A276 !important;
        color: white !important;
    }

    .navbar-scrolled .btn-outline-light i {
        color: #B1A276 !important;
    }

    .navbar-scrolled .btn.text-primary i {
        color: #B1A276 !important;
    }

    /* Topbar scrolled - fundo branco */
    .topbar-scrolled {
        background-color: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }

    /* Textos dourados quando topbar scrolled */
    .topbar-scrolled .text-light,
    .topbar-scrolled .text-white-50 {
        color: #B1A276 !important;
    }

    .topbar-scrolled small {
        color: #B1A276 !important;
    }

    .topbar-scrolled i {
        color: #B1A276 !important;
    }

    .topbar-scrolled .topbar-divider {
        background: rgba(177, 162, 118, 0.4) !important; /* Cor dourada semi-transparente */
    }

    .topbar-scrolled .btn-outline-light {
        border-color: #B1A276 !important;
        color: #B1A276 !important;
    }

    .topbar-scrolled .btn-outline-light:hover,
    .topbar-scrolled .btn-outline-light:focus {
        background-color: #B1A276 !important;
        border-color: #B1A276 !important;
        color: white !important;
    }

    .topbar-scrolled .btn-outline-light:hover i,
    .topbar-scrolled .btn-outline-light:focus i {
        color: white !important;
    }

    /* Desktop Hover Effect for the 3 topbar buttons */
    #topbar:not(.topbar-scrolled) .topbar-btn {
        transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
    }
    
    #topbar:not(.topbar-scrolled) .topbar-btn:hover,
    #topbar:not(.topbar-scrolled) .topbar-btn:active,
    #topbar:not(.topbar-scrolled) .topbar-btn:focus {
        background: rgba(255,255,255,0.15) !important;
        color: white !important;
    }

    /* Override for pages with light header (no background image) */
    .header-light-page #topbar:not(.topbar-scrolled) .topbar-btn:hover {
        background: rgba(177, 162, 118, 0.1) !important;
        color: #4D1C21 !important;
        border-color: #B1A276 !important;
    }

    /* Mobile "MENU" text color for light pages */
    .header-light-page #mobile-header-simple .navbar-toggler::after {
        color: #B1A276 !important;
    }
    .header-light-page .mobile-navbar-wrapper .navbar-toggler::after {
        color: white !important;
    }

    #topbar:not(.topbar-scrolled) .topbar-btn:hover i,
    #topbar:not(.topbar-scrolled) .topbar-btn:active i,
    #topbar:not(.topbar-scrolled) .topbar-btn:focus i {
        color: white !important;
    }

    .header-light-page #topbar:not(.topbar-scrolled) .topbar-btn:hover i {
        color: #4D1C21 !important;
    }

    .header-light-page #mobile-header-simple .navbar-toggler i {
        color: #B1A276 !important;
    }
    .header-light-page .mobile-navbar-wrapper .navbar-toggler i {
        color: white !important;
    }

    /* Ajustar padding do conteúdo para não ficar sobreposto pelo navbar fixo */
    .bg-header {
        padding-top: 8rem !important;
    }
}

/* ===== GOOGLE TRANSLATE FIXES ===== */
/* Esconder a barra nativa do Google que empurra o site para baixo */
.goog-te-banner-frame.skiptranslate, 
.goog-te-banner-frame {
    display: none;
}

body {
    top: 0px !important;
}

/* Ajustar posição de elementos fixos quando o Google Translate está ativo */
.translated-ltr .navbar-dark,
.translated-ltr .bg-dark,
.translated-ltr #topbar {
    top: 0 !important;
}

/* Customizar o widget de tradução para dentro do Modal */
#google_translate_element {
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#google_translate_element select {
    border-radius: 8px !important;
    border: 1px solid #B1A276 !important;
    padding: 8px 12px !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 0.9rem !important;
    background-color: #fff !important;
    color: #333 !important;
    cursor: pointer;
    width: 100%;
    max-width: 250px;
}

.goog-te-gadget span {
    display: none !important; /* Esconder o "Powered by Google" */
}

.goog-te-gadget {
    color: transparent !important;
}


