/* Variabili per la modalità chiara e scura */
:root {
    --background-color: #0b0b0b;
    --text-color: #f0f0f0;
    --header-background: #1a1a1a;
    --main-border-color: #333;
    --button-background: #2b2b2b;
    --button-hover-background: #444;
    --button-border: #007bff;
    --icon-fill: #f0f0f0;
}

body.light-mode {
    --background-color: #f0f0f0;
    --text-color: #1a1a1a;
    --header-background: #ffffff;
    --main-border-color: #e0e0e0;
    --button-background: #e0e0e0;
    --button-hover-background: #ccc;
    --button-border: #007bff;
    --icon-fill: #1a1a1a;
    /* Rimosse le variabili per il footer per mantenerlo scuro */
}

/* Stili del corpo che usano le variabili */
body {
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.5s, color 0.5s;
}

/* Custom Scrollbar */
#custom-scrollbar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 8px;
    z-index: 100;
    background-color: var(--button-background);
    border-left: 1px solid #222;
}

#scrollbar-thumb {
    width: 100%;
    background-color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    transition: background-color 0.2s, opacity 0.2s;
}

#scrollbar-thumb.active {
    background-color: var(--button-border);
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.splash-logo {
    width: 250px;
    height: auto;
    animation: pulse 2s infinite;
    filter: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* HEADER E NAVIGATION */
.main-header {
    background-color: var(--header-background);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 50px;
    z-index: 20;
    position: relative;
    border-bottom: 1px solid var(--main-border-color);
    transition: background-color 0.5s, border-color 0.5s;
}

.logo-container {
    margin-right: 200px;
}

.logo-container img {
    width: 150px;
    height: auto;
    filter: none;
    transition: filter 0.5s;
}

.navigation-container {
    display: flex;
    gap: 20px;
}

.nav-button {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1em;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 15px;
    border: 1px solid transparent;
    transition: border-color 0.3s, color 0.3s;
}

.nav-button:hover {
    border-color: var(--button-border);
    color: var(--text-color);
}

/* Main Content e Carosello */
.main-content {
    position: relative;
    width: 100vw;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-image.active {
    opacity: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.overlay[data-image="1"].active,
.overlay[data-image="2"].active {
    opacity: 1;
}

.overlay-text {
    color: #f0f0f0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 4em;
    font-weight: 300;
}

.overlay-text .line2 {
    font-weight: 700;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 25px;
    height: 25px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: transparent;
}

.dot.active {
    background-color: #f0f0f0;
    color: #1a1a1a;
}

/* Tende da Sole Section */
.tende-da-sole-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 50px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 50px;
    color: var(--text-color);
    transition: color 0.5s;
}

.tende-content-container {
    flex: 1;
    text-align: left;
}

.tende-title {
    font-family: 'Lalezar', sans-serif;
    font-size: 4em;
    color: var(--text-color);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.tende-description-container {
    font-size: 1.1em;
    line-height: 1.6;
    max-width: 500px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.tende-image-container {
    flex: 1;
    text-align: right;
}

.tende-image-container img {
    max-width: 100%;
    height: auto;
}

/* Stile per la linea di separazione tra le sezioni */
.section-divider {
    width: 80%;
    max-width: 1000px;
    height: 1px;
    background-color: var(--main-border-color);
    margin: 60px auto;
    transition: background-color 0.5s;
}

/* Sezione NEWS */
.news-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.news-section .tende-title {
    font-family: 'Lalezar', sans-serif;
    font-size: 4em;
    color: var(--text-color);
    text-transform: uppercase;
    margin-bottom: 40px;
}

.news-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 30px;
    overflow-x: auto;
    padding: 10px 20px;
}

.news-item-card {
    flex: 0 0 350px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--main-border-color);
    border-radius: 10px;
    background-color: var(--header-background);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.5s;
    box-sizing: border-box; /* Assicura che padding e bordo non alterino le dimensioni */
}

.news-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

body.light-mode .news-item-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.news-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.news-item-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.news-item-description {
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-color);
    text-align: left;
}

.news-item-link {
    text-decoration: none;
    color: inherit;
    display: contents; /* Rende l'elemento <a> invisibile al layout, delegando tutto a .news-item-card */
}

/* Sezione CONTATTACI */
.contact-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 0;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.5s, color 0.5s;
    text-align: left;
}

.contact-content-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 80px;
    padding: 0 50px;
}

.contact-left-container {
    flex: 1;
    text-align: left;
}

.contact-right-container {
    flex: 1;
    max-width: 500px;
}

.contact-title {
    font-family: 'Lalezar', sans-serif;
    font-size: 4em;
    color: var(--text-color);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.contact-description-container {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 40px;
    color: var(--text-color);
}

.contact-details {
    margin-top: 30px;
    line-height: 1.8;
}

.contact-details p {
    margin: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--header-background);
    border: 1px solid var(--main-border-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s, background-color 0.3s;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--button-border);
}

.submit-button {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    padding: 15px 30px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    text-transform: uppercase;
    align-self: center;
}

.submit-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: #aaa;
    padding: 60px 20px;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px;
}

.footer-logo,
.footer-pages,
.footer-support {
    flex: 1;
    min-width: 250px;
    text-align: left;
}

.footer-logo img {
    width: 150px;
    margin-bottom: 15px;
    filter: none;
}

.footer-text {
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #aaa;
}

.footer-social-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social-buttons a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2b2b2b;
    transition: background-color 0.3s;
}

.footer-social-buttons a:hover {
    background-color: #444;
}

/* Le icone dei social media rimangono chiare */
.footer-social-buttons svg {
    width: 20px;
    height: 20px;
    fill: #f0f0f0;
    transition: none;
}

