@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Montserrat:wght@200;300;400;500;600&display=swap');

/* ===== THEME VARIABLES ===== */
:root {
    --bg-primary:    #050505;
    --bg-secondary:  #1a1a1a;
    --bg-card:       #0d0d0d;
    --text-primary:  #e5e5e5;
    --text-muted:    #a0a0a0;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-muted:  rgba(255, 255, 255, 0.12);
    --glass-bg:      rgba(5, 5, 5, 0.75);
    --glass-scrolled:rgba(5, 5, 5, 0.95);
    --overlay-grad:  linear-gradient(to top, rgba(5,5,5,1) 0%, rgba(5,5,5,0.2) 50%, rgba(5,5,5,0.6) 100%);
    --service-card-bg: rgba(255, 255, 255, 0.02);
    --service-card-hover-bg: rgba(255, 255, 255, 0.04);
    --input-bg:      transparent;
    --shadow-color:  rgba(0, 0, 0, 0.5);
}

body.light-mode {
    --bg-primary:    #ffffff;
    --bg-secondary:  #f4f4f5;
    --bg-card:       #ffffff;
    --text-primary:  #111827;
    --text-muted:    #6b7280;
    --border-subtle: rgba(0, 0, 0, 0.07);
    --border-muted:  rgba(0, 0, 0, 0.15);
    --glass-bg:      rgba(255, 255, 255, 0.88);
    --glass-scrolled:rgba(255, 255, 255, 0.98);
    --overlay-grad:  linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.5) 100%);
    --service-card-bg: rgba(0, 0, 0, 0.02);
    --service-card-hover-bg: rgba(0, 0, 0, 0.04);
    --input-bg:      #ffffff;
    --shadow-color:  rgba(0, 0, 0, 0.10);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.5s ease, border-color 0.5s ease;
}

