/* ============================================
   TOURIMAX – TOURS PAGE
   Improved grid + consistent tour modal
   Fixed modal overflow & booking button
   ============================================ */


/* ============================================
   TOURS HERO
   ============================================ */

.tours-hero {
    position: relative;
    min-height: 50vh;

    background:
        url(
            https://res.cloudinary.com/dhwwgua60/image/upload/v1788338911/12-Curacao-wildlife_xsa5v5.webp
        )
        center / cover no-repeat;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
    color: #fff;

    overflow: hidden;

    /* NOTE: The margin and padding fixes are applied in style.css.
       This rule does not override them, so it remains correct. */
}


.tours-hero .hero-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            ellipse at center,
            rgba(0, 0, 0, 0.12) 0%,
            rgba(0, 0, 0, 0.58) 100%
        );

    z-index: 1;
}


.tours-hero .hero-content {
    position: relative;
    z-index: 2;

    max-width: 780px;

    padding: 3rem 24px;
}


.tours-hero .hero-tag {
    display: inline-block;

    background: rgba(255,255,255,0.12);

    backdrop-filter: blur(10px);

    border: 1px solid rgba(255,255,255,0.25);

    color: #fff;

    padding: 0.45rem 1.25rem;

    border-radius: 30px;

    font-size: 0.9rem;

    letter-spacing: 1.5px;

    text-transform: uppercase;

    margin-bottom: 1rem;
}


.tours-hero h1 {
    color: #fff;

    font-size:
        clamp(2.6rem, 5vw, 3.8rem);

    line-height: 1.15;

    margin-bottom: 1rem;

    text-shadow:
        0 2px 15px rgba(0,0,0,0.3);
}


.tours-hero p {
    max-width: 680px;

    margin: 0 auto;

    font-size: 1.12rem;

    line-height: 1.75;

    opacity: 0.94;
}


/* ============================================
   TOURS SECTION
   ============================================ */

.tours-section {
    padding-top: 5.25rem;
}


.tours-heading {
    margin-bottom: 3rem;
}


/* ============================================
   IMPROVED TOUR GRID
   ============================================ */

.tours-cards-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    column-gap: 32px;
    row-gap: 36px;

    align-items: stretch;

    width: 100%;

    max-width: 1180px;

    margin: 0 auto;
}


/* ============================================
   TOUR CARD
   ============================================ */

.tour-card {
    position: relative;

    background: #fff;

    border:
        1px solid
        rgba(232, 226, 217, 0.9);

    border-radius:
        var(--radius-lg);

    overflow: hidden;

    box-shadow:
        var(--shadow-sm);

    cursor: pointer;

    display: flex;

    flex-direction: column;

    min-width: 0;

    height: 100%;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;

    outline: none;
}


.tour-card:hover {

    transform:
        translateY(-7px);

    box-shadow:
        var(--shadow-lg);

    border-color:
        rgba(255,107,44,0.25);
}


.tour-card:focus-visible {

    outline:
        3px solid
        rgba(255,107,44,0.35);

    outline-offset: 4px;
}


/* ============================================
   CARD IMAGE
   ============================================ */

.tour-card-image {
    position: relative;

    width: 100%;

    height: 270px;

    overflow: hidden;

    flex-shrink: 0;
}


.tour-card-image img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.65s ease;
}


.tour-card:hover
.tour-card-image img {

    transform:
        scale(1.06);
}


/* ============================================
   CARD OVERLAY
   ============================================ */

.tour-card-overlay {

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.08) 0%,
            rgba(0,0,0,0.02) 40%,
            rgba(0,0,0,0.58) 100%
        );

    pointer-events: none;
}


/* ============================================
   CATEGORY BADGE
   ============================================ */

.tour-card-category {

    position: absolute;

    top: 16px;
    left: 16px;

    background:
        var(--clr-primary);

    color: #fff;

    padding:
        0.34rem 0.9rem;

    border-radius:
        25px;

    font-size:
        0.78rem;

    font-weight:
        700;

    letter-spacing:
        0.5px;

    text-transform:
        uppercase;

    box-shadow:
        0 5px 15px
        rgba(255,107,44,0.25);
}


/* ============================================
   PRICE
   ============================================ */

