/* ==========================================================================
   Magic MP USA - Custom Premium Stylesheet
   Design: Modern, Premium, Corporate Navy & Brand Orange
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700|Rubik:300,400,500,700|Mulish:300,400,500,600,700&display=swap');

/* Reset and Core Variables */
:root {
    /* Color Tokens */
    --color-navy: #06163a;
    --color-navy-light: #0d255c;
    --color-navy-dark: #030a1c;
    --color-orange: #f6872d; /* Authentic Magic MP Corporate Orange */
    --color-orange-light: #ff9b4f;
    --color-orange-dark: #d66b18;
    --color-white: #ffffff;
    --color-light-bg: #f8fafc;
    --color-text-dark: #1e293b;
    --color-text-light: #64748b;
    --color-border: #e2e8f0;
    
    /* Typography */
    --font-headers: 'Rubik', sans-serif;
    --font-accent: 'Montserrat', sans-serif;
    --font-body: 'Mulish', sans-serif;
    
    /* Layout Tokens */
    --max-width: 1200px;
    --header-height: 80px;
    --header-height-scroll: 65px;
    --border-radius: 12px;
    
    /* Shadows & Transitions */
    --shadow-sm: 0 2px 4px rgba(6, 22, 58, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(6, 22, 58, 0.08), 0 4px 6px -2px rgba(6, 22, 58, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(6, 22, 58, 0.12), 0 10px 10px -5px rgba(6, 22, 58, 0.04);
    --shadow-glow: 0 0 20px rgba(246, 135, 45, 0.25);
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-light-bg);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography Presets */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headers);
    color: var(--color-navy);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-light-bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utility Classes */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-navy) 30%, var(--color-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

header.scrolled {
    height: var(--header-height-scroll);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-svg {
    height: 48px;
    width: auto;
    transition: var(--transition-smooth);
}

header.scrolled .logo-svg {
    height: 40px;
}

.logo-text {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-navy);
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
}

.logo-subtext {
    font-size: 0.65rem;
    color: var(--color-text-light);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    gap: 32px;
    align-items: center;
    list-style: none;
}

.nav-link {
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-orange);
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: var(--color-orange);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-navy);
    margin: 5px 0;
    transition: var(--transition-smooth);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: var(--header-height);
    background: radial-gradient(circle at 10% 20%, rgba(6, 22, 58, 0.95) 0%, rgba(3, 10, 28, 0.98) 100%);
    overflow: hidden;
}

/* Geometric details */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(246, 135, 45, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(6, 22, 58, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
    width: 100%;
}

.hero-text {
    text-align: left;
    color: var(--color-white);
    position: relative;
    z-index: 2;
}

.hero-image-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-machine-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(246, 135, 45, 0.2);
    border: 1px solid rgba(246, 135, 45, 0.3);
    transition: var(--transition-smooth);
    animation: float 6s ease-in-out infinite;
}

.hero-machine-img:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(246, 135, 45, 0.4);
    border-color: rgba(246, 135, 45, 0.6);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.hero h1 {
    text-align: left;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    font-family: var(--font-headers);
}

.hero-tagline {
    text-align: left;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-orange-light);
    margin-bottom: 20px;
    font-family: var(--font-accent);
}

.hero-subtext {
    text-align: left;
    font-size: 1.1rem;
    font-weight: 300;
    color: #94a3b8;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.hero-text .btn-group {
    justify-content: flex-start;
}

@media (max-width: 992px) {
    .hero-text .btn-group {
        justify-content: center;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--color-orange);
    color: var(--color-white);
    border: 2px solid var(--color-orange);
}

.btn-primary:hover {
    background-color: var(--color-orange-light);
    border-color: var(--color-orange-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Sections General */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.25rem;
    color: var(--color-navy);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--color-orange);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Group Section */
.group-section {
    background-color: var(--color-white);
    position: relative;
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.group-card {
    background: var(--color-light-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.group-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(246, 135, 45, 0.3);
}

.card-logo-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    width: 100%;
}

.card-logo {
    max-height: 55px;
    max-width: 80%;
    object-fit: contain;
    transition: var(--transition-smooth);
}

/* Emblems for Group */
.logo-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-accent);
    font-weight: 700;
    color: var(--color-navy);
}

.group-card h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.group-card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-link {
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--color-navy);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-link svg {
    transition: var(--transition-smooth);
}

.group-card:hover .card-link {
    color: var(--color-orange);
}

.group-card:hover .card-link svg {
    transform: translateX(4px);
}

