* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #0D0D0D 0%, #121212 50%, #1A1A1A 100%);
}

/* HEADER */
header {
    background: #111;
    color: white;
    padding: 25px 15px;
    text-align: center;
    position: relative;
    font-family: 'Poppins', sans-serif;
}

header h1 {
    font-size: clamp(28px, 6vw, 48px);
    font-weight: 700;
    letter-spacing: 1px;
}

header h2 {
    font-size: clamp(16px, 4vw, 24px);
    margin-top: 8px;
    font-weight: 400;
    color: #FFC107;
}

/* LAYOUT BASE MOBILE */
.container {
    display: flex;
    flex-direction: column;
}

.brother {
    width: 100%;
    padding: 15px;
}

/* CARD MOBILE */
.card {
    background: linear-gradient(160deg, #1A1A1D 0%, #2A2A2F 40%, #1F1F23 100%);
    border: 1px solid #2C2C32;
    border-radius: 18px;
    padding: 20px;
    box-shadow:
        0 10px 25px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.04);
    color: #F5F5F5;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.8;
}

.card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.card-content {
    max-width: 100%;
}

.card a {
    text-decoration: none;
    color: white;
}

/* GALLERY */
.gallery {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.main-img-container {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 14px;
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
}

.thumbnails img {
    flex: 1;
    max-width: 80px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.thumbnails img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* OPTIONAL BOX */
.optional-box {
    background: linear-gradient(160deg, #0B0F1A 0%, #16223C 40%, #101830 100%);
    border: 1px solid #1E2A45;
    border-radius: 18px;
    padding: 20px;
    box-shadow:
        0 10px 25px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.04);
    color: #F5F5F5;

    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
    line-height: 1.8;
}

.optional-box span.optional-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #F5F5F5;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
}

/* FOOTER */
footer {
    background: linear-gradient(135deg, #0D0D0D 0%, #121212 50%, #1A1A1A 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

/* DROPDOWN */
.dropdown {
    position: absolute;
    top: 15px;
    right: 15px;
}

.dropbtn {
    background: #ffc107;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: bold;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    width: 180px;
    box-shadow: 0px 5px 10px rgba(0,0,0,0.2);
}

.dropdown-content a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: black;
}

.dropdown-content a:hover {
    background: #eee;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* LOGO */
.logo {
    width: 120px;
    margin: 0 auto 15px;
    display: block;
}

/* LANGUAGE SWITCHER */
.language-switcher {
    text-align: center;
    margin: 10px 0;
}

.language-switcher img {
    width: 35px;
    margin: 0 5px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.language-switcher img:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* IMMAGINI GLOBALI */
img {
    max-width: 100%;
    height: auto;
}

/* TABLET */
@media (min-width: 768px) {

    .container {
        flex-direction: row;
    }

    .brother {
        width: 50%;
        padding: 20px;
    }

    .card {
        flex-direction: row;
        text-align: left;
        align-items: center;
        gap: 25px;
    }

    .card img {
        width: 140px;
        height: 140px;
        margin-left: auto;
        margin-bottom: 0;
    }

    .card-content {
        max-width: 60%;
    }
}

/* TABLET FIX mantenendo 2 colonne */
@media (min-width: 768px) and (max-width: 1024px) {

    .container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 20px;
    }

    /* Mantieni 2 colonne ma con controllo spazio */
    .brother {
        width: calc(50% - 10px);
        padding: 15px;
        box-sizing: border-box;
    }

    /* Card più equilibrata (evita compressione) */
    .card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 15px;
    }

    .card img {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    .card-content {
        max-width: 100%;
    }

    /* Evita overflow laterale iPad */
    body {
        overflow-x: hidden;
    }

    .thumbnails {
        padding: 0 12px;
        gap: 8px;
        overflow-x: auto; /* 👈 scroll orizzontale smooth */
         margin-top: 10px;
    }

    .thumbnails img {
        flex: 0 0 auto;
        width: 65px;
    }

    /* scrollbar invisibile (più elegante) */
    .thumbnails::-webkit-scrollbar {
        display: none;
    }
}


/* DESKTOP */
@media (min-width: 1024px) {

    .brother {
        padding: 30px;
    }

    .card img {
        width: 160px;
        height: 160px;
    }
}

/* =========================
   MOBILE DRIVER SELECT MODE
========================= */

.mobile-intro {
    display: none;
}

/* MOBILE ONLY */
@media (max-width: 768px) {


    .mobile-intro {
        display: block;
        text-align: center;
        color: white;
        margin: 15px;
        font-weight: 600;
    }


    /* stato nascosto driver */
    .driver-hidden {
        display: none !important;
    }

    /* migliora UX click mobile */
    .brother {
        cursor: pointer;
    }
}

@media (max-width: 768px) {

    /* 🔥 STATO INIZIALE: nascondi tutto tranne card */
    .brother .gallery,
    .brother .optional-box {
        display: none;
    }

    /* quando un tassista è selezionato */
    .brother.active .gallery,
    .brother.active .optional-box {
        display: block;
    }

    /* nasconde il non selezionato */
    .brother.driver-hidden {
        display: none !important;
    }
}

/* bottone reset */
.back-btn {
    display: none;
    margin: 20px auto 0;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #ffc107;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

/* mobile only */
@media (max-width: 768px) {

    .brother.active .back-btn {
        display: block;
      width: fit-content;
    }
}

@media (max-width: 768px) {

    header .logo {
        display: none;
    }

    footer {
        padding-top: 100px; /* spazio per il logo */
        position: relative;
    }

    footer::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);

        width: 60px;
        height: 60px;

        background-image: url("../images/logo.png");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
}

@media (max-width: 768px) {

    .thumbnails {
        padding: 0 12px;
        gap: 8px;
        overflow-x: auto; /* 👈 scroll orizzontale smooth */
         margin-top: 20px;
    }

    .thumbnails img {
        flex: 0 0 auto;
        width: 65px;
    }

    /* scrollbar invisibile (più elegante) */
    .thumbnails::-webkit-scrollbar {
        display: none;
    }
}

