@import url("global.css");
@import url("header.css");
:root {
  --gap: 20px;
  --border-radius: 7px;
  --slider-width: 70px;
}

.product-layout {
  display: grid;
  grid-template-columns: 65% 1fr;
  gap: var(--gap);
  padding: 20px 0;
  min-height: 100vh; 
}

.product-details {
  grid-row: span 2;
}

@media (max-width: 899px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
}

.product-imgs {
  position: relative;
  display: flex;
  justify-content: center;
  max-height: 550px;
}

.scroll-container {
  position: absolute;
  left: 0;
  height: 100%;
  width: var(--slider-width);
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

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

.slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
}

.slide-item {
  height: 60px;
  width: 60px;
  opacity: 0.6;
  cursor: pointer;
  border-radius: var(--border-radius);
  scroll-snap-align: start;
}

.slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
  transition: transform 0.2s;
}

.slide-item:hover {
  opacity: 0.9;
}

.active-slide {
  opacity: 1;
  border: 2px solid #000;
}

.active-slide img {
  transform: scale(0.99);
}

.slide-show {
  height: 100%;
  width: calc(80% - var(--slider-width));
  margin-left: var(--slider-width);
}

.slide-show img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius);
  transition: all 0.2s;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0px 1px 3px 0px #0000004d, 0px 4px 8px 3px #00000026;
  cursor: pointer;
  transition: all 0.2s;
}

.next-btn {
  right: 15px;
}

.prev-btn {
  left: calc(15px + var(--slider-width));
}

.carousel-btn:hover,
.favorite-btn:hover {
  background-color: #eaeaea;
}
.carousel-btn .icon,
.favorite-btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn .icon svg {
  width: 24px;
  height: 24px;
  fill: var(--primary-color);
  transition: transform 0.2s;
}

.carousel-btn:active .icon svg {
  transform: scale(0.9);
}

.favorite-btn {
  position: absolute;
  right: 15px;
  top: 15px;
  background-color: white;
  padding: 9px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0px 1px 3px 0px #0000004d, 0px 4px 8px 3px #00000026;
  transition: transform 0.01s cubic-bezier(0.345, 0.115, 0.135, 1.42),
    background-color 0.015s ease-out, box-shadow 0.2s ease-out;
}
.favorite-btn svg {
  width: 23px;
  height: 23px;
  fill: var(--primary-color);
  transition: fill 0.3s;
}
.favorite-btn.active svg {
  fill: red;
}

.favorite-btn:hover {
  box-shadow: 0px 1px 5px 0px #0000004d, 0px 5px 20px 6px #00000026;
  transform: scale(1.03);
}

/* product reviews */

.product-reviews {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
}

/*  Review stars*/
.product-reviews .rev-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  max-height: 19px;
  width: 20.2px;
}
.product-reviews .rev-stars {
  display: flex;
  align-items: center;
  gap: 3.8px;
}
.product-reviews .star {
  background: url("/public/images/icons/star1.png") no-repeat center center;
  background-size: cover;
}
.product-reviews .half-star {
  background: url("/public/images/icons/half-empty.png") no-repeat center center;
  background-size: cover;
}
.product-reviews .empty-star {
  background: url("/public/images/icons/star\(1\).png") no-repeat center center;
  background-size: cover;
}

/* review header */
.product-reviews header {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 2px solid #0e0e0e17;
  padding-bottom: 20px;
}
.product-reviews header h2 {
  letter-spacing: 0.31238px;
  font-size: 24.99px;
  font-weight: 200;
  line-height: 1.2;
  text-align: center;
}

/* Review sort */
.reviews-sort {
  margin-bottom: 18px;
  margin-top: 12px;
  width: fit-content;
  align-self: flex-end;
  position: relative;
  border-radius: 12px 12px 0 0;
}

.comments-sort-button {
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 410;
  display: flex;
  align-items: center;
  position: relative;
  padding: 9px 15px;
  height: 42px;
  z-index: 6;
  color: var(--primary-color);
}

