/* ================================================================
   CALICI IN BICI — Bootstrap Override
   Sovrascrive i token di Travela con l'identità Calici in Bici.
   Caricare DOPO bootstrap.min.css e DOPO style.css (Travela).
   ================================================================ */

/* ── Font ────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Nunito:wght@300;400;500;600&display=swap');

/* ── Variabili Bootstrap ─────────────────────────────────────── */
:root {
    --bs-primary:          #B5451B;
    --bs-primary-rgb:      181, 69, 27;
    --bs-secondary:        #C9943A;
    --bs-secondary-rgb:    201, 148, 58;

    /* Palette completa Calici in Bici */
    --cib-rust:            #B5451B;
    --cib-rust-dark:       #8B3214;
    --cib-gold:            #C9943A;
    --cib-gold-light:      #E8C67A;
    --cib-gold-pale:       #F5E8CC;
    --cib-green:           #1C3D2E;
    --cib-green-mid:       #2E6B4F;
    --cib-cream:           #F7F0E6;
    --cib-brown:           #2C1810;
    --cib-text-muted:      #7A6254;
}

/* ── Tipografia ──────────────────────────────────────────────── */
body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--cib-cream);
    color: var(--cib-brown);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
}

/* ── Override colori primari Bootstrap ───────────────────────── */
.bg-primary      { background-color: var(--cib-rust)    !important; }
.text-primary    { color:            var(--cib-rust)    !important; }
.border-primary  { border-color:     var(--cib-rust)    !important; }
.btn-primary     { background-color: var(--cib-rust); border-color: var(--cib-rust); color: #fff; }
.btn-primary:hover { background-color: var(--cib-rust-dark); border-color: var(--cib-rust-dark); color: #fff; }
.btn-outline-primary { color: var(--cib-rust); border-color: var(--cib-rust); }
.btn-outline-primary:hover { background-color: var(--cib-rust); color: #fff; }

/* ── Topbar ──────────────────────────────────────────────────── */
.container-fluid.bg-primary {
    background: linear-gradient(135deg, var(--cib-green) 0%, var(--cib-brown) 100%) !important;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar-light .navbar-brand h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 1.9rem;
    letter-spacing: .03em;
    color: var(--cib-green);   /* default leggibile su sfondo chiaro */
}
.navbar-light .navbar-brand h1 span {
    color: var(--cib-gold);
}
/* Desktop: logo bianco sopra l'hero, verde dopo scroll */
@media (min-width: 992px) {
    .navbar-light:not(.sticky-top) .navbar-brand h1 { color: #fff !important; }
    .navbar-light:not(.sticky-top) .navbar-brand h1 span { color: var(--cib-gold-light) !important; }
}
/* Mobile: sempre verde scuro, sovrascrive style.css */
@media (max-width: 991.98px) {
    .navbar-light .navbar-brand h1 { color: var(--cib-green) !important; }
    .navbar-light .navbar-brand h1 span { color: var(--cib-gold) !important; }
}
.sticky-top.navbar-light { background: var(--cib-cream) !important; }
.sticky-top.navbar-light .navbar-brand h1 { color: var(--cib-green) !important; }
.sticky-top.navbar-light .navbar-nav .nav-link { color: var(--cib-brown) !important; }

/* ── Sezione titoli ──────────────────────────────────────────── */
.section-title, .section-about-title {
    font-family: 'Nunito', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    color: var(--cib-rust) !important;
}

/* ── Carousel hero ───────────────────────────────────────────── */
.carousel-caption h4 {
    font-family: 'Nunito', sans-serif;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .15em;
    color: var(--cib-gold-light) !important;
}
.carousel-caption h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    line-height: 1.1;
    text-shadow: 0 2px 30px rgba(0,0,0,.9), 0 1px 6px rgba(0,0,0,1), 0 0 60px rgba(0,0,0,.7);
    color: #fff !important;
}
.carousel-caption h4 {
    text-shadow: 0 1px 8px rgba(0,0,0,.9);
}
.carousel-caption p {
    text-shadow: 0 1px 12px rgba(0,0,0,.9);
}

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar .rounded-pill {
    background: rgba(28, 61, 46, 0.88) !important;
}

/* ── About section ───────────────────────────────────────────── */
.about {
    background: var(--cib-cream) !important;
}
.about h1 span.text-primary { color: var(--cib-green) !important; }
.about .border-primary {
    border-color: var(--cib-gold) !important;
}

/* ── Servizi ─────────────────────────────────────────────────── */
.service { background: #fff !important; }
.service-content-inner {
    border-color: var(--cib-gold) !important;
    border-radius: 12px !important;
    transition: .4s !important;
}
.service-content-inner:hover {
    background: var(--cib-green) !important;
    border-color: var(--cib-green) !important;
}
.service-content-inner:hover .service-content h5,
.service-content-inner:hover .service-content p,
.service-content-inner:hover .service-icon i {
    color: #fff !important;
}

/* ── Tour cards ──────────────────────────────────────────────── */
.tour-item {
    border-radius: 12px;
    overflow: hidden;
    transition: .4s;
    box-shadow: 0 2px 12px rgba(44,24,16,.08);
}
.tour-item:hover { box-shadow: 0 8px 32px rgba(44,24,16,.18); transform: translateY(-4px); }
.tour-item .tour-img { position: relative; overflow: hidden; height: 220px; }
.tour-item .tour-img img { width: 100%; height: 100%; object-fit: cover; transition: .5s; }
.tour-item:hover .tour-img img { transform: scale(1.07); }
.tour-item .tour-img .tour-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(28,61,46,.7) 0%, transparent 60%);
}
.tour-item .tour-img .tour-day-badge {
    position: absolute; top: 12px; right: 12px;
    background: var(--cib-rust); color: #fff;
    padding: 4px 12px; border-radius: 999px;
    font-size: .72rem; font-weight: 600;
}
.tour-item .tour-body { padding: 20px; background: #fff; }
.tour-item .tour-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem; font-weight: 400;
    color: var(--cib-green);
    margin-bottom: 8px;
}
.tour-item .tour-meta { font-size: .8rem; color: var(--cib-text-muted); margin-bottom: 14px; }
.tour-item .tour-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem; color: var(--cib-rust); font-weight: 600;
}
.tour-item .tour-price small { font-size: .75rem; font-family: 'Nunito', sans-serif; color: var(--cib-text-muted); font-weight: 400; }

/* ── Numeri statistiche ──────────────────────────────────────── */
.counter-item {
    text-align: center;
    padding: 28px;
    background: rgba(255,255,255,.1);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.15);
}
.counter-item .counter-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem; font-weight: 300; color: var(--cib-gold-light); line-height: 1;
}
.counter-item .counter-label {
    font-size: .75rem; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(255,255,255,.55);
    margin-top: 6px;
}

