/* =========================================
   VARIABILI GLOBALI
   ========================================= */
/* :root = selettore globale, definisce variabili CSS riutilizzabili */
:root {
    --primary: #FF0157;
    --primary-light: #ff4b87;

    --black: #000000;
    --white: #ffffff;

    --text: #222222;
    --text-light: #666666;

    --border: #e5e5e5;

    --shadow-soft: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-medium: 0 8px 20px rgba(0,0,0,0.08);

    --transition: all 0.35s ease;

    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 24px;
}

/* =========================================
   RESET
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* include padding/bordo nel calcolo della larghezza */
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

html {
    scroll-behavior: smooth; /* scroll animato tra gli anchor link */
}

body {
    background: var(--white);
    color: var(--text);
    overflow-x: hidden; /* evita scroll orizzontale indesiderato */
}

/* =========================================
   HEADER
   ========================================= */

header {
    position: sticky;  /* resta attaccato in cima quando si scrolla */
    top: 0;
    z-index: 1000;     /* sopra a tutto */
    background: var(--white);
    border-bottom: 4px solid var(--primary);
}

.nav-container {
    max-width: 1200px;
    margin: auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
}

/* HAMBURGER TOGGLE — nascosto su desktop, visibile su mobile */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--black);
    border-radius: 3px;
    transition: var(--transition);
}

/* NAV BOTTONI MODERNI */
nav ul {
    display: flex;
    list-style: none;
    gap: 12px;
}

nav ul li a {
    padding: 10px 18px;
    border-radius: 999px;   /* bordi super arrotondati = forma a pillola */
    border: 2px solid var(--primary);
    text-decoration: none;
    color: var(--black);
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px); /* effetto sollevamento all'hover */
}

/* =========================================
   HERO FULL SCREEN (solo home page)
   ========================================= */

.hero {
    position: relative;
    height: calc(100vh - 84px); /* 100vh = altezza intera finestra, meno l'header */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

/* LAYER BACKGROUND CON DISSOLVENZA */
.hero-bg {
    position: absolute;
    inset: 0;   /* shorthand per top:0; right:0; bottom:0; left:0 */
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.8s ease;
}

.hero-bg.hidden {
    opacity: 0;  /* nascosto per la dissolvenza */
}

/* overlay leggero per migliorare leggibilità del testo sulle foto */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-content h1 {
    font-size: 52px;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 25px;
}

/* =========================================
   BOTTONE CHI SIAMO
   ========================================= */

.scroll-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 14px 30px;
    border-radius: 999px;

    background: var(--primary);
    color: var(--white);

    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;

    transition: var(--transition);
}

.scroll-btn:hover {
    background: #000;
    transform: translateY(4px);
}

/* =========================================
   FRECCE SLIDER
   ========================================= */

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%); /* centra verticalmente */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.35);
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.hero-arrow:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1); /* ingrandisce leggermente */
}

.hero-arrow.left { left: 20px; }
.hero-arrow.right { right: 20px; }

/* =========================================
   HERO INTERNAL (pagine interne: servizi, flotta, news, contatti)
   ========================================= */

.hero-internal {
    background:
        linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), /* filtro scuro sopra l'immagine */
        url('../picture/5.png') no-repeat center center/cover;
    height: 35vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
}

/* fleet-hero sovrascrive lo sfondo dell'hero-internal (senza filtro scuro) */
.fleet-hero {
    background:
        url('../picture/30.jpeg') no-repeat center center/cover;
}

.hero-internal h1 {
    font-size: 38px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-internal p {
    font-size: 18px;
    color: var(--primary-light);
    margin-top: 5px;
}

.hero-subtitle {
    font-size: 18px;
    margin-top: 5px;
}

/* =========================================
   FLEET CATEGORY
   ========================================= */

.fleet-category {
    margin-bottom: 60px;
}

.badge {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 10px;
}

/* =========================================
   FLEET GRID & CARDS
   ========================================= */

.fleet-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.fleet-card {
    /* calc((100% - 75px) / 4) = 4 colonne con gap di 25px l'una */
    flex: 0 0 calc((100% - 75px) / 4);
    max-width: calc((100% - 75px) / 4);
    min-width: 260px;
    background: var(--white);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition);
}

