@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

.tour-section {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 40px 20px;
    font-family: 'Poppins', sans-serif;
    background-color: #F5F7F9;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    position: relative;
}

.filter-section {
    width: 300px;
    padding: 20px;
    background-color: #F5F7F9;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: block;
}

.filter-section.active {
    margin-bottom: 30px;
}

.filter-section.hidden {
    display: none;
}

.filter-section h2 {
    font-size: 1.5em;
    color: #1a2a44;
    margin-bottom: 20px;
}

.filter-button {
    display: none;
    background: #465b2d; /* Changed to #465b2d as requested */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: auto;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 30px;
    margin-left: 20px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.2s;
    position: relative;
    padding-left: 35px; /* Space for icon */
}

.filter-button::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z"/></svg>') no-repeat center;
    background-size: contain;
}

.filter-button:hover {
    background: #3d5033; /* Slightly darker shade of #465b2d for hover effect */
    transform: translateY(-2px);
}

#tour-rows {
    flex-grow: 1;
    width: calc(100% - 320px);
    box-sizing: border-box;
}

.pagination {
    width: calc(100% - 320px);
    margin-left: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    flex-wrap: wrap;
}

.tour-row {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tour-card {
    background: #F5F7F9;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    width: calc(50% - 10px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
}

.tour-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.tour-image {
    height: 300px;
    position: relative;
    overflow: hidden;
}

.tour-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.tour-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.tour-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
    transition: opacity 0.3s ease;
    z-index: 1;
}

.tour-card:hover .tour-image::before {
    opacity: 0.8;
}

.tour-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: gold;
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    z-index: 2;
}

.tour-content {
    padding: 20px;
    background-color: #F5F7F9;
    position: relative;
}

.tour-content.has-price {
    padding-top: 60px;
    padding-bottom: 10px;
}

.tour-price-banner {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #465b2d;
    color: white;
    padding: 5px 15px;
    font-size: 1em;
    font-weight: 850;
    border-bottom-left-radius: 10px;
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 20% 0);
    z-index: 2;
    margin-bottom: 30px;
}

.tour-price-banner::before {
    content: "FROM";
    margin-left: 5px;
    display: block;
    font-size: 0.8em;
}

