body {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

/* Override Bootstrap primary color to navy blue */
.bg-primary { background-color: #0a1f44 !important; }
.btn-primary {
    background-color: #0a1f44 !important;
    border-color: #0a1f44 !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #081735 !important;
    border-color: #081735 !important;
}
.text-primary { color: #0a1f44 !important; }
#video {
    /* background image optimized via imagen7-opt.webp */
    background: #0C2641 !important;
    position: relative;
}
#video::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 31, 68, 0.7);
}
#video > .container {
    position: relative;
    z-index: 1;
}

/* ===== White Navbar with slide-down animation ===== */
.navbar-white {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
    padding: 0.25rem 0;
    padding-top: max(0.25rem, env(safe-area-inset-top));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    animation: navSlideDown 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    z-index: 1050;
    overflow: visible;
}

@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Navbar shrinks on scroll */
.navbar-white.scrolled {
    padding: 0.3rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}
.navbar-white.scrolled .nav-logo {
    height: 50px;
    width: 50px;
}
.navbar-white.scrolled .brand-text {
    font-size: 1.6rem;
}

/* Logo */
.nav-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
    transition: height 0.35s ease, width 0.35s ease;
}

/* Brand text — bigger */
.navbar-brand {
    gap: 14px;
    padding-top: 0;
    padding-bottom: 0;
}
.brand-text {
    font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #0a1f44;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: font-size 0.35s ease;
}

/* Nav links — dark on white */
.navbar-white .nav-link {
    color: #0a1f44;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    transition: color 0.25s, background 0.25s;
}
@media (hover: hover) and (pointer: fine) {
    .navbar-white .nav-link:hover {
        color: #fff;
        background: #0a1f44;
    }
}
.navbar-white .nav-link:focus {
    color: #fff;
    background: #0a1f44;
}
.navbar-white .nav-link:active {
    color: #fff;
    background: #0a1f44;
}

/* Toggler — dark icon on white bg */
.navbar-white .navbar-toggler {
    border: 2px solid #0a1f44;
    color: #0a1f44;
    font-size: 1.5rem;
    padding: 0.35rem 0.6rem;
    min-height: 44px;
    min-width: 44px;
}

section {
    scroll-margin-top: 100px;
}

#bienvenida h1 {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    letter-spacing: 3px;
    font-size: 3.6rem;
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 3px 3px 8px rgba(0,0,0,0.9), 1px 1px 2px rgba(0,0,0,1);
    animation: heroTitleIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes heroTitleIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        letter-spacing: 12px;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: 3px;
    }
}

#bienvenida .lead {
    font-size: 1.25rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
    animation: heroFadeIn 0.8s ease 0.7s both;
}

#bienvenida .btn {
    animation: heroFadeIn 0.8s ease 1s both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

#video h2 {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    font-size: 2.2rem;
}

#bienvenida.bienvenida-bg {
    position: relative;
    /*background-image: url('images/fondoweb.png'); */
    background-image: linear-gradient(to bottom, rgba(12,38,65,0) 75%, #0B2143 90%, #0B2143 100%), url('images/imagen6-opt.webp');
    background-color: #0B2143;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 40%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}

/* Independent text layer — floats over the image */
.hero-text-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 160px;
    padding-bottom: 60px;
    background: linear-gradient(135deg, rgba(10,31,68,0.5), rgba(0,0,0,0.2));
    z-index: 2;
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
    will-change: opacity, transform;
}

.hero-cta-bottom {
    margin-top: auto;
    width: 100%;
    text-align: center;
    animation: heroFadeIn 0.8s ease 1s both;
}

/* Section headings */
#tours h2,
#about h2,
#included h2,
#galeria h2,
#guest-stories h2,
#contacto h2 {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    font-weight: 900;
    color: #0a1f44;
    letter-spacing: 2px;
}

/* About section */
#about {
    background: #f7fbff;
}

.about-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(12, 38, 65, 0.14);
    box-shadow: 0 10px 24px rgba(12, 38, 65, 0.08);
    line-height: 1.75;
    color: #163252;
}

.about-captain-photo {
    width: min(100%, 240px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 999px;
    border: 5px solid #0a1f44;
    box-shadow: 0 12px 26px rgba(10, 31, 68, 0.24);
}

.about-photo-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

/* Included / Bring section */
#included {
    background: #ffffff;
}

.info-box {
    background: #f8fbff;
    border: 1px solid rgba(12, 38, 65, 0.14);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 8px 20px rgba(12, 38, 65, 0.08);
}

.info-box h3 {
    color: #0a1f44;
}

.info-box ul {
    padding-left: 1.2rem;
    margin: 0;
}

.info-box li {
    margin-bottom: 0.45rem;
    color: #1f3d5d;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* Guest Stories section */
#guest-stories {
    display: none;
    background: #f8fbff;
}

