:root {
    --primary: #004aad;
    --primary-dark: #00337a;
    --secondary: #2e9ac1;
    --accent: #ffb703;
    --dark: #0a192f;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px -10px rgba(0, 74, 173, 0.1);
    --container: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

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

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

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

ul {
    list-style: none;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 80px 0;
}

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

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

.text-white {
    color: var(--white);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 74, 173, 0.2);
}

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

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-text {
    padding: 0;
    color: var(--primary);
    font-weight: 700;
}

.btn-outline-secondary {
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

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

/* Header & Nav */
/* Header & Nav */
#main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
    background: transparent;
}

#main-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 1.8rem;
    color: var(--primary);
    position: relative;
    display: flex;
    align-items: center;
}

.logo img {
    transition: var(--transition);
}

.logo-dark {
    display: none;
}

#main-header.scrolled .logo-light {
    display: none;
}

#main-header.scrolled .logo-dark {
    display: block;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#main-header.scrolled .nav-links a {
    color: var(--dark);
    text-shadow: none;
}

#main-header.scrolled .nav-links a.btn-primary,
#main-header.scrolled .nav-links a.btn-secondary {
    color: var(--white);
    text-shadow: none;
}

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

#main-header.scrolled .nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
#hero {
    height: 100vh;
    background: url('hero-bg.jpg') center/cover;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    text-align: center;
    width: 100%;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Booking Bar */
.booking-bar {
    background: var(--white);
    padding: 1rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.booking-field {
    flex: 1;
    text-align: left;
    padding: 0 1.5rem;
    border-right: 1px solid #eee;
}

.booking-field:last-of-type {
    border-right: none;
}

.booking-field label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gray);
    margin-bottom: 0.3rem;
}

.booking-field select,
.booking-field input {
    width: 100%;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
    outline: none;
    background: transparent;
}

/* Section Common */
.section-header,
.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2,
.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.badge {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: block;
}

.text-block {
    margin-bottom: 4rem;
    /* Ensure space below text block on all layouts */
    display: block;
}

/* Grid & Cards */
.section-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.fleet-grid,
.destination-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#home-destinations,
#home-boats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

#home-destinations .destination-card,
#home-boats .fleet-card {
    border: 1px solid rgba(0, 0, 0, 0.15);
}

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

.card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -15px rgba(0, 74, 173, 0.15);
}

.card img,
.destination-card img,
.fleet-card img {
    width: 45%;
    /* Horizontal split */
    height: 100%;
    /* Full height of card */
    min-height: 160px;
    object-fit: cover;
    display: block;
}

.destination-card,
.fleet-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: row;
    /* Horizontal layout on desktop */
    align-items: stretch;
    align-items: stretch;
    min-height: 180px;
    height: auto;
    /* Allow expanding */
}

.destination-info,
.fleet-info {
    padding: 0.8rem 2rem;
    flex-direction: column;
    height: auto;
    /* Allow growing */
    justify-content: space-between;
    /* Push buttons to bottom if needed */
    flex: 1;
    /* Take remaining space */
}

/* Ensure no child pushes the others */
.destination-info>*,
.fleet-info>* {
    margin-top: 0;
    margin-bottom: 0.3rem;
}

.destination-info h3,
.fleet-info h3 {
    margin-bottom: 0.1rem;
    font-size: 1.2rem;
}

.destination-info p,
.fleet-info p {
    font-size: 0.9rem;
    line-height: 1.2;
}

.destination-info .btn,
.fleet-info .btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

.destination-card:hover,
.fleet-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -15px rgba(0, 74, 173, 0.15);
}

.card-img {
    height: 250px;
    background: #e9ecef;
}

#about-img {
    background: url('hero-bg.jpg') center/cover;
    border-radius: 20px;
    min-height: 400px;
}

#pontine-img {
    background: url('pontine-orig.jpg') center/cover;
}

#eolie-img {
    background: url('eolie-orig.jpg') center/cover;
}

#seychelles-img {
    background: url('seychelles-orig.jpg') center/cover;
}

#lotus-img {
    background: url('lotus-orig.png') center/cover;
}

#free-img {
    background: url('free-orig.png') center/cover;
}

#dorotea-img {
    background: url('dorotea-orig.jpg') center/cover;
}

.card-body {
    padding: 2rem;
}

.card-body h3 {
    margin-bottom: 1rem;
}

.card-body p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    padding: 80px 0 30px;
    background: var(--light);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 50px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 50px;
    margin-bottom: 30px;
}

.footer-bottom {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.08);
    color: var(--dark);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.25s, color 0.25s, transform 0.2s;
}