.glass-header-scrolled {
    background: var(--glass-scrolled);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.text-gradient-gold {
    background: linear-gradient(to right, #D4AF37, #F3E5AB);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-gold {
    background: linear-gradient(135deg, #A8812D 0%, #D4AF37 50%, #F3E5AB 100%);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    background-color: transparent;
    border: 1px solid #D4AF37;
    color: #D4AF37;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #A8812D 0%, #D4AF37 50%, #F3E5AB 100%);
    transition: width 0.4s ease;
    z-index: -1;
}

.btn-primary:hover {
    color: #050505;
}

.btn-primary:hover::before {
    width: 100%;
}

.btn-solid-gold {
    background: linear-gradient(135deg, #a6812c 0%, #D4AF37 100%);
    color: #050505;
    border: none;
}
.btn-solid-gold:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.section-padding {
    padding: 6rem 0;
}
@media (min-width: 768px) {
    .section-padding {
        padding: 9rem 0;
    }
}

.service-card {
    background: var(--service-card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.4);
    background: var(--service-card-hover-bg);
    box-shadow: 0 10px 40px -10px rgba(212, 175, 55, 0.15);
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #D4AF37;
    border-radius: 2px;
}

/* Image Overlays */
.img-overlay {
    position: relative;
}
.img-overlay::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-grad);
    transition: background 0.5s ease;
}

/* ===== THEME TOGGLE BUTTON ===== */
#theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #A8812D 0%, #D4AF37 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4), 0 0 0 0 rgba(212, 175, 55, 0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6), 0 0 0 4px rgba(212, 175, 55, 0.15);
}

#theme-toggle:active {
    transform: scale(0.95);
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
    position: absolute;
    font-size: 1.1rem;
    color: #050505;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Dark mode: show moon, hide sun */
#theme-toggle .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.5); }
#theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* Light mode: show sun, hide moon */
body.light-mode #theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
body.light-mode #theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* ===== LIGHT MODE OVERRIDES (Tailwind-hard-coded classes) ===== */
/* Text colors that Tailwind hard-codes and don't use CSS vars */
body.light-mode .text-white           { color: #111827 !important; }
body.light-mode .text-gray-300        { color: #4b5563 !important; }
body.light-mode .text-gray-400        { color: #6b7280 !important; }
body.light-mode h1, body.light-mode h2,
body.light-mode h3, body.light-mode h4 { color: #111827; }

/* ===== HERO SECTION: sempre sobre imagem escura, texto sempre branco ===== */
body.light-mode #home .text-white,
body.light-mode #home h1,
body.light-mode #home span,
body.light-mode #home p              { color: #ffffff !important; }
/* Garante que o subtítulo também permaneça legível */
body.light-mode #home .text-gray-300 { color: rgba(255,255,255,0.85) !important; }
/* Restaura o overlay escuro na hero para manter contraste com a imagem */
body.light-mode #home .img-overlay::after {
    background: linear-gradient(to top, rgba(5,5,5,0.92) 0%, rgba(5,5,5,0.3) 50%, rgba(5,5,5,0.65) 100%) !important;
}

/* ===== NAVIGATION LINKS (Desktop) ===== */
body.light-mode header nav a                 { color: #1f2937 !important; }
body.light-mode header nav a:hover           { color: #D4AF37 !important; }

/* Botão hamburguer (mobile) */
body.light-mode #mobile-menu-btn             { color: #D4AF37 !important; }

/* Footer navigation links */
body.light-mode footer a                     { color: #4b5563 !important; }
body.light-mode footer a:hover               { color: #D4AF37 !important; }
body.light-mode footer h5                    { color: #111827 !important; }
body.light-mode footer p                     { color: #4b5563 !important; }

/* Section backgrounds */
body.light-mode .bg-brand-dark,
body.light-mode .bg-brand-dark\/95    { background-color: var(--bg-primary) !important; }
body.light-mode .bg-brand-gray        { background-color: var(--bg-secondary) !important; }
body.light-mode .bg-\[\#030303\]      { background-color: var(--bg-secondary) !important; }

/* Borders adjusted for light */
body.light-mode .border-white\/5      { border-color: var(--border-subtle) !important; }
body.light-mode .border-white\/10     { border-color: var(--border-muted) !important; }
body.light-mode .border-white\/20     { border-color: var(--border-muted) !important; }

/* Cards in catalog */
body.light-mode .catalogo-item .relative.overflow-hidden {
    background-color: #f4f4f5 !important;
    border-color: var(--border-subtle) !important;
}

/* Input fields */
body.light-mode input[type="text"],
body.light-mode input[type="email"] {
    background-color: var(--input-bg) !important;
    color: #111827 !important;
    border-color: var(--border-muted) !important;
}
body.light-mode input::placeholder { color: #9ca3af !important; }

/* Mobile menu */
body.light-mode #mobile-menu {
    background: rgba(255, 255, 255, 0.97) !important;
}
body.light-mode #mobile-menu a {
    color: #111827 !important;
}

/* Logo - remove dark invert filter in light mode so it shows naturally */
body.light-mode .filter.brightness-0.invert {
    filter: none !important;
    opacity: 0.85;
}

/* Footer divider line */
body.light-mode .border-white\/10.pt-8 {
    border-color: var(--border-muted) !important;
}

/* Trust badges section */
body.light-mode #trust-badges {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-subtle) !important;
}

/* Materials cards */
body.light-mode #materiais .border {
    background-color: #fff !important;
}

/* Process section step circles */
body.light-mode .bg-brand-dark.border.border-brand-gold {
    background-color: var(--bg-primary) !important;
}

/* Catalog badge label */
body.light-mode .absolute.top-4.right-4.bg-brand-dark\/95 {
    background-color: rgba(245,240,232,0.95) !important;
}

/* Tab buttons */
body.light-mode .tab-btn:not(.active) {
    color: #5a5040 !important;
    border-color: var(--border-muted) !important;
}

/* Zona franca gradient overlay */
body.light-mode .bg-gradient-to-l.from-brand-gray\/50 {
    background: linear-gradient(to left, rgba(237,231,217,0.5), transparent) !important;
}

/* Technology section icon circles */
body.light-mode .w-16.h-16.rounded-full.bg-brand-dark {
    background-color: var(--bg-secondary) !important;
}

/* ===== MOBILE MENU OVERLAY ===== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 2rem;
    gap: 0;
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 320px;
}

.mobile-nav-link {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #e5e5e5;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    width: 100%;
    text-align: center;
    position: relative;
    transition: color 0.3s ease;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.35rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #D4AF37;
    transition: width 0.35s ease;
}

.mobile-nav-link:hover {
    color: #D4AF37;
}

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

.mobile-nav-cta {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 200px;
    font-size: 0.8rem;
}

.mobile-lang-row {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

/* Light mode overrides for new mobile menu */
body.light-mode .mobile-menu-overlay {
    background: rgba(255, 255, 255, 0.97);
}
body.light-mode .mobile-nav-link {
    color: #111827;
}
body.light-mode .mobile-nav-link:hover {
    color: #D4AF37;
}

/* ===== LANG SWITCHER ===== */
.lang-switcher-container {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(26, 26, 26, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    color: #e5e5e5;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lang-dropdown-btn:hover {
    border-color: rgba(212, 175, 55, 0.5);
    color: #D4AF37;
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 140px;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem;
    z-index: 60;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    color: #e5e5e5;
    font-size: 0.875rem;
    text-align: left;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lang-dropdown-item:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #A8812D;
}

/* ===== NEW LANG SWITCHER (lang-switcher-btn / lang-dropdown) ===== */
.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    background: rgba(26, 26, 26, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 9999px;
    color: #e5e5e5;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.lang-switcher-btn:hover {
    border-color: rgba(212, 175, 55, 0.7);
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.08);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 148px;
    background: rgba(8, 8, 8, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 0.6rem;
    padding: 0.4rem;
    z-index: 200;
    box-shadow: 0 12px 30px -6px rgba(0,0,0,0.6);
    animation: dropIn 0.18s ease;
}
.lang-dropdown.open { display: block; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    color: #c8c8c8;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    text-align: left;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    background: none;
    border: none;
}
.lang-option:hover { background: rgba(212,175,55,0.12); color: #D4AF37; }
.lang-option.active { color: #D4AF37; font-weight: 600; }

.mobile-lang-option { cursor: pointer; background: none; border: none; padding: 0.25rem 0; }
.mobile-lang-option.active { color: #D4AF37 !important; }

body.light-mode .lang-switcher-btn {
    background: rgba(255,255,255,0.6);
    border-color: rgba(168,129,45,0.3);
    color: #374151;
}
body.light-mode .lang-dropdown {
    background: rgba(255,255,255,0.97);
    border-color: rgba(212,175,55,0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
body.light-mode .lang-option { color: #374151; }
body.light-mode .lang-option:hover,
body.light-mode .lang-option.active { color: #A8812D; }
