/* ===== Bestsellers Component Layout ===== */
.com-tour-hotel-section {
  margin: 40px 0;
  font-family: inherit;
}

/* Скрываем переполнение, чтобы карточки не "выпирали" */
.com-tour-hotel-section .container {
  position: relative;
  overflow: hidden;
}

/* Фильтры */
.com-tour-filter-buttons {
  display: flex;
  gap: 12px;
  margin: 10px 0 22px;
  flex-wrap: wrap;
}

.com-tour-filter-btn {
  background: #f2f2f4;
  border: 0;
  padding: 10px 18px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #222;
  transition: background .2s, color .2s;
}
.com-tour-filter-btn:hover { background:#e1e1e4; }
.com-tour-filter-btn.com-tour-active {
  background: #ff8c00;
  color: #fff;
}

/* Контейнер для карточек (горизонтальный ряд) */
.com-tour-hotels-container { position: relative; }

.com-tour-cards-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: 100%;
  /* Лента: скрываем то, что уходит вправо */
  overflow: hidden;
  padding: 4px 4px 10px;
  box-sizing: border-box;
  min-height: 280px;
}

/* Обёртка каждой карточки рассчитана на 3 штуки в ряд */
.com-tour-card-wrap {
  flex: 0 0 calc((100% - 32px) / 3);  /* 2 gaps => 32px */
  max-width: calc((100% - 32px) / 3);
  display: flex;
  /* Для плавного появления следующей карточки */
  transition: transform .3s;
}

@media (max-width: 1100px) {
  .com-tour-card-wrap {
    flex: 0 0 calc((100% - 16px)/2);
    max-width: calc((100% - 16px)/2);
  }
}
@media (max-width: 640px) {
  .com-tour-card-wrap { flex: 0 0 100%; max-width:100%; }
}

/* Карточка */
.com-tour-hotel-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  padding: 12px 14px 14px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Изображение с ratio */
.com-tour-img-ratio {
  position: relative;
  width: calc(100% + 28px);
  left: -14px;
  top: -12px;
  padding-top: 60%;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #f0f0f0;
  margin-bottom: 8px;
}
.com-tour-img-ratio img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Типографика уменьшена */
.com-tour-hotel-name {
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0 0 6px;
  font-weight: 700;
  text-transform: uppercase;
}
.com-tour-hotel-location {
  font-size: 1.2rem;
  line-height: 1.2;
  margin: 0 0 10px;
  color: #666;
}

.com-tour-price-section {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.com-tour-price-info { display: flex; flex-direction: column; }
.com-tour-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
}
.com-tour-price-note {
  font-size: 1.1rem;
  color: #888;
  margin-top: 4px;
}

/* Кнопка Выбрать */
.com-tour-select-btn {
  background: #ff8c00;
  color: #fff;
  border: 0;
  padding: 8px 14px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 18px;
  cursor: pointer;
  white-space: nowrap;
}
.com-tour-select-btn:hover { background:#e57d00; }

/* Удаляем декоративные иконки до заголовков (зонтик и т.п.) */
.com-tour-hotel-section .com-tour-hotel-name:before {
  content: none !important;
  display: none !important;
}

/* Состояния */
.com-tour-loading {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  min-height:200px;
  font-size:.8rem;
  gap:12px;
}
.com-tour-loading-spinner {
  width:42px;height:42px;
  border:4px solid #eee;
  border-top-color:#ff8c00;
  border-radius:50%;
  animation: comTourSpin 0.8s linear infinite;
}
@keyframes comTourSpin { to { transform: rotate(360deg); } }

.com-tour-error {
  text-align:center;
  padding:40px 10px;
  font-size:.85rem;
  color:#900;
}

.com-tour-retry-btn {
  margin-top:14px;
  background:#ff8c00;
  color:#fff;
  border:0;
  padding:8px 18px;
  border-radius:20px;
  cursor:pointer;
  font-size:.7rem;
}
.com-tour-retry-btn:hover { background:#e57d00; }

.com-tour-empty {
  font-size:.8rem;
  padding:30px 10px;
  color:#555;
}

/* Навигационные кнопки */
.com-tour-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  background:#fff;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:5;
  transition: background .2s;
}
.com-tour-carousel-nav i { font-size:20px; color:#111; }
.com-tour-carousel-nav:hover { background:#f2f2f2; }
.com-tour-carousel-nav.com-tour-prev { left:-6px; }
.com-tour-carousel-nav.com-tour-next { right:-6px; }

@media (max-width: 640px) {
  .com-tour-carousel-nav.com-tour-prev { left:4px; }
  .com-tour-carousel-nav.com-tour-next { right:4px; }
}

/* ===== Fallback / Hardening Rules ===== */

/* If template not yet updated (container still has class="row") */
[data-component="bestsellers"] [id^="com-tour-hotels-content-"].row {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow: hidden;
  padding: 4px 4px 10px;
  box-sizing: border-box;
}

/* If cards were rendered without .com-tour-card-wrap (legacy col-*), adapt */
[data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-md-3,
[data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-sm-4,
[data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-xs-12 {
  flex: 0 0 calc((100% - 32px)/3);
  max-width: calc((100% - 32px)/3);
  float: none;  /* neutralize Bootstrap floats */
  width: auto;  /* allow flex-basis to apply */
}

@media (max-width: 1100px) {
  [data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-md-3,
  [data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-sm-4,
  [data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-xs-12 {
    flex: 0 0 calc((100% - 16px)/2);
    max-width: calc((100% - 16px)/2);
  }
}
@media (max-width: 640px) {
  [data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-md-3,
  [data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-sm-4,
  [data-component="bestsellers"] [id^="com-tour-hotels-content-"].row > .col-xs-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}