.social-links a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.social-links a i {
    font-size: 1.2rem;
}

/* Highlights Box */
.highlights-box {
    background: var(--light);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    border-left: 5px solid var(--accent);
}

.highlights-box h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.highlights-box ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.highlights-box li {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

/* Gallery Grid */
.image-gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gallery-main {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.gallery-thumbs img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* Improved Hero Buttons */
.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Animations */
.anim-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.anim-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for grid items */
.card:nth-child(2),
.destination-card:nth-child(2),
.fleet-card:nth-child(2) {
    transition-delay: 0.1s;
}

.card:nth-child(3),
.destination-card:nth-child(3),
.fleet-card:nth-child(3) {
    transition-delay: 0.2s;
}

.card:nth-child(4),
.destination-card:nth-child(4),
.fleet-card:nth-child(4) {
    transition-delay: 0.3s;
}

/* Mobile Responsive */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 30px;
    height: 3px;
    background-color: var(--white);
    transition: var(--transition);
}

#main-header.scrolled .mobile-menu-btn span,
#main-header.menu-open .mobile-menu-btn span {
    background-color: var(--dark);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .container {
        padding: 0 1.5rem;
        /* Increased side margin on mobile */
    }

    #chi-siamo-teaser {
        padding-top: 100px;
        /* Increased separation from Hero */
    }

    .hero-btns {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        color: var(--dark);
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
        /* Scaled down for mobile */
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .fleet-grid,
    .destination-grid,
    .cards-grid,
    .section-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .gallery-thumbs {
        grid-template-columns: 1fr;
    }

    .destination-card,
    .fleet-card {
        flex-direction: column;
        height: auto;
        /* Allow growth on mobile */
        min-height: unset;
    }

    .destination-card img,
    .fleet-card img {
        width: 100%;
        height: 180px;
        /* Shorter image on mobile */
        min-height: unset;
    }

    .destination-info,
    .fleet-info {
        padding: 1.5rem;
    }

    .destination-info h3,
    .fleet-info h3 {
        font-size: 1.3rem;
    }

    .destination-info p,
    .fleet-info p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    /* Fix for button touching image */
    .text-block {
        margin-bottom: 5rem !important;
        padding-bottom: 2rem;
    }
}

/* Booking Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-content.booking-modal-wide {
    max-width: 800px;
    /* Wider modal */
    width: 95%;
    padding: 2.5rem;
}

.booking-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.form-section-title {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--gray);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.half {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
    .booking-grid-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content.booking-modal-wide {
        padding: 1.5rem;
    }
}

.modal-title {
    margin-bottom: 0.2rem;
    color: var(--primary);
    font-size: 1.8rem;
}

.modal-subtitle {
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 3000;
    border-left: 5px solid var(--secondary);
}

.notification-toast.active {
    transform: translateY(0);
    opacity: 1;
}

.notification-toast.success {
    border-left-color: #2ecc71;
}

.notification-toast.error {
    border-left-color: #e74c3c;
}
/* ===================================================
   SITO UTENTE - MIGLIORAMENTI MOBILE
   sail.reverso.agency
   =================================================== */

/* --- Navigazione: hamburger e menu mobile --- */
@media (max-width: 768px) {
    /* Nav container più compatto */
    header nav.container {
        padding: 0 1rem;
    }

    /* Menu mobile: font più grande e spaziatura migliore */
    .nav-links a {
        font-size: 1.3rem !important;
        padding: 0.5rem 0;
    }

    /* Pulsante Contattaci nel menu mobile */
    .nav-links a.btn-secondary {
        margin-top: 1rem;
        padding: 0.75rem 2rem !important;
        font-size: 1rem !important;
    }
}

/* --- Hero: testo ottimizzato per mobile --- */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.7rem !important;
        line-height: 1.25;
    }
    .hero-content p {
        font-size: 0.95rem !important;
        padding: 0 0.5rem;
    }
    .hero-btns {
        gap: 0.75rem !important;
    }
    .hero-btns a {
        width: 100%;
        text-align: center;
        padding: 0.85rem 1.5rem;
    }
}

/* --- Sezione Chi Siamo: stack verticale su mobile --- */
@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    .section-grid img {
        width: 100%;
        border-radius: 16px;
        max-height: 280px;
        object-fit: cover;
    }
}

/* --- Cards destinazioni/imbarcazioni: 1 colonna su mobile --- */
@media (max-width: 640px) {
    #home-destinations,
    #home-boats,
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .destination-card,
    .fleet-card {
        border-radius: 16px !important;
    }
}