/* Riduci a 3 colonne su schermi medi, 2 su tablet, 1 su mobile */
@media (max-width: 1200px) {
    .fleet-card {
        flex: 0 0 calc((100% - 50px) / 3);
        max-width: calc((100% - 50px) / 3);
    }
}

@media (max-width: 900px) {
    .fleet-card {
        flex: 0 0 calc((100% - 25px) / 2);
        max-width: calc((100% - 25px) / 2);
    }
}

@media (max-width: 600px) {
    .fleet-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.fleet-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary);
}

.fleet-card-logo {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.fleet-card-logo img {
    max-height: 100px;
    max-width: 100%;
    object-fit: contain; /* adatta l'immagine senza tagliarla */
    filter: grayscale(0%);
    transition: var(--transition);
}

.fleet-card:hover .fleet-card-logo img {
    transform: scale(1.08);
}

.fleet-card-body {
    text-align: center;
    padding: 20px 22px 24px;
}

.fleet-card-body h3 {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: var(--text);
}

.fleet-card-body .quantity {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}

.fleet-card:hover .quantity,
.fleet-card-simple:hover .quantity {
    max-height: 40px;
    opacity: 1;
    margin-top: 8px;
}

.fleet-card-simple {
    display: flex;
    flex-direction: column;
}

.fleet-card-simple .fleet-card-body {
    text-align: center;
    padding: 40px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.fleet-card-simple .fleet-card-body h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.fleet-card-simple .fleet-card-body .quantity {
    font-size: 18px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}

.fleet-card-simple:hover .fleet-card-body .quantity {
    max-height: 40px;
    opacity: 1;
    margin-top: 6px;
}

/* =========================================
   BRANDS ROW
   ========================================= */

.brands-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.brand-tag {
    display: inline-block;
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.brand-tag:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

/* =========================================
   TOTAL BOX
   ========================================= */

.total-box {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 28px 20px;
    border-radius: var(--radius-large);
    margin-top: 20px;
}

.total-box h3 {
    font-size: 28px;
    font-weight: 700;
}

.total-box strong {
    font-size: 36px;
}

/* =========================================
    CONTAINER
 ========================================= */

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

/* =========================================
   TITOLI
   ========================================= */

.section-title {
    text-align: center;
    font-size: 34px;
    margin-bottom: 40px;
    text-transform: uppercase;
}

/* ::after aggiunge un elemento decorativo dopo il testo (la lineetta rosa) */
.section-title::after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    background: var(--primary);
    margin: 10px auto 0;
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: -10px auto 40px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-light);
}

.about-text p {
    text-align: center;
    max-width: 800px;
    margin: -10px auto 40px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-light);
}

/* =========================================
   GRID UNIVERSALE
   ========================================= */

.grid {
    display: grid;
    /* auto-fit = automaticamente adatta le colonne in base allo spazio */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* =========================================
   CARD (UNIVERSALI)
   ========================================= */

.card {
    background: var(--white);
    border-radius: var(--radius-medium);
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary);
}

.card-content {
    padding: 30px 24px 28px;
    text-align: center;
}

.card-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.card-content h3 {
    font-size: 17px;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 14px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* Lineetta rosa sotto il titolo della card */
.card-content h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.card-content p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 14px;
}

/* =========================================
   NEWS / DATE & BUTTON
   ========================================= */

.date {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.btn-small {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 20px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    transition: var(--transition);
}

.btn-small:hover {
    background: #000;
    transform: translateY(-2px);
}

/* =========================================
   STATS GRID
   ========================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 colonne fisse */
    gap: 25px;
    margin-bottom: 70px;
}

.stat-item {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    padding: 35px 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-item:hover {
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.1;
}

.stat-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tablet: stats su 2 colonne */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: stats su 1 colonna */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   CONTATTI
   ========================================= */

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colonne uguali */
    gap: 30px;
    margin-bottom: 60px;
}

.info-box {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
}

.info-box:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-medium);
}

.info-box h3 {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--text);
    position: relative;
    padding-bottom: 12px;
}

/* Lineetta rosa sotto il titolo info-box */
.info-box h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.info-box p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box strong {
    font-weight: 700;
    color: var(--text);
}

.info-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.info-box a:hover {
    text-decoration: underline;
}

/* FORM */
form {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    padding: 30px;
    transition: var(--transition);
}

form:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-medium);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fafafa;
    transition: var(--transition);
    outline: none; /* toglie il bordo blu di default del browser */
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 1, 87, 0.1); /* alone rosa attorno */
}

