/* CSS variables for the color palette */
:root {
    --william: #3a6862;
    --tasman: #cbd6cd;
    --mariner: #2471b9;
    --fern: #5eb657;
    --dark-text: #2c2c2c;
    --light-text: #ffffff;
    --bg-color: #f0f2f5;
    --whatsapp-green: #25d366;
}

/* General body and typography styles */
body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--dark-text);
    line-height: 1.6;
    overflow-x: hidden; /* Prevents horizontal scroll from animations */
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-top: 0;
}

a {
    text-decoration: none;
    color: var(--mariner);
}

/* Keyframe animations for a more dynamic feel */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes lineGrow {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* New top header for address and social icons */
.top-header {
    background-color: var(--william);
    color: var(--light-text);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header .social-icons a {
    color: var(--light-text);
    font-size: 1rem;
    margin-right: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.top-header .social-icons a:hover {
    color: var(--fern);
    transform: scale(1.2);
}

.top-header .address-info {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-header .address-info i {
    color: var(--fern);
}

/* Animated separation line */
.animated-divider {
    height: 2px;
    background-color: var(--fern);
    margin: 0 auto;
    animation: lineGrow 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Main Header with centered logo and menu */
.main-header {
    background-color: var(--light-text);
    padding: 0.5rem 2rem 1rem; /* Adjust padding to stack elements */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: padding 0.3s ease;
}

.main-header .logo img {
    /* Using the logo's actual dimensions by removing explicit CSS sizing */
    transition: transform 0.3s ease;
    margin-bottom: 1rem; /* Space between logo and nav menu */
    max-height:60px;
    max-width:120px;
}

.main-header .logo a:hover img {
    transform: scale(1.05);
}

/* Navigation Menu styles (used in both main and sticky headers) */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--william);
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--fern);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* The new sticky navigation bar */
.sticky-nav {
    background-color: var(--william);
    color: var(--light-text);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center; /* Center the navigation links */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.sticky-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sticky-nav .nav-menu a {
    color: var(--light-text); /* White text for the sticky nav */
}

.sticky-nav .nav-menu a::after {
    background-color: var(--fern); /* Green underline for the sticky nav */
}

.hamburger {
    display: none; /* Initially hidden on desktop */
    background: none;
    border: none;
    color: var(--william);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section - now with a static background image */
.hero {
    position: relative; /* Essential for containing the overlay */
    height: 80vh; /* Set a specific height for the hero section */
    background-size: cover;
    background-position: center;
    color: var(--light-text);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Overlay to make text readable */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Adjust opacity for desired darkness */
}

/* The content of the hero section, to be placed on top of the overlay */
.hero-content {
    position: relative;
    z-index: 1; /* Ensures text is above the overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    color: var(--light-text);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1s ease-out;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    max-width: 700px;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.5s forwards;
    opacity: 0;
}

.cta-button {
    background-color: var(--fern);
    color: var(--light-text);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.8s ease-out 1s forwards;
    opacity: 0;
}

.cta-button:hover {
    background-color: var(--mariner);
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Content Sections */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    color: var(--william);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.section-header p {
    max-width: 800px;
    margin: 0 auto;
    color: #666;
}

/* Combined grid for About Us and Mission/Vision cards */
.about-grid, .why-puffz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--tasman);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: var(--mariner);
    margin-bottom: 1rem;
}

.card i {
    font-size: 2.5rem;
    color: var(--mariner);
    margin-bottom: 1rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--tasman);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Gallery Section */
.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Location Section */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Job Vacancies Section */
.job-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.job-card {
    background-color: var(--tasman);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.job-card h4 {
    margin: 0;
    color: var(--william);
    font-size: 1.25rem;
}

.job-card p {
    margin: 0.5rem 0 0;
}

.apply-button {
    background-color: var(--fern);
    color: var(--light-text);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.apply-button:hover {
    background-color: var(--mariner);
}

/* Contact Section */
.contact-content {
    display: flex;
    flex-direction: column; /* Forces a single column on all screen sizes */
    gap: 2rem;
}

.contact-form, .contact-info {
    background-color: var(--tasman);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.contact-form h3, .contact-info h3 {
    color: var(--mariner);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--mariner);
}

.submit-button {
    background-color: var(--fern);
    color: var(--light-text);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: var(--william);
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info ul li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.contact-info ul li i {
    color: var(--mariner);
    margin-right: 1rem;
    font-size: 1.25rem;
}

/* Footer */
.footer {
    background-color: var(--william);
    color: var(--light-text);
    text-align: center;
    padding: 2rem;
}

/* Floating action buttons container */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

/* Back to Top button */
#back-to-top {
    background-color: var(--mariner);
    color: var(--light-text);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    transform: scale(1.1);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* WhatsApp floating icon */
#whatsapp-icon {
    background-color: var(--whatsapp-green);
    color: var(--light-text);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#whatsapp-icon:hover {
    transform: scale(1.1);
}

#whatsapp-icon.visible {
    opacity: 1;
    visibility: visible;
}

/* Success message style */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--fern);
    color: var(--light-text);
    padding: 2rem;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.success-message.visible {
    opacity: 1;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    /* The main header is now a row-based flex container */
    .main-header {
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center; /* Vertically align logo and hamburger */
        position: relative;
    }

    .main-header .logo {
        margin: 0;
       
    }

    .main-header .logo img {
        margin: 0;
        
        
    }
    
   
    /* The hamburger icon is now part of the flex layout, not fixed */
    .hamburger {
        display: block; /* Show hamburger on mobile */
        position: static;
        align-self: center;
        z-index: 1000;
        color: var(--william); /* Set color to match original theme */
    }

    /* Mobile menu panel that slides in */
    .main-header .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Start off-screen */
        width: 70%;
        height: 100vh;
        background-color: var(--william);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease-in-out;
        z-index: 999;
    }

    .main-header .nav-menu.active {
        right: 0;
    }

    /* Dedicated close icon inside the mobile menu */
    .main-header .nav-menu .menu-close-icon {
        background: none;
        border: none;
        color: var(--light-text);
        font-size: 2rem;
        cursor: pointer;
        position: absolute;
        top: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001; /* Higher z-index to be on top of the menu items */
        transition: transform 0.3s ease;
    }

    .main-header .nav-menu .menu-close-icon:hover {
        transform: translateX(-50%) scale(1.1);
    }

    .main-header .nav-menu.active .menu-close-icon {
        display: block; /* Show the close icon when menu is active */
    }
    
    .main-header .nav-menu a {
        color: var(--light-text);
        font-size: 1.2rem;
        padding: 1rem 0;
    }

    .main-header .nav-menu a::after {
        background-color: var(--fern);
    }

    .sticky-nav {
        display: none; /* Hide the sticky nav on mobile, use the main header menu instead */
    }
}



/* Bug fix: Hide the menu close icon on desktop */
.main-header .nav-menu .menu-close-icon {
    display: none;
}