/* ==========================================================================
   1. STILI GENERALI E VARIABILI (CSS VARIABLES)
   ========================================================================== */
:root {
    --primary-color: #0056b3;
    --primary-hover: #004085;
    --secondary-color: #ffc107;
    --dark-color: #1a1d20;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius-sm: 4px;
    --radius-md: 8px;
    --transition-fast: 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: #f4f6f8;
    color: var(--text-color);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.main-header {
    background-color: var(--dark-color);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.brand-logo span {
    color: var(--secondary-color);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: #d1d5db;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
}

.main-nav a:hover,
.main-nav a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. HERO BANNER & PRESENTAZIONE (INDEX)
   ========================================================================== */
.hero-section {
    background: linear-gradient(rgba(26, 29, 32, 0.85), rgba(26, 29, 32, 0.85)), 
                url('../img/hero-bg.jpg') center/cover no-repeat #1a1d20;
    color: #ffffff;
    padding: 5rem 1rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.15rem;
    color: #e2e8f0;
    margin-bottom: 2rem;
}

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

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-outline:hover {
    background-color: #ffffff;
    color: var(--dark-color);
}

/* Punti di forza Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

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

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.link-more {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ==========================================================================
   4. CARD AUTO & GRIGLIA VETRINA
   ========================================================================== */
.auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.auto-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    color: inherit;
}

.auto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-img-wrap {
    position: relative;
    width: 100%;
    height: 190px;
    background: #e9ecef;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-offer {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-highlight {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-color);
    color: #000000;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.card-title {
    font-size: 1.1rem;
    margin: 0.3rem 0 0.8rem 0;
    color: var(--text-color);
}

.card-specs {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #555;
    padding: 0.6rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 1rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
}

.btn-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==========================================================================
   5. PAGINA CONTATTI
   ========================================================================== */
.page-title-block {
    margin-bottom: 2rem;
}

.page-title-block h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

.contact-form-card,
.contact-info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.info-box-auto {
    background: #e8f4fd;
    border-left: 4px solid var(--primary-color);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.map-placeholder {
    width: 100%;
    height: 180px;
    background: #e9ecef;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.main-footer {
    background-color: var(--dark-color);
    color: #a0aec0;
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 2.5rem;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-col p {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

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

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #a0aec0;
}

.footer-col a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #2d3748;
    text-align: center;
    padding: 1.2rem 1rem;
    font-size: 0.85rem;
}

/* ==========================================================================
   7. MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================================================== */
@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .auto-grid {
        grid-template-columns: 1fr;
    }
}

.btn-pdf-download {
    display: inline-flex;
    align-items: center;
    background-color: #dc3545; /* Rosso stile PDF */
    color: #ffffff;
    padding: 0.65rem 1.25rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-pdf-download:hover {
    background-color: #c82333;
    color: #ffffff;
    transform: translateY(-1px);
}