.tour-card-price {

    position: absolute;

    right: 16px;
    bottom: 16px;

    background:
        rgba(0,0,0,0.72);

    backdrop-filter:
        blur(6px);

    color: #fff;

    padding:
        0.45rem 1rem;

    border-radius:
        25px;

    font-size:
        1.15rem;

    font-weight:
        700;

    box-shadow:
        0 5px 18px
        rgba(0,0,0,0.18);
}


/* ============================================
   VIEW TOUR
   ============================================ */

.tour-card-view {

    position: absolute;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -42%);

    opacity: 0;

    background:
        rgba(255,255,255,0.96);

    color:
        var(--clr-dark);

    padding:
        0.65rem 1.1rem;

    border-radius:
        30px;

    font-size:
        0.85rem;

    font-weight:
        700;

    white-space:
        nowrap;

    box-shadow:
        0 8px 25px
        rgba(0,0,0,0.18);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;

    pointer-events:
        none;
}


.tour-card:hover
.tour-card-view {

    opacity: 1;

    transform:
        translate(-50%, -50%);
}


.tour-card-view i {

    color:
        var(--clr-primary);

    margin-right:
        5px;
}


/* ============================================
   CARD CONTENT
   ============================================ */

.tour-card-simple-content {

    padding:
        1.35rem
        1.4rem
        1.45rem;

    min-height:
        112px;

    display:
        flex;

    flex-direction:
        column;

    justify-content:
        center;
}


.tour-card-simple-content h3 {

    font-size:
        1.4rem;

    line-height:
        1.25;

    color:
        var(--clr-dark);

    margin-bottom:
        0.4rem;
}


.tour-card-simple-content p {

    color:
        var(--clr-text-light);

    font-size:
        0.95rem;

    line-height:
        1.6;
}


/* ============================================
   TOUR MODAL
   ============================================ */

body.modal-open {
    overflow: hidden;
}


