* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: Tahoma, Arial, sans-serif;
  background: #f4f4f4;
  color: #111827;
  line-height: 1.9;
}

button {
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.breadcrumb {
  font-size: 13px;
  color: #7b7b7b;
  margin-bottom: 28px;
}

/* بخش اول */

.product-section {
  display: flex;
  flex-direction: row-reverse;
  gap: 34px;
  align-items: center;
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.06);
}

.product-info {
  flex: 1.2;
  min-width: 0;
}

.product-info h1 {
  font-size: 27px;
  line-height: 1.7;
  margin-bottom: 18px;
  color: #111827;
}

.meta {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 8px;
}

.description {
  margin-top: 22px;
  color: #374151;
  font-size: 15px;
  text-align: justify;
}

.actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn-cart {
  border: none;
  background: linear-gradient(135deg, #006b45, #008f5b);
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  transition: 0.3s ease;
  box-shadow: 0 14px 30px rgba(0, 107, 69, 0.24);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-cart:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(0, 107, 69, 0.32);
}

.simple-link {
  border: none;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-size: 14px;
}

.simple-link:hover {
  color: #006b45;
}

.product-image-card {
  flex: 0.85;
  min-width: 0;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #eeeeee;
}

.image-zoom-box {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: zoom-in;
  background: #eee;
}

.image-zoom-box img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
  transition: 0.45s ease;
}

.image-zoom-box:hover img {
  transform: scale(1.06);
  filter: brightness(0.88);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 60%);
  color: #fff;
  opacity: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 22px;
  transition: 0.35s ease;
  font-size: 14px;
}

.image-zoom-box:hover .image-overlay {
  opacity: 1;
}

.zoom-icon {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.96);
  color: #333;
  font-size: 23px;
  cursor: pointer;
  transition: 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.zoom-icon:hover {
  background: #006b45;
  color: #fff;
  transform: scale(1.12) rotate(6deg);
}

/* تب‌ها */

.book-tabs-container {
  margin-top: 34px;
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.05);
}

.tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid #edf0f2;
  padding-bottom: 18px;
}

.tabs-header h2 {
  font-size: 22px;
  color: #111827;
  position: relative;
  padding-right: 14px;
}

.tabs-header h2::before {
  content: "";
  width: 4px;
  height: 34px;
  background: #006b45;
  border-radius: 999px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.tabs-buttons {
  display: flex;
  gap: 10px;
  background: #f5f7f6;
  padding: 6px;
  border-radius: 999px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: #5b6472;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.25s ease;
}

.tab-btn:hover {
  color: #006b45;
}

.tab-btn.active {
  background: #006b45;
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 107, 69, 0.22);
}

.tab-panel {
  display: none;
  animation: fadeUp 0.35s ease;
}

.tab-panel.active {
  display: block;
}

.tab-panel h3 {
  font-size: 19px;
  margin-bottom: 14px;
  color: #111827;
}

.tab-panel p {
  color: #4b5563;
  font-size: 15px;
  margin-bottom: 12px;
  text-align: justify;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.spec-item {
  background: #f8fbfa;
  border: 1px solid #e1eee8;
  border-radius: 18px;
  padding: 18px;
}

.spec-item span {
  display: block;
  color: #7b8494;
  font-size: 13px;
  margin-bottom: 6px;
}

.spec-item strong {
  color: #1f2937;
  font-size: 15px;
}

.topics-list {
  padding-right: 22px;
  color: #4b5563;
  font-size: 15px;
}

.topics-list li {
  margin-bottom: 8px;
}

/* امتیازدهی */

.rating-section {
  margin-top: 34px;
  background: #fff;
  border-radius: 24px;
  padding: 34px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 22px;
  margin-bottom: 30px;
  color: #111827;
  border-right: 4px solid #006b45;
  padding-right: 12px;
}

.rating-wrapper {
  display: flex;
  flex-direction: row-reverse;
  gap: 30px;
  align-items: center;
}

.rating-card {
  flex: 1;
}

.user-rating-box {
  flex: 1.2;
}

.user-rating-box {
  background: #fafafa;
  border-radius: 22px;
  padding: 28px;
  border: 1px solid #e8e8e8;
}

.user-rating-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
  text-align: center;
}

.hint {
  color: #777;
  font-size: 14px;
  text-align: center;
  margin-bottom: 20px;
}

.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 9px;
  margin-bottom: 18px;
}

.star {
  width: 49px;
  height: 49px;
  border-radius: 14px;
  border: 1px solid #ddd;
  background: #fff;
  color: #c7c7c7;
  font-size: 27px;
  cursor: pointer;
  transition: 0.25s ease;
}

.star:hover,
.star.active {
  color: #ffc400;
  background: #fff8d7;
  border-color: #ffd54a;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 10px 18px rgba(255, 196, 0, 0.22);
}

.rating-message {
  min-height: 28px;
  font-size: 14px;
  color: #006b45;
  margin-bottom: 20px;
  font-weight: bold;
  text-align: center;
}

.rating-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 58px 1fr 30px;
  gap: 10px;
  align-items: center;
  color: #666;
  font-size: 13px;
}

.bar {
  height: 9px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #006b45, #3ab879);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.rating-card {
  background: linear-gradient(135deg, #f5fff9, #ffffff);
  border: 1px solid #dceee6;
  border-radius: 22px;
  padding: 30px;
  text-align: center;
}

.average-circle {
  width: 125px;
  height: 125px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: conic-gradient(#006b45 0deg, #e6e6e6 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: 0.5s ease;
}

.average-circle::before {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: #fff;
}

.average-number {
  position: relative;
  color: #006b45;
  font-size: 30px;
  font-weight: bold;
}

.vote-count {
  color: #777;
  font-size: 14px;
}

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.86);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 92%;
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  animation: zoomIn 0.35s ease;
}

.close-lightbox {
  position: absolute;
  top: 24px;
  left: 30px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 28px;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #fff;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.86);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* responsive */

@media (max-width: 900px) {
  .page {
    padding: 24px 16px 40px;
  }

  .product-section {
    flex-direction: column;
    padding: 22px;
  }

  .product-image-card {
    order: 1;
    width: 100%;
    max-width: 480px;
    flex: unset;
  }

  .product-info {
    order: 2;
    width: 100%;
    flex: unset;
  }

  .image-zoom-box img {
    height: auto;
  }

  .tabs-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 18px;
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rating-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 18px 12px 32px;
  }

  .breadcrumb {
    font-size: 12px;
  }

  .product-section,
  .book-tabs-container,
  .rating-section {
    border-radius: 18px;
    padding: 18px;
  }

  .product-info h1 {
    font-size: 20px;
  }

  .meta,
  .description {
    font-size: 13px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-cart,
  .simple-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .simple-link {
    background: #f5f5f5;
    padding: 10px 14px;
    border-radius: 999px;
  }

  .tabs-header h2,
  .section-title {
    font-size: 18px;
  }

  .tab-btn {
    width: 100%;
  }

  .specs-grid {
    grid-template-columns: 1fr;
  }

  .star {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .bar-row {
    grid-template-columns: 56px 1fr 26px;
    font-size: 12px;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 14px;
    text-align: center;
  }
}