.footer-pages ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.footer-pages li a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9em;
    line-height: 2;
    transition: color 0.3s;
}

.footer-pages li a:hover {
    color: #ccc;
}

.footer-heading,
.support-heading {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.support-description {
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #aaa;
}

.shop-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.shop-button:hover {
    background-color: #0056b3;
}

/* L'icona dello shop rimane bianca */
.shop-button svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: none;
}

.footer-bottom {
    border-top: 1px solid #333;
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.8em;
    color: #aaa;
}

/* Stile per la freccia "Torna su" */
#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--button-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    transition: opacity 0.5s, transform 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#scroll-to-top:hover {
    transform: translateY(-5px);
}

#scroll-to-top svg {
    fill: var(--background-color);
    transition: fill 0.5s;
}

/* Stile per la pagina 404 (non utilizzato in questa pagina, ma mantenuto) */
.error-page-body {
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    text-align: center;
    transition: background-color 0.5s, color 0.5s;
}

.error-container {
    padding: 20px;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    transition: color 0.5s;
}

.error-logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
    filter: none;
    transition: filter 0.5s;
}

.error-title {
    font-size: 8em;
    margin: 0;
    font-weight: 700;
}

.error-message {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 30px;
}

.error-button {
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--header-background);
    color: var(--text-color);
    text-decoration: none;
    border: 2px solid var(--button-border);
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s, border-color 0.5s;
}

.error-button:hover {
    background-color: var(--button-border);
    color: var(--header-background);
}

/* Stili per il bottone del tema (forma a pillola) */
.theme-toggle {
    display: flex;
    position: relative;
    width: 80px;
    height: 40px;
    border-radius: 20px;
    background-color: var(--button-background);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.theme-toggle:hover {
    background-color: var(--button-hover-background);
    transform: scale(1.05);
}

/* Stili specifici per le icone sole e luna */
.theme-toggle .sun,
.theme-toggle .moon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    fill: var(--icon-fill);
    transition: all 0.3s ease-in-out;
}

.theme-toggle .sun {
    left: 8px;
    opacity: 0;
}

.theme-toggle .moon {
    right: 8px;
    opacity: 1;
}

.light-mode .theme-toggle .sun {
    opacity: 1;
}

.light-mode .theme-toggle .moon {
    opacity: 0;
}

/* Ottimizzazione per Dispositivi Mobili */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: center;
        padding: 15px 10px;
    }

    .logo-container {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .logo-container img {
        width: 120px;
    }

    .navigation-container {
        display: none;
    }

    .overlay-text {
        font-size: 2.5em;
    }

    .tende-da-sole-section,
    .contact-section {
        flex-direction: column;
        padding: 50px 20px;
        text-align: center;
    }

    .tende-title,
    .contact-title {
        font-size: 2.5em;
    }

    .tende-content-container,
    .tende-image-container {
        flex: auto;
        width: 100%;
        text-align: center;
    }

    .tende-description-container,
    .contact-description-container {
        max-width: 100%;
    }
    
    .contact-content-container {
        flex-direction: column;
        gap: 40px;
        padding: 0 20px;
    }

    .contact-left-container,
    .contact-right-container {
        max-width: 100%;
        text-align: center;
    }

    .contact-details {
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
    }

    .footer-logo,
    .footer-pages,
    .footer-support {
        text-align: center;
    }

    .footer-social-buttons {
        justify-content: center;
    }

    .theme-toggle {
        margin-top: 15px;
    }

    /* Adattamento della freccia per i mobile */
    #scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }

    /* Ottimizzazione della sezione NEWS per i mobile */
    .news-grid {
        flex-direction: column;
        align-items: center;
    }

    .news-item-card {
        width: 100%;
        max-width: 400px;
        flex: none;
    }
}

/* Ottimizzazione aggiuntiva per schermi molto piccoli */
@media (max-width: 480px) {
    .logo-container img {
        width: 100px;
    }

    .overlay-text {
        font-size: 2em;
    }

    .tende-title,
    .contact-title,
    .news-section .tende-title {
        font-size: 2em;
    }

    .theme-toggle {
        width: 70px;
        height: 35px;
        border-radius: 17.5px;
    }
}

.tende-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.tende-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Se hai altre sezioni con la stessa struttura, assicurati che anche i loro contenitori abbiano queste regole o classi */
/* Ad esempio, se le sezioni "bioclimatiche", "pergole", "vetratevepa" e "zanzariere" usano la stessa classe per il contenitore dell'immagine, la modifica sopra sarà sufficiente. */
/* Se usano classi diverse, dovrai applicare regole simili anche a quelle: */

/* Esempio per una classe diversa (se non usassi tende-image-container per tutti)
.bioclimatiche-image-container,
.pergole-image-container,
.vetratevepa-image-container,
.zanzariere-image-container {
    width: 300px;
    height: 300px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bioclimatiche-image-container img,
.pergole-image-container img,
.vetratevepa-image-container img,
.zanzariere-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
*/

/* Stili per la pagina "In Costruzione" */
.under-construction-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    text-align: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.under-construction-container {
    max-width: 600px;
    padding: 30px;
    border-radius: 10px;
    background-color: var(--card-background-color);
    box-shadow: var(--card-shadow);
}

.under-construction-image {
    max-width: 80%;
    height: auto;
    margin-bottom: 20px;
}

.under-construction-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 30px;
}

.back-to-home-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--accent-color);
    color: var(--button-text-color);
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.back-to-home-button:hover {
    background-color: var(--accent-color-hover);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .under-construction-container {
        padding: 20px;
    }
    .under-construction-text {
        font-size: 1em;
    }
    .back-to-home-button {
        padding: 10px 20px;
    }
}