/* --- FONTS & VARIABLES --- */
:root {
    --primary-color: #0d2c4b;  /* Deep Navy Blue */
    --accent-color: #fca311;   /* Vibrant Gold/Orange */
    --dark-color: #141414;
    --light-color: #f8f9fa;
    --text-color: #343a40;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
    --container-width: 1140px;
    --header-height: 80px;
}

/* --- BASE STYLES --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }
body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-color);
    background-color: #ffffff;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--primary-color); font-weight: 700; }
.container { max-width: var(--container-width); margin: auto; padding: 0 1.5rem; }

/* --- GLOBAL CLASSES --- */
.page-section { padding: 6rem 0; }
.page-section.alt-bg { background-color: var(--light-color); }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-size: 2.8rem; margin-bottom: 0.5rem; }
.section-subtitle { font-size: 1.1rem; color: #6c757d; max-width: 600px; margin: auto; }
.btn {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

/* --- HEADER & NAVIGATION --- */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}
.logo { font-size: 1.8rem; font-family: var(--font-heading); color: var(--primary-color); font-weight: 700; }
.navbar a {
    color: var(--primary-color);
    margin-left: 2rem;
    font-weight: 700;
    position: relative;
    padding: 5px 0;
}
.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}
.navbar a:hover::after, .navbar a.active::after { width: 100%; }
#mobile-menu-icon { font-size: 2.5rem; color: var(--primary-color); cursor: pointer; display: none; }

/* --- HERO SECTION --- */
.hero {
    height: calc(100vh - var(--header-height));
    min-height: 600px;
    background: url('../images/sfondo.jpg') no-repeat center center/cover;
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
}
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(13, 44, 75, 0.7); }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 800px; margin: auto; padding: 0 1rem; }
.hero h1 { font-size: 3.8rem; color: #fff; margin-bottom: 1rem; line-height: 1.2; }
.hero p { font-size: 1.3rem; margin-bottom: 2rem; color: rgba(255,255,255,0.9); }

/* --- SERVICES SECTION --- */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.service-card {
    background: #fff;
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.service-icon { 
    font-size: 3rem; 
    color: var(--accent-color); 
    margin-bottom: 1rem; 
    transition: transform 0.3s ease-in-out; /* Add smooth transition for icon */
}
.service-card h3 { margin-bottom: 0.5rem; font-size: 1.3rem; }


.about-us-container { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4rem; align-items: center; }
.about-us-image img { border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.about-us-content .section-title { text-align: left; }
.about-us-content p { margin-bottom: 2rem; }
.feature-grid { margin-bottom: 2rem; }
.feature-item { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.feature-icon { font-size: 2rem; color: var(--accent-color); }


.portfolio-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* More responsive */
    gap: 1.5rem; 
}
.portfolio-item { overflow: hidden; border-radius: 10px; position: relative; }
.portfolio-item img { transition: transform 0.4s ease; }
.portfolio-item:hover img { transform: scale(1.1); }


.contact-section { background: var(--primary-color); color: #fff; }
.contact-section .section-title { color: #fff; }
.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.contact-text p { color: rgba(255,255,255,0.8); margin-bottom: 2rem; }
.contact-info p { display: flex; align-items: center; margin-bottom: 1rem; font-size: 1.1rem; }
.contact-info i { font-size: 1.5rem; margin-right: 1rem; color: var(--accent-color); }
.contact-form-wrapper { background: #fff; padding: 2.5rem; border-radius: 10px; }
.form-group { margin-bottom: 1.5rem; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

/* --- FOOTER --- */
.footer { background: var(--dark-color); color: #ccc; text-align: center; padding: 2rem 0; }

/* --- ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .about-us-container { grid-template-columns: 1fr; }
    .contact-container { grid-template-columns: 1fr; }
    .contact-text { text-align: center; }
    .contact-info { justify-content: center; }
}


@media (max-width: 768px) {
    :root { 
        --header-height: 70px; 
    }
    .section-title { font-size: 2.2rem; }
    .hero h1 { font-size: 2.8rem; }
    .hero p { font-size: 1.1rem; }

    
    #mobile-menu-icon { 
        display: block; 
        z-index: 1001; 
    }
    
   
    #mobile-menu-icon.bx-x {
        color: #fff; 
    }

    .navbar {
        position: fixed; 
        top: 0;
        left: -100%; 
        width: 100%;
        height: 100vh; 
        background: rgba(13, 44, 75, 0.98); 
        backdrop-filter: blur(8px); 

       
        display: flex;
        flex-direction: column; 
        justify-content: center; 
        align-items: center; 
        
        transition: left 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
    }

   
    .navbar.active {
        left: 0;
    }

    
    .navbar a {
        color: #fff; 
        margin: 1.5rem 0; /
        font-size: 1.8rem; 
    }
    .navbar a::after {
        background: var(--accent-color); 
    }

    
    .services-grid { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }
}


.icon-container {
    position: relative;
    height: 48px; /* Corresponds to font-size: 3rem */
    width: 100%;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 1. Gardening Icon: Gentle Bloom and Twinkle Effect */

/* The flower icon itself will transition smoothly */
#gardening-icon {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* The pseudo-elements will become our sparkles */
.icon-container::before,
.icon-container::after {
    content: '✦';
    position: absolute;
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0;
    z-index: -1;
}

/* Position the sparkles initially */
.icon-container::before { top: 0; left: 40%; }
.icon-container::after { bottom: 0; right: 40%; }

/* The animation that makes the sparkles appear, move, and disappear */
@keyframes twinkle {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1.5) rotate(90deg); opacity: 0; }
}

/* ON HOVER: Trigger the animations */
.service-card:hover #gardening-icon {
    transform: scale(1.2) rotate(10deg); /* The bloom effect */
}
.service-card:hover .icon-container::before {
    animation: twinkle 0.8s ease-out; /* The first sparkle */
}
.service-card:hover .icon-container::after {
    animation: twinkle 0.8s ease-out 0.2s; /* The second sparkle, slightly delayed */
}


/* 2. Maintenance Icon: Heartbeat Effect (Restored) */
@keyframes heartbeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.15); }
  40% { transform: scale(1); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.service-card:hover #maintenance-icon {
  animation: heartbeat 1s ease-in-out;
}



@keyframes wobble {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  50% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); }
  100% { transform: rotate(0deg); }
}
.service-card:hover #plumbing-icon {
  animation: wobble 0.7s ease-in-out;
}


@keyframes flash {
  0%, 100% { color: var(--accent-color); text-shadow: none; }
  50% { color: #fff; text-shadow: 0 0 8px #ffc107, 0 0 16px #ffc107, 0 0 24px #ffc107; }
}
.service-card:hover #electrical-icon {
  animation: flash 1.2s ease-in-out;
}

.portfolio-filters {
    text-align: center;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--dark-color);
    padding: 0.6rem 1.2rem;
    margin: 0 0.3rem;
    cursor: pointer;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.portfolio-item {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.portfolio-item.hidden {
    transform: scale(0.9);
    opacity: 0;
    width: 0; 
    padding: 0;
    margin: 0;
    overflow: hidden;
}


.hero-location {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hero-location .bxs-map-pin {
    color: var(--accent-color);
}