/**
 * Center menu & testimonial sections when only 1–2 items/slides exist (all CMS templates).
 */

/* ── Bootstrap-style rows ── */
.cms-items-count-1 > .row,
.cms-items-count-2 > .row,
.row.cms-items-count-1,
.row.cms-items-count-2,
.cms-items-count-few > .row,
.row.cms-items-count-few {
  justify-content: center !important;
}

.cms-items-count-1 > .row > [class*="col-"],
.row.cms-items-count-1 > [class*="col-"],
.cms-items-count-1.row > [class*="col-"] {
  flex: 0 0 auto;
  width: 100%;
  max-width: min(100%, 420px);
}

@media (min-width: 768px) {
  .cms-items-count-2 > .row > [class*="col-"],
  .row.cms-items-count-2 > [class*="col-"],
  .cms-items-count-2.row > [class*="col-"] {
    flex: 0 0 auto;
    width: auto;
    max-width: min(50%, 480px);
  }
}

/* ── Default template testimonial carousel ── */
.testimonial-carousel-wrapper.cms-items-count-1 .testimonial-track,
.testimonial-carousel-wrapper.cms-items-count-2 .testimonial-track {
  justify-content: center;
  gap: 24px;
}

.testimonial-carousel-wrapper.cms-items-count-1 .testimonial-slide,
.testimonial-carousel-wrapper.cms-items-count-2 .testimonial-slide {
  flex: 0 0 auto;
  width: min(100%, 540px);
  max-width: 540px;
  cursor: default;
}

.testimonial-carousel-wrapper.cms-items-count-1 .testimonial-slide .testimonial-item,
.testimonial-carousel-wrapper.cms-items-count-2 .testimonial-slide .testimonial-item {
  background: var(--dark);
  color: #fff;
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.testimonial-carousel-wrapper.cms-items-count-1 .testimonial-slide .testimonial-item h4,
.testimonial-carousel-wrapper.cms-items-count-2 .testimonial-slide .testimonial-item h4 {
  color: var(--primary) !important;
}

.testimonial-carousel-wrapper.cms-items-count-1 .testimonial-slide .testimonial-item span,
.testimonial-carousel-wrapper.cms-items-count-1 .testimonial-slide .testimonial-item p,
.testimonial-carousel-wrapper.cms-items-count-2 .testimonial-slide .testimonial-item span,
.testimonial-carousel-wrapper.cms-items-count-2 .testimonial-slide .testimonial-item p {
  color: #fff !important;
}

@media (min-width: 768px) {
  .testimonial-carousel-wrapper.cms-items-count-2 .testimonial-slide {
    width: min(48%, 480px);
    max-width: 480px;
  }
}

/* ── Template B testimonial grid ── */
.ve-testi-grid.cms-items-count-1,
.ve-testi-grid.cms-items-count-2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}

.ve-testi-grid.cms-items-count-1 .ve-testi-card {
  flex: 0 0 100%;
  max-width: 540px;
}

.ve-testi-grid.cms-items-count-2 .ve-testi-card {
  flex: 0 0 100%;
  max-width: 540px;
}

@media (min-width: 768px) {
  .ve-testi-grid.cms-items-count-2 .ve-testi-card {
    flex: 0 0 calc(50% - 14px);
    max-width: calc(50% - 14px);
  }
}

/* ── Template C menu list ── */
.tc-menu-list.cms-items-count-1,
.tc-menu-list.cms-items-count-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tc-menu-list.cms-items-count-1 .tc-menu-line,
.tc-menu-list.cms-items-count-2 .tc-menu-line {
  width: 100%;
  max-width: 640px;
}

