/* ==========================================================================
   CSS VARIABLES & RESET
   ========================================================================== */
:root {
    --bg: #FFFFFF;
    --bg-elevated: #FAFAFA;
    --text-primary: #2A2A2A;
    --text-secondary: #555555;
    --accent: #C39D52; /* Oro elegante */
    --accent-hover: #b08d4a;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-medium: 0.4s ease;
    --transition-fast: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none; /* Custom cursor */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-4 { margin-bottom: 2rem; }
.w-full { width: 100%; }
.max-w-3xl { max-width: 768px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
}

.section-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.section-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   GLOBAL UI ELEMENTS
   ========================================================================== */
/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent);
    z-index: 10000;
    transition: width 0.1s;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10001;
    transition: transform 0.1s ease;
}

.custom-cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10000;
    transition: transform 0.3s ease, width 0.3s, height 0.3s, background 0.3s;
}

.cursor-hover .custom-cursor-follower {
    width: 60px;
    height: 60px;
    background: rgba(195, 157, 82, 0.1);
}

/* Luxury Button */
.btn-luxury {
    position: relative;
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    cursor: pointer;
    overflow: hidden;
    transition: color var(--transition-medium);
    z-index: 1;
}

.btn-luxury::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transition: width var(--transition-medium);
}

.btn-luxury:hover {
    color: var(--bg);
}

.btn-luxury:hover::before {
    width: 100%;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all var(--transition-slow);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Section Styling */
.section-padding {
    padding: 10rem 0;
}

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

.section-elevated {
    background-color: var(--bg-elevated);
}

.section-number {
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    font-family: var(--font-heading);
    font-size: 15rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.03;
    pointer-events: none;
    line-height: 1;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: background var(--transition-medium), padding var(--transition-medium);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link img {
    height: 55px;
    transition: transform var(--transition-medium), filter var(--transition-medium);
}

.site-header:not(.scrolled) .logo-link img {
    filter: invert(1);
}

.desktop-nav {
    display: flex;
    gap: 2.5rem;
}

.desktop-nav a {
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding: 0.5rem 0;
    color: #FFFFFF;
    transition: color var(--transition-medium);
}

.site-header.scrolled .desktop-nav a {
    color: var(--text-primary);
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition-medium);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2000;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background: var(--text-primary);
    transition: background var(--transition-medium);
}

.site-header:not(.scrolled) .hamburger span {
    background: #FFFFFF;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav a {
    font-family: var(--font-heading);
    font-size: 2rem;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3.5rem;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1;
    font-family: sans-serif;
    transition: transform var(--transition-fast);
}

.mobile-menu-close:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55); /* Scurisce lo sfondo per far risaltare il testo */
    z-index: 1;
}

.hero-gradient {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 15%;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 5rem;
}

.hero-title {
    font-family: 'Great Vibes', cursive;
    font-size: 7.5rem;
    color: #FFFFFF;
    margin-bottom: 1rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ==========================================================================
   GRID LAYOUTS
   ========================================================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.align-center {
    align-items: center;
}

/* ==========================================================================
   ROOMS CARDS
   ========================================================================== */
.room-card {
    cursor: pointer;
}

.room-img-wrapper {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.room-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-slow);
}

.room-hover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity var(--transition-medium);
    z-index: 2;
}

.room-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.room-card:hover .room-img {
    transform: scale(1.05);
}

.room-card:hover .room-img-wrapper::after,
.room-card:hover .room-hover-text {
    opacity: 1;
}

.room-name {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.room-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   SERVICES
   ========================================================================== */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem 2rem;
    text-align: center;
}

.service-item {
    flex: 0 1 250px;
}

.service-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
    margin-bottom: 1rem;
}

.service-item h4 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.service-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   REVIEWS (Drag to scroll)
   ========================================================================== */
.reviews-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 2rem 0;
    cursor: grab;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Custom Scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0,0,0,0.03);
}

/* Custom Minimalist Webkit Scrollbar */
.rooms-carousel::-webkit-scrollbar,
.reviews-carousel::-webkit-scrollbar,
.territory-carousel::-webkit-scrollbar,
.lightbox-track::-webkit-scrollbar {
    height: 6px;
}
.rooms-carousel::-webkit-scrollbar-track,
.reviews-carousel::-webkit-scrollbar-track,
.territory-carousel::-webkit-scrollbar-track,
.lightbox-track::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.06);
    border-radius: 6px;
}
.rooms-carousel::-webkit-scrollbar-thumb,
.reviews-carousel::-webkit-scrollbar-thumb,
.territory-carousel::-webkit-scrollbar-thumb,
.lightbox-track::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 6px;
}

.reviews-carousel:active {
    cursor: grabbing;
}

.review-card {
    min-width: 350px;
    background: var(--bg);
    padding: 3rem 2rem;
    border: 1px solid rgba(0,0,0,0.05);
    user-select: none;
}

