/* ============================================== */
/* 11. UNFORGETTABLE TOUR PACKAGES SECTION (Reversed Layout) */
/* ============================================== */

.packages-section {
    /* Set the background image */
    background-image: 
        /* CRITICAL: Dark overlay for text readability */
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
        /* The user-provided image */
        url('/images/fishingbackdrop.jpg'); 
        
    /* Ensure the image covers the entire section */
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Image scrolls with the section */
    
    padding-top: 150px; 
    padding-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden; 
    z-index: 5;
}

/* --- LARGE BACKGROUND TITLE --- */
.packages-title {
    font-family: var(--font-heading);
    color: var(--color-text-light); /* White */
    z-index: 9; /* CRITICAL: Ensure it is behind the content (z-index 10) */
    opacity: 0.15; /* Subtly faded */
    
    /* SCALING AND POSITIONING */
    position: absolute;
    width: 100%;
     top: var(--spacing-sm);  /* Position it high in the section */
    text-align: center;
    box-sizing: border-box;
    overflow: hidden; 
    white-space: nowrap; /* Prevents wrapping */
    
    /* Mobile First: Large VW sizing */
    font-size: 16vw; 
    letter-spacing: 0.05em;
    user-select: none; /* Prevents selecting the giant text */
}

/* Larger screen sizing */
@media (min-width: 768px) {
    .packages-title {
        font-size: 10rem; 
        letter-spacing: 0.2em;
        top: 20px;
    }
}
@media (min-width: 1200px) {
    .packages-title {
        font-size: 12rem;
    }
}

/* --- TOP BLACK FADE --- */
.packages-section::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 300px; /* How tall the fade is */
    background: linear-gradient(
        to bottom, /* Fades downward from the top edge */
        #000 0%, /* Starts solid black at the very top */
        rgba(0,0,0,0.7) 40%,
        rgba(0,0,0,0) 100% /* Fully transparent at 300px down */
    );
    z-index: 9;
    pointer-events: none;
}

/* --- BOTTOM BLACK FADE (Your Confirmed Code) --- */
.packages-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px; /* How tall the fade is */
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.7) 60%,
        #000 100%
    );
    z-index: 9;
    pointer-events: none;
}

/* Ensure content is visible */
.packages-grid-wrapper,
.packages-text-container {
    position: relative;
    z-index: 10;
}

/* --- GRID LAYOUT: Cards left, Text right (Desktop) --- */
.packages-grid-wrapper {
    display: grid;
    /* Define columns: Cards (Wide) | Text (Narrow) */
    grid-template-columns: 2fr 1fr; 
    align-items: flex-start; 
    gap: var(--spacing-lg);
}

/* --- RIGHT COLUMN: STICKY TEXT & SEARCH (Fixed in place) --- */
.packages-text-container {
    padding: 0; 
    text-align: left;
    
    /* CRITICAL FIX: Make the container sticky to keep the content in view */
    position: sticky; 
    top: 100px; /* Aligns to the top of the viewport when scrolling */
    
    /* Give it vertical room to appear over the content */
    height: 100vh; 
    
    /* Align text content to the top (like the destinations section) */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: flex-start;
}

