/* ============================================================
   STYLE.CSS — Pianotrafo
   Fix applicati:
   - z-index overlay corretto (200 > header 100)
   - Proprietà duplicate rimosse da .bento-card
   - Conflitto colore testo .details-text p risolto
   - Media query @media (max-width: 768px) unificate in fondo
   - Aggiunto fallback background-attachment per iOS/Safari
   ============================================================ */

/* --- Variabili globali --- */
:root {
    --bg-page: #FFFFFF;
    --bg-surface: #F8FAFC;
    --blue-primary: #0F172A;
    --blue-brand: #1D4ED8;
    --orange-accent: #FF6B00;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   NAVBAR
   ============================================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 15px 5%;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--orange-accent);
}

.logo img {
    max-width: 160px;
    height: auto;
    width: 100%;
    display: block;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    margin-left: 32px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--blue-primary);
}

/* ============================================================
   BOTTONI
   ============================================================ */
.btn-primary {
    background-color: var(--orange-accent);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-shadow: 0 4px 14px 0 rgba(255, 107, 0, 0.3);
}

.btn-primary:hover {
    background-color: #e66000;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: white;
    color: var(--blue-primary);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-surface);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    text-align: center;
    padding: 160px 5% 120px;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, var(--bg-page) 100%),
        url('img/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallasse su desktop */
    overflow: hidden;
}

/* FIX: background-attachment: fixed non funziona su iOS/Safari — fallback */
@supports (-webkit-touch-callout: none) {
    .hero {
        background-attachment: scroll;
    }
}

.badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--blue-brand);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(29, 78, 216, 0.2);
}

.hero h1 {
    font-size: 4rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--blue-primary);
}

.hero h1 span {
    background: -webkit-linear-gradient(45deg, var(--blue-brand), var(--blue-primary));
    -webkit-background-clip: text;
    /* Per Safari e versioni precedenti di Chrome */
    background-clip: text;
    /* Versione standard per la compatibilità futura */
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(rgb(255, 0, 0), green, blue, alpha);
    max-width: 700px;
    margin: 0 auto 40px;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ============================================================
   SEZIONI GENERICHE
   ============================================================ */
.section-padding {
    padding: 100px 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    color: var(--blue-primary);
    margin-bottom: 16px;
}


.subtitle {
    color: var(--text-muted);
}

/* ============================================================
   SERVIZI — BENTO GRID
   ============================================================ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* FIX: rimossi overflow:hidden e background-size duplicati */
.bento-card {
    grid-column: span 2;
    border-radius: 16px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 400px;
    background-color: var(--blue-primary);
    background-size: 115%;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.4s ease, background-size 0.4s ease, border-color 0.4s ease;
}



/* Immagini di sfondo per ogni scheda */
.bento-grid .bento-card:nth-child(1) {
    background-image: url('img/scheda_1.jpg');
}

.bento-grid .bento-card:nth-child(2) {
    background-image: url('img/scheda_2.jpg');
}

.bento-grid .bento-card:nth-child(3) {
    background-image: url('img/scheda_3.jpg');
}

.bento-grid .bento-card:nth-child(4) {
    background-image: url('img/scheda_4.jpg');
}

.bento-grid .bento-card:nth-child(5) {
    background-image: url('img/scheda_5.jpg');
}

.bento-grid .bento-card:nth-child(6) {
    background-image: url('img/scheda_6.jpg');
}

/* Overlay scuro per leggibilità */
.bento-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.2));
    z-index: 1;
    transition: opacity 0.4s ease;
}

/* Contenuto sopra l'overlay */
.card-icon,
.bento-card h3,
.bento-card p {
    position: relative;
    z-index: 2;
}

.bento-card h3 {
    color: white;
}

.bento-card p {
    color: #E2E8F0;
}

/* Hover */
.bento-card:hover {
    background-size: 100%;
    border: 2px solid var(--blue-brand);
    transform: translateY(-5px);
}

.bento-card:hover::before {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.3));
}

/* ============================================================
   SEZIONE TECNOLOGIA
   ============================================================ */
.tech-section {
    background-color: var(--blue-primary);
    color: white;
    padding: 100px 5%;
}

.tech-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.tech-text h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.tech-text p {
    color: #94A3B8;
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.tech-list {
    list-style: none;
}

.tech-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #E2E8F0;
}

