/* 
   Policar 2026 Premium Design - Strict White Background Edition
   Modern, Responsive, WCAG 2.2 AA Compliant
*/
:root {
    --primary-color: #d32f2f; /* Deep Red for Racing/Ferrari heritage */
    --text-color: #333333;
    --gray-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --link-color: #0056b3;
    --border-radius: 4px;
    --transition: all 0.2s ease-in-out;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* --- FORZATURA GLOBALE FONT TAHOMA --- */
/* Sovrascrive qualsiasi tag <font face="..."> o stile in linea del vecchio sito */
body, body * {
    font-family: 'Tahoma', system-ui, -apple-system, sans-serif !important;
}

/* Preserva il font moderno Inter SOLO per la barra di navigazione */
.professional-nav, .professional-nav * {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

body {
    font-family: 'Tahoma', system-ui, -apple-system, sans-serif;
    background-color: #ffffff; /* STRICTLY WHITE */
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--primary-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover, a:focus {
    color: var(--primary-color);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Header & Logo --- */
.site-header {
    background-color: #ffffff; /* STRICTLY WHITE */
    width: 100%;
}

.header-logo-container {
    background-color: #ffffff;
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.site-logo {
    margin: 0 auto;
    max-width: 1001px;
    width: 100%;
    height: auto;
}

/* --- Professional Navigation Bar --- */
.professional-nav {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    position: relative;
    z-index: 999;
    background-color: var(--gray-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column !important;
    align-items: center;
    gap: 15px;
}

.nav-menu {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 0;
    
    overflow: visible; /* Fixed dropdown clipping */
    width: 100%;
}


.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu li:not(:last-child)::after {
    content: "|";
    color: #b0b0b0;
    margin: 0 8px;
    font-size: 14px;
}

.nav-menu a {
    color: var(--link-color);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-highlight a {
    color: var(--primary-color);
    font-weight: 700;
}

.nav-social a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.social-icon {
    width: 16px;
    height: 16px;
    margin: 0;
    display: inline-block;
}

.search-container {
    width: 100%;
    max-width: 500px;
}

/* --- Main Content --- */
.site-main {
    min-height: 60vh;
    padding: 40px 15px;
    background-color: #ffffff; /* STRICTLY WHITE */
}

.content-wrapper {
    background-color: #ffffff;
    max-width: 1001px;
    margin: 0 auto;
}

.legacy-content-wrapper {
    background-color: #ffffff;
}

/* Old Table Responsive wrapper */
.table-responsive {
    overflow: visible; /* Fixed dropdown clipping */
    width: 100%;
    margin-bottom: 1.5rem;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
}

.table-responsive td {
    padding: 10px;
}

/* --- Footer --- */
.site-footer {
    background-color: #ffffff; /* STRICTLY WHITE */
    border-top: 2px solid var(--primary-color);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.site-footer h3 {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    display: inline-block;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    display: block;
    padding: 5px 0;
    color: #555555;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #888888;
    font-size: 0.9rem;
}

/* --- GDPR Banner --- */


    .cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.cookie-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.cookie-content p {
    flex: 1 1 60%;
    margin: 0;
    font-size: 0.95rem;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-accept, .btn-reject {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-accept {
    background-color: var(--primary-color);
    color: white;
}
.btn-accept:hover { background-color: #b71c1c; }

.btn-reject {
    background-color: transparent;
    color: #666;
    border: 1px solid #ccc;
}
.btn-reject:hover { background-color: #f0f0f0; }

.btn-link {
    color: #666;
    text-decoration: underline;
    font-size: 0.9rem;
}


/* --- Dropdown Menu --- */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    z-index: 100;
    min-width: 160px;
    border-radius: var(--border-radius);
    margin-top: 0; /* Removed to fix hover gap */
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-menu .dropdown-menu li {
    width: 100%;
    display: block;
}

/* Remove the separator line for dropdown items */
.nav-menu .dropdown-menu li::after {
    display: none !important;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color) !important;
    font-weight: 500;
    text-align: center;
    
    text-transform: none !important;
    letter-spacing: normal !important;
}

.dropdown-menu a:hover {
    background-color: var(--gray-bg);
    color: var(--primary-color) !important;
}

/* Responsive Overrides */

/* Hamburger Menu Styles */
.mobile-nav-header {
    display: none;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.mobile-menu-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column !important;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-bar {
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .mobile-nav-header {
        display: flex;
    }
    
    .nav-menu {
        display: none; /* Hidden by default on mobile */
        flex-direction: column !important;
        width: 100%;
        gap: 0;
        background-color: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        overflow: hidden;
    }
    
    .nav-menu.active {
        display: flex; /* Show when active */
    }

    .nav-menu li:not(:last-child)::after {
        display: none;
    }

    .nav-menu li {
        width: 100%;
        justify-content: center;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-menu li a {
        display: block;
        width: 100%;
        padding: 12px 15px;
        text-align: center;
    }
    
    .nav-menu a:hover {
        background-color: #f9f9f9;
    }

    

    .cookie-banner {
        flex-direction: column !important;
        bottom: 0; left: 0; right: 0;
        border-radius: 0;
    }
    
    /* Hamburger animation when active */
    .mobile-menu-toggle.active .hamburger-bar:nth-child(1) {
        transform: rotate(45deg);
    }
    .mobile-menu-toggle.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active .hamburger-bar:nth-child(3) {
        transform: rotate(-45deg);
    }
}

/* Modern Page Layout */
.modern-page-layout {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.left-sidebar {
    flex: 0 0 260px; /* Fixed width of 260px for the sidebar */
    position: sticky;
    top: 20px;
}

.main-content {
    flex: 1 1 auto;
    min-width: 0; /* Prevents overflow bugs in flexbox */
}

.right-sidebar {
    flex: 0 0 200px;
}

/* Ensure images inside main-content don't break the layout */
.main-content img, .main-content table {
    max-width: 100%;
    height: auto;
}

/* Responsive Layout for Mobile */
@media (max-width: 992px) {
    .modern-page-layout {
        flex-direction: column !important;
        margin: 20px auto;
    }
    
    .left-sidebar {
        flex: 1 1 auto;
        width: 100%;
        position: static;
        order: 2; /* Place sidebar below main content on mobile */
        margin-top: 30px;
        display: flex;
        flex-direction: column !important;
        align-items: center; /* Center sidebar items on mobile */
    }
    
    .main-content {
        order: 1; /* Place main content at the top */
        width: 100%;
    }
}
