/* slider-reviews.css — 好評推薦 */

.tc-reviews {
  padding: 48px 0;
}

.tc-reviews__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
}

.tc-reviews__card {
  width: 100%;
  min-height: 335px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6.2px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 24px 24px;
  box-sizing: border-box;
  color: #000;
}

.tc-reviews__stars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tc-reviews__star {
  display: none;
}

.tc-reviews__star--filled {
  display: inline-block;
  width: 24px;
  height: 23px;
  background-image: url("../../../assets/images/tc-reviews__star-hard.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  font-size: 0;
  color: transparent;
  line-height: 1;
}

.tc-reviews__content {
  margin: 0;
  color: #000;
  flex: 1;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tc-reviews__images {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tc-reviews__image {
  width: 71px;
  height: 71px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.tc-reviews__divider {
  width: 100%;
  height: 1px;
  border-top: 1px solid #a6a6a6;
}

.tc-reviews__user {
  display: flex;
  align-items: center;
  gap: 13px;
}

.tc-reviews__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.tc-reviews__avatar--placeholder {
  background-color: #d9d9d9;
}

.tc-reviews__user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.tc-reviews__nickname,
.tc-reviews__email,
.tc-reviews__account {
  overflow-wrap: break-word;
  word-break: break-word;
}

.tc-reviews__nickname {
  font-weight: 500;
  color: #000;
}

.tc-reviews__email {
  color: #666;
  font-size: 14px;
}

.tc-reviews__account {
  color: #666;
}

.tc-reviews__empty {
  text-align: center;
  color: #666;
  padding: 32px 0;
  margin: 0;
}

/* ==================== 前台評論表單 ==================== */
.tc-reviews__form {
  width: 100%;
  margin-top: 60px;
  border-radius: 10px;
  border: 1px solid #a3a3a3;
  box-sizing: border-box;
  padding: 28px 34px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #000;
  scroll-margin-top: 180px;
}

.tc-reviews__form-title {
  margin: 0;
  font-weight: 500;
  color: #0b2f53;
}

.tc-reviews__form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tc-reviews__form-row--inline {
  gap: 32px;
}

.tc-reviews__form-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0b2f53;
  font-weight: 500;
  flex-shrink: 0;
}

.tc-reviews__required {
  color: #e31717;
}

.tc-reviews__rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.tc-reviews__rating-star {
  display: inline-flex;
  line-height: 0;
}

.tc-reviews__rating-star input {
  display: none;
}

.tc-reviews__rating-star span {
  display: inline-block;
  width: 24px;
  height: 23px;
  cursor: pointer;
  background-image: url("../../../assets/images/tc-reviews__star.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  font-size: 0;
  color: transparent;
  line-height: 1;
}

.tc-reviews__rating-star:has(input:checked) ~ .tc-reviews__rating-star span,
.tc-reviews__rating-star:has(input:checked) span {
  background-image: url("../../../assets/images/tc-reviews__star-hard.svg");
}

.tc-reviews__rating-input:hover .tc-reviews__rating-star span {
  background-image: url("../../../assets/images/tc-reviews__star.svg");
}

.tc-reviews__rating-input
  .tc-reviews__rating-star:hover
  ~ .tc-reviews__rating-star
  span,
.tc-reviews__rating-input .tc-reviews__rating-star:hover span {
  background-image: url("../../../assets/images/tc-reviews__star-hard.svg");
}

.tc-reviews__form-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-reviews__form-field--full {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.tc-reviews__form-field input[type="text"],
.tc-reviews__form-field input[type="email"] {
  min-height: 33px;
  border-radius: 2px;
  border: 1px solid #d9d9d9;
  padding: 4px 8px;
  box-sizing: border-box;
}

.tc-reviews__form-field input[type="text"] {
  width: 100%;
  max-width: 154px;
}

.tc-reviews__form-field input[type="email"] {
  width: 100%;
  max-width: 240px;
}

.tc-reviews__form-field textarea {
  width: 100%;
  min-height: 101px;
  border-radius: 2px;
  border: 1px solid #d9d9d9;
  padding: 8px 12px;
  box-sizing: border-box;
  resize: vertical;
}

.tc-reviews__form-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.tc-reviews__upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #004dff;
  cursor: pointer;
}

.tc-reviews__upload input[type="file"] {
  display: none;
}

.tc-reviews__consent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tc-reviews__submit {
  min-width: 138px;
  min-height: 44px;
  background-color: #0b2f53;
  color: #fff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.tc-reviews__submit:hover {
  background-color: #1969b9;
}

/* 平板 */
@media (max-width: 992px) {
  .tc-reviews__card {
    padding: 20px;
  }
  .tc-reviews__form-row--inline {
    gap: 16px;
  }
}

/* 手機 */
@media (max-width: 480px) {
  .tc-reviews {
    padding: 32px 0;
  }
  .tc-reviews__card {
    min-height: 0;
    gap: 16px;
    padding: 22px 20px;
    border-radius: 2px;
    max-width: 340px;
    margin: 0 auto;
  }
  .tc-reviews__star--filled {
    width: 20px;
    height: 19px;
  }
  .tc-reviews__content {
    font-size: 15px;
    line-height: 1.75;
  }
  .tc-reviews__images {
    gap: 6px;
    flex-wrap: wrap;
  }
  .tc-reviews__image {
    width: 56px;
    height: 56px;
  }
  .tc-reviews__divider {
    margin: 4px 0;
  }
  .tc-reviews__avatar {
    width: 48px;
    height: 48px;
  }
  .tc-reviews__user {
    gap: 12px;
  }
  .tc-reviews__nickname {
    font-size: 15px;
    line-height: 1.4;
  }
  .tc-reviews__email,
  .tc-reviews__account {
    font-size: 13px;
    line-height: 1.4;
  }
  .tc-reviews__form {
    padding: 20px;
  }
  .tc-reviews__form-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==================== 上傳預覽 + lightbox + 感謝訊息 ==================== */

/* 感謝訊息：上下 margin 對稱（取代原本 inline style 的 margin-bottom only） */
.tc-reviews__success {
  background: #e6f7ec;
  color: #0b6b2a;
  padding: 16px 20px;
  border-radius: 8px;
  margin-top: 60px;
  margin-bottom: 60px;
  font-weight: 500;
  text-align: center;
  scroll-margin-top: 180px;
}

/* 表單上傳區包裝 */
.tc-reviews__upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

/* 上傳預覽容器 */
.tc-reviews__upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tc-reviews__upload-preview[hidden] {
  display: none;
}

/* 預覽單張縮圖容器（含右上角刪除鈕） */
.tc-reviews__upload-item {
  position: relative;
  width: 64px;
  height: 64px;
}

.tc-reviews__upload-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  border: 1px solid #ddd;
}

.tc-reviews__upload-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #b00020;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tc-reviews__upload-remove:hover {
  background: #800015;
}

/* 卡片中的圖片改為按鈕（lightbox 觸發） */
.tc-reviews__image-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
  display: inline-block;
  line-height: 0;
}

.tc-reviews__image-btn:hover .tc-reviews__image {
  opacity: 0.85;
  transform: scale(1.02);
}

.tc-reviews__image-btn .tc-reviews__image {
  transition:
    opacity 0.2s,
    transform 0.2s;
}

/* Lightbox overlay */
.tc-reviews__lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}

.tc-reviews__lightbox[hidden] {
  display: none;
}

.tc-reviews__lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.tc-reviews__lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.tc-reviews__lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
  .tc-reviews__success,
  .tc-reviews__form {
    scroll-margin-top: 60px;
  }

  .tc-reviews__success {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 12px 16px;
    font-size: 14px;
  }

  .tc-reviews__upload-item {
    width: 52px;
    height: 52px;
  }

  .tc-reviews__lightbox {
    padding: 20px;
  }

  .tc-reviews__lightbox-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}