/* --- Sezione titoli: dimensioni ridotte su mobile --- */
@media (max-width: 768px) {
    .section-header h2,
    section h2 {
        font-size: 1.6rem !important;
    }
    .section-header p,
    section > .container > p {
        font-size: 0.95rem !important;
    }
}

/* --- Tasto Prenota nelle pagine destinazione: full-width su mobile --- */
@media (max-width: 640px) {
    .detail-cta,
    .trips-section-user .detail-cta {
        text-align: center;
    }
    .detail-cta .btn-primary,
    #btn-book {
        width: 100%;
        padding: 1rem !important;
        font-size: 1rem !important;
    }
}

/* --- Sezione partenze nelle pagine destinazione --- */
@media (max-width: 640px) {
    .trips-section-user {
        padding: 1.5rem 1rem !important;
        border-radius: 14px !important;
    }
    .trips-section-user h3 {
        font-size: 1.1rem !important;
    }
    .trips-section-user .trip-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }
}

/* --- Modal prenotazione: bottom sheet su mobile --- */
@media (max-width: 640px) {
    .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }
    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 1.5rem !important;
        transform: translateY(100%) !important;
    }
    .modal-overlay.active .modal-content {
        transform: translateY(0) !important;
    }
    .modal-title {
        font-size: 1.4rem !important;
    }
    .booking-grid-layout {
        grid-template-columns: 1fr !important;
    }
}

/* --- Form input: font 16px per evitare zoom su iOS --- */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* --- Footer: stack verticale su mobile --- */
@media (max-width: 640px) {
    footer .container {
        flex-direction: column !important;
        gap: 1.5rem !important;
        text-align: center;
    }
    footer .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem !important;
    }
    footer .social-links {
        justify-content: center;
    }
}

/* --- Chatbot button: non sovrapposto ai bottoni su mobile --- */
@media (max-width: 640px) {
    #sailbot-btn {
        bottom: 16px !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 1.3rem !important;
    }
}

/* --- Notification toast: full-width su mobile --- */
@media (max-width: 640px) {
    .notification-toast {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 80px !important;
        width: auto !important;
    }
}


/* --- Fix logo mobile v2: mostra sempre logo-dark (blu) su mobile --- */
/* Su mobile non usiamo il logo bianco, sempre versione blu */
@media (max-width: 768px) {
    .logo-light {
        display: none !important;
    }
    .logo-dark {
        display: block !important;
    }
    /* Posizionamento logo nel nav mobile */
    .logo {
        flex: 1;
    }
    .logo a {
        display: flex;
        align-items: center;
    }
}

/* ===================================================
   MIGLIORIE UX/UI 2026
   =================================================== */

/* --- Focus ring accessibilità --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Button active/click feedback --- */
.btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 74, 173, 0.15);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-secondary:hover {
    background: #247fa0;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(46, 154, 193, 0.2);
}

/* --- Nav link active indicator --- */
.nav-links a.nav-active {
    color: var(--secondary) !important;
    position: relative;
}
.nav-links a.nav-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}
#main-header.scrolled .nav-links a.nav-active {
    color: var(--primary) !important;
}
#main-header.scrolled .nav-links a.nav-active::after {
    background: var(--primary);
}

/* --- Card image hover overlay --- */
.destination-card,
.fleet-card,
.dest-card-modern {
    position: relative;
}
.destination-card img,
.fleet-card img {
    transition: transform 0.4s ease;
}
.destination-card:hover img,
.fleet-card:hover img {
    transform: scale(1.05);
}

/* --- Back to top button --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 74, 173, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease;
    z-index: 999;
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 74, 173, 0.4);
}
#back-to-top:active {
    transform: translateY(0) scale(0.95);
}

/* --- Form input focus glow --- */
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.1);
    outline: none;
}