.review-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(12, 38, 65, 0.14);
    box-shadow: 0 8px 22px rgba(12, 38, 65, 0.08);
    padding: 1.25rem;
    color: #163252;
}

.review-stars {
    color: #ffc107;
    letter-spacing: 0.08rem;
    font-size: 1.1rem;
    margin-bottom: 0.65rem;
}

.review-author {
    font-weight: 700;
    color: #0a1f44;
}

#contacto h2 {
    text-transform: uppercase;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 0.4rem 1rem;
    border-radius: 10px 10px 0 0;
    background: rgba(12, 38, 65, 0.75);
    color: #fff;
    text-align: center !important;
}

#contacto .lead {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    background: rgba(12, 38, 65, 0.75);
    color: #fff;
    text-align: center !important;
}

/* Tours section background */
#tours {
    position: relative;
    background: #0C2641;
}
#tours::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 48%);
}
#tours > .container {
    position: relative;
    z-index: 1;
}

#tours h2 {
    color: #fff;
}

#tours .tour-hero-content h3,
#tours .tour-hero-content p {
    color: #fff;
}

/* Contact section background */
#contacto {
    position: relative;
    overflow: hidden;
}
#contacto::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('images/imagen7-opt.webp') center 40% / cover no-repeat;
}
#contacto::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
}
#contacto > .container {
    position: relative;
    z-index: 2;
}

/* Gallery section background */
#galeria {
    background: #0C2641 !important;
    position: relative;
}
#galeria::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
    pointer-events: none;
}
#galeria > .container {
    position: relative;
    z-index: 1;
}

#galeria h2 {
    color: #fff;
    text-transform: uppercase;
}

#galeria .carousel-inner {
    background: transparent;
    box-shadow: none !important;
}
#galeria .carousel-item img {
    object-fit: contain;
    width: 100%;
    height: 550px;
    background: transparent;
    cursor: zoom-in;
}

.gallery-lightbox-content {
    background: transparent;
    border: none;
}

.gallery-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.gallery-lightbox-img {
    width: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gallery-lightbox-prev {
    left: 14px;
}

.gallery-lightbox-next {
    right: 14px;
}

.gallery-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.6);
}

@media (max-width: 576px) {
    .gallery-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
}

/* Carousel arrows: black by default, white on hover */
#galeria .carousel-control-prev-icon,
#galeria .carousel-control-next-icon {
    filter: none !important;
    background-color: transparent !important;
    background-image: none !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    border-radius: 0;
    padding: 0;
    background-size: 100% 100%;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-block;
    position: relative;
}
#galeria .carousel-control-prev-icon::after,
#galeria .carousel-control-next-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70% 70%;
}
#galeria .carousel-control-prev-icon::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="black" viewBox="0 0 16 16"><path d="M11.354 1.646a.5.5 0 0 1 0 .708L6.707 8l4.647 5.646a.5.5 0 0 1-.708.708l-5-6a.5.5 0 0 1 0-.708l5-6a.5.5 0 0 1 .708 0z"/></svg>');
}
#galeria .carousel-control-next-icon::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="black" viewBox="0 0 16 16"><path d="M4.646 1.646a.5.5 0 0 1 .708 0l5 6a.5.5 0 0 1 0 .708l-5 6a.5.5 0 0 1-.708-.708L9.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>');
}
#galeria .carousel-control-prev:hover .carousel-control-prev-icon::after,
#galeria .carousel-control-next:hover .carousel-control-next-icon::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 16 16"><path d="M11.354 1.646a.5.5 0 0 1 0 .708L6.707 8l4.647 5.646a.5.5 0 0 1-.708.708l-5-6a.5.5 0 0 1 0-.708l5-6a.5.5 0 0 1 .708 0z"/></svg>');
}
#galeria .carousel-control-next:hover .carousel-control-next-icon::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 16 16"><path d="M4.646 1.646a.5.5 0 0 1 .708 0l5 6a.5.5 0 0 1 0 .708l-5 6a.5.5 0 0 1-.708-.708L9.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>');
}

/* Tour cards - Hero Overlay */
.tour-hero {
    position: relative;
    height: 420px;
    border-radius: 18px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s;
}

@media (hover: hover) and (pointer: fine) {
    .tour-hero:hover {
        transform: scale(1.02);
    }
}

.tour-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}

.tour-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    z-index: 2;
}

.tour-hero-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffc107;
}

footer {
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

#formMsg {
    min-height: 30px;
}

/* ===== Scroll-reveal Animations ===== */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: translateY(0); }
}

.anim-reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.anim-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.anim-d1 { transition-delay: 0.15s !important; }
.anim-d2 { transition-delay: 0.30s !important; }
.anim-d3 { transition-delay: 0.45s !important; }

/* Fallback: if JS fails, show everything */
.no-js .anim-reveal {
    opacity: 1;
    transform: none;
}

