/* ============================================
   PRODUCT DETAIL CSS - FINAL VERSION (FIXED)
   ============================================ */

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  background: #020617;
  color: #f1f5f9;
  line-height: 1.6;
  overflow-x: hidden;
  font-family: system-ui, 'Segoe UI', 'Tahoma', sans-serif;
}

.glass {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}
.glass:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5);
}

.product-detail-wrapper {
  max-width: 1300px;
  margin: 40px auto 80px;
  padding: 0 24px;
}
.breadcrumb {
  margin-bottom: 30px;
  color: #94a3b8;
  font-size: 0.9rem;
}
.breadcrumb a { color: #38bdf8; text-decoration: none; transition: opacity 0.2s; }
.breadcrumb a:hover { opacity: 0.8; }
.breadcrumb span { margin: 0 6px; }

.feedback-message {
  padding: 16px 20px; border-radius: 18px; margin-bottom: 25px; font-weight: 500; text-align: center;
  background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.06);
}
.feedback-message.error { color: #ef4444; }
.feedback-message.success { color: #10b981; }

.product-main {
  display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 60px;
}
.product-image-large {
  flex: 1.2; min-width: 280px; aspect-ratio: 1 / 1; position: relative; border-radius: 28px; overflow: hidden;
}
.product-image-large img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* اسلایدر (در صورت وجود گالری) */
.slider-container { width: 100%; height: 100%; position: relative; }
.slides { display: flex; height: 100%; transition: transform 0.5s ease; will-change: transform; }
.slide { min-width: 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; background: #0f172a; }
.prev, .next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); border: none; color: white;
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all 0.2s; z-index: 10;
}
.prev:hover, .next:hover { background: #38bdf8; transform: translateY(-50%) scale(1.05); color: #0f172a; }
.prev { left: 16px; } .next { right: 16px; }
.dots {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex;
  gap: 10px; background: rgba(0,0,0,0.5); padding: 6px 16px; border-radius: 30px;
  backdrop-filter: blur(4px); z-index: 10;
}
.dot { width: 10px; height: 10px; background: rgba(255,255,255,0.4); border-radius: 50%; cursor: pointer; transition: all 0.2s; }
.dot.active { background: #38bdf8; transform: scale(1.3); box-shadow: 0 0 8px #38bdf8; }

.product-info {
  flex: 1; padding: 32px; display: flex; flex-direction: column; gap: 20px;
}
.product-info h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; line-height: 1.3; color: #f1f5f9; }
.rating-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stars { color: #fbbf24; font-size: 1.3rem; letter-spacing: 2px; }
.price { font-size: 2rem; font-weight: 800; color: #38bdf8; }
.short-desc { color: #cbd5e1; line-height: 1.7; }
.actions { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 10px; }
.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1); border: none; padding: 14px 32px;
  border-radius: 40px; color: white; font-weight: 600; font-size: 1rem; display: inline-flex;
  align-items: center; gap: 10px; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3); }

/* ===== رسانه‌های اضافی (GIF + موزیک) ===== */
.extra-media { display: flex; flex-wrap: wrap; gap: 30px; margin: 40px 0; }
.media-card { flex: 1; min-width: 260px; padding: 20px; border-radius: 28px; background: rgba(15,23,42,0.6); backdrop-filter: blur(10px); transition: transform 0.2s; }
.media-card:hover { transform: translateY(-4px); }
.media-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px; }
.media-header h3 { font-size: 1.3rem; font-weight: 600; color: #f1f5f9; }
.gif-container img { width: 100%; border-radius: 20px; box-shadow: 0 12px 25px -8px black; transition: transform 0.3s; }
.gif-container img:hover { transform: scale(1.02); }

/* ===== پلیر صوتی ===== */
.pro-audio-player { background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(15,23,42,0.8)); border-radius: 24px; padding: 18px 20px; backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.1); transition: all 0.3s; }
.pro-audio-player:hover { border-color: #38bdf8; box-shadow: 0 8px 25px rgba(56,189,248,0.2); }
.player-top { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.player-play-btn { background: #38bdf8; border: none; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; color: #0f172a; box-shadow: 0 2px 10px rgba(56,189,248,0.4); }
.player-play-btn:hover { transform: scale(1.05); background: #6366f1; color: white; }
.player-track-info { flex: 1; }
.track-name { font-weight: 700; font-size: 1rem; color: #f1f5f9; }
.player-time { font-family: monospace; font-size: 0.85rem; background: rgba(0,0,0,0.5); padding: 4px 12px; border-radius: 30px; letter-spacing: 1px; }
.player-progress-container { margin: 12px 0 15px; }
.player-progress-bar { height: 6px; background: #334155; border-radius: 10px; cursor: pointer; position: relative; overflow: visible; touch-action: none; }
.player-buffer-fill { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: rgba(255,255,255,0.15); border-radius: 10px; z-index: 0; transition: width 0.2s ease; }
.player-progress-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: linear-gradient(90deg, #38bdf8, #6366f1); border-radius: 10px; transition: width 0.1s linear; z-index: 1; }
.player-progress-fill::after { content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; background: #fff; border: 2px solid #38bdf8; border-radius: 50%; box-shadow: 0 0 6px rgba(56,189,248,0.6); z-index: 3; transition: transform 0.1s, box-shadow 0.1s; pointer-events: none; }
.player-progress-bar:hover .player-progress-fill::after { transform: translateY(-50%) scale(1.2); box-shadow: 0 0 10px rgba(56,189,248,0.8); }
.player-seek-tooltip { position: absolute; bottom: 120%; left: 0; transform: translateX(-50%); background: #0f172a; color: #f1f5f9; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-family: monospace; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.player-seek-tooltip.visible { opacity: 1; }
.player-controls-bottom { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.player-volume-wrap { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.4); padding: 5px 12px; border-radius: 40px; }
.player-volume-btn { background: none; border: none; color: white; cursor: pointer; display: flex; align-items: center; }
.player-volume-slider { width: 80px; cursor: pointer; background: #334155; height: 4px; border-radius: 5px; -webkit-appearance: none; }
.player-volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #38bdf8; border-radius: 50%; cursor: pointer; }
.player-download-btn { background: rgba(255,255,255,0.1); border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #cbd5e1; transition: 0.2s; }
.player-download-btn:hover { background: #38bdf8; color: #0f172a; }

/* ===== تب‌ها ===== */
.tabs {
  display: flex; gap: 8px; margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); flex-wrap: wrap;
}
.tab-btn {
  padding: 12px 24px; background: transparent; border: none; color: #cbd5e1;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border-bottom: 3px solid transparent; transition: all 0.2s;
  display: flex; align-items: center; gap: 8px;
}
.tab-btn .material-icons { font-size: 1.2rem; }
.tab-btn.active { color: #38bdf8; border-bottom-color: #38bdf8; }
.tab-btn:hover:not(.active) { color: #f1f5f9; background: rgba(255, 255, 255, 0.05); }

.tab-content {
  display: block !important;  /* همیشه block باشد، مگر با کلاس hidden مخفی شود */
}
.tab-content:not(.active) {
  display: none !important;
}
.tab-content.active {
  display: block !important;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.content-card { padding: 30px; border-radius: 28px; line-height: 1.8; }
.content-card h3 { font-size: 1.5rem; margin-bottom: 20px; color: #38bdf8; }
.content-card p { color: #cbd5e1; }

/* ===== نظرات ===== */
.review-item { border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 20px 0; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.review-header strong { color: #f1f5f9; }
.review-date { color: #94a3b8; font-size: 0.8rem; }
.review-comment { margin-top: 8px; color: #cbd5e1; }
.no-reviews { text-align: center; padding: 30px; color: #94a3b8; }
.review-form-wrapper { margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 30px; }
.review-form-wrapper h4 { font-size: 1.3rem; margin-bottom: 15px; color: #f1f5f9; }
.custom-star-rating { margin: 20px 0 15px; }
.rating-label { display: block; margin-bottom: 10px; font-weight: 600; color: #cbd5e1; }
.stars-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 12px; }
.stars-input input { display: none; }
.stars-input label { font-size: 32px; color: #475569; cursor: pointer; transition: all 0.2s; line-height: 1; }
.stars-input label:hover,
.stars-input label:hover ~ label,
.stars-input input:checked ~ label { color: #fbbf24; transform: scale(1.1); }
textarea { width: 100%; padding: 14px 16px; background: #1e293b; border: 1px solid #334155; border-radius: 20px; color: #f1f5f9; font-family: inherit; font-size: 1rem; resize: vertical; transition: border 0.2s, box-shadow 0.2s; }
textarea:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
.login-prompt { text-align: center; padding: 20px; background: rgba(15, 23, 42, 0.7); border-radius: 18px; margin-top: 20px; }

/* ===== دانلود ===== */
.download-section { margin: 50px 0 30px; text-align: center; }
.download-box { background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(12px); padding: 25px 35px; border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.06); display: inline-block; width: 100%; max-width: 500px; }
.download-box h3 { font-size: 1.5rem; margin-bottom: 10px; color: #38bdf8; display: flex; align-items: center; justify-content: center; gap: 8px; }
.download-link-btn { background: linear-gradient(135deg, #10b981, #059669); color: white; padding: 14px 28px; border-radius: 40px; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 12px; transition: all 0.2s; margin-top: 15px; }
.download-link-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3); }

/* ===== محصولات مرتبط ===== */
.related-section { margin-top: 60px; display: block !important; }
.related-section h2 { font-size: 1.8rem; margin-bottom: 25px; text-align: center; color: #f1f5f9; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 25px; }
.related-card { text-align: center; padding: 18px; border-radius: 24px; transition: all 0.2s; text-decoration: none; color: inherit; display: block; }
.related-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 16px; margin-bottom: 12px; }
.related-card h4 { font-size: 1rem; margin-bottom: 6px; color: #f1f5f9; }
.related-card p { color: #38bdf8; font-weight: 600; }
.related-card:hover { transform: translateY(-6px); border-color: #38bdf8; }

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px; width: 52px; height: 52px;
  background: #38bdf8; border: none; border-radius: 50%; color: #0f172a;
  cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3); z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); background: #6366f1; color: white; }

/* ===== Reveal ===== */
.reveal { opacity: 0; transition: all 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1); }
.reveal.fade-up { transform: translateY(35px); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== Responsive (موبایل) ========== */
@media (max-width: 860px) {
  .product-detail-wrapper { padding: 0 16px; margin-top: 20px; }
  .product-main { flex-direction: column; gap: 24px; }
  .product-image-large { max-width: 100%; aspect-ratio: 1/1; }
  .prev, .next { width: 36px; height: 36px; }
  .prev { left: 10px; } .next { right: 10px; }
  .dots { gap: 6px; padding: 4px 12px; bottom: 12px; }
  .dot { width: 8px; height: 8px; }
  .product-info { padding: 20px; }
  .btn-primary { padding: 12px 20px; font-size: 0.9rem; }
  .extra-media { flex-direction: column; gap: 20px; }
  .player-top { flex-direction: column; align-items: stretch; text-align: center; }
  .player-time { align-self: center; }
  .player-controls-bottom { justify-content: center; }
  .player-volume-wrap { order: 1; }
  .player-download-btn { order: 2; }
  .tabs { justify-content: center; }
  .tab-btn { padding: 8px 16px; font-size: 0.85rem; }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
  .back-to-top { width: 44px; height: 44px; bottom: 20px; right: 20px; }
  .glass, .media-card, .download-box { backdrop-filter: none !important; background: #1e293b !important; }
  .glass:hover, .related-card:hover, .btn-primary:hover, .download-link-btn:hover { transform: none; box-shadow: none; }
}

@media (max-width: 480px) {
  .product-info h1 { font-size: 1.4rem; }
  .price { font-size: 1.6rem; }
  .stars { font-size: 1rem; }
  .tab-btn { padding: 6px 12px; font-size: 0.75rem; }
  .content-card { padding: 20px; }
  .player-volume-slider { width: 60px; }
}