/* --- Lightbox fade-in animation --- */
.lightbox,
[class*="lightbox"] {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* --- Selection color --- */
::selection {
    background: rgba(0, 74, 173, 0.15);
    color: var(--dark);
}

/* --- Smooth image loading --- */
img.lazy-fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img.lazy-fade.loaded {
    opacity: 1;
}

/* --- Section divider decorativo --- */
.section-header::after,
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* --- Footer improvements --- */
footer h4 {
    position: relative;
    margin-bottom: 1.2rem;
}
footer ul li {
    margin-bottom: 0.6rem;
}
footer ul li a {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease, color 0.3s ease;
}
footer ul li a:hover {
    color: var(--primary);
    padding-left: 8px;
}

/* --- Tablet breakpoint --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.2rem;
    }
    .section-header h2,
    .section-title h2 {
        font-size: 2rem;
    }
    .booking-bar {
        max-width: 700px;
        flex-wrap: wrap;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #home-destinations,
    #home-boats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Clamp typography per smooth scaling --- */
@media (min-width: 481px) and (max-width: 768px) {
    .hero-content h1 {
        font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
    }
    .hero-content p {
        font-size: clamp(0.95rem, 2.5vw, 1.2rem) !important;
    }
}

/* --- Booking bar responsive wrap on small screens --- */
@media (max-width: 768px) {
    .booking-bar {
        flex-direction: column;
        border-radius: 20px;
        padding: 1.5rem;
        gap: 0.8rem;
    }
    .booking-field {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 0.8rem 0;
    }
    .booking-field:last-of-type {
        border-bottom: none;
    }
    .booking-bar .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Back to top mobile position --- */
@media (max-width: 640px) {
    #back-to-top {
        bottom: 16px;
        left: 16px;
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
}

/* ===================================================
   MOBILE UX MIGLIORAMENTI 2026 v2
   =================================================== */

/* --- Header mobile: logo più piccolo, hamburger più grande --- */
@media (max-width: 768px) {
    .logo img {
        height: 50px !important;
    }
    #main-header {
        padding: 0.6rem 0 !important;
    }
    #main-header.scrolled {
        padding: 0.5rem 0 !important;
    }
    .mobile-menu-btn {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .mobile-menu-btn span {
        width: 26px;
    }
}

/* --- Hero mobile: meno altezza, padding migliore --- */
@media (max-width: 768px) {
    #hero {
        height: auto;
        min-height: 85vh;
        padding: 100px 0 60px;
    }
    .hero-content {
        padding: 0 0.5rem;
    }
}

/* --- Section padding ridotto su mobile --- */
@media (max-width: 768px) {
    .section-padding {
        padding: 50px 0;
    }
    .section-header,
    .section-title {
        margin-bottom: 30px;
    }
}

/* --- Footer mobile: colonne stacked e spacing --- */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center;
    }
    footer {
        padding: 50px 0 25px;
    }
    .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    .social-links a {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    .footer-brand img {
        height: 50px !important;
    }
}

/* --- Touch targets: tutti i bottoni min 44px --- */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-text {
        min-height: auto;
    }
}

/* --- Card hover disabilitato su touch (usa active) --- */
@media (hover: none) {
    .destination-card:hover,
    .fleet-card:hover,
    .dest-card-modern:hover,
    .fleet-card-modern:hover,
    .card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    .destination-card:active,
    .fleet-card:active,
    .dest-card-modern:active,
    .fleet-card-modern:active {
        transform: scale(0.98);
    }
}

/* --- Immagini responsive migliorate --- */
@media (max-width: 480px) {
    .gallery-main {
        height: 220px;
    }
    .gallery-thumbs img {
        height: 100px;
    }
    #about-img {
        min-height: 250px;
    }
}

/* --- Migliore scrolling orizzontale prevenzione --- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* --- Spaziatura sezioni homepage su mobile --- */
@media (max-width: 640px) {
    #home-destinations,
    #home-boats {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .dest-card-modern,
    .fleet-card-modern {
        border-radius: 16px;
    }
    .dest-card-img,
    .fleet-card-img {
        height: 200px !important;
    }
    .dest-card-body,
    .fleet-card-body {
        padding: 1.2rem;
    }
    .blog-preview-grid,
    .faq-preview-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .blog-preview-card-img {
        height: 160px;
    }
    .faq-preview-card {
        padding: 1.2rem;
    }
    #reviews blockquote {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }
}

/* --- Booking bar: hidden on mobile (non usato) --- */
@media (max-width: 640px) {
    .booking-bar {
        display: none;
    }
}

/* --- Safe area padding per iPhone con notch --- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(25px + env(safe-area-inset-bottom));
    }
    #sailbot-btn {
        bottom: calc(28px + env(safe-area-inset-bottom)) !important;
    }
    #back-to-top {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* --- Chatbot window mobile migliorato --- */
@media (max-width: 480px) {
    #sailbot-window {
        width: calc(100vw - 16px) !important;
        right: 8px !important;
        bottom: 85px !important;
        max-height: 70vh !important;
        border-radius: 16px !important;
    }
    #sailbot-messages {
        max-height: 50vh !important;
    }
}

/* --- Review text mobile --- */
@media (max-width: 480px) {
    #reviews cite {
        font-size: 0.9rem;
    }
}
