/* Sections */
section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

h2 {
    font-size: 2.8rem;
    margin-bottom: 3rem;
    color: #1e3c72;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #1e3c72, #64b5f6);
    border-radius: 2px;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 4rem 2rem;
    margin: 0;
    max-width: 100%;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: bold;
    color: #64b5f6;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Service Cards */
.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    border: 1px solid rgba(30, 60, 114, 0.1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #1e3c72, #64b5f6);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.service-card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    transition: all 0.4s ease;
}

.service-card:hover .service-card-icon {
    transform: scale(1.2) rotate(5deg);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1e3c72;
}

.service-card p {
    color: #666;
    line-height: 1.8;
}

/* About Section */
#chi-siamo-idraulica,
#chi-siamo-edilizia {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 0;
    max-width: 100%;
    padding: 5rem 2rem;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #444;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-features {
    list-style: none;
    margin-top: 2rem;
}

.about-features li {
    padding: 1rem;
    padding-left: 3rem;
    position: relative;
    margin-bottom: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.about-features li:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.about-features li:before {
    content: "✓";
    position: absolute;
    left: 1rem;
    color: #2a5298;
    font-weight: bold;
    font-size: 1.5rem;
}

/* Contact Cards */
.contact-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.contact-card-icon {
    font-size: 3rem;
    color: #2a5298;
    margin-bottom: 1rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.contact-card:hover .contact-card-icon {
    transform: scale(1.2) rotate(10deg);
}

.contact-card h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.contact-card a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.contact-card a:hover {
    color: #1e3c72;
}

/* Map Section */
.map-section {
    background: var(--card-bg);
    padding: 5rem 2rem;
}

.map-container {
    max-width: 1200px;
    margin: 3rem auto 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px var(--shadow);
    height: 450px;
    position: relative;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Custom Map Marker Overlay */
.map-marker-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 10;
    pointer-events: none;
}

.custom-marker {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    font-weight: bold;
    white-space: nowrap;
    position: relative;
}

.custom-marker::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--primary-color);
}

.custom-marker i {
    margin-right: 0.5rem;
}

/* Certifications */
.certifications {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: var(--light-bg);
}

.cert-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.cert-badge {
    background: var(--card-bg);
    padding: 2rem 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
}

.cert-badge:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--shadow);
}

.cert-badge h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Blog Styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow);
    transition: all 0.4s ease;
}

.blog-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 60px var(--shadow);
}

.blog-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.blog-content {
    padding: 2rem;
}

.blog-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.blog-card p {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.read-more:hover {
    gap: 1rem;
    color: var(--secondary-color);
}

/* Blog Article Modal */
.blog-article-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    overflow-y: auto;
    padding: 2rem;
}

.blog-article-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.blog-article-content {
    background: var(--card-bg);
    max-width: 900px;
    width: 100%;
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-article-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.blog-article-close:hover {
    background: var(--secondary-color);
    transform: rotate(90deg);
}

.blog-article-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: left;
}

.blog-article-content h2::after {
    display: none;
}

.blog-article-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.blog-article-meta i {
    margin-right: 0.5rem;
}

.blog-article-body {
    color: var(--text-color);
    line-height: 1.8;
    font-size: 1.05rem;
}

.blog-article-body h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.blog-article-body p {
    margin-bottom: 1.2rem;
}

.blog-article-body ul, .blog-article-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-article-body li {
    margin-bottom: 0.8rem;
}

.blog-article-body strong {
    color: var(--primary-color);
}

.blog-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-top: 3rem;
}

.blog-cta h4 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.blog-cta p {
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.blog-cta a {
    display: inline-block;
    background: var(--card-bg);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.blog-cta a:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}



/* FAQ Answer Animation */
.faq-item {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.faq-item:hover {
    background-color: rgba(30, 60, 114, 0.05);
}

body.dark-mode .faq-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 15px;
    opacity: 0;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
}

.faq-item.active .faq-question {
    color: var(--accent-color);
    font-weight: 700;
}

.faq-item .faq-question::after {
    content: '+';
    float: right;
    font-weight: bold;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    content: '−';
    transform: rotate(180deg);
}

/* Blog Article Modal Transition */
.blog-article-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}


/* Extended Dark Mode Coverage */
body.dark-mode .service-box,
body.dark-mode .service-card,
body.dark-mode .about-text,
body.dark-mode .stat-card,
body.dark-mode .review-card,
body.dark-mode .blog-card,
body.dark-mode .blog-article-content,
body.dark-mode .faq-item,
body.dark-mode .contact-form,
body.dark-mode .price-card {
    background: var(--card-bg);
    color: var(--text-color);
}

body.dark-mode .cookie-settings-content {
    background: var(--card-bg);
    color: var(--text-color);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: var(--text-color);
}

body.dark-mode footer {
    background: #0d1b2a;
}

body.dark-mode header {
    background: rgba(22, 33, 62, 0.95);
}

body.dark-mode header.scrolled {
    background: rgba(22, 33, 62, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .blog-article-body {
    color: var(--text-color);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #1a1a2e;
    color: var(--text-color);
    border-color: #2a5298;
}