/* ═══════════════════════════════════════════
   B&B Magnolia — Main Stylesheet (Front-end)
   ═══════════════════════════════════════════ */

/* ─── 1. Variabili & Reset Base ────────────── */
:root {
    --primary: #2E5F3E; /* Verde Foresta */
    --accent: #E67E22;  /* Arancione CTA */
    --accent-hover: #D35400;
    --background: #FAFAFA;
    --surface: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-soft: 0 8px 30px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
}

/* h1-h4 base - sovrascritti in contesti specifici (es. .hero h1) */
h1, h2, h3, h4 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

/* ─── 2. Utility Class & Layout ────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.grid {
    display: grid;
    gap: 32px;
}

.bg-light {
    background-color: #F0F4F1; /* Verde chiarissimo */
}

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

.mt-4 {
    margin-top: 32px;
}

/* ─── 3. Bottoni e Badge ───────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-full {
    width: 100%;
}

.badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--surface);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-accent {
    color: var(--accent);
}

/* ─── 4. Header & Navigazione ──────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 20px 0;
    transition: var(--transition);
}

.header.scrolled {
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft);
}

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

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-main);
}

.nav-links a:hover {
    color: var(--accent);
}

/* ─── 5. Homepage: Hero Section & Slider ───── */
.hero {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background-color: transparent; 
    color: white;
    z-index: 1; 
}

.hero-spacer {
    display: none;
}

.hero-slider, .hero-slider .slide {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-slider {
    z-index: -2;
}

.hero-slider .slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    will-change: opacity, transform;
}

.hero-slider .slide.transition-fade { transition: opacity 2.5s ease-in-out; }
.hero-slider .slide.transition-zoom { transition: opacity 2.5s ease-in-out, transform 6s ease-out; transform: scale(1); }
.hero-slider .slide.transition-zoom.active { transform: scale(1.15); }
.hero-slider .slide.transition-slide-right { transition: opacity 1.8s ease-in-out, transform 2.5s ease-out; transform: translateX(8%); }
.hero-slider .slide.transition-slide-right.active { transform: translateX(0); }
.hero-slider .slide.transition-slide-left { transition: opacity 1.8s ease-in-out, transform 2.5s ease-out; transform: translateX(-8%); }
.hero-slider .slide.transition-slide-left.active { transform: translateX(0); }
.hero-slider .slide.transition-kenburns { transition: opacity 2.5s ease-in-out; animation: none; }
.hero-slider .slide.transition-kenburns.active { animation: kenburns 8s ease-out forwards; }
.hero-slider .slide.active { opacity: 1; }

.hero-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(46, 95, 62, 0.8) 0%, rgba(20, 40, 25, 0.6) 100%);
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.hero .btn-outline {
    border-color: white;
    color: white;
}

.hero .btn-outline:hover {
    background-color: white;
    color: var(--primary);
}

/* ─── 6. Homepage: Sezioni (Features, Rooms, About) ─ */
.features {
    padding: 64px 0;
    position: relative;
    z-index: 1;
    background-color: var(--background);
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.feature-card {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    color: var(--accent);
    width: 48px;
    height: 48px;
    margin-bottom: 24px;
}

.feature-card h3 { margin-bottom: 16px; }
.feature-card p { color: var(--text-muted); }

/* Sezione Camere Home */
.rooms {
    padding: 96px 0;
    position: relative;
    z-index: 1;
    background-color: #F0F4F1;
}

.section-header { margin-bottom: 64px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 16px; }
.section-header p { font-size: 1.25rem; color: var(--text-muted); }

.rooms-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    height: 240px;
    position: relative;
}

.card-content { padding: 32px; }
.card-content h3 { font-size: 1.5rem; margin-bottom: 8px; }

.price { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 16px; }
.price strong { color: var(--primary); font-size: 1.5rem; }

.description { color: var(--text-muted); margin-bottom: 24px; }

/* Sezione Chi Siamo */
.about {
    padding: 96px 0;
    position: relative;
    z-index: 1;
    background-color: var(--background);
}

.about-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 64px;
}

.about-content h2 { font-size: 2.5rem; margin-bottom: 24px; }
.about-content p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 16px; }


/* ─── 7. Pagine Interne (Banner e Struttura) ─ */
.page-content {
    padding: 64px 0;
    min-height: 60vh;
}

.page-banner {
    position: relative;
    width: 100%;
    height: 40vh;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    color: white;
    z-index: 1;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(46,95,62,0.95), rgba(46,95,62,0.4));
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.banner-spacer {
    height: 40vh;
    min-height: 350px;
}

/* Dettaglio Camera (camere.html) */
.room-detail {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-bottom: 64px;
    background: white;
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-soft);
}

.room-detail.reverse { flex-direction: row-reverse; }
.room-gallery { flex: 1; overflow: hidden; border-radius: var(--radius-sm); }
.main-room-img { width: 100%; height: 350px; object-fit: cover; transition: transform 0.5s; }
.room-gallery:hover .main-room-img { transform: scale(1.05); }

.room-info { flex: 1; }
.room-info h2 { font-size: 2rem; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.room-desc { color: var(--text-muted); margin-bottom: 24px; }

.room-features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.room-features li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.room-features i { color: var(--primary); width: 20px; }

.room-divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin: 64px 0;
}