.btn-submit {
    display: inline-block;
    width: 100%;
    padding: 14px 30px;
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background: #000;
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

/* Mobile: contact-wrapper passa a 1 colonna */
@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* =========================================
    MAP BOX
 ========================================= */

.map-box {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    padding: 0;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-box:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-medium);
}

.map-box h3 {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
    padding: 18px 24px 16px;
    margin: 0;
}

.map-container {
    margin: 0 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    overflow: hidden;
    flex: 1;
    min-height: 0;
    transition: var(--transition);
}

.map-container:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-medium);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.map-box p {
    padding: 14px 24px 20px;
    margin: 0;
}

.map-box p a {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.map-box p a:hover {
    background: #000;
    transform: translateY(-2px);
}

/* =========================================
    SOCIAL
 ========================================= */

.social-section {
    margin-top: 20px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    min-width: 90px;
    height: 90px;
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}

.social-icon span {
    display: block;
    max-height: 0;         /* nascosto all'inizio (collassato) */
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    transition: max-width 0.35s ease, max-height 0.35s ease, opacity 0.35s ease, margin 0.35s ease;
}

.social-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
}

.social-icon:hover span {
    max-height: 40px;      /* si espande mostrando il testo */
    max-width: 300px;
    opacity: 1;
    margin-top: 6px;
}

.social-icon svg {
    transition: var(--transition);
    flex-shrink: 0;
}

.social-icon:hover svg {
    transform: scale(1.15);
}

/* =========================================
   FOOTER
   ========================================= */

footer {
    background: #000;
    color: white;
    text-align: center;
    padding: 25px;
    border-top: 4px solid var(--primary);
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* =========================================
    RESPONSIVE TABLET (max 768px)
 ========================================= */

@media (max-width: 768px) {

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-arrow {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .hero-arrow.left { left: 10px; }
    .hero-arrow.right { right: 10px; }

    .nav-container {
        flex-wrap: wrap;
    }

    .hamburger {
        display: flex; /* mostra l'hamburger su mobile */
    }

    nav {
        order: 3;
        width: 100%;
    }

    nav ul {
        display: none;            /* menu nascosto di default */
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 8px;
        padding: 12px 0 4px;
    }

    nav ul.open {
        display: flex;           /* mostra il menu quando ha classe .open */
    }

    nav ul li a {
        font-size: 12px;
        padding: 10px 24px;
        display: inline-block;
    }

    .hero-internal {
        height: 28vh;
    }

    .hero-internal h1 {
        font-size: 26px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-description {
        font-size: 15px;
    }

    .contact-wrapper {
        gap: 20px;
    }

    .map-box h3,
    .info-box h3 {
        font-size: 15px;
    }

    .map-container {
        margin: 0 14px;
    }

    .map-box p {
        padding: 12px 14px 16px;
    }

    .social-links {
        gap: 12px;
    }

    .social-icon {
        min-width: 70px;
        height: 70px;
        padding: 10px 12px;
        font-size: 11px;
    }

    .social-icon svg {
        width: 22px;
        height: 22px;
    }

    .total-box h3 {
        font-size: 22px;
    }

    .total-box strong {
        font-size: 28px;
    }

    .fleet-card-logo {
        height: 120px;
    }

    .fleet-card-logo img {
        max-height: 70px;
    }

    .container {
        margin: 40px auto;
    }
}

/* =========================================
    RESPONSIVE MOBILE (max 480px)
 ========================================= */

@media (max-width: 480px) {

    .hero-content h1 {
        font-size: 26px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .hero-arrow {
        display: none; /* frecce slider nascoste su mobile */
    }

    .hero-internal {
        height: 22vh;
    }

    .hero-internal h1 {
        font-size: 20px;
    }

    .hero-internal p {
        font-size: 14px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 28px;
    }

    .section-description {
        font-size: 14px;
        margin: -6px auto 28px;
    }

    .stats-grid {
        gap: 14px;
    }

    .stat-item {
        padding: 24px 14px;
    }

    .stat-number {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }

    nav ul li a {
        font-size: 10px;
        padding: 6px 10px;
    }

    .logo img {
        height: 38px;
    }

    .card-content {
        padding: 22px 16px 20px;
    }

    .card-content h3 {
        font-size: 15px;
    }

    .card-content p {
        font-size: 13px;
    }

    .info-box {
        padding: 20px;
    }

    form {
        padding: 20px;
    }

    .total-box {
        padding: 20px 14px;
    }

    .total-box h3 {
        font-size: 18px;
    }

    .total-box strong {
        font-size: 22px;
    }

    .contact-wrapper {
        gap: 16px;
    }

    .map-container {
        margin: 0 10px;
    }

    .map-box p a {
        font-size: 12px;
        padding: 8px 18px;
    }

    .container {
        margin: 28px auto;
        padding: 0 14px;
    }

    footer {
        padding: 18px 14px;
        font-size: 13px;
    }
}

/* =========================================
   CERTIFICAZIONI
   ========================================= */

body.modal-open {
    overflow: hidden;
}

.cert-wrapper {
    display: flex;
    justify-content: center;
}

.cert-card {
    background: var(--white);
    border-radius: var(--radius-medium);
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    width: 100%;
    max-width: 420px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary);
}

.cert-card-header {
    padding: 22px 24px 18px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.cert-card-header h3 {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 14px;
    margin-bottom: 10px;
}

.cert-card-header h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.cert-card-header p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-light);
}

.cert-card-body {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    background: #f4f4f4;
    overflow: hidden;
}

.cert-card-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--white);
}