/* ── Template C testimonial stage ── */
.tc-testimonial-stage.cms-items-count-1,
.tc-testimonial-stage.cms-items-count-2 {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Template G & F testimonial swipers (1–2 slides) ── */
.testimonials .testimonial-slider.tg-testimonial-count-1,
.testimonials .testimonials-slider.vf-testimonial-count-1 {
  max-width: 540px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.testimonials .testimonial-slider.tg-testimonial-count-2,
.testimonials .testimonials-slider.vf-testimonial-count-2 {
  max-width: min(960px, 100%);
  margin-left: auto !important;
  margin-right: auto !important;
}

.testimonials .testimonial-slider.tg-testimonial-count-1 .swiper-slide,
.testimonials .testimonials-slider.vf-testimonial-count-1 .swiper-slide {
  width: 100% !important;
  max-width: 100% !important;
}

.testimonials .testimonial-slider.tg-testimonial-count-1 .swiper-wrapper,
.testimonials .testimonials-slider.vf-testimonial-count-1 .swiper-wrapper {
  justify-content: center;
}

@media (min-width: 768px) {
  .testimonials .testimonial-slider.tg-testimonial-count-2 .swiper-slide,
  .testimonials .testimonials-slider.vf-testimonial-count-2 .swiper-slide {
    width: calc(50% - 15px) !important;
    max-width: calc(50% - 15px) !important;
  }

  .testimonials .testimonial-slider.tg-testimonial-count-2 .swiper-wrapper,
  .testimonials .testimonials-slider.vf-testimonial-count-2 .swiper-wrapper {
    justify-content: center;
  }
}

/* Generic swiper testimonial centering via shared CMS classes */
.testimonials .testimonial-slider.cms-items-count-1,
.testimonials .testimonials-slider.cms-items-count-1 {
  max-width: 540px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.testimonials .testimonial-slider.cms-items-count-2,
.testimonials .testimonials-slider.cms-items-count-2 {
  max-width: min(960px, 100%);
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ── Swiper carousels (Template F menu, etc.) ── */
.vf-section-carousel.cms-items-count-1,
.vf-section-carousel.cms-items-count-2,
.menu-slider.cms-items-count-1,
.menu-slider.cms-items-count-2 {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.vf-section-carousel.cms-items-count-1 .swiper-wrapper,
.menu-slider.cms-items-count-1 .swiper-wrapper {
  justify-content: center;
}

.vf-section-carousel.cms-items-count-1 .swiper-slide,
.menu-slider.cms-items-count-1 .swiper-slide {
  max-width: 540px;
}

@media (min-width: 768px) {
  .vf-section-carousel.cms-items-count-2 .swiper-slide,
  .menu-slider.cms-items-count-2 .swiper-slide {
    max-width: calc(50% - 12px);
  }
}

/* ── Template G menu (1–2 items — same grid as blog location-cards) ── */
.rooms-showcase.location-cards .cms-items-count-1 .row,
.rooms-showcase.location-cards .cms-items-count-2 .row {
  justify-content: center;
}

.rooms-showcase.location-cards .cms-items-count-1 .row > [class*="col-"] {
  flex: 0 0 auto;
  width: 100%;
  max-width: min(100%, 420px);
}

.rooms-showcase.location-cards .cms-items-count-2 .row > [class*="col-"] {
  flex: 0 0 auto;
  width: 100%;
  max-width: min(100%, 480px);
}

@media (min-width: 768px) {
  .rooms-showcase.location-cards .cms-items-count-2 .row > [class*="col-"] {
    max-width: min(50%, 480px);
  }
}

/* ── Template A / C single-column testimonial stacks ── */
.col-lg-7.cms-items-count-1 .testimonial-item,
.tc-testimonial-stage.cms-items-count-1 .tc-testimonial-panel {
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.col-lg-7.cms-items-count-2,
.tc-testimonial-stage.cms-items-count-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .col-lg-7.cms-items-count-2 {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .col-lg-7.cms-items-count-2 .testimonial-item {
    flex: 0 0 calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
  }
}

@media (min-width: 768px) {
  .tc-testimonial-stage.cms-items-count-2 {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .tc-testimonial-stage.cms-items-count-2 .tc-testimonial-panel {
    flex: 0 0 calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
  }
}