/* Tabella Prezzi */
.pricing-table { display: flex; gap: 16px; margin-top: 24px; }
.price-tier {
    flex: 1;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    position: relative;
}
.price-tier.highlighted { border-color: var(--accent); background: rgba(230, 126, 34, 0.05); }
.price-tier .dates { font-size: 0.85rem; color: var(--text-muted); margin: 8px 0 16px; }
.price-tier .amount { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.price-tier .amount span { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }

/* Territorio (Masonry Gallery) */
.masonry-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 250px;
    gap: 24px;
    margin-top: 48px;
}

.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item:hover img { transform: scale(1.1); }

.gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent);
    padding: 24px 16px 16px;
    color: white;
}
.gallery-caption h4 { color: white; margin-bottom: 4px; }
.gallery-caption p { font-size: 0.9rem; opacity: 0.9; }

/* Contatti & Form */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.info-card { background: white; padding: 32px; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.info-list { list-style: none; margin-top: 24px; }
.info-list li { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; color: var(--text-main); }
.info-list i { color: var(--accent); flex-shrink: 0; }

.faq-item { margin-bottom: 24px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 16px; }
.faq-item h4 { margin-bottom: 8px; }

.contact-form { padding: 32px; }
.form-desc { color: var(--text-muted); margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
input, textarea { width: 100%; padding: 12px 16px; border: 1px solid #ccc; border-radius: var(--radius-sm); font-family: inherit; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); }

/* Pagina Singola Camera (camera.php) */
.camera-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.camera-gallery-item { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-soft); }
.camera-gallery-item img { width: 100%; height: 220px; object-fit: cover; transition: transform 0.4s ease; display: block; }
.camera-gallery-item:hover img { transform: scale(1.05); }

.camera-cta {
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 48px 32px;
    margin-top: 48px;
    box-shadow: var(--shadow-soft);
}

.camera-cta h3 { font-size: 1.8rem; margin-bottom: 12px; color: var(--primary); }
.camera-cta p { color: var(--text-muted); margin-bottom: 24px; font-size: 1.1rem; }
.camera-cta .btn { margin: 0 8px; }


/* ─── 8. Lightbox Modal (Galleria) ─────────── */
.lightbox-modal {
    position: fixed;
    z-index: 2000; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    display: none; 
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease-out;
}

.lightbox-close {
    position: absolute;
    top: 30px; right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.lightbox-close:hover { color: var(--accent); transform: scale(1.1); }
.lightbox-caption { margin-top: 20px; color: white; font-size: 1.2rem; font-weight: 600; text-align: center; }
.gallery-item-link { cursor: zoom-in; display: block; }

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    z-index: 2100;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: var(--accent); color: white; }

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ─── 9. Footer & Partners ─────────────────── */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 64px 0 24px 0;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 48px;
}

.footer-col h3, .footer-col h4 { color: white; margin-bottom: 24px; }
.footer-col p, .footer-col a { color: rgba(255,255,255,0.8); margin-bottom: 12px; display: block; }
.footer-col a:hover { color: var(--accent); }

.footer-col-partners { text-align: center; }

.partners-logos-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.partners-logos-inline img {
    max-height: 45px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: var(--transition);
}

.partners-logos-inline img:hover { opacity: 1; transform: scale(1.05); }

.footer-partners {
    margin: 40px 0 20px 0;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.partners-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.partner-logo img {
    max-height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: var(--transition);
}

.partner-logo:hover img { opacity: 1; transform: translateY(-3px); }

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}


/* ─── 10. Animazioni Base (Scroll) ─────────── */
.animate-on-scroll {
    opacity: 0;
    transition: 0.8s ease-out;
    transition-delay: var(--delay, 0s);
    will-change: transform, opacity;
}

.fade-up { transform: translateY(40px); }
.fade-in { transform: scale(0.95); }
.fade-left { transform: translateX(40px); }
.animate-on-scroll.is-visible { opacity: 1; transform: none; }

.scroll-indicator {
    position: absolute;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    color: white; opacity: 0.8;
    transition: var(--transition);
    animation: bounce 2s infinite;
}

.scroll-indicator:hover { color: var(--accent); opacity: 1; }
.scroll-indicator .mouse-icon { width: 24px; height: 24px; margin-bottom: 4px; }
.scroll-indicator .arrow-icon { width: 20px; height: 20px; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}


/* ─── 11. Responsive (Media Queries Unificate) */

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    .partners-logos-inline { justify-content: center; }
}

@media (max-width: 900px) {
    .room-detail, .room-detail.reverse, .contact-grid {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Header e Nav */
    .header-content { flex-direction: column; gap: 16px; }
    
    .nav-links {
        display: none; /* Mantengo l'opzione nascosta originale */
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    /* Se aggiungi classe .active tramite javascript per aprire il menu: */
    .nav-links.active { display: flex; }
    
    .header .btn { display: none; }
    
    /* Hero Section */
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1.1rem; }
    .hero-buttons { flex-direction: column; }
    
    /* Layout Pagine */
    .section-header h2 { font-size: 2rem; }
    .about-grid { grid-template-columns: 1fr; }
    
    /* Lightbox Modal */
    .lightbox-close { top: 20px; right: 20px; font-size: 40px; }
    .lightbox-content { max-width: 100%; }
    .lightbox-prev, .lightbox-next { padding: 10px; font-size: 30px; }
    
    /* Partner nel Footer */
    .partners-grid { gap: 25px; }
    .partner-logo img { max-height: 40px; }
}