/* ==========================================================================
   Review Carousel + Modal
   File: dnlab-snippets/modules/review-carousel/review-carousel.css
   ========================================================================== */

/* ── Wrap ─────────────────────────────────────────────────────────────────── */
.rl-carousel-wrap {
  position: relative;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.rl-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.rl-carousel-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.rl-carousel-viewall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.rl-carousel-viewall:hover {
  opacity: 1;
}

/* ── Track overflow visible để peek ──────────────────────────────────────── */
.rl-review-carousel .splide__track {
  overflow: visible;
}

.splide.is-initialized,
.splide.is-rendered {
  overflow: hidden;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {
    .rl-review-carousel .splide__list {
        padding-left: 10px!important;
    }
}
.rl-review-carousel .splide__slide {
    padding: 10px;
}
.rc-card {
  background: #fff;
  border: 1px solid #EEE;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 10px #0000001a;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.rc-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rc-avatar img,
.rc-avatar__fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.rc-avatar__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #555;
}
.rc-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rc-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: normal;
}
.rc-date {
  font-size: 1.25rem;
  color: #888;
  line-height: normal;
}
.rc-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #22a06b;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-left: auto;
}
.rc-rating svg {
  color: #22a06b;
}

/* ── Content ──────────────────────────────────────────────────────────────── */
.rc-content {
  font-size: 1.25rem;
  line-height: 1.65;
  color: #333;
}
.rc-content p {
  margin: 0;
}

.rl-readmore-btn {
    display: block;
    margin-top: 4px;
    padding: 0;
    background: none;
    border: none;
    color: #555;
    font-size: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: .25s;
}
.rl-readmore-btn:hover {
  color: #ae2126;
}

/* ── Arrows ───────────────────────────────────────────────────────────────── */
.rl-carousel-prev,
.rl-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #ffffffb3;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.25s;
  border: 1px solid #e0e0e0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.rl-carousel-prev {
  left: -12px;
}
.rl-carousel-next {
  right: -25px;
}
.rl-carousel-prev.rl-disabled,
.rl-carousel-next.rl-disabled {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 477px) {
    .rl-carousel-prev.rl-disabled,
    .rl-carousel-next.rl-disabled {
      opacity: 0.85;
    }
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
#rl-review-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;

  /* Overlay fade */
  opacity: 0;
  transition: opacity 0.25s ease;
}
#rl-review-modal.rl-modal--open {
  opacity: 1;
}
.rl-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.rl-modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;

  /* Box scale animation */
  transform: scale(0.92) translateY(12px);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}
#rl-review-modal.rl-modal--open .rl-modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal header */
.rl-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
@media (max-width: 478px) {
  .rl-modal-header {
    gap: 10px;
    padding: 15px 15px 10px;
  }
}
.rl-modal-avatar img,
.rl-modal-avatar-fb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.rl-modal-avatar-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #555;
}
.rl-modal-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: normal;
}
.rl-modal-meta strong {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: normal;
}
@media (max-width: 478px) {
  .rl-modal-meta strong {
    font-size: 1.25rem;
  }
}
.rl-modal-meta span {
  font-size: 1.25rem;
  color: #888;
  line-height: normal;
}
.rl-modal-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #22a06b;
  font-weight: 500;
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: normal;
}
.rl-modal-rating svg {
  color: #22a06b;
}

.rl-modal-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #888;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.rl-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Modal body */
.rl-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
#rl-modal-content {
  font-size: 1.25rem;
  line-height: 1.75;
  color: #333;
  white-space: pre-wrap;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .rl-carousel-prev {
    left: -5px;
  }
  .rl-carousel-next {
    right: -25px;
  }
  .rc-card {
    padding: 16px;
  }
  .rl-modal-box {
    max-height: 90vh;
    border-radius: 12px;
  }
}
@media (max-width: 478px) {
  .rl-carousel-prev,
  .rl-carousel-next {
    top: auto;
    bottom: -60px;
    transform: none;
  }
  .rl-carousel-prev {
    left: calc(50% - 50px);
  }
  .rl-carousel-next {
    right: calc(50% - 50px);
  }
  .rl-modal-body {
    padding: 15px;
  }
}

/* ── Gallery trong card ───────────────────────────────────────────────────── */
.rc-card .rc-gallery {
  margin-top: 8px;
}

/* Override rg-grid: 4 cột, hide ảnh thứ 5+ */
.rc-card .rg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

/* Ẩn ảnh thứ 5 trở đi — chỉ show 4 trong card */
.rc-card .rg-item:nth-child(n + 5) {
  display: none;
}

/* Ảnh thứ 4 là "View All" nếu có nhiều hơn 4 ảnh */
.rc-card .rg-item:nth-child(4) {
  display: block;
}

.rc-card .rg-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  background: #f0f0f0;
}

.rc-card .rg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.rc-card .rg-item:hover img {
  transform: scale(1.05);
}

.rc-card .rg-item--viewall .rg-viewall-label {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 2px;
  pointer-events: none;
}