.review-stars {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.review-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.review-author {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* ==========================================================================
   TERRITORY
   ========================================================================== */
.territorio-img {
    height: 600px;
    background-size: cover;
    background-position: center;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--text-primary);
    color: #fff;
    padding-bottom: 2rem;
}

.site-footer .section-title {
    color: #fff;
}

.contact-info h3 {
    font-size: 2.5rem;
    color: var(--accent);
}

.contact-info p {
    color: #ccc;
}

.btn-book-footer {
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-book-footer:hover {
    background: #fff;
}

.map-container {
    height: 400px;
    filter: grayscale(100%) contrast(120%);
}

.footer-bottom {
    text-align: center;
    padding-top: 4rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: #888;
}

/* ==========================================================================
   LIGHTBOX & MODALS
   ========================================================================== */
.lightbox, .booking-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(255,255,255,0.98);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.lightbox.active, .booking-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-tabs {
    position: absolute;
    top: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 3002;
    max-width: calc(100vw - 7rem);
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0.25rem 0.5rem;
}

.lightbox-tabs::-webkit-scrollbar {
    display: none;
}

.lightbox-tab {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.lightbox-tab:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.lightbox-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.lightbox-content {
    width: 84vw;
    max-width: 1180px;
    max-height: 86vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.lightbox-track {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 1rem 0 1.5rem 0;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0,0,0,0.03);
}

.lightbox-track:active {
    cursor: grabbing;
}

.lightbox-slide {
    flex: 0 0 100%;
    width: 100%;
    max-height: 72vh;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    user-select: none;
}

.lightbox-img,
.lightbox-video {
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border-radius: 2px;
    -webkit-user-drag: none;
    user-select: none;
}

.lightbox-caption {
    margin-top: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

@keyframes lightboxSlideFocus {
    0% { transform: scale(0.92); opacity: 0.6; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.92); opacity: 0.6; }
}

@media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
        .lightbox-slide {
            animation: lightboxSlideFocus auto linear both;
            animation-timeline: view(inline);
        }
    }
}

.lightbox-close, .modal-close {
    position: absolute;
    top: 2rem; right: 3rem;
    background: none; border: none;
    font-size: 3rem; color: var(--text-primary);
    cursor: pointer; z-index: 3003;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: none; border: none;
    font-size: 3rem; color: var(--text-primary);
    cursor: pointer; padding: 1rem;
    z-index: 3003;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.lightbox-prev:hover, .lightbox-next:hover {
    color: var(--accent);
}

.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

.booking-modal-box {
    background: var(--bg);
    padding: 4rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    position: relative;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#booking-form input, #booking-form select {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    font-family: var(--font-body);
    background: transparent;
    outline: none;
}

#booking-form input:focus, #booking-form select:focus {
    border-color: var(--accent);
}

/* ==========================================================================
   INTRO SCHIZZI DI COLORE (FLUIDA & MINIMAL)
   ========================================================================== */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background-color: #efeee9;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    will-change: opacity;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.preloader-hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-splashes {
    position: absolute;
    width: 560px;
    max-width: 92vw;
    height: auto;
    pointer-events: none;
}

.splash-layer {
    transform-box: fill-box;
    transform-origin: center;
    will-change: transform, opacity;
    opacity: 0;
}

.splash-grey {
    animation: splashPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.splash-black {
    animation: splashPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.16s forwards;
}

.splash-yellow {
    animation: splashPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.27s forwards;
}

.preloader-stage {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preloader-logo {
    height: 145px;
    width: auto;
    opacity: 0;
    will-change: transform, opacity;
    animation: logoPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.36s forwards;
}

@keyframes splashPop {
    0% {
        transform: scale3d(0.2, 0.2, 1);
        opacity: 0;
    }
    100% {
        transform: scale3d(1, 1, 1);
        opacity: 1;
    }
}

@keyframes logoPop {
    0% {
        transform: scale3d(0.82, 0.82, 1);
        opacity: 0;
    }
    100% {
        transform: scale3d(1, 1, 1);
        opacity: 1;
    }
}

/* ==========================================================================
   ROOMS & TERRITORY CAROUSELS
   ========================================================================== */
.rooms-carousel,
.territory-carousel {
    display: flex;
    gap: 3rem;
    overflow-x: auto;
    padding: 2rem 0;
    cursor: grab;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* Custom Scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0,0,0,0.03);
}

.rooms-carousel:active,
.territory-carousel:active {
    cursor: grabbing;
}

.rooms-carousel-item,
.territory-item {
    min-width: 340px;
    width: 340px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}

.territory-img-wrapper {
    position: relative;
}

.territory-item .t-distance {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: #FFF;
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(195, 157, 82, 0.3);
    z-index: 5;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    .section-title { font-size: 2.8rem; }
    .hero-title { font-size: 6rem; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .section-number { font-size: 10rem; }
}

@media (max-width: 768px) {
    body { cursor: auto; }
    .custom-cursor, .custom-cursor-follower { display: none; }
    
    .desktop-nav, .btn-book-nav { display: none; }
    .hamburger { display: flex; }
    
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 2rem; }
    
    .section-padding { padding: 6rem 0; }
    .hero-title { font-size: 4.5rem; }
    .section-title { font-size: 2.2rem; }
    
    .room-img-wrapper { aspect-ratio: 4/5; }
    .rooms-carousel-item, .territory-item {
        min-width: 290px;
        width: 290px;
    }
    
    .booking-modal-box { padding: 2.5rem; }

    .lightbox-tabs {
        top: 1.2rem;
        left: 1rem;
        transform: none;
        max-width: calc(100vw - 4.5rem);
    }
    .lightbox-tab {
        padding: 0.4rem 0.9rem;
        font-size: 0.72rem;
    }
    .lightbox-content {
        width: 92vw;
        margin-top: 2.5rem;
    }
    .lightbox-prev, .lightbox-next {
        font-size: 2rem;
        padding: 0.5rem;
    }
    .lightbox-prev { left: 0.25rem; }
    .lightbox-next { right: 0.25rem; }
    .lightbox-close {
        top: 0.8rem; right: 1rem;
        font-size: 2.5rem;
    }
}
