/* =========================================
   1. VARIABILI E RESET
   ========================================= */
:root {
    --primary-blue: #005B96;
    --light-blue: #B3CDE0;
    --dark-footer: #011F4B;
    --accent-gold: #D4AF37;
    --white: #FFFFFF;
    --text-dark: #333333;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Lora', serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
}

/* =========================================
   2. HEADER E NAVIGAZIONE
   ========================================= */
header {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

nav ul {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    align-items: center;
    background: rgba(1, 31, 75, 0.98);
    backdrop-filter: blur(5px);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

nav ul.active {
    max-height: 700px;
    padding: 20px 0;
}

ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    text-align: center;
}

ul li:last-child {
    border-bottom: none;
}

/* Hamburger Menu - SEMPRE VISIBILE */
.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(12px, 12px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.menu-trigger-label {
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: 0.3s;
    display: block;
    padding: 10px 15px;
}

nav a:hover,
nav a:active {
    color: var(--light-blue);
    background: rgba(255, 255, 255, 0.1);
}


nav a:hover {
    color: var(--light-blue);
}

.nav-cta {
    background: var(--accent-gold);
    padding: 8px 20px;
    border-radius: 5px;
    color: var(--dark-footer) !important;
}

/* =========================================
   3. HERO SECTION - SFONDO ABBASSATO SUL MARE
   ========================================= */
.home-bg {
    /* Zoom 130% e posizione BOTTOM per inquadrare il mare ed eliminare il cielo in eccesso */
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3)),
        url('../img/hero-mare.webp') no-repeat center bottom / 130%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    background-attachment: fixed;
}

.hero-tag {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.hero-text {
    z-index: 10;
    padding: 0 20px;
}

.hero-text h1 {
    font-size: clamp(2rem, 10vw, 4.5rem);
    text-shadow: 3px 3px 15px rgba(0, 0, 0, 0.5);
    margin: 10px 0;
    word-wrap: break-word;
}

.hero-text p {
    font-size: clamp(0.95rem, 4vw, 1.3rem);
    margin: 10px 0 0 0;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.4);
}

/* =========================================
   4. SEZIONE CARDS E SERVIZI
   ========================================= */