.packages-section-title {
    color: var(--color-secondary); 
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

.packages-section-desc {
    color: var(--color-tertiary);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

/* Trust Indicators */
.trust-indicators {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.trust-item {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.trust-divider {
    color: var(--color-secondary);
    opacity: 0.5;
}

/* Search Box Styles (Reused) */
.packages-search-box {
    display: flex;
    border: 1px solid var(--color-tertiary);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    width: 100%;
}

.packages-search-box input {
    background-color: #1a1a1a; 
    color: var(--color-text-light);
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    flex-grow: 1;
    font-size: 1rem;
    outline: none;
}

.packages-search-box .search-btn {
    background-color: var(--color-secondary); 
    border: none;
    color: var(--color-primary); 
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
}

/* Editorial CTA */
.cta-editorial {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-secondary);
    font-weight: 600;
    margin-top: var(--spacing-sm);
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 3px;
    transition: var(--transition-fast);
    text-decoration: none;
}

.cta-editorial:hover {
    color: var(--color-text-light);
    gap: 0.75rem;
}

.cta-editorial svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.cta-editorial:hover svg {
    transform: translateX(4px);
}

/* --- LEFT COLUMN: Horizontal Stepped Carousel --- */
.packages-card-scroller {
    overflow: hidden;
    padding: var(--spacing-md) 0;
    position: relative;
}

.packages-grid {
    display: flex; 
    gap: var(--spacing-md);
    padding: var(--spacing-xs) 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.packages-grid::-webkit-scrollbar {
    display: none;
}

/* Carousel Progress Indicator */
.carousel-progress {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: var(--spacing-md);
    border-radius: 1px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 25%;
    background: var(--color-secondary);
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform: translateX(0);
}

/* --- Package Card Styles --- */
.package-card {
    flex: 0 0 auto;
    width: 280px; 
    height: 400px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    scroll-snap-align: start;
}

.package-card:hover,
.package-card:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.package-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.package-card:hover img {
    transform: scale(1.05);
}

.package-content {
    position: absolute;
    bottom: 0;
    padding: var(--spacing-md);
    color: white;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    width: 100%;
    z-index: 2;
    transform: translateY(0);
    transition: transform var(--transition-fast);
}

.package-card:hover .package-content {
    transform: translateY(-5px);
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.package-content h3 {
    font-size: 1.2rem;
    margin: 0;
    color: white;
}

.package-type {
    font-size: 0.75rem;
    color: var(--color-secondary);
    padding: 0.25rem 0.5rem;
    background: rgba(232, 193, 111, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(232, 193, 111, 0.2);
}

.package-days {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.package-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}


/* ============================================== */
/* MOBILE/TABLET RESPONSIVENESS (MAX-WIDTH: 991px) */
/* ============================================== */
@media (max-width: 991px) {
    
    /* SECTION & CONTAINER ADJUSTMENTS */
    .packages-section {
        padding-top: 80px; 
        padding-bottom: 80px; 
        background-attachment: scroll;
    }

    /* 1. OVERRIDE DESKTOP GRID & STACK CONTENT VERTICALLY */
    .packages-grid-wrapper {
        display: flex; 
        flex-direction: column; 
        gap: 0;
        width: 100%;
        padding: 0;
    }

    /* TYPOGRAPHY SCALING */
    .packages-title {
        font-size: 100px; 
        top: 0;
    }
    
    /* ========================================= */
    /* 2. TEXT/CONTROLS CONTAINER (REORDERING & CENTERING) */
    /* ========================================= */
    .packages-text-container {
        order: 1;
        position: static; 
        height: auto; 
        align-items: center;
        text-align: center;
        padding: 0 var(--spacing-md); 
        margin-bottom: var(--spacing-lg);
    }
    
    /* Ensure text blocks are constrained for readability */
    .packages-section-title,
    .packages-section-desc {
        max-width: 500px; 
        margin-left: auto;
        margin-right: auto;
    }
    
    .packages-section-title {
        font-size: 2rem;
    }

    /* Ensure search box is constrained and centered */
    .packages-search-box {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .trust-indicators {
        justify-content: center;
    }
    
    /* ========================================= */
    /* 3. CAROUSEL SCROLLING SETUP (MANUAL SCROLL) */
    /* ========================================= */
    .packages-card-scroller {
        order: 2;
        overflow-x: scroll;
        overflow-y: hidden;
        padding: 0 var(--spacing-md);
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .packages-card-scroller::-webkit-scrollbar {
        display: none;
    }
    
    .packages-grid {
        animation: none;
        width: auto;
        flex-wrap: nowrap;
        scroll-snap-type: x mandatory;
        padding-bottom: var(--spacing-sm);
    }

    /* CARD SIZE ADJUSTMENT */
    .package-card {
        width: 85vw;
        height: 360px;
        scroll-snap-align: start;
    }
    
    /* Hide progress bar on mobile */
    .carousel-progress {
        display: none;
    }
}

/* Desktop (992px and above) */
@media (min-width: 992px) {
    .packages-card-scroller {
        padding-left: var(--spacing-md);
    }
    
    .packages-grid {
        overflow-x: hidden;
    }
    
    .package-card {
        width: 320px;
        opacity: 0.9;
    }
    
    .package-card:nth-child(2),
    .package-card:nth-child(4) {
        opacity: 0.7;
    }
    
    .package-card:nth-child(3) {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* ============================================== */
/* SMALL MOBILE RESPONSIVENESS (MAX-WIDTH: 480px) */
/* ============================================== */
@media (max-width: 480px) {
    .packages-section {
        padding-top: 60px;
        padding-bottom: 60px;
    }
    
    .packages-title {
        font-size: 80px; 
    }
    
    .packages-card-scroller {
        padding: 0 var(--spacing-sm); 
    }
    
    .package-card {
        height: 340px;
    }
    
    .trust-indicators {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
}