/* ======== GENERAL STYLES & VARIABLES ======== */
:root {
    --primary-blue: #003366; /* A darker blue inspired by the logo */
    --accent-teal: #4db1b1;  /* The turquoise from the logo */
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --text-color: #555;
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Roboto', sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for the fixed header */
}

body {
    margin: 0;
    font-family: var(--body-font);
    color: var(--text-color);
    line-height: 1.7;
    background-color: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--heading-font);
    color: var(--primary-blue);
    font-weight: 700;
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-teal);
    margin: 15px auto 0;
}

.content-section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-gray);
}

/* ======== BUTTONS ======== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-teal);
    color: white;
    border: 2px solid var(--accent-teal);
}

.btn-primary:hover {
    background-color: #3aa0a0;
    border-color: #3aa0a0;
}

.btn-secondary {
    background-color: var(--primary-blue);
    color: white;
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: #002244;
    border-color: #002244;
}

.btn-nav {
    padding: 8px 20px;
}


/* ======== HEADER & NAVIGATION ======== */
.main-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    height: 50px;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1rem;
    position: relative;
    padding-bottom: 5px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-teal);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}


/* ======== HERO SECTION ======== */
.hero-section {
    height: 100vh;
    min-height: 600px;
    background-image: linear-gradient(rgba(0, 40, 85, 0.6), rgba(0, 40, 85, 0.6)), url('https://images.unsplash.com/photo-1517842645767-c6f90415add1?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 4rem;
    color: white;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 40px;
}

/* ======== CHI SIAMO SECTION ======== */
.about-us-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-us-text {
    flex: 1;
}

.about-us-image {
    flex: 1;
}

.about-us-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ======== SERVIZI SECTION ======== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 5px solid var(--accent-teal);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.service-card h3 {
    margin-top: 0;
    font-size: 1.4rem;
}


/* ======== CONTATTI SECTION ======== */
.contact-container {
    display: flex;
    gap: 50px;
}

.contact-details, .contact-form {
    flex: 1;
}

.contact-details h3, .contact-form h3 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 20px;
}

.contact-details a {
    color: var(--accent-teal);
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

.map-container {
    margin-top: 30px;
    border-radius: 8px;
    overflow: hidden;
    height: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-blue);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 5px rgba(77, 177, 177, 0.5);
}

/* ======== FOOTER ======== */
.main-footer {
    background-color: var(--primary-blue);
    color: white;
    padding: 20px 0;
    text-align: center;
}

.main-footer a {
    color: var(--accent-teal);
    text-decoration: none;
}
.main-footer a:hover {
    text-decoration: underline;
}

/* ======== RESPONSIVE DESIGN ======== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }

    .about-us-content {
        flex-direction: column;
    }

    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .main-header .container {
       flex-direction: column;
       height: auto;
       padding: 15px;
    }
    
    .main-nav {
        margin-top: 15px;
    }

    .main-nav li {
        margin: 0 10px;
    }
    
    .btn-nav {
        display: none; /* Hide button in nav on small screens */
    }

    html {
        scroll-padding-top: 120px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
}

/* ======== COOKIE POPUP STYLES ======== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Make sure it's on top of everything */
    opacity: 1;
    transition: opacity 0.3s ease;
}

.cookie-consent-popup {
    background-color: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 600px;
    width: 90%;
    text-align: left;
    transform: scale(1);
    transition: transform 0.3s ease;
}

/* Class to hide the popup */
.popup-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Disables interaction when hidden */
}

.popup-overlay.hidden .cookie-consent-popup {
    transform: scale(0.9);
}


.popup-title {
    font-family: var(--heading-font);
    color: var(--primary-blue);
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 15px;
}

.cookie-consent-popup p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cookie-consent-popup a {
    color: var(--accent-teal);
    font-weight: bold;
}

.popup-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    align-items: center;
    flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
    gap: 15px;
}

.popup-link {
    margin-right: auto; /* Pushes the link to the left */
    text-decoration: none;
}

.popup-link:hover {
    text-decoration: underline;
}

.popup-btn {
    padding: 10px 25px;
}

/* ======== PRIVACY PREFERENCES POPUP & TOGGLES ======== */
.preferences-options {
    margin-top: 30px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}
.preference-item + .preference-item {
    border-top: 1px solid #f0f0f0;
}

.preference-item label {
    flex: 1;
    margin-right: 20px;
    line-height: 1.4;
}
.preference-item small {
    display: block;
    color: #777;
    font-size: 0.85rem;
    font-weight: normal;
    margin-top: 4px;
}

/* The switch - a checkbox disguised as a toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-teal);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-teal);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}


/* ======== FLOATING PRIVACY WIDGET ======== */
.privacy-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary-blue);
    color: white;
    padding: 10px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1001; /* Above content, below popups */
    transition: all 0.3s ease;
}
.privacy-widget:hover {
    background-color: #002244;
}
.privacy-widget.hidden {
    display: none;
}