.tour-title {
    font-size: 1.3em;
    color: #1a2a44;
    margin: 15px 0 10px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.tour-title a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.tour-title a:hover {
    color: #2A5C54;
}

.tour-description {
    font-size: 0.9em;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 10px;
}

.tour-best {
    font-size: 0.9em;
    color: #4b5e77;
    margin: 0 0 15px;
}

.tour-button {
    display: inline-block;
    text-align: center;
    background: #1A3C34;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s ease, background 0.3s ease;
}

.tour-button:hover {
    background: #2A5C54;
    transform: translateY(-2px);
}

.tour-footer {
    padding: 15px 20px;
    background-color: #F5F7F9;
    border-top: 1px solid #e5e7eb;
}

.tour-reviews {
    margin: 0;
    font-weight: 600;
    display: inline;
    white-space: nowrap;
}

.tour-reviews span {
    color: gold;
}

.tour-reviews .review-text {
    color: black;
}

.tour-image-wrapper {
    position: relative;
    display: inline-block;
}

.pagination-button {
    background: #1A3C34;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease, transform 0.2s, box-shadow 0.3s;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.pagination-button:hover:not(:disabled) {
    background: #2A5C54;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.pagination-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.4;
    transform: none;
    box-shadow: none;
}

.pagination-info {
    font-size: 0.9em;
    color: #1a2a44;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pagination-info div {
    font-weight: bold;
    color: #006400;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tour-row {
    animation: slideInFromLeft 0.8s ease-out;
    margin-bottom: 20px;
}

.tour-row:nth-child(2) {
    animation-delay: 0.3s;
}

.tour-row:nth-child(3) {
    animation-delay: 0.6s;
}

.tour-row:nth-child(4) {
    animation-delay: 0.9s;
}

.tour-card {
    opacity: 0;
    animation: slideInFromLeft 0.5s ease-out forwards;
}

.tour-row:nth-child(1) .tour-card:nth-child(1) { animation-delay: 0.1s; }
.tour-row:nth-child(1) .tour-card:nth-child(2) { animation-delay: 0.2s; }
.tour-row:nth-child(2) .tour-card:nth-child(1) { animation-delay: 0.4s; }
.tour-row:nth-child(2) .tour-card:nth-child(2) { animation-delay: 0.5s; }
.tour-row:nth-child(3) .tour-card:nth-child(1) { animation-delay: 0.7s; }
.tour-row:nth-child(3) .tour-card:nth-child(2) { animation-delay: 0.8s; }
.tour-row:nth-child(4) .tour-card:nth-child(1) { animation-delay: 1.0s; }
.tour-row:nth-child(4) .tour-card:nth-child(2) { animation-delay: 1.1s; }

@media (min-width: 769px) {
    .filter-section {
        position: sticky;
        top: 20px;
        align-self: flex-start;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        z-index: 5;
    }
}

@media (max-width: 768px) {
    .tour-section {
        flex-direction: column;
        gap: 0;
        padding-top: 60px; /* Space for sticky filter button */
    }

    .filter-button {
        display: block;
        position: sticky;
        top: 100px;
       
        margin: 0 auto 20px;
        width: calc(100% - 40px); /* Full width minus padding */
        text-align: center;
        background: #465b2d; /* Changed to #465b2d as requested */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .filter-section {
        display: none;
        width: 100%;
        margin: 0;
        padding: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        position: static;
        background-color: #F5F7F9;
    }

    .filter-section.active {
        display: block;
        margin-bottom: 30px;
    }

    .filter-section.hidden {
        display: none;
    }

    #tour-rows {
        width: 100%;
    }

    .pagination {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        justify-content: center;
    }

    .tour-row {
        flex-direction: column;
    }

    .tour-card {
        width: 100%;
        margin-bottom: 20px;
    }

    .tour-image {
        height: 400px;
    }

    .tour-button {
        float: none;
        width: 40%;
        margin: 0 auto 10px;
        display: block;
        font-size: 0.9em;
    }

    .tour-reviews {
        font-size: 1.2em;
    }

    .tour-category {
        font-size: 0.9em;
    }

    .tour-content.has-price {
        padding-top: 60px;
    }

    .tour-price-banner {
        margin-bottom: 30px;
    }

    .tour-title {
        margin: 15px 0 10px;
    }

    .pagination-button {
        padding: 8px 12px;
        font-size: 0.85em;
        min-width: 36px;
    }

    .pagination-info {
        font-size: 0.85em;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .tour-section {
        padding-top: 60px; /* Consistent space for sticky filter button */
    }

    .filter-button {
        width: calc(100% - 30px); /* Adjust for smaller screens */
        margin: 0 auto 15px;
        padding: 8px 15px;
        font-size: 0.85em;
        background: #465b2d; /* Changed to #465b2d as requested */
    }

    .filter-button::before {
        width: 14px;
        height: 14px;
        left: 10px;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z"/></svg>') no-repeat center;
        background-size: contain;
    }

    .filter-section {
        display: none;
        width: 100%;
        margin: 0;
        padding: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        position: static;
        background-color: #F5F7F9;
    }

    .filter-section.active {
        display: block;
        margin-bottom: 30px;
    }

    .filter-section.hidden {
        display: none;
    }

    .tour-button {
        width: 60%;
        font-size: 0.9em;
    }

    .tour-image {
        height: 300px;
    }

    .tour-reviews {
        font-size: 1.2em;
    }

    .tour-category {
        margin-bottom: 0;
        font-size: 14px;
    }

    .tour-content.has-price {
        padding-top: 60px;
    }

    .tour-price-banner {
        margin-bottom: 30px;
    }

    .tour-title {
        margin: 15px 0 10px;
    }

    .pagination-button {
        padding: 6px 10px;
        font-size: 0.8em;
        min-width: 32px;
    }

    .pagination-info {
        font-size: 0.8em;
        padding: 5px 10px;
        text-align: center;
    }
}

@media (max-width: 360px) {
    .tour-section {
        padding-top: 55px; /* Slightly less for smaller screens */
    }

    .filter-button {
        width: calc(100% - 20px);
        margin: 0 auto 10px;
        padding: 7px 12px;
        font-size: 0.8em;
        background: #465b2d; /* Changed to #465b2d as requested */
    }

    .filter-button::before {
        width: 12px;
        height: 12px;
        left: 8px;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z"/></svg>') no-repeat center;
        background-size: contain;
    }

    .pagination {
        gap: 6px;
    }

    .pagination-button {
        padding: 5px 8px;
        font-size: 0.75em;
        min-width: 28px;
    }

    .pagination-info {
        font-size: 0.75em;
        padding: 4px 8px;
    }

    .tour-content.has-price {
        padding-top: 60px;
    }

    .tour-price-banner {
        margin-bottom: 30px;
    }

    .tour-title {
        margin: 15px 0 10px;
    }
}
