/* Global CSS - Header and Footer styles */
/* Scoped with page-specific IDs to prevent inheritance */

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 110px;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    color: #1a1a1a;
    background: #f9fafb;
    padding-top: 110px;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 40px;
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    z-index: 2000;
    transition: 0.3s ease;
}

@keyframes headerReveal {
    from { transform: translateY(-100%); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
}

header.scrolled {
    animation: headerReveal 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Logo animation */
.brand {
    transition: 0.3s ease;
}

/* When scrolled */
header.scrolled {
    justify-content: center;
}

/* Hide logo when scrolled */
header.scrolled .brand {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: scale(0);
}

/* Center menu */
header.scrolled nav {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.2rem;
}

.brand img {
    width: auto;
    max-width: 275px;
    height: 129px;
    object-fit: contain;
    object-position: center;
    display: block;
}

nav {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

nav a {
    margin-left: 15px;
    text-decoration: none;
    color: #000;
    font-weight: 600;
    font-size: 1.02rem;
    padding: 8px 5px;
    background: transparent;
    border: none;
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

nav a i {
    margin-right: 8px;
    font-size: 0.95rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: inline-block;
}

nav a:hover i {
    opacity: 1;
    transform: scale(1.2);
    color: #2e7d32;
    filter: drop-shadow(0 0 5px rgba(46, 125, 50, 0.4));
}

/* Micro-animations */
.dropdown:hover .fa-gears,
nav a:hover .fa-gears {
    animation: fa-spin 3s infinite linear;
}

nav a:hover .fa-bolt-lightning {
    animation: pulse-bolt 0.5s ease-in-out infinite alternate;
}

nav a:hover .fa-paper-plane {
    transform: translateX(3px) translateY(-3px) scale(1.2);
}

@keyframes pulse-bolt {
    from { transform: scale(1.2) rotate(0deg); filter: drop-shadow(0 0 2px rgba(46, 125, 50, 0.4)); }
    to { transform: scale(1.3) rotate(10deg); filter: drop-shadow(0 0 8px rgba(46, 125, 50, 0.8)); }
}

nav a:hover {
    color: #2e7d32;
    background: transparent;
    border: none;
}

/* Active page style */
.active-page {
    color: #2e7d32 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid #2e7d32 !important;
    border-radius: 0 !important;
    padding: 8px 5px !important;
}

.active-page i {
    color: #2e7d32 !important;
    opacity: 1 !important;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 3000;
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    border: 1px solid #eee;
    padding: 8px 0;
}

.dropdown-content::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.dropdown-content a {
    color: #111 !important;
    padding: 12px 20px !important;
    text-decoration: none !important;
    display: block !important;
    background: white !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    transition: 0.2s;
    text-align: left !important;
}

.dropdown-content a:hover {
    background-color: #f0f7f0 !important;
    color: #2e7d32 !important;
    padding-left: 25px !important;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown:hover .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown:hover > a#services-toggle {
    color: #2e7d32 !important;
}

.dropdown:hover > a#services-toggle i {
    opacity: 1;
    transform: scale(1.2);
    color: #2e7d32;
    filter: drop-shadow(0 0 5px rgba(46, 125, 50, 0.4));
}

.dropdown:hover > a#services-toggle i.fa-chevron-down {
    transform: scale(1.2) rotate(180deg);
}

header.scrolled .dropdown:hover > a#services-toggle i {
    color: #a5d6a7 !important;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: 0.8;
}

.mobile-submenu {
    display: none;
}

@media (max-width: 1150px) {
    .dropdown .dropdown-content { display: none !important; }
    
    .mobile-submenu {
        background: #fdfdfd;
        border-radius: 8px;
        margin: 5px 0 10px 20px;
        border-left: 2px solid #2e7d32;
    }
    
    .mobile-submenu a {
        display: block;
        background: transparent !important;
        border: none !important;
        padding: 10px 15px !important;
        font-size: 0.95rem !important;
        opacity: 0.8;
    }
    
    .mobile-submenu.active {
        display: block;
    }
    
    .nav-links .dropdown > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .arrow-trigger {
        padding: 10px 15px;
        margin: -10px -15px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-left: 1px solid rgba(0,0,0,0.05);
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(120px); }
    to { opacity: 1; transform: translateY(-80px); }
}

@keyframes fadeInUpMobile {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Menu toggle */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #2e7d32;
    transition: 0.3s;
}

header.scrolled .menu-toggle {
    color: white;
}

.sidebar-header, .sidebar-footer, #close-menu { display: none; }
.nav-links { display: contents; }

@media(max-width: 1150px) {
    body { padding-top: 100px; }
    header {
        justify-content: space-between;
        padding: 15px 30px;
        flex-direction: row !important;
        background: white !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        z-index: 4000;
    }
    
    .brand img {
        max-width: 240px !important;
    }
    
    .menu-toggle {
        display: block;
        color: #2e7d32 !important;
        font-size: 2rem;
        cursor: pointer;
    }

    nav {
        position: fixed !important;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        height: 100dvh;
        background: white !important;
        display: flex !important;
        flex-direction: column;
        padding: 40px 20px !important;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 3000;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-top: 4px solid #2e7d32;
        border-left: 4px solid #2e7d32;
        overflow-y: auto;
    }
    
    nav.active { right: 0 !important; }
    
    .sidebar-header {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-bottom: 40px;
        padding: 0 10px;
    }
    
    nav .sidebar-header h2 {
        margin: 0;
        padding: 0;
        font-size: 1.8rem !important;
        font-weight: 800 !important;
        color: #2e7d32 !important;
        letter-spacing: -1px !important;
        text-align: left;
        width: 100%;
    }
    
    #close-menu {
        position: absolute;
        top: 40px;
        right: 20px;
        font-size: 1.6rem;
        cursor: pointer;
        color: #111;
        z-index: 2100;
        width: 44px;
        height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: background 0.2s ease;
    }
    
    #close-menu:hover {
        background: #f0f0f0;
    }
    
    .nav-links {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        flex: 1;
        width: 100% !important;
        align-items: flex-start !important;
    }
    
    .dropdown {
        width: 100% !important;
        display: block !important;
    }

    .nav-links a {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 14px 15px !important;
        text-align: left !important;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        color: #000 !important;
        background: transparent !important;
        font-size: 1.1rem !important;
        transition: all 0.3s ease;
    }

    #services-toggle {
        justify-content: space-between !important;
    }

    .arrow-trigger {
        margin-left: auto !important;
        display: flex !important;
        align-items: center !important;
    }

    .nav-links a.active-page {
        border-bottom: 2px solid #2e7d32 !important;
        color: #2e7d32 !important;
        font-weight: 700 !important;
    }

    .nav-links a:hover {
        color: #2e7d32 !important;
        background: #f9fdf9 !important;
    }

    .sidebar-footer {
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid #eee;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .sidebar-footer p {
        margin: 0;
        font-size: 0.9rem;
        color: #666;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .sidebar-footer .sidebar-social-links {
        margin-top: 15px;
        display: flex;
        gap: 20px;
        align-items: center;
    }
    
    .sidebar-footer .sidebar-social-links a {
        background: transparent !important;
        border: none !important;
        text-decoration: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
    }
    
    .sidebar-footer .sidebar-social-links a:hover {
        transform: scale(1.15);
    }
    
    .sidebar-footer .sidebar-social-links a i {
        font-size: 2rem !important;
        opacity: 1 !important;
        margin: 0 !important;
    }
    
    .sidebar-footer .sidebar-social-links a.fb-icon i { color: #0866FF !important; }
    .sidebar-footer .sidebar-social-links a.ig-icon i { color: #E4405F !important; }
    .sidebar-footer .sidebar-social-links a.wa-icon i { color: #25D366 !important; }
    
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 2500;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .overlay.active { display: block !important; opacity: 1; }

    .dropdown .dropdown-content { display: none !important; }
    .mobile-submenu { background: #fdfdfd; border-radius: 8px; margin: 5px 0 10px 20px; border-left: 2px solid #2e7d32; display: none; }
    .mobile-submenu a { display: block !important; background: transparent !important; border: none !important; padding: 10px 15px !important; font-size: 0.95rem !important; opacity: 0.8; }
    .mobile-submenu.active { display: block; }
}

@media (min-width: 1151px) {
    header.scrolled nav {
        width: 100%;
        justify-content: center;
        gap: 12px;
        transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    }
}

header.scrolled nav a {
    padding: 8px 10px;
    font-size: 0.95rem;
    color: white;
    border: none;
    background: transparent;
}

header.scrolled nav a:hover {
    background: transparent;
    color: #a5d6a7;
}

header.scrolled nav a:hover i {
    color: #a5d6a7 !important;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

header.scrolled .active-page {
    color: white !important;
    border: none !important;
    background: transparent !important;
    border-bottom: 2px solid white !important;
    border-radius: 0 !important;
}

header.scrolled .active-page i {
    color: white !important;
}

header.scrolled {
    background: #2e7d32;
    height: 60px;
    padding: 0 20px;
    justify-content: flex-start;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    animation: headerReveal 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

header.scrolled .brand {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: scale(0);
    transition: 0.3s ease;
}

@media (min-width: 1151px) {
  header.scrolled nav {
      width: 100%;
      justify-content: center;
      gap: 12px;
      transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  }
}

header.scrolled nav a{
  padding: 8px 10px;
  font-size: 0.95rem;
  color:white;
  border:none;
  background:transparent;
}

header.scrolled nav a:hover{
  background:transparent;
  color: #a5d6a7;
}

header.scrolled nav a:hover i {
  color: #a5d6a7 !important;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

header.scrolled .dropdown:hover > a#services-toggle {
  color: #a5d6a7 !important;
}

header.scrolled .dropdown:hover > a#services-toggle i {
  color: #a5d6a7 !important;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* Footer styles */
footer {
    background: #111;
    color: #ccc !important;
    text-align: center;
    padding: 15px 20px !important;
    margin-top: 60px !important;
    min-height: 50px !important;
    height: 50px !important;
    box-sizing: border-box !important;
    display: block !important;
}

footer p {
    color: #ccc !important;
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    line-height: 1.5;
    min-height: 20px;
}

.footer-separator {
    margin: 0 25px;
    opacity: 0.3;
}

footer a {
    color: #2e7d32;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Footer Mobile Optimization */
@media (max-width: 768px) {
    footer {
        padding: 20px 15px !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    footer p {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 5px;
        line-height: 1.6;
    }
    
    .footer-separator {
        margin: 0;
        display: none;
    }
    
    footer a {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    footer {
        padding: 18px 12px !important;
    }
    
    footer p {
        font-size: 0.8rem;
    }
    
    footer a {
        font-size: 0.75rem;
    }
}

/* WhatsApp float button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 3000;
    text-decoration: none;
    transition: 0.3s ease;
}

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

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 26px;
    }
}

/* Reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes revealButton {
  0% { transform: translate(100vw, 0); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}
