/* ===== VARIABILI ===== */
:root {
    /* Colori principali */
    --primary-color: #0056b3;
    --secondary-color: #003366;
    --accent-color: #ff9900;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --black: #212529;
    
    /* Sfumature */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--accent-color), #ff6b00);
    
    /* Ombre */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    /* Transizioni */
    --transition: all 0.3s ease;
    
    /* Bordi */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Spaziature */
    --section-padding: 100px 0;
    --section-padding-sm: 60px 0;
    
    /* Font */
    --font-primary: 'Roboto', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-header h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
}

.section-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

.bg-light {
    background-color: var(--light-gray);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* ===== BOTTONI ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    margin-left: 15px;
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    padding: 10px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.logo img {
    height: 50px;
    transition: var(--transition);
}

.header.scrolled .logo img {
    height: 40px;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu li {
    margin-left: 30px;
    position: relative;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: relative;
    padding: 5px 0;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover:after,
.nav-link.active:after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
}

/* Menu Mobile */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 100%;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: var(--transition);
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    background: url('../img/mb339.jpeg') no-repeat center center/cover;
    color: var(--white);
    padding: 200px 0;
    text-align: center;
    margin-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== CHI SIAMO ===== */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-top: 40px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-image {
    flex: 1;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.about-image:hover img {
    transform: scale(1.03);
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-text {
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* ===== SERVIZI ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px 25px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
    transition: var(--transition);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-card:hover:before {
    height: 100%;
}

.service-card:hover .service-icon {
    background: var(--white);
    color: var(--primary-color);
}

.service-card:hover h3,
.service-card:hover p {
    color: var(--white);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: var(--transition);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    transition: var(--transition);
}

.service-card p {
    color: var(--gray-color);
    margin-bottom: 0;
    transition: var(--transition);
}

/* ===== PROGETTI ===== */
.projects-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    gap: 10px;
}

.filter-btn {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    margin: 0 5px 10px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    position: relative;
}

.project-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 220px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 25px;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.project-content p {
    color: var(--gray-color);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.project-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== VIDEO ===== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-container {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.video-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-placeholder {
    position: relative;
    padding-bottom: 56.25%;
    background: var(--light-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
}

.video-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.video-container h3 {
    padding: 20px;
    text-align: center;
    font-size: 1.2rem;
    color: var(--dark-color);
}

/* ===== CONTATTI ===== */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    margin-top: 40px;
}

.contact-info {
    padding: 30px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 15px;
}

.contact-info h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.contact-details {
    margin: 30px 0;
}

.contact-item {
    display: flex;
    margin-bottom: 25px;
    align-items: flex-start;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.contact-text h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.contact-text p,
.contact-text a {
    color: var(--gray-color);
    margin: 0;
    line-height: 1.6;
}

.contact-text a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--light-gray);
    color: var(--dark-color);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.contact-form {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.form-check-input {
    margin-right: 10px;
    margin-top: 5px;
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--gray-color);
    line-height: 1.5;
}

.privacy-link {
    color: var(--primary-color);
    text-decoration: underline;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

/* ===== MAPPA ===== */
.map-container {
    width: 100%;
    height: 450px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-color);
    color: var(--light-gray);
    padding: 80px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo img {
    height: 50px;
    margin-bottom: 20px;
}

.footer-logo p {
    margin: 15px 0;
    opacity: 0.8;
    line-height: 1.7;
}

.footer h4 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}

.footer-links ul li,
.footer-services ul li {
    margin-bottom: 12px;
}

.footer-links ul li a,
.footer-services ul li a {
    color: var(--light-gray);
    opacity: 0.8;
    transition: var(--transition);
    display: inline-block;
}

.footer-links ul li a:hover,
.footer-services ul li a:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    line-height: 1.6;
}

.footer-contact ul li i {
    color: var(--accent-color);
    margin-right: 15px;
    margin-top: 5px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
}

.footer-copyright {
    margin-bottom: 15px;
}

.footer-legal {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-legal a {
    color: var(--light-gray);
    opacity: 0.8;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--accent-color);
    opacity: 1;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    .section {
        padding: 80px 0;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-text,
    .about-image {
        width: 100%;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
}

@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        margin: 15px 0;
    }
    
    .hero {
        padding: 150px 0;
        margin-top: 70px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-secondary {
        margin-left: 0;
    }
    
    .stats {
        flex-direction: column;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 575.98px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .hero {
        padding: 120px 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 20px;
        right: 20px;
    }
}

/* Stili per la modale e la galleria kit */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #333;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #e74c3c;
}

.kit-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kit-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.kit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.kit-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.kit-description {
    padding: 15px;
}

.kit-description h3 {
    margin-top: 0;
    color: #2c3e50;
}


/* Aggiungi questo alla fine del file style.css */
.hero-content {
    position: absolute;
    top: 140px;      /* Distanza dal bordo superiore */
    left: 40px;     /* Distanza dal bordo sinistro */
    text-align: left;
    width: auto;
    max-width: 600px;
    padding: 0;     /* Rimosso il padding */
}

.hero h1 {
    margin: 0;
    padding: 0;
    font-size: 3.0rem;
    line-height: 1.3;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Assicurati che la sezione hero abbia position:relative */
.hero {
    position: relative;
}



/* Aggiungi questo alla fine del file style.css */
.hero {
    background-position: center 50%;  /* 50% è il centro, meno di 50% sposta verso l'alto */
    background-size: cover;
    height: 80vh;  /* Mantieni l'altezza della viewport */
    overflow: hidden;  /* Nasconde la parte che esce dal contenitore */
}

/* Se vuoi vedere più in basso nell'immagine, aumenta la percentuale */
.hero {
    background-position: center 20%;  /* Più alto il numero, più si sposta verso il basso */
}