.tech-list li::before {
    content: "✓";
    color: var(--orange-accent);
    font-weight: bold;
}

.tech-image {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 400px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-style: italic;
}

.tech-image img {
    height: 25rem;
    width: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--bg-page);
    border-top: 1px solid var(--border-color);
    padding: 60px 5% 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    color: var(--blue-primary);
    margin-bottom: 16px;
}

.footer-col p,
.footer-col a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   FORM PREVENTIVO (Linear Style)
   ============================================================ */
.form-container-wide {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
}

.linear-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-section-title {
    font-size: 1.25rem;
    color: var(--blue-primary);
    margin-bottom: 24px;
    font-weight: 600;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.form-row-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.input-group label.fp {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--blue-primary);
    margin-bottom: 8px;
}

.field {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

select.field {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748B%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 10px auto;
}

.field::placeholder {
    color: #94A3B8;
}

.field:focus {
    background-color: var(--bg-page);
    border-color: var(--blue-brand);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.field.area {
    min-height: 120px;
    resize: vertical;
}

.upload-section {
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    padding: 24px;
    border-radius: 8px;
    margin-top: 10px;
}

.upload-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.file-input-wrapper {
    margin-bottom: 12px;
}

.field-file {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-outline-small {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--blue-primary);
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-outline-small:hover {
    background: #E2E8F0;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 20px;
}

.form-submit-btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
}

/* ============================================================
   SEZIONE CONTATTI — sfondo blu
   ============================================================ */
#contatti {
    background-color: var(--blue-primary) !important;
}

#contatti .section-header h2 {
    color: #ffffff;
}

#contatti .section-header .subtitle {
    color: #94A3B8;
}

#contatti .leftf h4,
#contatti .leftf p,
#contatti .contact-label {
    color: #E2E8F0;
}

#contatti .contact-link {
    color: var(--orange-accent);
}

#contatti .form-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

#contatti .rightf h3 {
    color: #ffffff;
}

#contatti .field {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

#contatti .field::placeholder {
    color: #64748B;
}

#contatti .field:focus {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--blue-brand);
}

/* ============================================================
   FORM CONTATTI (box con mappa)
   ============================================================ */
.form-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
}

.leftf h4 {
    font-size: 1.2rem;
    color: var(--blue-primary);
    margin-bottom: 8px;
}

.leftf p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.frame {
    border-radius: 12px;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-surface);
}

.rightf {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
}

.rightf h3 {
    font-size: 1.25rem;
    color: var(--blue-primary);
    margin-bottom: 8px;
}

.form-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 8px;
    cursor: pointer;
}


/* ============================================================
   BOX POP-UP SUCCESSO MAIL
   ============================================================ */
/* Centra il box all'interno dell'overlay */
#success-overlay[style*="display: block"] {
    display: flex !important;
}

.success-box {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    margin: auto; /* Centrato */
    padding: 50px 40px;
    border-radius: 16px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-box h2 {
    color: var(--blue-primary) !important; /* Forza il colore blu scuro */
    margin-bottom: 15px;
    font-size: 2rem;
}

.success-box p {
    color: var(--text-muted) !important; /* Forza il colore grigio */
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.success-icon {
    font-size: 4rem;
    color: var(--orange-accent);
    margin-bottom: 20px;
    line-height: 1;
}

.success-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.success-close:hover {
    color: var(--blue-primary);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================================
   GALLERY ANIMATA (Fade Gallery)
   ============================================================ */
.fade-gallery-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    max-width: 1500px;
    margin: 0 auto 40px auto;
}

.fade-slot {
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    overflow: hidden;
    background-color: var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.fade-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

.fade-slot img.fade-out {
    opacity: 0;
}

/* ============================================================
   SEZIONE AZIENDA — SPLIT SCREEN
   ============================================================ */
.company-split-container {
    display: flex;
    width: 100%;
    min-height: 90vh;
    overflow: hidden;
}

.split-image-block {
    flex: 1;
    position: relative;
    background-color: var(--bg-surface);
}

.factory-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.split-text-block {
    flex: 1;
    background-color: var(--blue-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10% 8%;
}

.text-content-wrapper {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.orange-line-accent {
    width: 60px;
    height: 4px;
    background-color: var(--orange-accent);
    border-radius: 2px;
}

.split-text-block h2 {
    font-size: 3rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: white;
}

.split-text-block h2 span {
    color: white;
    position: relative;
    z-index: 1;
}

.split-text-block h2 span::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 107, 0, 0.5);
    z-index: -1;
    border-radius: 2px;
}

.split-text-block p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #E2E8F0;
    font-weight: 300;
}

/* ============================================================
   GALLERY MOSAICO
   ============================================================ */
.company-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 350px;
    grid-auto-flow: dense;
    gap: 15px;
    max-width: 1300px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: all 0.6s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 10;
    border: 2px solid var(--blue-brand);
}

.gallery-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 34, 77, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ============================================================
   OVERLAY SERVIZI
   FIX: z-index portato a 200 (era 90, coperto dall'header a 100)
   ============================================================ */
.service-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--blue-primary);
    color: #FFFFFF;
    z-index: 99;
    /* Sotto l'header (z-index: 100) */
    display: none;
    overflow-y: auto;
    padding: 80px 8% 80px;
    /* 80px top = altezza header */
    animation: fadeInOverlay 0.4s ease-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-header-spacer {
    height: 140px;
    width: 100%;
}

/* Tasto chiudi */
.close-overlay {
    position: fixed;
    top: 90px;
    /* sotto l'header */
    right: 5%;
    background-color: var(--blue-brand);
    color: white;
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 98;
    /* sotto l'header */
}

.close-overlay:hover {
    background-color: #2563EB;
    transform: scale(1.1) rotate(90deg);
}

/* Titolo overlay */
.overlay-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: #FFFFFF !important;
    margin-bottom: 30px;
}