.tour-modal {

    position: fixed;

    inset: 0;

    z-index: 2000;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        24px;

    visibility:
        hidden;

    opacity:
        0;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


.tour-modal.active {

    visibility:
        visible;

    opacity:
        1;
}


/* ============================================
   MODAL BACKDROP
   ============================================ */

.tour-modal-backdrop {

    position: absolute;

    inset: 0;

    background:
        rgba(10,25,32,0.72);

    backdrop-filter:
        blur(6px);
}


/* ============================================
   MODAL DIALOG - FIXED OVERFLOW ISSUE
   ============================================ */

.tour-modal-dialog {

    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 1080px;

    max-height: 90vh;

    background:
        #fff;

    border-radius:
        24px;

    overflow: hidden;

    box-shadow:
        0 30px 90px
        rgba(0,0,0,0.3);

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    grid-template-rows: minmax(0, 1fr);

    transform:
        translateY(20px)
        scale(0.98);

    transition:
        transform 0.3s ease;
}


.tour-modal.active
.tour-modal-dialog {

    transform:
        translateY(0)
        scale(1);
}


/* ============================================
   CLOSE BUTTON
   ============================================ */

.tour-modal-close {

    position:
        absolute;

    top:
        16px;

    right:
        16px;

    z-index:
        20;

    width:
        42px;

    height:
        42px;

    border:
        none;

    border-radius:
        50%;

    background:
        rgba(0,0,0,0.58);

    color:
        #fff;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        1rem;

    cursor:
        pointer;

    box-shadow:
        0 5px 15px
        rgba(0,0,0,0.18);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.tour-modal-close:hover {

    background:
        var(--clr-primary);

    transform:
        scale(1.05);
}


/* ============================================
   MODAL GALLERY - FIXED HEIGHT
   ============================================ */

.tour-modal-gallery {

    position:
        relative;

    height: 100%;

    min-height: 0;

    background:
        #18212B;

    overflow:
        hidden;

    border-radius:
        0;
}


.tour-modal-gallery > img {

    width:
        100%;

    height:
        100%;

    min-height: 0;

    object-fit:
        cover;
}


/* ============================================
   GALLERY CONTROLS
   ============================================ */

.tour-gallery-button {

    position:
        absolute;

    top:
        50%;

    transform:
        translateY(-50%);

    width:
        46px;

    height:
        46px;

    border:
        none;

    border-radius:
        50%;

    background:
        rgba(0,0,0,0.48);

    color:
        #fff;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    cursor:
        pointer;

    font-size:
        1rem;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.tour-gallery-button:hover {

    background:
        var(--clr-primary);
}


.tour-gallery-prev {
    left:
        18px;
}


.tour-gallery-next {
    right:
        18px;
}


.tour-gallery-counter {

    position:
        absolute;

    left:
        50%;

    bottom:
        18px;

    transform:
        translateX(-50%);

    background:
        rgba(0,0,0,0.58);

    backdrop-filter:
        blur(5px);

    color:
        #fff;

    padding:
        0.35rem 0.8rem;

    border-radius:
        20px;

    font-size:
        0.8rem;

    font-weight:
        600;
}


/* ============================================
   MODAL CONTENT - FIXED OVERFLOW
   ============================================ */

.tour-modal-content {

    position:
        relative;

    padding:
        2rem 2rem 2.2rem;

    overflow-y:
        auto;

    overflow-x: hidden;

    min-width:
        0;

    min-height: 0;

    max-height: 90vh;
}


/* ============================================
   MODAL HEADER
   ============================================ */

.tour-modal-header {

    display:
        flex;

    justify-content:
        space-between;

    align-items:
        flex-start;

    gap:
        55px;

    padding-right:
        48px;

    margin-bottom:
        1rem;
}


.tour-modal-category {

    display:
        inline-block;

    color:
        var(--clr-primary);

    text-transform:
        uppercase;

    letter-spacing:
        1.5px;

    font-size:
        0.8rem;

    font-weight:
        700;

    margin-bottom:
        0.4rem;
}


.tour-modal-header h2 {

    margin:
        0;

    color:
        var(--clr-dark);

    font-size:
        clamp(
            1.9rem,
            4vw,
            2.7rem
        );

    line-height:
        1.15;
}


/* ============================================
   MODAL PRICE
   ============================================ */

.tour-modal-price {

    text-align:
        right;

    flex-shrink:
        0;

    padding-top:
        0.3rem;
}


.tour-modal-price span {

    display:
        block;

    color:
        var(--clr-text-muted);

    font-size:
        0.8rem;
}


.tour-modal-price strong {

    display:
        block;

    color:
        var(--clr-primary);

    font-size:
        1.8rem;

    line-height:
        1.2;
}


.tour-modal-price small {

    display:
        block;

    color:
        var(--clr-text-light);

    font-size:
        0.75rem;
}


/* ============================================
   MODAL HIGHLIGHT
   ============================================ */

.tour-modal-highlight {

    color:
        var(--clr-secondary);

    font-size:
        1rem;

    font-weight:
        600;

    line-height:
        1.6;

    margin-bottom:
        1.35rem;
}


/* ============================================
   MODAL INFO GRID
   ============================================ */

.tour-modal-info-grid {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        12px;

    margin-bottom:
        1.5rem;
}


.tour-info-item {

    display:
        flex;

    align-items:
        center;

    gap:
        12px;

    padding:
        0.9rem;

    background:
        var(--clr-cream);

    border-radius:
        var(--radius-sm);
}


.tour-info-icon {

    width:
        42px;

    height:
        42px;

    flex-shrink:
        0;

    border-radius:
        50%;

    background:
        #fff;

    color:
        var(--clr-primary);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    box-shadow:
        var(--shadow-xs);
}


.tour-info-item span {

    display:
        block;

    font-size:
        0.75rem;

    color:
        var(--clr-text-light);
}


.tour-info-item strong {

    display:
        block;

    font-size:
        0.9rem;

    color:
        var(--clr-dark);

    line-height:
        1.35;
}


/* ============================================
   MODAL DESCRIPTION
   ============================================ */

.tour-modal-description {

    margin-bottom:
        1.5rem;
}


.tour-modal-description h3,
.tour-modal-includes h3 {

    font-family:
        var(--font-body);

    font-size:
        1.05rem;

    font-weight:
        700;

    color:
        var(--clr-dark);

    margin-bottom:
        0.55rem;
}


.tour-modal-description p {

    color:
        var(--clr-text-light);

    font-size:
        0.95rem;

    line-height:
        1.7;
}


/* ============================================
   INCLUDED
   ============================================ */

.tour-modal-includes {

    margin-bottom:
        1.5rem;
}


.tour-includes-list {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        8px 14px;
}


.tour-include-item {

    display:
        flex;

    align-items:
        center;

    gap:
        8px;

    font-size:
        0.9rem;

    color:
        var(--clr-text);
}


.tour-include-item i {

    color:
        var(--clr-primary);

    font-size:
        0.8rem;
}


/* ============================================
   MODAL BOOK BUTTON - FIXED WIDTH & ICON
   ============================================ */

.tour-modal-book {

    width:
        100%;

    margin-top:
        0.5rem;

    flex-shrink: 0;
}


.tour-modal-book i {
    margin-right: 8px;
}


/* ============================================
   TABLET
   ============================================ */

@media (max-width: 1100px) {

    .tours-cards-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap:
            28px;
    }


    .tour-modal {

        padding:
            20px;
    }


    .tour-modal-dialog {

        max-width:
            920px;
    }

}


/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 768px) {

    .tours-hero {

        min-height:
            45vh;
    }


    .tours-hero .hero-content {

        padding:
            2.5rem 20px;
    }


    .tours-hero h1 {

        font-size:
            clamp(
                2.25rem,
                8vw,
                3rem
            );
    }


    .tours-hero p {

        font-size:
            1.02rem;
    }


    .tours-cards-grid {

        grid-template-columns:
            1fr;

        gap:
            24px;
    }


    .tour-card-image {

        height:
            250px;
    }


    /* Modal becomes a vertical card */

    .tour-modal {

        padding:
            12px;
    }


    .tour-modal-dialog {

        display:
            flex;

        flex-direction:
            column;

        width:
            100%;

        max-width:
            600px;

        max-height:
            94vh;

        border-radius:
            22px;

        overflow:
            hidden;
    }


    .tour-modal-gallery {

        height:
            300px;

        min-height:
            300px;

        flex-shrink:
            0;
    }


    .tour-modal-gallery > img {

        height:
            300px;

        min-height:
            300px;
    }


    .tour-modal-close {

        top:
            14px;

        right:
            14px;
    }


    .tour-modal-content {

        padding:
            1.5rem;

        overflow-y:
            auto;

        max-height: none;
    }


    .tour-modal-header {

        flex-direction:
            column;

        gap:
            8px;

        padding-right:
            0;

        margin-bottom:
            0.9rem;
    }


    .tour-modal-price {

        text-align:
            left;

        display:
            flex;

        align-items:
            baseline;

        gap:
            7px;

        padding-top:
            0;
    }


    .tour-modal-price span {

        display:
            none;
    }


    .tour-modal-price strong {

        font-size:
            1.55rem;
    }


    .tour-modal-price small {

        font-size:
            0.75rem;
    }


    .tour-modal-info-grid {

        grid-template-columns:
            1fr;
    }


    .tour-includes-list {

        grid-template-columns:
            1fr;
    }

}


/* ============================================
   SMALL PHONES
   ============================================ */

@media (max-width: 480px) {

    .tours-section {

        padding-top:
            4rem;
    }


    .tour-card-image {

        height:
            225px;
    }


    .tour-card-simple-content {

        min-height:
            100px;

        padding:
            1.15rem 1.2rem 1.3rem;
    }


    .tour-card-simple-content h3 {

        font-size:
            1.3rem;
    }


    .tour-card-simple-content p {

        font-size:
            0.9rem;
    }


    .tour-card-price {

        font-size:
            1rem;

        padding:
            0.4rem 0.85rem;
    }


    .tour-modal {

        padding:
            8px;
    }


    .tour-modal-dialog {

        border-radius:
            20px;

        max-height:
            95vh;
    }


    .tour-modal-gallery {

        height:
            245px;

        min-height:
            245px;
    }


    .tour-modal-gallery > img {

        height:
            245px;

        min-height:
            245px;
    }


    .tour-modal-content {

        padding:
            1.25rem;
    }


    .tour-modal-header h2 {

        font-size:
            1.8rem;
    }


    .tour-gallery-button {

        width:
            40px;

        height:
            40px;
    }

}