/* ── Blog / CMS cards ────────────────────────────────────────── */
.blog .blog-item:hover .blog-img-inner .blog-icon {
    background: rgba(28, 61, 46, .6) !important;
}

/* ── Subscribe section ───────────────────────────────────────── */
.subscribe {
    background: linear-gradient(rgba(28,61,46,.82), rgba(28,61,46,.82)), url('../img/subscribe-bg.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
}
.subscribe .subscribe-title { color: var(--cib-gold-light) !important; }
.subscribe .subscribe-title::before,
.subscribe .subscribe-title::after { border-color: var(--cib-gold-light) !important; }

/* ── Breadcrumb pages ────────────────────────────────────────── */
.bg-breadcrumb {
    background: linear-gradient(rgba(28,61,46,.6), rgba(28,61,46,.6)), url('../img/breadcrumb-bg.jpg') !important;
    background-position: center center !important;
    background-size: cover !important;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer { background: var(--cib-brown) !important; }
.footer .footer-item a:hover { color: var(--cib-gold-light) !important; }
.copyright { background: #1a0e08 !important; border-color: rgba(255,255,255,.05) !important; }

/* ── Cantina cards ───────────────────────────────────────────── */
.cantina-card {
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(44,24,16,.08);
    transition: .4s; background: #fff;
}
.cantina-card:hover { box-shadow: 0 8px 32px rgba(44,24,16,.18); transform: translateY(-4px); }
.cantina-card .cantina-visual { height: 200px; overflow: hidden; position: relative; }
.cantina-card .cantina-visual img { width:100%; height:100%; object-fit:cover; transition:.5s; }
.cantina-card:hover .cantina-visual img { transform: scale(1.08); }
.cantina-card .cantina-body { padding: 20px; }
.cantina-card .cantina-day {
    font-size: .7rem; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--cib-rust); margin-bottom: 4px;
}
.cantina-card .cantina-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem; color: var(--cib-green); margin-bottom: 8px;
}
.wine-chip {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; background: var(--cib-gold-pale);
    border: 1px solid var(--cib-gold-light);
    font-size: .72rem; font-weight: 600; color: var(--cib-brown);
    margin: 2px;
}

/* ── Alloggi cards ───────────────────────────────────────────── */
.alloggio-card {
    border-radius: 12px; background: #fff;
    border: 1px solid #E8DDD0;
    overflow: hidden; transition: .4s;
}
.alloggio-card:hover { box-shadow: 0 8px 32px rgba(44,24,16,.14); transform: translateY(-3px); }
.alloggio-card .alloggio-tipo {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; background: rgba(28,61,46,.1);
    color: var(--cib-green); font-size: .72rem; font-weight: 600;
}
.alloggio-card .alloggio-prezzo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; color: var(--cib-rust);
}

