/* ===== TOURS CATALOG PAGE STYLES ===== */

.tours-page {
    background: #FFFFFF;
    min-height: 100vh;
    color: #333;
}

/* Results count summary */
.results-count {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #F7FAF7;
    border: 1px solid #E2F1E4;
    border-radius: 9999px;
    color: #55616A;
    font-size: 14px;
}

.results-count strong {
    color: var(--color-primary);
    font-weight: 800;
    padding: 2px 8px;
    background: #E9F6EB;
    border-radius: 9999px;
}

/* Adjust appearance when inside green filters panel */
.filters-panel .results-count {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.filters-panel .results-count strong {
    background: #FFFFFF;
    color: var(--color-primary);
}

/* Add a subtle search icon before the text inside filters panel */
.filters-panel .results-count::before {
    content: "";
    width: 16px;
    height: 16px;
    background: #FFFFFF;
    opacity: 0.9;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Основний контейнер */
.tours-container {
    padding-top: 105px;
    padding-bottom: 24px;
    background: #FFFFFF;
}

.tours-layout {
    display: grid;
    grid-template-columns: 413px 1fr;
    gap: 24px;
    max-width: 1720px;
    margin: 0 auto;
}

@media (max-width: 1752px) {
    .tours-layout {
        width: 100% !important;
        max-width: unset !important;
        padding: 0 15px;
    }
}

/* Mobile filter toggle button */
.mobile-filter-toggle {
    display: none;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.btn-mobile-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    color: black;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family-secondary);
}

.filter-icon-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.filter-icon-svg path {
    stroke: #000000;
}

.filter-count {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* Бічна панель з фільтрами */
.filters-sidebar {
    position: relative;
    height: fit-content;
}

.filters-panel {
    background: var(--color-primary);
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(70, 163, 81, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
}

.filters-panel-header {
    flex-shrink: 0;
    margin-bottom: 10px;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.filters-panel-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.filters-panel-footer {
    flex-shrink: 0;
}

.filters-title {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    text-transform: none;
    text-align: left;
    font-family: var(--font-family-secondary);
}

.btn-close-filters {
    display: none;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.btn-close-filters:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Active filters block */
.active-filters {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.active-filters-title {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 13px;
    margin: 0 0 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    color: var(--color-primary);
    border: 1px solid #FFFFFF;
    border-radius: 9999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-content {
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
}

.filter-label {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    font-family: var(--font-family-secondary);
    letter-spacing: 0.02em;
}

.filter-group-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px 0;
}

.filter-group.collapsed .filter-content {
    max-height: 0;
    opacity: 0;
}

.filter-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: #333333;
    font-family: inherit;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 3px;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    transition: all 0.15s ease;
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.filter-checkbox:has(input:checked) {
    background: #FFFFFF;
    color: var(--color-primary);
}

.filter-checkbox:has(input:checked) .option-text,
.filter-checkbox:has(input:checked) .count-badge {
    color: var(--color-primary);
}

.option-text {
    font-size: 14px;
    font-weight: 500;
}

.count-badge {
    font-size: 13px;
    opacity: 0.8;
}

.btn-reset {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: block;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Основний контент */
.tours-main {
    min-height: 600px;
}

.tours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.tour-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tour-card {
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 240px;
    display: flex;
    flex-direction: column;
}

.tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(70, 163, 81, 0.2);
}

.card-image {
    position: relative;
    height: 100%;
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
}

.card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    filter: brightness(70%);
    transition: transform 0.3s ease;
}

.tour-card:hover .card-bg {
    transform: scale(1.05);
}

.card-bg-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #46A351 0%, #2d6b35 100%);
}

.card-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 90%;
}

.card-title {
    font-size: 32px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    font-family: var(--font-family-secondary);
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
    text-align: center;
}

.card-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
    line-height: 1.4;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

.pagination-prev,
.pagination-next {
    padding: 10px 20px;
    border-radius: 12px;
    background: #F7FAF7;
    border: 1px solid #E2F1E4;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: var(--color-primary);
    color: #fff;
}

.pagination-current {
    font-size: 14px;
    color: #666;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-results h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

/* Адаптивність */
@media (max-width: 1200px) {
    .tours-layout {
        grid-template-columns: 300px 1fr;
        gap: 15px;
    }

    .tours-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
        gap: 15px;
    }

    .filters-header {
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 0;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 10px;
    }
}

/* Large tablets / small laptops */
@media (max-width: 992px) {
    .tours-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 22px;
    }

    .tour-card {
        border-radius: 16px;
        min-height: 300px;
    }

    .card-image {
        aspect-ratio: 16 / 11;
    }

    .card-title {
        font-size: 26px;
    }
}

/* Mobile overlay and sidebar behavior */
@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: block;
    }

    .tours-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filters-sidebar {
        position: fixed;
        top: 105px;
        left: 0;
        width: 100%;
        height: calc(100vh - 105px);
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        padding: 15px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .filters-sidebar.mobile-open {
        opacity: 1;
        visibility: visible;
    }

    .filters-panel {
        background: var(--color-primary);
        border-radius: 16px;
        width: 100%;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        padding: 20px;
    }

    .filters-sidebar.mobile-open .filters-panel {
        transform: translateX(0);
    }

    .btn-close-filters {
        display: block;
        position: absolute;
        right: 5px;
        top: 2px;
        height: 20px;
    }

    body.filters-open {
        overflow: hidden;
    }

    .tours-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tour-card {
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    .tours-container {
        padding-top: 78px;
    }

    .filters-sidebar {
        top: 78px;
        height: calc(100vh - 78px);
    }

    .tours-layout {
        padding: 0 15px;
        gap: 20px;
    }

    .tour-card {
        min-height: 250px;
    }

    .card-image {
        height: 150px;
        aspect-ratio: 16 / 12;
    }

    .card-title {
        font-size: 20px;
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tour-card,
    .card-bg {
        transition: none;
    }
}