/* Reset e Variabili */
:root {
    --primary-color: #722F37; /* <--- HO RIMESSO IL CODICE COLORE CHE MANCAVA */
    --secondary-color: #F5F5DC; /* Beige pietra */
    --text-dark: #333;
    --text-light: #fff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--primary-color); }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* Layout Generico */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px; /* Padding standard per PC */
}

.section-padding { padding: 60px 0; }
.bg-light { background-color: #f9f9f9; }
.center-title { text-align: center; margin-bottom: 40px; font-size: 2rem; }

/* Header */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px 0;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 { font-size: 1.5rem; }
header nav ul { display: flex; gap: 20px; }
header nav a:hover { color: var(--primary-color); }

.dark-header { background-color: var(--primary-color); color: white; }
.dark-header h1, .dark-header a { color: white; }

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("https://media.istockphoto.com/id/513906137/nl/foto/tuscany-seen-from-the-walls-of-montepulciano-i.jpg?s=612x612&w=0&k=20&c=ozszbwN5t8whUHIeTGPakwN6DRe8QqwZBXLVd14vdL4=");
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}
.hero h2 { color: white; font-size: 3rem; margin-bottom: 10px; }

/* Pulsanti */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white !important;
    padding: 10px 25px;
    border-radius: 5px;
    margin-top: 15px;
}
.btn:hover { background: #5a242b; }

.btn-outline, .btn-outline-dark {
    padding: 8px 20px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
}

.btn-outline {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover { background: var(--primary-color); color: white; }

.btn-outline-dark {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline-dark:hover { background: #5a242b; color: white; }

.btn-outline-white {
    padding: 8px 20px;
    border-radius: 5px;
    display: inline-block;
    border: 1px solid white;
    color: white;
    margin-top: 10px;
}
.btn-outline-white:hover {
    background: white;
    color: var(--primary-color); /* Diventa rosso quando ci passi sopra */
}

.full-width { width: 100%; text-align: center; cursor: pointer; border: none; font-size: 1rem; }

/* Griglia Home */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 20px; text-align: center; }

/* Pagina Appartamento */
.apt-title { text-align: center; margin-bottom: 30px; font-size: 2.5rem; }

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-bottom: 40px;
}
.main-img img, .thumb-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.main-img { height: 400px; }
.thumb-img { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: space-between; }

.apt-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 30px;
}
.price-box {
    background: #fff;
    border: 1px solid #ddd;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.price { font-size: 1.8rem; font-weight: bold; color: var(--primary-color); }
.per-night { font-size: 1rem; color: #666; font-weight: normal; }
.small { font-size: 0.9rem; color: #666; margin-bottom: 10px; }
.extra-info { margin-bottom: 5px; font-size: 0.9rem; }

/* --- LINGUE --- */
.lang-switch, .lang-switch-dark {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 20px;
}

.lang-switch a, .lang-switch-dark a {
    color: #333; 
    text-decoration: none;
    padding: 2px 5px;
    border-radius: 4px;
}

.lang-switch span, .lang-switch-dark span { color: #ccc; }
.lang-switch-dark span { color: #333; }

.lang-switch a.active-lang, .lang-switch-dark a.active-lang {
    background-color: var(--primary-color);
    color: white !important;
}

.lang-switch a:hover, .lang-switch-dark a:hover { color: var(--primary-color); }
.lang-switch-dark a:hover { color: #ccc; }
.lang-switch a.active-lang:hover, .lang-switch-dark a.active-lang:hover { color: #ccc; }

/* =========================================
   SEZIONE CALENDARIO (CENTRATA)
   ========================================= */

.calendar-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}

.iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    
    width: 100%;
    max-width: 800px;
    margin: 20px auto 0;
    
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* =========================================
   STILE CAROSELLO (MODIFICATO: SFONDO BIANCO)
   ========================================= */

.carousel-container {
    position: relative;
    width: 100%;           
    max-width: 800px;      
    height: 500px;         
    margin: 0 auto 40px;   
    overflow: hidden;      
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: #fff; 
}

.carousel-slide {
    display: flex;         
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out; 
}

.carousel-slide img {
    width: 100%;           
    height: 100%;          
    object-fit: contain;      
    background-color: #fff; 
    flex-shrink: 0;        
    display: block;
}

/* Tasti Avanti/Indietro */
.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(114, 47, 55, 0.9); 
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 50%;
    margin: 0 10px;
    transition: 0.3s;
    z-index: 10; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.carousel-prev:hover, .carousel-next:hover {
    background-color: var(--primary-color);
}

.carousel-next { right: 0; }
.carousel-prev { left: 0; }

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

/* =========================================
   MEDIA QUERIES (MOBILE) - MODIFICATO
   ========================================= */

@media (max-width: 768px) {
    /* 1. AGGIUNTA SPAZIO AI BORDI SU MOBILE */
    .container {
        padding-left: 30px;  /* Spazio extra a sinistra */
        padding-right: 30px; /* Spazio extra a destra */
    }

    /* Header e Navigazione */
    header .container { flex-direction: column; text-align: center; }
    header h1 { margin-bottom: 15px; }
    header nav ul { flex-direction: column; gap: 10px; padding: 0; }
    header nav a { display: block; padding: 10px; background-color: #f4f4f4; border-radius: 5px; }
    
    /* Hero e Griglie */
    .hero { height: 50vh; }
    .hero h2 { font-size: 2rem; padding: 0 10px; }
    .grid-3 { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; gap: 15px; }
    .main-img { height: 250px; }
    
    /* Carosello su Mobile */
    .carousel-container { 
        height: 300px; 
    }

    /* Miniature Gallery */
    .thumb-img {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 10px;
        padding-bottom: 10px;
    }
    .thumb-img img { width: 150px; height: 100px; flex-shrink: 0; scroll-snap-align: start; }
    
    /* Dettagli Appartamento */
    .apt-details-grid { grid-template-columns: 1fr; gap: 30px; }
    .apt-title { font-size: 1.8rem; margin-top: 10px; }

    /* Lingue */
    .lang-switch, .lang-switch-dark {
        margin-left: 0;
        margin-top: 15px;
        justify-content: center;
        width: 100%;
    }
    .lang-switch a, .lang-switch-dark a { padding: 5px 10px; border: 1px solid #ddd; }
    .lang-switch span, .lang-switch-dark span { display: none; }
    
    /* Extra: assicuro che i testi p non tocchino mai i bordi se fuori container */
    p {
        margin-left: 5px;
        margin-right: 5px;
    }
}

@media (max-width: 480px) {
    .hero h2 { font-size: 1.5rem; }
    .btn { width: 100%; text-align: center; }
}

/* =========================================
   STILE BANNER COOKIE
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    color: var(--text-dark);
    padding: 20px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    z-index: 9999;
    
    display: none; 
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-top: 3px solid var(--primary-color);
}

.cookie-text p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 0;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

@media (min-width: 768px) {
    .cookie-banner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 20px 40px;
    }
    .cookie-text {
        max-width: 70%;
    }
    .cookie-text p {
        text-align: left;
    }
}