/* =========================================
   RESET E IMPOSTAZIONI GENERALI
   ========================================= */
* { box-sizing: border-box; }

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #000; color: #333;
    display: flex; flex-direction: column;
    overflow-x: hidden;
}

a { text-decoration: none; transition: color 0.3s ease; }

/* =========================================
   1. TOPBAR (Desktop Default)
   ========================================= */
.topbar {
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 80px;
    /* Trasparenza iniziale */
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; 
    z-index: 3000; 
    /* Transizione fluida per l'effetto hover */
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

/* EFFETTO HOVER TOPBAR: Meno trasparente e più chiara */
.topbar:hover {
    background-color: rgba(255, 255, 255, 0.85); /* Molto più solida e chiara */
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* LOGO */
.logo {
    height: 50px; 
    width: auto; 
    display: flex; 
    align-items: center; 
    flex-shrink: 0;
    z-index: 3100;
}

.logo a { 
    height: 100%; 
    display: flex; 
    align-items: center; 
}

.logo-image-final { 
    height: 100%; 
    width: auto; 
    object-fit: contain; 
    display: block; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); 
}

/* MENU DESKTOP */
.main-menu { flex-grow: 1; display: flex; justify-content: center; padding: 0 20px; }
.main-menu ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 30px; align-items: center; }
.main-menu a {
    color: #111 !important; font-size: 13px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1px; white-space: nowrap; padding: 10px 0; position: relative;
}
.main-menu a::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: 5px; left: 0;
    background-color: #D4AF37; transition: width 0.3s;
}
.main-menu a:hover::after { width: 100%; }

/* SELETTORE LINGUA */
.language-selector {
    height: 100%; display: flex; align-items: center; position: relative; cursor: pointer; z-index: 3100; flex-shrink: 0;
}
.current-lang { display: flex; align-items: center; gap: 8px; padding: 10px; }
.current-lang img { width: 20px; height: auto; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.current-lang span { font-size: 13px; font-weight: 600; color: #111; text-transform: uppercase; }
.current-lang .arrow { font-size: 10px; margin-left: 2px; color: #333; }
.lang-dropdown {
    display: none; position: absolute; top: 70px; right: 0; background-color: #fff; min-width: 130px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2); border: 1px solid #eee; z-index: 2000; border-radius: 2px;
}
.language-selector:hover .lang-dropdown { display: block; }
.lang-dropdown a {
    display: flex; align-items: center; gap: 12px; padding: 10px 15px; color: #333 !important;
    font-size: 12px; font-weight: 600; border-bottom: 1px solid #f5f5f5;
}
.lang-dropdown a:hover { background-color: #f0f0f0; }
.lang-dropdown a img { width: 20px; height: auto; border-radius: 2px; }

/* =========================================
   2. VIDEO BACKGROUND
   ========================================= */
.video-container {
    position: relative; width: 100%; height: 100vh; padding: 0; margin: 0;
    overflow: hidden; background-color: #000; z-index: 1;
}
#bg-video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* =========================================
   3. BOTTOM BAR (Prezzi)
   ========================================= */
.bottombar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    height: auto; min-height: 50px;
    background-color: rgba(10, 10, 10, 0.85);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(5px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 40px;
    z-index: 2900;
}

.metal-price-box {
    display: flex; align-items: center; gap: 5px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px; color: #ccc; white-space: nowrap;
    min-width: 120px;
}
.metal-price-box:first-child { justify-content: flex-start; }
.metal-price-box:last-child { justify-content: flex-end; }

.metal-label { font-weight: 700; letter-spacing: 1px; margin-right: 5px; }
.gold-text { color: #D4AF37; }
.silver-text { color: #E0E0E0; }

.metal-value { font-weight: 600; color: #fff; }
.metal-unit { color: #888; font-size: 0.9em; text-transform: lowercase; }

.legal-info-desktop {
    font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 1px; text-align: center;
}

/* =========================================
   4. MOBILE LUXURY (iPhone Optimization)
   ========================================= */

.hamburger-menu {
    display: none; 
    flex-direction: column; justify-content: space-between;
    width: 30px; height: 20px; cursor: pointer;
    z-index: 4000; position: absolute; right: 20px;
}
.hamburger-menu span {
    width: 100%; height: 2px; background-color: #333;
    transition: all 0.3s ease-in-out;
}
.hamburger-menu.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: #fff; }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background-color: #fff; }

.mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px);
    z-index: 3500; display: flex; flex-direction: column; justify-content: center;
    padding-left: 40px; opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

.mobile-nav-links { display: flex; flex-direction: column; gap: 20px; }
.mobile-nav-links a {
    color: #ffffff; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 24px; font-weight: 300; text-transform: uppercase; letter-spacing: 2px;
    opacity: 0; transform: translateX(-20px); transition: all 0.5s ease;
}

.mobile-overlay.open .mobile-nav-links a { opacity: 1; transform: translateX(0); }
.mobile-overlay.open .mobile-nav-links a:nth-child(1) { transition-delay: 0.1s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(2) { transition-delay: 0.15s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(3) { transition-delay: 0.2s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(4) { transition-delay: 0.25s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(5) { transition-delay: 0.3s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(6) { transition-delay: 0.35s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(7) { transition-delay: 0.4s; }
.mobile-overlay.open .mobile-nav-links a:nth-child(8) { transition-delay: 0.45s; }

@media (max-width: 900px) {
    .hamburger-menu { display: flex; }
    .main-menu, .language-selector { display: none; }
    
    /* Su mobile disabilitiamo l'hover della topbar per evitare glitch visivi */
    .topbar { background-color: transparent !important; backdrop-filter: none !important; border-bottom: none !important; }
    .topbar:hover { background-color: transparent !important; }
    
    .logo { position: absolute; left: 20px; height: 40px; }

    .bottombar {
        background-color: rgba(10, 10, 10, 0.4); 
        border-top: none;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        padding-left: 20px; padding-right: 20px;
    }
    
    .legal-info-desktop { display: none; }
    .metal-price-box { font-size: 12px; min-width: auto; }
}
