/* ===================================
   CSS RESET & BASE
   =================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================================
   CSS VARIABLES (Design System)
   =================================== */
:root {
    /* Colors */
    --primary-color: #343C43;
    --secondary-color: #708090;
    --accent-color: #3498db;
    --text-dark: #2c3e50;
    --text-light: #696969;
    --bg-light: #F1F1F1;
    --bg-white: #FFFFFF;
    --border-color: #E1E1E1;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 80px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

/* ===================================
   GLOBAL STYLES
   =================================== */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xxl) 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    margin-bottom: var(--spacing-md);
}

.section-divider.center {
    margin-left: auto;
    margin-right: auto;
}

.text-center {
    text-align: center;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform var(--transition-base);
}

/* Header sempre visibile - nascondimento disabilitato */

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo img {
    height: 60px;
    width: auto;
    transition: transform var(--transition-base);
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-sm);
}

.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background-color: var(--accent-color);
    transition: transform var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all var(--transition-base);
}

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

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    margin-top: var(--header-height);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(112, 128, 144, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: var(--spacing-xl) 0;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 300;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.85;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero-elements {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

.element-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    transition: transform var(--transition-base);
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

.element-icon:hover {
    transform: translateY(-10px);
}

.element-icon img {
    width: 80px;
    height: 80px;
    transition: transform var(--transition-base);
}

.element-icon span {
    font-weight: 600;
    font-size: 1.1rem;
}

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

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.about-text p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.about-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.about-image {
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: 'DB Consulenze';
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-light {
    background-color: white;
    color: var(--primary-color);
    border-color: white;
}

.btn-light:hover {
    background-color: transparent;
    color: white;
    border-color: white;
}

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

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.service-card {
    background-color: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    text-align: center;
    display: flex;
    flex-direction: column;
}

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

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    border-radius: var(--radius-full);
    padding: var(--spacing-md);
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.service-card p {
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.service-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
    margin-top: auto;
}

.service-link:hover {
    color: var(--secondary-color);
}

/* ===================================
   STATS SECTION
   =================================== */
.stats {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    text-align: center;
}

.stat-item {
    padding: var(--spacing-md);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-number::after {
    content: '+';
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ===================================
   CTA SECTION
   =================================== */
.cta-section {
    background-color: var(--accent-color);
    color: white;
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.cta-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--spacing-md);
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

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

.footer-section h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

.footer-section p {
    opacity: 0.9;
    line-height: 1.7;
}

.footer-logo {
    margin-top: var(--spacing-md);
}

.footer-logo img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-links,
.footer-contact {
    list-style: none;
}

.footer-links li,
.footer-contact li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-contact li {
    opacity: 0.9;
    line-height: 1.8;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--spacing-md);
    text-align: center;
    opacity: 0.8;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1024px) {
    :root {
        --spacing-xxl: 4rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
        --spacing-xxl: 3rem;
    }
    
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }
    
    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: 0;
    }
    
    .nav-link {
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link::after {
        display: none;
    }
    
    /* Hero */
    .hero-elements {
        gap: var(--spacing-md);
    }
    
    .element-icon img {
        width: 60px;
        height: 60px;
    }
    
    /* Buttons */
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 1.5rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero-elements {
        gap: var(--spacing-sm);
    }
    
    .element-icon img {
        width: 50px;
        height: 50px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   PRODUCT PAGE - Additional Styles
   =================================== */
.product-code {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    margin: 0.25rem 0 0.5rem 0 !important;
}

.product-short-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 2.5em;
}

.product-meta {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-sm);
    margin-top: auto;
}

.product-meta small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.btn-info {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: var(--spacing-md);
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    font-size: 0.95rem;
}

.btn-info:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-info:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.error-message {
    padding: var(--spacing-xl);
    background-color: #fee;
    border-left: 4px solid #c33;
    border-radius: var(--radius-md);
    margin: var(--spacing-xl) 0;
    text-align: center;
}

.error-message h3 {
    color: #c33;
    margin-bottom: var(--spacing-sm);
}

.error-message p {
    color: var(--text-dark);
}

/* ===================================
   UTILITIES
   =================================== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