/* Info Section (Where We Are) */
.info-section {
    background-color: var(--color-light-bg);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.info-icon-wrapper {
    background: rgba(246, 135, 45, 0.1);
    color: var(--color-orange);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.info-content h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    font-family: var(--font-accent);
    font-weight: 600;
}

.info-content p {
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.5;
}

.info-content p a:hover {
    color: var(--color-orange);
}

/* Map Card */
.map-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.map-card:hover {
    box-shadow: var(--shadow-lg);
}

.map-visual {
    background: linear-gradient(135deg, rgba(6, 22, 58, 0.05) 0%, rgba(246, 135, 45, 0.05) 100%);
    border: 1px dashed var(--color-border);
    height: 250px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    gap: 12px;
    text-align: center;
    padding: 20px;
}

.map-visual svg {
    color: var(--color-orange);
}

.map-card .btn {
    width: 100%;
}

/* Footer Styles */
footer {
    background-color: var(--color-navy);
    color: #94a3b8;
    padding: 60px 0 30px 0;
    border-top: 4px solid var(--color-orange);
    margin-top: auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-svg {
    height: 40px;
    width: auto;
}

.footer-logo .logo-text {
    color: var(--color-white);
}

.footer-logo .logo-subtext {
    color: #64748b;
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-link {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
}

.footer-link:hover {
    color: var(--color-white);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.copyright {
    color: #64748b;
}

/* Legal pages structure */
.legal-main {
    padding-top: 140px;
    padding-bottom: 100px;
    background: var(--color-white);
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    color: var(--color-navy);
    border-bottom: 2px solid var(--color-orange);
    padding-bottom: 16px;
}

.legal-content h2 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--color-navy-light);
}

.legal-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-dark);
    margin-bottom: 20px;
}

.legal-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
    color: var(--color-text-dark);
}

.legal-content li {
    margin-bottom: 8px;
    font-size: 1rem;
}

.legal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-orange);
    font-weight: 600;
    font-family: var(--font-accent);
    margin-bottom: 30px;
}

.legal-back-btn:hover {
    color: var(--color-orange-light);
    transform: translateX(-4px);
}

/* ====================================================================
   Nuove Sezioni Custom (Parco Macchine, Materiali, Processo, Settori)
   ==================================================================== */

/* Stile per i passaggi del Processo Produttivo */
.step-badge {
    background-color: var(--color-orange);
    color: var(--color-white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(246, 135, 45, 0.2);
}

.step-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 30px 24px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(246, 135, 45, 0.3);
}

.step-card h3 {
    font-size: 1.2rem;
    color: var(--color-navy);
    margin-bottom: 12px;
    font-weight: 600;
}

.step-card p {
    color: var(--color-text-light);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Stile per la Sezione Materiali Lavorati */
.materials-section {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding-top: 80px;
    padding-bottom: 100px;
}

.material-list-card {
    background: var(--color-light-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 30px;
    transition: var(--transition-smooth);
}

.material-list-card:hover {
    border-color: rgba(246, 135, 45, 0.3);
    box-shadow: var(--shadow-md);
}

.material-list-card h3 {
    font-size: 1.25rem;
    color: var(--color-navy);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid rgba(246, 135, 45, 0.15);
    padding-bottom: 8px;
}

.material-list-card ul {
    list-style: none;
    padding: 0;
}

.material-list-card li {
    margin-bottom: 10px;
    font-size: 0.92rem;
    color: var(--color-text-light);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.material-list-card li::before {
    content: "•";
    color: var(--color-orange);
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
}

/* Stile per i Settori di Applicazione */
.sectors-section {
    background-color: var(--color-light-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.sector-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 35px 25px;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sector-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(246, 135, 45, 0.3);
}

.sector-card h3 {
    font-size: 1.25rem;
    color: var(--color-navy);
    margin-bottom: 12px;
    font-weight: 600;
}

.sector-card p {
    color: var(--color-text-light);
    font-size: 0.92rem;
    line-height: 1.6;
}

.sectors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    :root {
        --header-height: 70px;
    }
    
    .hero h1 {
    text-align: left;
        font-size: 2.75rem;
    }
    
    .hero-tagline {
    text-align: left;
        font-size: 1.25rem;
    }
    
    .group-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-top {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 24px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .sectors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Navigation drawer for mobile */
    .menu-toggle {
        display: block;
        z-index: 1100;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        box-shadow: -10px 0 30px rgba(6, 22, 58, 0.15);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: var(--transition-smooth);
        z-index: 1050;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -8px);
    }
    
    .sectors-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Custom button and media assets styles */
.btn-automa {
    background-color: #009fe3 !important; /* Authentic Automa Cyan */
    color: var(--color-white) !important;
    border: 2px solid #009fe3 !important;
    font-family: var(--font-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.btn-automa:hover {
    background-color: var(--color-navy) !important;
    border-color: var(--color-navy) !important;
    color: var(--color-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 159, 227, 0.35);
}

.card-img-visual {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
    transition: var(--transition-smooth);
}

.group-card:hover .card-img-visual,
.step-card:hover .card-img-visual {
    border-color: rgba(246, 135, 45, 0.4);
    transform: scale(1.02);
}

/* Responsive grid stacking for split hero */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero h1, .hero-tagline, .hero-subtext {
        text-align: center;
    }
    
    .hero-machine-img {
        max-width: 85%;
        margin: 0 auto;
    }
}
