/* ============================================================
   91LAB — RELATED PRODUCTS CSS  (v2)
   File: template/css/91lab-related-products.css
   ============================================================ */

/* ========== SECTION WRAPPER ========== */
.rp-section {
  background: #000;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding-top: 0;
  margin-top: 60px;
  overflow: visible; /* header lấn ra ngoài được */
  position: relative;
}

/* ========== INNER CONTAINER — giới hạn 1200px ========== */
.rp-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ========== HEADER — lấn lên nửa khung, căn giữa ========== */
.rp-header {
  display: flex;
  justify-content: left;
  position: relative;
  /* Dịch lên 50% chiều cao khối để nửa trên lấn ra ngoài bg đen */
  transform: translateY(-50%);
  margin-bottom: 0;
}

/* Khối xám chứa icon + text */
.rp-header-box {
  background: #a7a9ac;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px 12px 20px;
  position: relative;
}

/* Icon bông hoa — nhô ra góc trên-trái của khối xám */
.rp-asterisk {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: invert(18%) sepia(88%) saturate(5435%) hue-rotate(315deg)
    brightness(97%) contrast(107%);
  animation: rp-rotate 12s linear infinite;
  position: absolute;
  top: -20px;
  left: -20px;
}

@keyframes rp-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rp-title {
  font-size: 28px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  margin: 0 !important;
  letter-spacing: 0.04em;
  padding-left: 14px; /* bù khoảng trống chỗ icon nhô ra */
}

/* Khoảng cách giữa header và slider */
.rp-slider-area {
  padding-top: 20px;
}

/* ========== SLIDER WRAPPER — overflow hidden, không padding ngang ========== */
.rp-slider-wrapper {
  overflow: hidden;
  cursor: grab;
  width: 100%;
}

.rp-slider-wrapper:active {
  cursor: grabbing;
}

/* ========== PRODUCTS GRID ========== */
.rp-products-grid {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease;
  will-change: transform;
}

/* ========== PRODUCT CARD ========== */
/* JS sẽ set flex-basis = cardWidth px, CSS chỉ cần flex-shrink: 0 */
.rp-product-card {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  /* Fallback 4-card layout */
  flex-basis: calc((100% - 60px) / 4);
}

/* Card Inner */
.rp-card-inner {
  position: relative;
  width: 100%;
  height: 310px;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.rp-product-card.flipped .rp-card-inner {
  transform: rotateY(180deg);
}

/* ========== FRONT & BACK SHARED ========== */
.rp-card-front,
.rp-card-back {
  position: absolute;
  width: 100%;
  height: 310px;
  backface-visibility: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* ========== CARD FRONT ========== */
.rp-card-front {
  z-index: 2;
  padding: 20px 10px;
  background: #fff;
  border: 2px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.rp-product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.rp-product-image img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.rp-product-price {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.rp-price-original {
  text-decoration: line-through;
  color: #999;
}

.rp-price-sale {
  color: #ff1f8f;
  font-weight: 600;
}

.rp-price-undetermined {
  font-size: 12px;
  font-weight: 600;
  color: #a7a9ac;
  font-style: italic;
}

.rp-product-info {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rp-detail-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
  position: relative;
  padding-left: 18px;
}

.rp-detail-link i {
  color: #ff1f8f;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.rp-product-name {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  margin: 0;
  text-align: center;
  line-height: 1.2;
  display: inline-block;
}

/* ========== CARD BACK ========== */
.rp-card-back {
  transform: rotateY(180deg);
  background: #f8f9fa;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
}

.rp-card-header {
  text-align: center;
  margin-bottom: 14px;
}

.rp-card-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rp-ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 230px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #ff1f8f #f0f0f0;
}

.rp-ingredients-list::-webkit-scrollbar {
  width: 5px;
}
.rp-ingredients-list::-webkit-scrollbar-track {
  background: #f0f0f0;
}
.rp-ingredients-list::-webkit-scrollbar-thumb {
  background: #ff1f8f;
  border-radius: 3px;
}

.rp-ingredients-list li {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  text-align: left;
  padding-left: 14px;
  position: relative;
}

.rp-ingredients-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: #ff1f8f;
  font-size: 18px;
  line-height: 1.2;
}

/* ========== NAVIGATION ========== */
.rp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 40px;
}

.rp-nav-arrow {
  flex: 1;
  height: 4px;
  background: #ff1f8f;
  position: relative;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.rp-nav-arrow:hover {
  opacity: 0.7;
}

.rp-nav-arrow.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.rp-nav-left::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 15px solid #ff1f8f;
}

.rp-nav-right::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid #ff1f8f;
}

/* Dots */
.rp-nav-dots {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Chưa active: rỗng ruột đen, viền hồng */
.rp-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #ff1f8f;
  cursor: pointer;
  transition:
    background 0.25s,
    transform 0.25s;
  box-sizing: border-box;
}

/* Active: filled hồng */
.rp-nav-dot.active {
  background: #ff1f8f;
  border-color: #ff1f8f;
  transform: scale(1.2);
}

/* ========== BOTTOM MARQUEE — không border-top ========== */
.rp-marquee-wrap {
  width: 100%;
  background: #000;
  padding: 12px 0;
  overflow: hidden;
  /* border-top đã bỏ */
}

.rp-marquee-track {
  display: flex;
  white-space: nowrap;
  animation: rp-marquee 22s linear infinite;
}

.rp-marquee-item {
  font-size: 13px;
  font-weight: 700;
  color: #ff1f8f;
  letter-spacing: 0.08em;
  padding: 0 36px;
  display: inline-block;
  text-transform: uppercase;
}

.rp-sep {
  margin: 0 10px;
  color: #ff1f8f;
}

@keyframes rp-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .rp-inner {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .rp-card-inner,
  .rp-card-front,
  .rp-card-back {
    height: 270px;
  }

  .rp-product-image img {
    width: 110px;
    height: 110px;
  }
  .rp-product-name {
    font-size: 13px;
  }
  .rp-title {
    font-size: 18px;
  }

  .rp-asterisk {
    width: 34px;
    height: 34px;
    top: -14px;
    left: -14px;
  }

  .rp-inner {
    padding: 0 16px;
  }
}
  