.comments-sort-button::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 50%;
  left: 50%;
  height: 100%;
  width: 100%;
  background-color: #e9e9e9;
  transform: translate(-50%, -50%) scale(0);
  transition: all 0.05s linear;
  border-radius: 24px;
}
.comments-sort-button svg {
  width: 24px;
}
.comments-sort-button:hover::before {
  transform: translate(-50%, -50%) scale(1);
}
.sort-menu {
  width: 100%;
  position: absolute;
  top: 0;
  right: 0;
  padding-top: 42px;
  background-color: white;
  z-index: 2;
  box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 3px 0px,
    rgba(0, 0, 0, 0.15) 0px 4px 8px 3px;
  border-radius: 12px;
  cursor: pointer;
}
.hide {
  display: none;
}
.sort-menu li {
  padding: 12px 18px;
  font-size: 13px;
  transition: all 0.1s linear;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sort-menu li:last-child {
  border-radius: 0 0 12px 12px;
}
.sort-menu li:hover {
  background-color: #eaeaea;
}
.sort-menu li::after {
  content: "";
  background-image: url("/public/images/icons/check.svg");
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: 100%;
  width: 12px;
  height: 12px;
  margin-right: -2px;
  display: none;
}
.sort-menu .checked::after {
  display: block;
}
.sort-menu .checked {
  background-color: #f2f2f2;
}
.product-reviews .reviews-sort .clicked::before {
  display: none;
}
/* reviews cards */
#reviews-cards {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin-bottom: 20px;
}
.review-card {
  padding: 6px 6px 18px 6px;
  border-bottom: 1px solid #0e0e0e2e;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.review-info {
  width: 100%;
}
.review-content {
  letter-spacing: 0.16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  padding-bottom: 4px;
  padding-top: 9px;
}

.purchased-item {
  padding-top: 6px;
}
.purchased-item,
.purchased-item a,
.review-details {
  color: rgb(89, 89, 89);
  letter-spacing: 0.1299px;
  font-size: 14px;
  line-height: 1.6;
}
.purchased-item strong {
  line-height: 1.4;
}
.purchased-item a {
  text-decoration: underline;
  font-weight: 400;
}
.review-owner {
  display: flex;
  align-items: end;
  letter-spacing: 0.1299px;
  font-size: 12.99px;
  font-weight: 400;
  line-height: 1.4;
  color: rgb(89, 89, 89);
  gap: 10px;
  padding-top: 6px;
}
.review-owner img {
  width: 20px;
  height: 20px;
}

/* review summary */
.review-summary {
  text-align: start;
}
.review-recommend {
  font-size: 13px;
  font-weight: 100;
  line-height: 18px;
  color: rgb(89, 89, 89);
  margin: 19px 0 3px;
}
.review-recommend .right {
  color: rgb(75, 196, 109);
  font-size: 14px;
  display: none;
}
.review-recommend .wrong {
  color: rgb(208, 7, 57);
  font-size: 16px;
  display: none;
}
.review-recommend.check .right {
  display: inline;
}
.review-recommend.uncheck .wrong {
  display: inline;
}

.review-details {
  color: black;
  font-weight: 400px;
}
.review-details li {
  margin-top: 6px;
  font-size: 13.6px;
  color: var(--primary-color);
}
.review-details .star {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  background: url("/public/images/icons/star.svg") no-repeat center center;
  background-size: cover;
}
.review-details .count {
  margin-left: 10px;
  margin-right: 3px;
  font-size: 14px;
}

.comment-img{
  display: flex;
}
.comment-img div {
    border: 1px solid #999;
    margin-right: 5px;
    width: 50px;
    height: 50px;
    overflow: hidden;
}
.comment-img div img {
    width: 100%;
    height: 100%;
}

.goods-params table {
    border-color: #efefef;
    color: #999;
    min-width: 30%;
    margin-left: 30px;
    font-size: 12px
}

.goods-params table tr td:first-child {
    width: 100px
}

.goods-params table tr td:nth-child(2) {
    padding-left: 20px
}

.goods-params table td {
    padding: 6px
}

.goods-params {
    display: flex;
    border-bottom: 1px solid #eee;
    margin: 20px 0;
    font-size: 12px;
}

.goods-params span {
    color: #999
}
.ml_10 {
    margin-left: 10px;
    line-height: 28px;
}
.mb_10 {
    margin-bottom: 10px;
}

.product-des h2{
  border-bottom: 2px solid #0e0e0e17;
  padding-bottom: 20px;
  margin: 0;
  letter-spacing: 0.31238px;
  font-size: 24.99px;
  font-weight: 200;
  line-height: 1.2;
}

/* pagination part */
.pagination {
  display: flex;
  align-items: center;
  gap: 12 px;
  justify-content: center;
}
.pagination button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e9e9e9;
  font-weight: 500;
  transition: all 0.1s linear;
}
.pagination button:hover {
  background-color: #d4d4d4;
  border: none;
  box-shadow: none;
}
#next-page,
#prev-page {
  display: flex;
  align-self: center;
  justify-content: center;
}
.pagination svg {
  width: 18px;
}
.pagination .active {
  border: 2px solid var(--primary-color);
}
#next-page:disabled,
#prev-page:disabled {
  cursor: not-allowed;
}
#next-page:disabled:hover,
#prev-page:disabled:hover {
  background-color: #e9e9e9;
}

/* responsive reviews section */
@media (min-width: 640px) {
  .review-card {
    flex-wrap: nowrap;
  }
  .review-summary {
    text-align: end;
  }
  .review-info {
    width: 60%;
  }
  .pagination {
    justify-content: start;
    gap: 6px;
  }
  .review-recommend {
    margin: 0;
    margin-bottom: 18px;
  }
}
