/* =========================
   TOURS INDEX
   Единый чистый стиль каталога
   ========================= */

/* ---------- Base ---------- */

body {
  background: #f7fbff;
}

.min-w-0 {
  min-width: 0;
}

/* ---------- Header / title ---------- */

.tours-list {
  position: relative;
}

.tours-list > h1.h4 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.15;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  color: #172033;
  margin-bottom: 1rem !important;
}

/* =========================
   MONTHS BAR
   ========================= */

.months-bar {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(13, 110, 253, 0.08);
  border-radius: 22px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.05);
  margin-bottom: 1rem;
}

.months-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.months-scroll::-webkit-scrollbar {
  display: none;
}

.months-chip,
.months-bar .btn.btn-outline-secondary.btn-sm,
.months-filter-icon-btn {
  border-radius: 9999px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  line-height: 1.15;
  border: 1px solid transparent;
  background: #eef5ff;
  color: #0d6efd;
  transition: all 0.18s ease;
  box-shadow: none;
}

.months-chip:hover,
.months-bar .btn.btn-outline-secondary.btn-sm:hover,
.months-filter-icon-btn:hover {
  background: #e4efff;
  border-color: transparent;
  color: #0d6efd;
}

.months-all-pill {
  position: sticky;
  left: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  line-height: 1.15;
  background: #ffffff;
  color: #172033;
  border: 1px solid #dde7f3;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}

.months-all-pill::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -14px;
  bottom: -1px;
  width: 14px;
  background: linear-gradient(to right, #fff 65%, rgba(255, 255, 255, 0));
  pointer-events: none;
}

.months-all-pill:hover {
  color: #172033;
  background: #ffffff;
  border-color: #d7e3f3;
}

.months-bar .btn.btn-primary {
  border-color: transparent;
}

.months-chip.active,
.months-bar .btn.btn-outline-secondary.active,
.months-bar .btn.btn-outline-secondary:active,
.months-bar .btn.btn-primary,
.months-filter-icon-btn.active,
.months-all-pill.btn-primary,
.months-all-pill.active {
  background: linear-gradient(135deg, #0d6efd 0%, #2d7dff 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.18);
}

/* =========================
   TOUR CARDS
   ========================= */

.tour-card {
  min-height: 120px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(13, 110, 253, 0.08) !important;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.tour-card:hover {
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.10);
  transform: translateY(-2px);
  border-color: rgba(13, 110, 253, 0.14) !important;
}

.tour-card .card-body {
  padding: 16px 2px 16px 14px;
}

.tour-image-wrap {
  height: 176px;
  aspect-ratio: 4 / 3;
  background: #eef4fb;
  border-radius: 18px;
  overflow: hidden;
}

.tour-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.35s ease;
}

.tour-card:hover .tour-image-wrap img {
  transform: scale(1.03);
}

.tour-title {
  max-width: 78%;
  font-size: 1.08rem;
  line-height: 1.28;
  margin: 0;
  color: #172033;
}

.tour-title-link {
  color: inherit;
  text-decoration: none;
}

.tour-title-link:hover {
  color: #0d6efd;
}

.tour-badge-days {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  color: #0d6efd;
  background: #eef5ff;
  border: 1px solid rgba(13, 110, 253, 0.08);
  white-space: nowrap;
}

.tour-badge-days svg {
  width: 12px;
  height: 12px;
  stroke: #0d6efd;
  fill: none;
  stroke-width: 1.6;
  opacity: 0.9;
}

.price-strong {
  font-weight: 800;
  color: #172033;
}

.price-col {
  color: #5f6b7a !important;
}

.price-col .text-danger {
  color: #d92d20 !important;
  font-size: 1rem;
}

.tour-dates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.tour-date-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.36rem 0.62rem;
  border-radius: 999px;
  background: #f8fbff;
  border: 1px solid #e4edf8;
  font-size: 0.82rem;
  line-height: 1.1;
  color: #344054;
  transition: all 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .tour-date-item:hover {
    background: #ffffff;
    border-color: rgba(13, 110, 253, 0.25);
  }
}

.date-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.tour-date-more {
  font-size: 0.87rem;
  text-decoration: none;
  color: #0d6efd;
  font-weight: 600;
}

.tour-date-more:hover {
  color: #0b5ed7;
}

.btn.btn-primary.btn-sm.rounded-pill,
.btn-circle,
#loadMoreToursBtn {
  border-radius: 999px !important;
}

.btn.btn-primary.btn-sm.rounded-pill {
  padding-left: 1rem;
  padding-right: 1rem;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.14);
}