.cert-card-footer {
    padding: 12px 20px;
    text-align: center;
    background: var(--primary);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.cert-card:hover .cert-card-footer {
    background: #000;
}

.cert-card.expanding {
    pointer-events: none;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.2s ease, transform 0.35s ease;
}

/* MODALE CERTIFICAZIONE */

.cert-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        background 0.55s ease,
        backdrop-filter 0.55s ease,
        visibility 0s linear 0.65s;
}

.cert-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(0,0,0,0.86);
    backdrop-filter: blur(5px);
    transition:
        opacity 0.25s ease,
        background 0.55s ease,
        backdrop-filter 0.55s ease,
        visibility 0s;
}

.cert-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-medium);
    overflow: hidden;
    width: min(90vw, 720px);
    height: 90vh;
    box-shadow: 0 25px 80px rgba(0,0,0,0.28);
    display: flex;
    flex-direction: column;
    transform: scale(0.72);
    opacity: 0;
    clip-path: inset(0 0 0 0 round 24px);
    transition:
        width 0.72s cubic-bezier(.77,0,.18,1),
        height 0.72s cubic-bezier(.77,0,.18,1),
        max-width 0.72s cubic-bezier(.77,0,.18,1),
        border-radius 0.72s cubic-bezier(.77,0,.18,1),
        transform 0.72s cubic-bezier(.77,0,.18,1),
        opacity 0.35s ease;
}

.cert-modal.open .cert-modal-content {
    width: min(100vw, 1400px);
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    transform: scale(1);
    opacity: 1;
}

.cert-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    min-height: 62px;
    background: var(--primary);
    color: var(--white);
    transform: translateY(-12px);
    opacity: 0;
    transition:
        transform 0.45s ease 0.35s,
        opacity 0.35s ease 0.35s;
}

.cert-modal.open .cert-modal-header {
    transform: translateY(0);
    opacity: 1;
}

.cert-modal-header h3 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.cert-modal-close:hover {
    background: #000;
    transform: rotate(90deg);
}

.cert-modal-body {
    flex: 1;
    min-height: 0;
    background: #525659;
}

.cert-modal-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .cert-card { max-width: 320px; }
    .cert-modal { padding: 0; }
    .cert-modal-content,
    .cert-modal.open .cert-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }
    .cert-modal-header { min-height: 56px; }
}

@media (max-width: 480px) {
    .cert-card-header h3 { font-size: 16px; }
    .cert-card-header p { font-size: 12px; }
    .cert-card-footer { font-size: 12px; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .cert-modal,
    .cert-modal-content,
    .cert-modal-header,
    .cert-card {
        transition: none !important;
    }
}

/* =========================================
   REVEAL ALLA COMPARSA (card in entrata)
   ========================================= */

/* Stato iniziale: card nascosta (opacità 0) */
.reveal {
    opacity: 0;
}

/* Quando .visible viene aggiunta, parte l'animazione */
.reveal.visible {
    opacity: 1;
    animation: cardReveal 0.7s ease backwards;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utenti che preferiscono meno movimento: nessuna animazione */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        animation: none;
    }
}