.full-description {
    padding: 80px 20px;
    background: linear-gradient(to bottom, #ffffff, #fcfdfe);

    scroll-behavior: smooth;
}

.description-content {
    max-width: 1100px;
    margin: auto;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.subtitle {
    color: var(--accent-gold);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
}

.divider {
    width: 60px;
    height: 3px;
    background: var(--primary-blue);
    margin: 20px auto;
}

.lead-text {
    text-align: center;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 60px;
    color: #555;
}

/* Griglia Servizi */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: auto;
}

.grid-item {
    background: #f9fbfd;
    padding: 30px;
    border-radius: 15px;
    border-top: 4px solid var(--primary-blue);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Card Home Page */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: 0.4s;
    border: 1px solid #f0f0f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 91, 150, 0.1);
}

.card-image-placeholder {
    font-size: 3rem;
    margin-bottom: 20px;
    background: #f0f7ff;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto;
}

/* =========================================
   5. PAGINA PRENOTA (BOTTONI)
   ========================================= */
.booking-page {
    padding: 60px 20px;
    background: #f4f7f9;
    min-height: 70vh;
    text-align: center;
}

.booking-container {
    max-width: 500px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-booking {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: 0.3s;
}

.subito {
    background: #ff5023;
}

.airbnb {
    background: #FF5A5F;
}

.booking {
    background: #003580;
}

.logo-s,
.logo-b {
    margin-right: 15px;
    font-weight: bold;
}

footer {
    background: var(--dark-footer);
    color: white;
    text-align: center;
    padding: 40px;
}

/* =========================================
   6. PAGINA DINTORNI (MAPPA E GUIDA)
   ========================================= */

/* Sezione Mappa Interattiva */
.map-section {
    padding: 80px 20px;
    text-align: center;
    background: #fdfdfd;
}

/* wrapper usa padding-top per mantenere proporzione 16:9 */
.map-container {
    position: relative;
    max-width: 1000px;
    margin: 50px auto;
    background: #e3f2fd;
    /* Richiamo colore mare per l'area mappa */
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 4px solid white;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* La Vignetta (Pin cliccabile) */
.vignetta {
    position: absolute;
    background: var(--white);
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, background 0.3s, color 0.3s;
    cursor: pointer;
    border: 1px solid var(--light-blue);
    z-index: 2;
}

.vignetta:hover {
    transform: scale(1.1) translateY(-5px);
    z-index: 10;
    background: var(--primary-blue);
    color: var(--white);
}

.vignetta span {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Posizionamento delle vignette (Esempi di classi da usare nel HTML) */
.pos-casa {
    top: 50%;
    left: 50%;
    background: var(--accent-gold);
    color: var(--white);
    border: 2px solid var(--white);
}

/* Iframe Mappa Standard (se usi Google Maps Embed) */
.map-iframe-wrapper {
    margin-bottom: 60px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.map-iframe-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.map-embed-card {
    margin-top: 50px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.map-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e3f2fd;
}

.map-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Griglia Attrazioni / Guide */
.tourist-guide {
    margin-top: 40px;
}

.attraction-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #eee;
    transition: 0.3s;
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.attraction-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.attraction-card h3 {
    color: var(--primary-blue);
    margin-top: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.attraction-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Media Query per Mappa su Mobile */
@media (max-width: 768px) {
    .map-container {
        padding-top: 75%;
    }

    .vignetta span {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
}

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

.grid-item {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--primary-blue);
}

.grid-item h3 {
    margin-top: 0;
    color: var(--primary-blue);
}


/* =========================================
   7. SWITCH LINGUA IPHONE STYLE (TRASPARENTE)
   ========================================= */

/* Container dello switch */
.language-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.lang-label {
    color: var(--white);
    font-size: 0.75rem;
    font-weight: bold;
    font-family: sans-serif;
    letter-spacing: 1px;
}

/* Struttura base dello switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

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

/* Lo sfondo dello switch (Effetto Vetro) */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 34px;
}

/* Il pallino dello switch */
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

/* Quando attivato (ENG) - Verde iPhone */
input:checked+.slider {
    background-color: rgba(46, 204, 113, 0.6);
}

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


/* BLOCCO TOTALE BARRA GOOGLE */
html {
    padding-top: 0px !important;
}

body {
    top: 0px !important;
    position: static !important;
}

/* Rende invisibili tutti i componenti che Google inietta nel sito */
.goog-te-banner-frame,
.goog-te-banner,
.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-gadget-icon {
    display: none !important;
    visibility: hidden !important;
}

/* Nasconde il widget originale (che serve per far funzionare lo script) */
#google_translate_element {
    display: none !important;
}

/* Toglie l'effetto evidenziatore sui testi tradotti */
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Global responsive helpers */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container per il video, simile alla galleria */
.video-container {
    max-width: 900px;
    margin: 40px auto;
    /* Spazio sotto la galleria */
    padding: 0 20px;
    /* Margine laterale su mobile */
    text-align: center;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    line-height: 0;
    /* Rimuove spazi vuoti sotto il video */
}

video {
    width: 100%;
    height: auto;
    /* Fondamentale per mantenere le proporzioni su mobile */
    display: block;
}

/* Titolo opzionale per la sezione video */
.video-title {
    color: #4A3728;
    /* Colore cioccolato come il resto del sito */
    margin-bottom: 20px;
    font-family: 'Lora', serif;
}

.gallery-viewer {
    width: min(100%, 900px);
    margin: clamp(20px, 4vw, 50px) auto;
    position: relative;
    text-align: center;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    aspect-ratio: 16 / 10;
}

#main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.78);
    border: none;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    border-radius: 50%;
    transition: 0.25s;
    display: grid;
    place-items: center;
}

.nav-arrow:hover {
    background: #fff;
}

.prev {
    left: 14px;
}

.next {
    right: 14px;
}

/* =========================================
   8. FIX DEFINITIVI PER MOBILE E TABLET
   ========================================= */
@media (max-width: 768px) {

    .nav-container {
        padding: 12px 15px;
    }

    .menu-trigger {
        gap: 8px;
    }

    .menu-trigger-label {
        font-size: 0.72rem;
    }

    header {
        position: relative;
        background: var(--dark-footer);
    }

    .home-bg header {
        position: absolute;
        background: transparent;
        width: 100%;
    }

    .home-bg header .nav-container {
        background: rgba(1, 31, 75, 0.95);
        border-radius: 0 0 15px 15px;
    }

    /* Hero: Adattamento proporzioni */
    .home-bg {
        height: 60vh;
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        padding-top: 70px;
    }

    .hero-tag {
        font-size: 0.7rem;
        padding: 4px 12px;
    }

    /* Full Description: Migliore spacing */
    .full-description {
        padding: 40px 15px;
    }

    .section-title {
        margin-bottom: 30px;
    }

    .section-title h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    /* Cards: Riduzione padding per schermi stretti */
    .feature-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .card-image-placeholder {
        font-size: 2.5rem;
        width: 70px;
        height: 70px;
        line-height: 70px;
    }

    .gallery-viewer {
        aspect-ratio: 4 / 3;
        border-radius: 12px;
    }

    .nav-arrow {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    .map-iframe-wrapper,
    .map-embed {
        aspect-ratio: 4 / 3;
    }

    /* Switch Lingua responsivo */
    .language-switch {
        margin: 0;
        order: 3;
        width: 100%;
        padding: 15px 0 5px 0;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul.active~.language-switch {
        margin-top: 0;
    }

    /* Footer responsivo */
    footer {
        padding: 30px 15px;
        font-size: 0.9rem;
    }

    /* Grid containers */
    .grid-container,
    .features-grid {
        gap: 20px;
        padding: 0 10px;
    }
}