.btn.btn-primary.btn-sm.rounded-pill:hover {
  box-shadow: 0 14px 28px rgba(13, 110, 253, 0.18);
}

/* =========================
   FILTER SIDEBAR
   ========================= */

.tour-filter-sidebar {
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(13, 110, 253, 0.08);
  border-radius: 24px;
  padding: 1.2rem 1.2rem 1rem;
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.06);
}

.filter-block {
  padding: 0 0 1rem 0;
  border-bottom: 1px solid #edf2f7;
}

.filter-block:last-of-type {
  border-bottom: none;
}

.filter-block-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: #172033;
  margin-bottom: 0.35rem;
}

.filter-block-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: -0.05rem;
  margin-bottom: 0.75rem;
}

.filter-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.filter-scroll::-webkit-scrollbar {
  width: 8px;
}

.filter-scroll::-webkit-scrollbar-thumb {
  background: #d6deea;
  border-radius: 999px;
}

.filter-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 4px 0;
  cursor: pointer;
}

.filter-check .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  cursor: pointer;
  border-color: #cfd8e3;
  box-shadow: none;
}

.filter-check .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.filter-check-label {
  line-height: 1.45;
  font-size: 0.98rem;
  color: #344054;
}

.filter-actions {
  text-align: center;
  margin-top: 1.1rem;
}

.filter-apply-btn {
  display: inline-block;
  font-size: 0.96rem;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.14);
}

.filter-reset-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.9rem;
  color: #6b7280;
  text-decoration: none;
}

.filter-reset-link:hover {
  color: #111827;
  text-decoration: underline;
}

/* =========================
   OFFCANVAS FILTERS
   ========================= */

@media (max-width: 991.98px) {
  .offcanvas-bottom#offcanvasFilters {
    height: 82vh;
    max-height: 82vh;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 0;
    box-shadow: 0 -14px 40px rgba(16, 24, 40, 0.12);
  }

  .offcanvas-bottom#offcanvasFilters .offcanvas-header {
    background: #ffffff;
    padding: 1rem 1rem 0.9rem;
  }

  .offcanvas-filters-inner {
    padding: 0.9rem 1rem 4.6rem;
    height: 100%;
    overflow-y: auto;
    background: #f7fbff;
  }

  .offcanvas-filters-inner .tour-filter-sidebar {
    border-radius: 22px;
    box-shadow: none;
  }

  .offcanvas-bottom#offcanvasFilters .filter-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.65rem 1rem calc(0.45rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 -6px 18px rgba(16, 24, 40, 0.08);
    z-index: 1056;
  }

  .offcanvas-bottom#offcanvasFilters .filter-apply-btn {
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    font-size: 1rem;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }

  .offcanvas-bottom#offcanvasFilters .filter-reset-link {
    display: none;
  }
}

/* =========================
   TABLET / DESKTOP LAYOUT
   ========================= */

@media (min-width: 768px) {
  .tour-col-image {
    padding-right: 0 !important;
    margin-right: -14px;
  }

  .tour-col-body {
    padding-left: 0 !important;
  }

  .price-col {
    min-width: 170px;
    margin-top: 1px;
  }
}

