/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F3A712;
    --primary-dark: #d4940f;
    --secondary-color: #333333;
    --secondary-light: #4a4a4a;
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a1a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--text-light);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(51, 51, 51, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: visible;
}

.header * {
    box-sizing: border-box;
}

.header.scrolled {
    background: rgba(51, 51, 51, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: visible;
    isolation: isolate;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 50px;
    width: auto;
    transition: var(--transition);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    position: relative;
    overflow: visible;
}

.nav-links > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item-dropdown {
    margin: 0;
    padding: 0;
    list-style: none;
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

/* Link WIRECRAFT sempre arancione */
.nav-link[href*="wirecraft"] {
    color: var(--primary-color) !important;
}

.nav-link[href*="wirecraft"]::after {
    background: var(--primary-color);
}

.nav-link[href*="wirecraft"]:hover {
    color: var(--primary-dark) !important;
}

/* Dropdown Menu - Spawned outside header */
.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: fixed !important;
    background: rgba(51, 51, 51, 0.98) !important;
    width: max-content !important;
    min-width: 200px;
    max-width: max-content;
    padding: 10px 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    z-index: 1001 !important;
    list-style: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
}

.dropdown-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: auto !important;
}

.dropdown-menu a {
    display: block !important;
    padding: 12px 20px !important;
    color: var(--text-light) !important;
    text-decoration: none !important;
    transition: var(--transition);
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.dropdown-menu a:hover {
    background: rgba(243, 167, 18, 0.2);
    color: var(--primary-color);
    padding-left: 25px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    transition: var(--transition);
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Immagini/switchboards.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(4px);
    transform: scale(1.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(51, 51, 51, 0.85) 0%, rgba(243, 167, 18, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(243, 167, 18, 0.4);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 167, 18, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

.btn-secondary:hover {
    background: var(--text-light);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator span {
    display: block;
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-light);
    border-radius: 25px;
    position: relative;
}

.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* ============================================
   SECTION STYLES
   ============================================ */
section {
    padding: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    position: relative;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.section-description {
    font-size: 1.1rem;
    color: var(--secondary-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
    background: var(--bg-light);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--secondary-light);
}

.about-text .lead {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--text-light);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--secondary-light);
    margin: 0;
}

.about-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.image-slider {
    position: relative;
    width: 100%;
    height: 250px;
}

.image-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.image-slider .slide.active {
    opacity: 1;
}

.image-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 30px;
}

.slider-btn {
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.slider-dots {
    display: flex;
    gap: 8px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background: var(--primary-color);
    width: 25px;
    border-radius: 5px;
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services {
    background: var(--secondary-color);
    color: var(--text-light);
}

.services .section-title {
    color: var(--text-light);
}

.services .section-description {
    color: rgba(255, 255, 255, 0.8);
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.service-card {
    background: var(--text-light);
    color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    padding: 0;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.service-card p {
    color: var(--secondary-light);
    line-height: 1.6;
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.gallery {
    background: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.gallery-modal.active {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--text-light);
    font-size: 3rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2001;
}

.modal-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2001;
}

.modal-nav:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav.prev {
    left: 30px;
}

.modal-nav.next {
    right: 30px;
}

/* ============================================
   PARTNERS SECTION
   ============================================ */
.partners {
    background: var(--text-light);
}

.partners-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.partner-card {
    background: var(--text-light);
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    min-width: 200px;
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.partner-card img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    filter: grayscale(0%);
    transition: var(--transition);
}

.partner-card:hover img {
    transform: scale(1.05);
}

/* Card con sfondo scuro per loghi con testo chiaro */
.partner-card-dark {
    background: var(--secondary-color) !important;
}

.partner-card-dark:hover {
    background: var(--secondary-light) !important;
}

/* ============================================
   CONTACTS SECTION
   ============================================ */
.contacts {
    background: var(--primary-color);
    color: var(--text-light);
}

.contacts .section-title {
    color: var(--text-light);
}

.contacts .title-underline {
    background: var(--secondary-color);
}

.contacts .section-description {
    color: rgba(255, 255, 255, 0.9);
}

.contacts-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: start;
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-details h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 700;
}

.contact-details a,
.contact-details p {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
}

.contact-details a:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.contact-cta {
    margin-top: 1rem;
}

.contact-cta .btn-primary {
    background: var(--secondary-color);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(51, 51, 51, 0.4);
}

.contact-cta .btn-primary:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 51, 51, 0.6);
}

.contact-map {
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--secondary-color);
    color: var(--text-light);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 40px;
    width: auto;
}

.footer-logo span {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
/* ============================================
   DESKTOP LAYOUT (min-width: 969px)
   ============================================ */
@media (min-width: 969px) {
    section {
        padding: 80px 0;
    }

    .section-header {
        margin-bottom: 4rem;
    }

    .about-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: center;
    }

    .about-text {
        font-size: 1.1rem;
        line-height: 1.8;
    }

    .about-text .lead {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    .about-features {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        margin-top: 2.5rem;
    }

    .image-slider {
        height: 500px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .service-card {
        padding: 2.5rem;
    }

    .contacts-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: start;
    }

    .contact-map {
        height: 400px;
    }
}

/* ============================================
   MOBILE LAYOUT (max-width: 968px)
   ============================================ */
@media (max-width: 968px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(51, 51, 51, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 3rem;
        transition: right 0.3s ease;
        gap: 1rem;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links > li {
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .nav-link {
        padding: 1.5rem 0;
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
        display: block;
        position: relative;
    }

    .nav-link::after {
        bottom: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
    }

    .nav-link:hover::after,
    .nav-link:active::after {
        width: 40%;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* WIRECRAFT sempre arancione anche in mobile */
    .nav-link[href*="wirecraft"] {
        color: var(--primary-color) !important;
    }

    /* Disable hover dropdown in mobile */
    .dropdown-toggle:hover {
        cursor: pointer;
    }

    /* Mobile dropdown inline */
    .nav-item-dropdown {
        position: relative;
    }

    .nav-item-dropdown .dropdown-menu {
        position: static !important;
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        background: rgba(0, 0, 0, 0.4) !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-top: 0.5rem !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        z-index: auto !important;
    }

    .nav-item-dropdown.active .dropdown-menu {
        display: block !important;
    }

    .nav-item-dropdown .dropdown-menu li {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center !important;
        width: 100% !important;
    }

    .nav-item-dropdown .dropdown-menu li:first-child {
        border-top: none;
    }

    .nav-item-dropdown .dropdown-menu a {
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
        text-align: center !important;
        white-space: normal !important;
        display: block !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .nav-item-dropdown .dropdown-menu a:hover {
        background: rgba(243, 167, 18, 0.2) !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    /* Disable desktop dropdown hover behavior in mobile */
    .dropdown-toggle {
        pointer-events: auto;
    }

    .menu-toggle {
        display: flex !important;
    }
}

@media (max-width: 640px) {
    section {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        text-align: center;
    }

    .about-features {
        gap: 1rem;
    }

    .partners-grid {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