/* Titoli e paragrafi interni */
.overlay-content h2,
.overlay-content h3 {
    color: #FFFFFF !important;
}

/* FIX: unica regola per tutto il testo nell'overlay
   Rimossa .details-text p { color: var(--text-main) } che rendeva
   il testo quasi invisibile (#0F172A su sfondo blu scuro) */
.overlay-content p,
.overlay-content li,
.details-text p {
    color: #E2E8F0 !important;
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Layout a griglia interno overlay */
.details-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: start;
}

.details-image img {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Stile contenuto tecnico nell'overlay */
.inner-tech-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    color: var(--blue-primary);
}

.inner-tech-layout img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}


/* ============================================================
   POP-UP PROMOZIONE
   ============================================================ */
/* ── Promo Tab laterale (per riaprire il popup) ── */
.promo-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    background-color: var(--orange-accent);
    color: white;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 14px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 999;
    box-shadow: -3px 0 16px rgba(255, 107, 0, 0.25);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
}

.promo-tab.visible {
    opacity: 1;
    pointer-events: auto;
}

.promo-tab:hover {
    background-color: #e66000;
    box-shadow: -4px 0 20px rgba(255, 107, 0, 0.4);
    transform: translateY(-50%) translateX(-3px);
}

.promo-tab-icon {
    font-size: 14px;
    writing-mode: horizontal-tb;
    display: block;
}

/* ── Popup promozione ── */
.promo-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #1C1400;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(245, 158, 11, 0.4), 0 2px 8px rgba(0,0,0,0.1);
    padding: 28px 24px 24px;
    max-width: 420px;
    z-index: 1000;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    border-top: 4px solid #92400E;
}

.promo-popup.show {
    transform: translateY(0);
    opacity: 1;
}

.promo-popup-content {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.promo-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.promo-text h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: #1C1400;
    letter-spacing: -0.01em;
}

.promo-text strong {
    font-size: 1.05rem;
    color: #1C1400;
}

.promo-text p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #451A00;
    margin-bottom: 16px;
}

.promo-link {
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #F59E0B;
    background-color: #1C1400;
    padding: 9px 18px;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background-color 0.2s, transform 0.2s;
}

.promo-link:hover {
    background-color: #000000;
    transform: translateY(-1px);
}

.promo-close-btn {
    position: absolute;
    top: -14px;
    right: -10px;
    background: #92400E;
    border: none;
    color: #FEF3C7;
    font-size: 20px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.promo-close-btn:hover {
    background-color: #1C1400;
    color: #F59E0B;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .promo-popup {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: calc(100% - 40px);
        padding: 20px;
    }
}

    .promo-tab {
        top: auto;
        bottom: 80px;
        transform: translateY(0) translateX(0);
        border-radius: 8px 0 0 8px;
    }

    .promo-tab:hover {
        transform: translateY(0) translateX(-3px);
    }




