/* ============================================================
   1. RESET E STILI BASE
   ============================================================ */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    overflow-x: hidden;
}

/* ============================================================
   2. HEADER E ANIMAZIONI
   ============================================================ */
header {
    position: relative;
    background: #ffffff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    z-index: 100;
}

.slider {
    flex: 1; margin: 0 16px; border-radius: 20px; background: #e5e7eb;
    display: flex; justify-content: center; align-items: center; padding: 16px;
}

.animated-text {
    display: flex; flex-wrap: wrap; gap: 0.15em;
    font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 800;
    text-transform: uppercase; color: #111827;
}

.animated-text span {
    display: inline-block; opacity: 0; animation: slideIn 0.8s forwards; transition: 0.3s;
}
.animated-text span:hover { animation: dance 0.25s infinite alternate !important; }

@keyframes slideIn { from { transform: translateX(100vw); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes dance { from { transform: translate(0,0) rotate(0deg); } to { transform: translate(4px,-4px) rotate(5deg); } }

/* ============================================================
   3. SIDEBAR E RICERCA
   ============================================================ */
.hamburger {
    cursor: pointer; padding: 8px 10px; font-size: 22px;
    border-radius: 999px; border: 1px solid #e5e7eb; background: #f9fafb; transition: 0.2s;
}
.hamburger:hover { background: #e5e7eb; }

.sidebar {
    position: fixed; top: 16px; left: 16px; height: calc(100% - 32px);
    width: 240px; background: #111827; color: #e5e7eb; padding-top: 80px;
    transform: translateX(-260px); transition: 0.25s; border-radius: 20px; z-index: 1000;
}
.sidebar.active { transform: translateX(0); }
.sidebar a {
    display: block; padding: 12px 20px; color: #e5e7eb; text-decoration: none;
    border-radius: 999px; margin: 6px 10px;
}
.sidebar a:hover { background: #1f2937; }

/* Barra di Ricerca */
.search-bar-section { width: 100%; padding-top: 10px; }
.search-bar-wrapper { width: 66vw; max-width: 1000px; margin: 0 auto 10px auto; position: relative; }
.search-box {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-radius: 999px; background: #f9fafb; border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; }
.icon-search-svg { width: 18px; height: 18px; stroke: #4b5563; }

.search-results {
    position: absolute; top: 105%; left: 0; right: 0; background: #ffffff;
    border-radius: 16px; box-shadow: 0 10px 25px rgba(15,23,42,0.15);
    max-height: 260px; overflow-y: auto; padding: 6px 0; display: none; z-index: 1500;
}
.search-results.visible { display: block; }
.search-result-item { display: block; padding: 8px 14px; text-decoration: none; border-bottom: 1px solid #f3f4f6; color: #111827; font-size: 13px; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f3f4f6; }

/* ============================================================
   4. LAYOUT DESKTOP (PC)
   ============================================================ */
section.card, 
.search-bar-wrapper, 
.text-below-video,
.footer-content {
    width: 66vw; 
    max-width: 1200px; 
    margin: 20px auto;
}

.card { 
    background: #ffffff; 
    border-radius: 20px; 
    padding: 24px; 
    box-shadow: 0 8px 18px rgba(0,0,0,0.06); 
    margin-bottom: 20px; 
}

.hero-fullscreen { width: 100%; height: 60vh; overflow: hidden; transition: 0.4s; }
.hero-fullscreen img { width: 100%; height: 100%; object-fit: cover; }

/* --- SEZIONE INFO (BIO GIANVITO) --- */
.info-split {
    display: flex;
    flex-direction: row; 
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-top: 10px;
}
.info-text { flex: 2; font-size: 1.1rem; line-height: 1.6; }
.info-image { flex: 1; display: flex; justify-content: center; }
.info-image img {
    width: 100%; max-width: 250px; height: auto;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); border: 4px solid #f9fafb;
}

/* --- SEZIONE PUBBLICITÀ (MODIFICA RICHIESTA) --- */
/* Impostato su 1 sola colonna (1fr) anche su Desktop */
.gallery {
    display: grid;
    grid-template-columns: 1fr; /* Una colonna verticale */
    gap: 20px;
    margin-top: 12px;
}

.ad-box {
    background: #ffffff; border-radius: 16px; padding: 14px 16px;
    border: 1px solid #e5e7eb; text-align: center; color: #374151;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    display: flex; justify-content: center; align-items: center;
    min-height: 200px;
}

/* ROBOTTINO TITLE */
.robottino-title {
    display: flex; justify-content: center; font-size: 1.8rem; font-weight: 800;
    gap: 0.2em; margin-bottom: 10px;
}
.robottino-title span { display: inline-block; transition: 0.2s; }
.robottino-title span:hover {
    transform: translateY(-3px) rotate(3deg); text-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

/* TOOLTIP E ZOOM */
.zoom-tooltip {
    position: fixed; padding: 4px 10px; background: #111827; color: #ffffff;
    border-radius: 999px; opacity: 0; pointer-events: none; transition: 0.15s; z-index: 2600; font-size: 11px;
}
.zoom-tooltip.visible { opacity: 1; }

.img-zoom-overlay {
    position: fixed; inset: 0; display: none; background: rgba(0,0,0,0.85);
    justify-content: center; align-items: center; z-index: 2500;
}
.img-zoom-overlay.visible { display: flex; }
.img-zoom-overlay img {
    width: 1024px; height: 768px; object-fit: contain; max-width: 95%; max-height: 95%;
    border-radius: 20px; box-shadow: 0 18px 40px rgba(0,0,0,0.65);
}

/* FOOTER E WHATSAPP */
.site-footer { width: 100%; background: #111827; padding: 30px 20px; margin-top: 40px; color: #f9fafb; border-top-left-radius: 24px; border-top-right-radius: 24px; }
.footer-content { width: 66vw; margin: 0 auto; text-align: center; }
.footer-text { font-size: 14px; margin-bottom: 16px; opacity: 0.9; }

.footer-social { display: flex; justify-content: center; gap: 16px; }
.social-icon {
    width: 40px; height: 40px; display: flex; background: #1f2937;
    border-radius: 50%; align-items: center; justify-content: center; padding: 8px; transition: 0.25s;
}
.social-icon img { width: 100%; height: 100%; filter: invert(100%); }
.social-icon:hover { background: #374151; transform: scale(1.12); }

.whatsapp-float { position: fixed; bottom: 120px; right: 20px; width: 64px; height: 64px; z-index: 3000; }
.whatsapp-float img { width: 100%; height: 100%; padding: 12px; background: #25D366; border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,0.25); transition: 0.2s; }
.whatsapp-float img:hover { transform: scale(1.12); }


/* ============================================================
   5. ADATTAMENTO SMARTPHONE (Media Query)
   ============================================================ */
@media screen and (max-width: 992px) {
    /* 1. LARGHEZZA ESPANSA */
    section.card, 
    .search-bar-wrapper, 
    .text-below-video,
    .footer-content {
        width: 94vw !important;
    }

    /* 2. BIO (GIANVITO) */
    .info-split {
        flex-direction: column-reverse;
        text-align: center;
        gap: 20px;
    }
    .info-image img { max-width: 180px; }

    /* 3. PUBBLICITÀ */
    /* Mantiene 1 colonna (già ereditata dal PC, ma la confermiamo) */
    .gallery {
        grid-template-columns: 1fr; 
        gap: 20px;
    }
    .ad-box { width: 100%; }

    /* 4. ADATTAMENTI GENERALI */
    .hero-fullscreen { height: 40vh; }
    .animated-text { font-size: 1.8rem; justify-content: center; }
    ins.adsbygoogle { max-width: 100% !important; display: block !important; }
    .whatsapp-float { bottom: 20px; right: 15px; width: 55px; height: 55px; }
}