/* ── Form inputs ─────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--cib-gold);
    box-shadow: 0 0 0 3px rgba(201,148,58,.15);
}

/* ── Bottoni varianti ────────────────────────────────────────── */
.btn-gold {
    background: var(--cib-gold); border-color: var(--cib-gold); color: var(--cib-brown);
}
.btn-gold:hover { background: #a87a2e; border-color: #a87a2e; color: #fff; }

/* ── Utility ─────────────────────────────────────────────────── */
.bg-cib-green  { background: var(--cib-green) !important; }
.bg-cib-cream  { background: var(--cib-cream) !important; }
.bg-cib-brown  { background: var(--cib-brown) !important; }
.text-cib-gold { color: var(--cib-gold-light) !important; }
.text-cib-rust { color: var(--cib-rust) !important; }

/* Cormorant Garamond display */
.font-display {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
}

/* ── Search bar input — fondo bianco forzato ─────────────────── */
.search-bar .form-control,
#tour-search {
    background-color: #ffffff !important;
    color: var(--cib-brown) !important;
}
.search-bar .form-control::placeholder,
#tour-search::placeholder {
    color: var(--cib-text-muted) !important;
}

/* ── Navbar sticky — testo sempre bianco ─────────────────────── */
.sticky-top.navbar-light {
    background: var(--cib-green) !important;
}
.sticky-top.navbar-light .navbar-nav .nav-link,
.sticky-top.navbar-light .navbar-nav .nav-link:hover,
.sticky-top.navbar-light .navbar-nav .nav-link.active {
    color: #ffffff !important;
}
.sticky-top.navbar-light .navbar-brand h1 {
    color: #ffffff !important;
}

/* ── Fix mobile hero — pulsanti omogenei + landscape ──────────── */
@media (max-width: 576px) {
    .carousel-caption .btn {
        min-width: 0;
        width: 100%;
        max-width: 280px;
        padding: .75rem 1.5rem !important;
        font-size: .9rem !important;
        white-space: nowrap;
    }
    .carousel-caption .d-flex {
        flex-direction: column !important;
        align-items: center !important;
        gap: .75rem !important;
    }
    .carousel-caption h1 { font-size: 2.4rem !important; margin-bottom: .75rem !important; }
    .carousel-caption p  { font-size: .95rem !important; margin-bottom: 1.25rem !important; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .carousel-header { height: auto !important; min-height: 100svh; }
    .carousel-header .carousel-inner,
    .carousel-header .carousel-inner .carousel-item { height: auto !important; min-height: 100svh; }
    .carousel-caption {
        position: relative !important;
        bottom: auto !important; top: 0 !important;
        left: 0 !important; right: 0 !important;
        padding: 70px 20px 30px !important;
        overflow-y: auto; max-height: 100svh;
    }
    .carousel-caption h1 { font-size: 1.8rem !important; margin-bottom: .4rem !important; }
    .carousel-caption h4 { font-size: .75rem !important; margin-bottom: .5rem !important; }
    .carousel-caption p  { font-size: .85rem !important; margin-bottom: .75rem !important; }
    .carousel-caption .d-flex {
        flex-direction: row !important; flex-wrap: wrap !important;
        justify-content: center !important; gap: .5rem !important;
    }
    .carousel-caption .btn { min-width: 140px; padding: .5rem 1rem !important; font-size: .82rem !important; }
    /* Gallery landscape */
    .container-fluid.py-5 img.img-fluid { max-height: 220px; object-fit: cover; width: 100%; }
}

/* Mobile nav */
@media (max-width: 991.98px) {
    .sticky-top.navbar-light .navbar-nav .nav-link {
        color: rgba(255,255,255,.85) !important;
    }
}

/* ── Fix spazio mobile: search bar + hero compatto ───────────── */
@media (max-width: 768px) {
    /* Riduce l'altezza dell'hero da 700px a viewport height */
    .carousel-header {
        height: 100svh !important;
        max-height: 750px !important;
    }
    .carousel-header .carousel-inner .carousel-item img,
    .carousel-header .carousel-inner .carousel-item .carousel-caption {
        height: 100svh !important;
        max-height: 750px !important;
        margin-top: 0 !important;
    }
    /* Search bar sovrapposta all'hero senza spazio extra */
    .search-bar {
        margin-top: -60px !important;
        position: relative;
        z-index: 10;
    }
}

/* ── Riduce spazio vuoto tra search bar e prima sezione su mobile ─ */
@media (max-width: 768px) {
    .container-fluid.about.py-5,
    .container-fluid.py-5:first-of-type {
        padding-top: 1rem !important;
    }
    /* La search bar sporge già nell'hero, non serve margine extra */
    .search-bar {
        margin-bottom: 0 !important;
    }
}

/* ── Fix spazio mobile: riduce carousel e riposiziona search bar ─ */
@media (max-width: 768px) {
    /* Il template usa 700px + margin-top:-100px = 600px effettivi.
       Riduciamo a viewport height per eliminare spazio vuoto. */
    .carousel-header {
        height: 85svh !important;
    }
    .carousel-header .carousel-inner .carousel-item img,
    .carousel-header .carousel-inner .carousel-item .carousel-caption {
        height: 85svh !important;
        margin-top: 0 !important;
    }
    /* Search bar si sovrappone correttamente all'hero */
    .search-bar {
        margin-top: -70px !important;
    }
}

/* ── Language Dropdown ───────────────────────────────────────── */
.lang-dropdown__toggle {
    background: none;
    border: 1px solid rgba(255,255,255,.4);
    color: rgba(255,255,255,.85);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: .71rem;
    font-weight: 700;
    letter-spacing: .04em;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}

.lang-dropdown__toggle:hover,
.lang-dropdown__toggle:focus,
.lang-dropdown__toggle[aria-expanded="true"] {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.65);
    color: #fff;
    box-shadow: none;
}

