/* ================================
   COMMON STYLES - Dynamedica Italia
   Shared across all pages
   ================================ */

/* VARIABLES */
:root {
    --verde: #006D3B;
    --verde-chiaro: #00A356;
    --rosso: #CE2B37;
    --rosso-scuro: #9B1B2A;
    --oro: #D4A843;
    --oro-chiaro: #F0D27A;
    --oro-glow: rgba(212,168,67,0.5);
    --crema: #FFFBF2;
    --crema-scura: #F5ECD9;
    --avorio: #FFF8EB;
    --verde-bosco: #0A2E1C;
    --verde-notte: #061A10;
    --testo: #2A2520;
    --grigio: #70675D;
}

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    background: var(--crema);
    color: var(--testo);
}

/* TYPOGRAPHY */
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.15;
}
h1 { font-size: clamp(2.8rem, 5.5vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ================================
   ITALIAN FLAG TOP BAR - Animated
   ================================ */
.flag-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 6px; z-index: 10000; display: flex;
}
.flag-bar span {
    flex: 1; position: relative; overflow: hidden;
}
.flag-bar .fg { background: var(--verde); }
.flag-bar .fw { background: #fff; }
.flag-bar .fr { background: var(--rosso); }
.flag-bar span::after {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: flagShine 3s ease-in-out infinite;
}
.flag-bar .fw::after { animation-delay: 0.3s; }
.flag-bar .fr::after { animation-delay: 0.6s; }
@keyframes flagShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

/* ================================
   HEADER / NAVIGATION
   ================================ */
header {
    position: fixed; top: 6px; width: 100%;
    background: rgba(10,46,28,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--oro);
    padding: 0.7rem 0; z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4,0,0.2,1);
}
header.scrolled {
    background: rgba(10,46,28,0.98);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
nav {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between;
    align-items: center; padding: 0 2rem;
}
.logo {
    display: flex; align-items: center;
    text-decoration: none; gap: 12px;
}
.logo img {
    height: 50px; width: auto;
    transition: transform 0.3s;
}
.logo:hover img { transform: scale(1.05) rotate(-2deg); }
.logo-text {
    font-family: 'Playfair Display', serif;
    font-weight: 800; font-size: 1.4rem;
    color: var(--oro); letter-spacing: 1px;
}
.logo-sub {
    font-size: 0.65rem; letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    display: block; margin-top: -2px;
}
.nav-right {
    display: flex; align-items: center; gap: 1.5rem;
}
.nav-links {
    display: flex; list-style: none; gap: 0.3rem;
}
.nav-links a {
    text-decoration: none; color: rgba(255,255,255,0.8);
    font-weight: 600; font-size: 0.85rem;
    letter-spacing: 2px; text-transform: uppercase;
    padding: 8px 16px; border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}
.nav-links a::before {
    content: ''; position: absolute; bottom: 0;
    left: 50%; width: 0; height: 2px;
    background: var(--oro); transition: all 0.3s;
    transform: translateX(-50%);
}
.nav-links a:hover { color: var(--oro); }
.nav-links a:hover::before { width: 80%; }

/* Dropdown Menu */
.nav-dropdown { position: relative; }
.dropdown-arrow {
    font-size: 0.65rem; display: inline-block;
    transition: transform 0.3s; margin-left: 2px;
}
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: rgba(10,46,28,0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212,168,67,0.25);
    border-radius: 10px; padding: 10px 0;
    min-width: 280px; list-style: none;
    opacity: 0; visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 100;
}
.dropdown-menu::before {
    content: ''; position: absolute; top: -8px;
    left: 50%; transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(212,168,67,0.25);
}
.dropdown-menu::after {
    content: ''; position: absolute; top: -12px;
    left: 0; right: 0; height: 12px;
}
.nav-dropdown:hover .dropdown-menu {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.dropdown-menu li { padding: 0; }
.dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.5px !important;
    text-transform: none !important;
    color: rgba(255,255,255,0.75) !important;
    border-radius: 0 !important;
    border: none !important;
    white-space: nowrap;
    transition: all 0.3s !important;
}
.dropdown-menu a::before { display: none !important; }
.dropdown-menu a:hover {
    background: rgba(212,168,67,0.1) !important;
    color: var(--oro) !important;
    padding-left: 28px !important;
}
.dd-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; display: inline-block;
}
.dd-dot.strong { background: linear-gradient(135deg, #E91E63, #FF4081); }
.dd-dot.heat { background: linear-gradient(135deg, #FF6B35, #FF9800); }
.dd-dot.freeze { background: linear-gradient(135deg, #1E88E5, #42A5F5); }
.dd-dot.cbd { background: linear-gradient(135deg, #2E7D32, #66BB6A); }

/* Language Switcher */
.lang-switcher {
    display: flex;
    border: 1px solid rgba(212,168,67,0.4);
    border-radius: 30px; overflow: hidden;
}
.lang-btn {
    background: transparent; border: none;
    color: rgba(255,255,255,0.5);
    font-weight: 700; font-size: 0.8rem;
    padding: 6px 14px; cursor: pointer;
    transition: all 0.3s; letter-spacing: 1px;
}
.lang-btn.active, .lang-btn:hover {
    background: var(--oro); color: var(--verde-bosco);
}
.mobile-toggle {
    display: none; background: none;
    border: 1px solid rgba(212,168,67,0.4);
    color: var(--oro); font-size: 1.3rem;
    padding: 6px 12px; cursor: pointer;
    border-radius: 4px;
}

/* ================================
   SECTION TITLES - Shared
   ================================ */
.sec-header { text-align: center; margin-bottom: 5rem; }
.sec-label {
    font-family: 'Lato', sans-serif; font-size: 0.8rem;
    font-weight: 700; letter-spacing: 5px;
    text-transform: uppercase; color: var(--oro);
    display: block; margin-bottom: 1rem;
}
.sec-title { color: var(--verde-bosco); position: relative; display: inline-block; }
.sec-title.light { color: var(--crema); }
.sec-divider {
    display: flex; align-items: center;
    justify-content: center; gap: 0.8rem;
    margin-top: 1.5rem;
}
.sd-line { width: 60px; height: 1px; background: var(--oro); transition: width 0.5s; }
.sd-dia { width: 6px; height: 6px; background: var(--oro); transform: rotate(45deg); }
.sec-header:hover .sd-line { width: 90px; }

/* ================================
   ORNAMENT
   ================================ */
.ornament {
    display: flex; align-items: center;
    justify-content: center; gap: 1rem;
    margin: 1.5rem 0;
}
.orn-line { width: 80px; height: 1px; background: linear-gradient(to right, transparent, var(--oro)); }
.orn-line.r { background: linear-gradient(to left, transparent, var(--oro)); }
.orn-dia {
    width: 10px; height: 10px; background: var(--oro);
    transform: rotate(45deg);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: rotate(45deg) scale(1); opacity: 1; }
    50% { transform: rotate(45deg) scale(1.3); opacity: 0.7; }
}

/* ================================
   FOOTER
   ================================ */
footer {
    background: var(--verde-notte); color: white;
    padding: 80px 0 0; border-top: 3px solid var(--oro);
    position: relative;
}
footer::before {
    content: ''; position: absolute; top: 0;
    left: 0; right: 0; height: 100%;
    background: radial-gradient(ellipse at 50% 0%, rgba(212,168,67,0.05) 0%, transparent 50%);
    pointer-events: none;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 3rem; margin-bottom: 4rem;
    position: relative; z-index: 1;
}
.footer-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; color: var(--oro);
    margin-bottom: 1.5rem; padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(212,168,67,0.2);
}
.footer-section p, .footer-section li {
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem; line-height: 1.8;
    margin-bottom: 0.6rem;
}
.footer-section ul { list-style: none; }
.footer-section a {
    color: rgba(255,255,255,0.65);
    text-decoration: none; transition: all 0.3s;
}
.footer-section a:hover {
    color: var(--oro); transform: translateX(4px);
}
.social-links { display: flex; gap: 0.8rem; margin-top: 1.5rem; }
.social-link {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212,168,67,0.2);
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    color: white; text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.social-link:hover {
    background: var(--oro); border-color: var(--oro);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px var(--oro-glow);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 2rem; text-align: center;
    position: relative; z-index: 1;
}
.footer-bottom p {
    color: rgba(255,255,255,0.35); font-size: 0.82rem;
}
.footer-flag {
    display: flex; justify-content: center;
    gap: 0; margin-bottom: 1rem;
}
.footer-flag span {
    display: block; height: 3px; width: 30px;
    transition: width 0.3s;
}
.footer-bottom:hover .footer-flag span { width: 50px; }
.footer-flag .ffg { background: var(--verde); }
.footer-flag .ffw { background: white; }
.footer-flag .ffr { background: var(--rosso); }

/* ================================
   REVEAL ANIMATIONS
   ================================ */
.reveal {
    opacity: 0; transform: translateY(50px);
    transition: all 1s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left {
    opacity: 0; transform: translateX(-50px);
    transition: all 1s cubic-bezier(0.16,1,0.3,1);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right {
    opacity: 0; transform: translateX(50px);
    transition: all 1s cubic-bezier(0.16,1,0.3,1);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale {
    opacity: 0; transform: scale(0.8);
    transition: all 1s cubic-bezier(0.16,1,0.3,1);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .nav-links {
        display: none; position: absolute;
        top: 100%; left: 0; right: 0;
        background: rgba(10,46,28,0.98);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(212,168,67,0.2);
        flex-direction: column;
        padding: 1.5rem 2rem; gap: 0.5rem;
    }
    .nav-links.active { display: flex; }
    .nav-right { gap: 0.8rem; }
    /* Mobile dropdown */
    .nav-dropdown { position: static; }
    .dropdown-menu {
        position: static; transform: none;
        opacity: 1; visibility: visible;
        background: rgba(255,255,255,0.04);
        border: none; border-left: 2px solid rgba(212,168,67,0.3);
        border-radius: 0; box-shadow: none;
        min-width: auto; padding: 6px 0;
        margin: 6px 0 0 12px;
        display: none;
    }
    .dropdown-menu::before, .dropdown-menu::after { display: none; }
    .nav-dropdown.open .dropdown-menu { display: block; }
    .dropdown-menu a {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }
    .dropdown-menu a:hover { padding-left: 22px !important; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
    .lang-btn { padding: 5px 10px; font-size: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