/* Polished warning button */
.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    border: none;
    color: #0a1f44;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255,193,7,0.35);
    transition: transform 0.25s, box-shadow 0.25s;
}
@media (hover: hover) and (pointer: fine) {
    .btn-warning:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(255,193,7,0.5);
        background: linear-gradient(135deg, #ffd54f, #ffb300);
        color: #0a1f44;
    }
}


/* Contact buttons (WhatsApp + Call) */
.contact-btn {
    display: flex;
    padding: 1.5rem 0.75rem;
    border-radius: 12px;
    color: #fff !important;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-height: 130px;
    max-width: 260px;
    margin: 0 auto;
}
@media (hover: hover) and (pointer: fine) {
    .contact-btn:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 18px rgba(0,0,0,0.25);
        color: #fff !important;
    }
}
.contact-btn:active {
    transform: scale(0.97);
}
.contact-btn i {
    font-size: 2.7rem;
    margin-bottom: 0.5rem;
}
.contact-btn-label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.contact-btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}
.contact-btn-call {
    background: linear-gradient(135deg, #0a1f44 0%, #1e3a8a 100%);
}

/* ===== Mobile Optimizations ===== */

/* Small devices (phones, 576px and below) */
@media (max-width: 576px) {
    /* Navbar */
    .nav-logo {
        height: 45px !important;
        width: 45px !important;
    }
    .brand-text {
        font-size: 1rem;
    }
    .navbar-white {
        padding: 0.2rem 0;
    }
    .navbar-white.scrolled {
        padding: 0.2rem 0;
    }
    .navbar-white.scrolled .nav-logo {
        height: 35px !important;
        width: 35px !important;
    }
    .navbar-white.scrolled .brand-text {
        font-size: 0.9rem;
    }
    .navbar-white .navbar-collapse {
        background: rgba(255,255,255,0.98);
        border-radius: 0 0 10px 10px;
        padding: 0.5rem 0.75rem;
        margin-top: 0.4rem;
    }

    /* Hero / Bienvenida */
    #bienvenida.bienvenida-bg {
        min-height: 100vh;
        min-height: 100svh;
        background-image: url('images/fondomobile-sm.webp');
        background-size: cover;
        background-position: center center;
        background-attachment: scroll;
    }

    #contacto::before {
        background-image: url('images/imagen7-sm.webp');
        background-position: center 45%;
    }
    .hero-text-layer {
        padding-top: 100px;
        padding-bottom: 40px;
    }
    #bienvenida h1 {
        font-size: 1.6rem;
    }
    #bienvenida .lead {
        font-size: 0.95rem;
    }
    #bienvenida .btn-lg {
        font-size: 0.95rem;
        padding: 0.5rem 1.2rem;
    }

    /* Video section */
    #video h2 {
        font-size: 1.3rem;
    }

    /* Section headings */
    #tours h2,
    #about h2,
    #included h2,
    #galeria h2,
    #guest-stories h2,
    #contacto h2 {
        font-size: 1.4rem;
    }
    #contacto .lead {
        font-size: 0.9rem;
    }
    footer {
        font-size: 0.85rem;
    }

    /* Tours */
    .tour-hero {
        height: 280px;
        border-radius: 12px;
    }
    .tour-hero-content {
        padding: 16px;
    }
    .tour-hero-content h3 {
        font-size: 1.1rem;
    }
    .tour-hero-content p {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    .tour-hero-price {
        font-size: 1.8rem;
    }

    /* Gallery */
    #galeria .carousel-item img {
        height: 250px;
        object-fit: contain;
    }

    .about-card,
    .info-box,
    .review-card {
        padding: 1rem;
    }

    .about-card {
        line-height: 1.6;
    }

    .about-captain-photo {
        width: min(100%, 180px);
    }

    /* Contact */
    .contact-btn {
        min-height: 100px;
        padding: 1rem 0.5rem;
    }
    .contact-btn i {
        font-size: 2rem;
    }

    /* Sections padding */
    section.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Medium devices (tablets, 577px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .nav-logo {
        height: 60px !important;
        width: 60px !important;
    }
    .brand-text {
        font-size: 1.3rem;
    }

    #bienvenida.bienvenida-bg {
        min-height: 100vh;
        background-size: cover;
        background-attachment: scroll;
    }
    .hero-text-layer {
        padding-top: 130px;
        padding-bottom: 50px;
    }
    #bienvenida h1 {
        font-size: 2rem;
    }
    #bienvenida .lead {
        font-size: 1rem;
    }

    #video h2 {
        font-size: 1.6rem;
    }

    #tours h2,
    #about h2,
    #included h2,
    #galeria h2,
    #guest-stories h2,
    #contacto h2 {
        font-size: 1.6rem;
    }

    .tour-hero {
        height: 320px;
    }

    #galeria .carousel-item img {
        height: 380px;
        object-fit: contain;
    }
}