/* Dropdown menu */
.lang-dropdown .dropdown-menu {
    min-width: 145px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(44,24,16,.18);
    padding: 5px 0;
    background: #fff;
}

.lang-dropdown .dropdown-item {
    font-size: .82rem;
    padding: 7px 16px;
    color: var(--cib-brown);
    transition: background .1s;
}

.lang-dropdown .dropdown-item:hover {
    background: var(--cib-gold-pale);
    color: var(--cib-brown);
}

.lang-dropdown .dropdown-item.active {
    background: var(--cib-rust);
    color: #fff;
    font-weight: 600;
}

.lang-dropdown .dropdown-item.active:hover {
    background: var(--cib-rust-dark);
    color: #fff;
}

/* Mobile (navbar) variant — toggle su sfondo bianco */
.lang-dropdown--nav .lang-dropdown__toggle {
    border-color: rgba(44,24,16,.25);
    color: var(--cib-brown);
}

.lang-dropdown--nav .lang-dropdown__toggle:hover,
.lang-dropdown--nav .lang-dropdown__toggle[aria-expanded="true"] {
    background: rgba(44,24,16,.06);
    border-color: rgba(44,24,16,.4);
    color: var(--cib-brown);
}

/* Lang selector vecchio stile (usato nei template admin) */
.lang-selector { display: inline-flex; align-items: center; gap: 2px; }
.lang-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.4);
    color: rgba(255,255,255,.8);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: .7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.lang-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.lang-btn.active { background: var(--cib-gold); border-color: var(--cib-gold); color: var(--cib-brown); }

/* ── Fix iPhone SE: pulsanti hero sempre visibili ────────────── */
@media (max-width: 576px) {
    /* Pulsanti in colonna, compatti */
    .carousel-caption .d-flex {
        flex-direction: column !important;
        align-items: center !important;
        gap: .5rem !important;
        margin-bottom: .5rem !important;
    }
    .carousel-caption .btn {
        width: 85% !important;
        padding: .65rem 1rem !important;
        font-size: .88rem !important;
    }
    /* Riduce il testo per guadagnare spazio verticale */
    .carousel-caption h1 {
        font-size: 2rem !important;
        margin-bottom: .5rem !important;
        line-height: 1.1 !important;
    }
    .carousel-caption p {
        font-size: .88rem !important;
        margin-bottom: .75rem !important;
    }
    /* La search bar non copre i pulsanti:
       la spostiamo SOTTO l'hero invece di sovrapporla */
    .search-bar {
        margin-top: 0 !important;
        position: relative !important;
        z-index: 10;
    }
    /* Hero si riduce per lasciare spazio alla search bar */
    .carousel-header {
        height: 80svh !important;
    }
    .carousel-header .carousel-inner .carousel-item img,
    .carousel-header .carousel-inner .carousel-item .carousel-caption {
        height: 80svh !important;
        margin-top: 0 !important;
    }
}