@media (min-width: 992px) {
  .container.py-1.py-lg-4 {
    padding-top: 1.25rem !important;
    padding-bottom: 2rem !important;
  }

  .tour-filter-sidebar {
    padding: 1.05rem 1.05rem 0.95rem;
    border-radius: 22px;
  }

  .filter-block-title {
    font-size: 0.98rem;
    margin-bottom: 0.55rem;
  }

  .filter-check-label {
    font-size: 0.95rem;
  }

  .filter-scroll {
    max-height: 320px;
  }

  .tours-list > h1.h4 {
    margin-bottom: 0.85rem !important;
  }

  .months-bar {
    padding: 10px 12px;
    margin-bottom: 1.1rem;
  }

  .months-chip,
  .months-bar .btn.btn-outline-secondary.btn-sm,
  .months-filter-icon-btn,
  .months-all-pill {
    padding: 0.46rem 0.82rem;
    font-size: 0.95rem;
  }

  .tour-card {
    border-radius: 22px;
    margin-bottom: 1rem !important;
  }

  .tour-card .card-body {
    padding: 14px 0 14px 14px;
  }

  .tour-image-wrap {
    height: 150px;
    border-radius: 18px;
  }

  .tour-col-image {
    flex: 0 0 290px;
    max-width: 290px;
  }

  .tour-col-body {
    flex: 1 1 auto;
    max-width: calc(100% - 290px);
  }

  .tour-title {
    font-size: 1rem;
    line-height: 1.25;
    max-width: 72%;
  }

  .tour-col-body .text-muted.small {
    font-size: 0.92rem;
  }

  .tour-date-item {
    padding: 0.32rem 0.56rem;
    font-size: 0.8rem;
  }

  .price-col {
    min-width: 132px;
    text-align: right;
  }

  .price-col .text-decoration-line-through {
    font-size: 0.88rem;
  }

  .price-col .text-danger,
  .price-col .price-strong {
    font-size: 0.98rem;
    font-weight: 800;
  }

  .btn.btn-primary.btn-sm.rounded-pill {
    padding: 0.5rem 0.95rem;
    font-size: 0.9rem;
  }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 991.98px) {
  .months-bar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.92);
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .months-bar.is-stuck {
    padding-top: 8px;
    padding-bottom: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  }

  #offcanvasFilters {
    z-index: 200000 !important;
  }

  .offcanvas-backdrop.show {
    z-index: 199999 !important;
  }

  body.filters-offcanvas-open #chatwoot_live_chat_widget,
  body.filters-offcanvas-open .woot-widget-holder,
  body.filters-offcanvas-open .woot-widget-bubble,
  body.filters-offcanvas-open .woot--bubble-holder {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

@media (max-width: 767px) {
  .tour-dates-bar {
    margin-bottom: 6px;
    overflow: hidden;
  }

  .tour-dates-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }

  .tour-dates-scroll::-webkit-scrollbar {
    display: none;
  }

  .tour-dates-scroll > .d-flex {
    flex-wrap: nowrap !important;
    width: max-content;
    min-width: 100%;
  }

  .tour-date-item {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.1;
    background: #f8fbff;
    padding: 0.32rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
  }

  .tour-date-item .date-dot {
    pointer-events: none;
  }
}

@media (max-width: 576.98px) {
  .tours-list {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .tours-list .tour-card {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 18px;
    padding-left: 3px;
    padding-right: 0;
  }

  .tour-col-image {
    flex: 0 0 112px;
    max-width: 112px;
  }

  .tour-image-wrap {
    width: 112px;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin: 0;
    background: #ffffff;
  }

  .tour-col-body {
    flex: 1 1 auto;
    max-width: calc(100% - 112px);
    min-width: 0;
  }

  .tour-card .card-body {
    padding: 12px 12px 12px;
  }

  .tour-title {
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.22;
    margin-right: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tour-badge-days {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
  }

  .tour-col-body .text-muted.small {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 82%;
  }

  .tour-date-item {
    font-size: 0.79rem;
    padding: 0.3rem 0.58rem;
  }

  .btn-circle {
    width: 31px;
    height: 31px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.18);
  }

  .mobile-cta-row .text-muted.small {
    margin-left: auto;
    margin-right: 0.45rem;
    white-space: nowrap;
  }
}

/* =========================
   DESKTOP FIXES
   ========================= */
@media (min-width: 992px) {
  .tour-col-image {
    flex: 0 0 250px;
    max-width: 250px;
    margin-right: -18px;
  }

  .tour-col-body {
    flex: 1 1 auto;
    max-width: calc(100% - 250px);
    padding-left: 0 !important;
  }

  .tour-card .card-body {
    padding: 12px 12px 12px 2px;
  }
}

  .tour-title {
    max-width: 100%;
  }

  /* Верхняя строка карточки компактнее */
  .tour-card .d-flex.justify-content-between.align-items-start.mb-1.gap-2 {
    margin-bottom: 0.35rem !important;
  }

  /* Маршрут + цена */
  .tour-card .d-flex.justify-content-between.align-items-center.mb-2.gap-2 {
    margin-bottom: 0.6rem !important;
    align-items: flex-start !important;
  }

  /* Ценовой блок уже и компактнее */
  .price-col {
    min-width: 150px;
    text-align: right;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    line-height: 1;
    margin-top: 2px;
  }

  .price-col > div {
    display: inline-flex;
    align-items: baseline;
    margin: 0 !important;
  }

  .price-col .text-decoration-line-through {
    font-size: 0.92rem;
    white-space: nowrap;
  }

  .price-col .text-danger,
  .price-col .price-strong {
    font-size: 0.98rem;
    font-weight: 800;
    white-space: nowrap;
  }

  /* Когда цена без акции */
  .price-col strong {
    white-space: nowrap;
  }

  /* Кнопка и нижняя строка аккуратнее */
  .tour-card .d-none.d-md-flex.justify-content-between.align-items-center.mt-auto {
    margin-top: 0.75rem !important;
  }
}