/* ============================================================
   COOKIE BANNER
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--blue-primary); /* Sfondo blu scuro del tuo brand */
    color: #ffffff;
    padding: 20px;
    z-index: 9999; /* Assicura che sia sopra a tutto */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner.hidden {
    display: none;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-text p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: #e2e8f0;
}

.cookie-text a {
    color: var(--orange-accent);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-text a:hover {
    color: #ffffff;
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.cookie-buttons .btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cookie-buttons .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Adattamento per dispositivi mobili */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-buttons button {
        width: 100%;
    }
}

/* ============================================================
   FOOTER — sfondo blu
   ============================================================ */
footer {
    background-color: var(--blue-primary) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 60px 5% 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    align-items: start;
}

/* Colonna brand */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-logo {
    max-width: 150px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-brand p {
    color: #94A3B8;
    font-size: 0.88rem;
    line-height: 1.75;
    margin: 0;
}

.footer-tresun-link {
    display: inline-block;
    color: var(--orange-accent);
    font-size: 0.85rem;
    text-decoration: none;
}

.footer-tresun-link:hover {
    text-decoration: underline;
}

/* Social icons */
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.07);
    color: #94A3B8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
}

.footer-social a:hover {
    background-color: var(--orange-accent);
    color: #ffffff;
    border-color: var(--orange-accent);
    transform: translateY(-2px);
}

/* Colonne info */
.footer-col h4 {
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-col p,
.footer-col a {
    color: #94A3B8;
    font-size: 0.88rem;
    text-decoration: none;
    display: flex;
    margin-bottom: 8px;
    line-height: 1.5;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--orange-accent);
}

/* Striscia bottom */
.footer-bottom {
    max-width: 1200px;
    margin: 48px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    color: #334155;
    font-size: 0.8rem;
}


.footer-social a {
    /* aggiungi solo queste due righe, il resto rimane uguale */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: span 1;
    }
}




/* ============================================================
   RESPONSIVE — tutte le media query unificate qui in fondo
   ============================================================ */

/* Tablet grande */
@media (max-width: 1024px) {
    .company-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
}

/* Tablet / schermi medi */
@media (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .inner-tech-layout {
        grid-template-columns: 1fr;
    }

    .overlay-content h1 {
        font-size: 2.2rem;
    }

    .close-overlay {
        top: 80px;
        width: 45px;
        height: 45px;
    }
}

/* Smartphone */
@media (max-width: 768px) {

    /* Hero */
    .hero h1 {
        font-size: 2.5rem;
    }

    /* Navbar: menu nascosto (da gestire con hamburger) */
    nav {
        display: none;
    }

    /* Tecnologia */
    .tech-container {
        grid-template-columns: 1fr;
    }

    /* Bento grid: una sola colonna */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-card,
    .bento-grid .bento-card:nth-child(4),
    .bento-grid .bento-card:nth-child(5) {
        grid-column: span 1;
    }

    /* Gallery mosaico */
    .company-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
        padding: 0 15px;
    }

    .gallery-item.wide {
        grid-column: span 2;
    }

    .gallery-item.tall {
        grid-row: span 1;
    }

    /* Gallery fade */
    .fade-gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0 20px;
    }

    /* Form */
    .form-box {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 40px;
    }

    .form-container-wide {
        padding: 24px;
    }

    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .form-footer {
        flex-direction: column;
        gap: 20px;
    }

    .form-submit-btn-large {
        width: 100%;
    }

    .input-group[style*="max-width: 33%"] {
        max-width: 100% !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Smartphone stretto */
@media (max-width: 600px) {
    .company-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Eccellenza: testo sx + mosaico dx ── */
.eccellenza-layout {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 60px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}

.eccellenza-text {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.eccellenza-text h2 {
    font-size: 2.4rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--blue-primary);
    margin-top: 16px;
}

.eccellenza-text p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.eccellenza-gallery .company-gallery-grid {
    max-width: 100%;
    grid-auto-rows: 200px;
}

@media (max-width: 1024px) {
    .eccellenza-layout {
        grid-template-columns: 1fr;
    }

    .eccellenza-text {
        position: static;
    }
}

/* ── Gallery Blue Band ── */
.gallery-blue-band {
    background-color: var(--blue-primary, #003366);
    padding: 50px 0;
    width: 100%;
}

.gallery-blue-band .fade-gallery-container {
    margin: 0 auto;
}