/* ============================================================
   چرخ گستر سهند - Gallery Industrial
   نسخه: 1.0 - چرخ‌دنده‌ها + قالی + پیچ و مهره متحرک
   ============================================================ */

:root {
  /* متغیرهای اصلی از hero – در صورت نیاز تکرار می‌شوند */
  --atlas-deep-blue: #0a1a2f;
  --atlas-hero-bg: #060e1a;
  --atlas-gold: #d4af37;
  --atlas-gold-light: #e5c767;
  --atlas-copper: #b87333;
  --atlas-steel: #8b9dc3;
  --atlas-iron-dark: #1a1a2e;
}

.gallery-industrial {
  position: relative;
  min-height: 100vh;
  background: var(--atlas-hero-bg);
  padding: 6rem 2rem;
  overflow: hidden;
  font-family: 'IRANSans', 'Vazirmatn', 'Tahoma', sans-serif;
  isolation: isolate;
}

/* ==================== پس‌زمینه طرح فرش ایرانی ==================== */
.rug-pattern-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='120' height='120' fill='none'/%3E%3Cpath d='M60 10 L70 30 L90 40 L70 50 L60 70 L50 50 L30 40 L50 30 Z' stroke='%23d4af37' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='60' cy='40' r='4' fill='%23d4af37'/%3E%3Ccircle cx='40' cy='60' r='2' fill='%23b87333'/%3E%3Ccircle cx='80' cy='60' r='2' fill='%23b87333'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}

/* ==================== پس‌زمینه چرخ‌دنده‌ها و پیچ‌ها ==================== */
.gears-gallery-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* چرخ‌دنده بزرگ – بالا چپ */
.gear-gallery-big {
  position: absolute;
  top: -80px;
  left: -80px;
  width: 450px;
  height: 450px;
  animation: gearSpinGallery 28s linear infinite;
}

/* چرخ‌دنده متوسط – پایین راست */
.gear-gallery-medium {
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  animation: gearSpinGalleryReverse 18s linear infinite;
}

/* چرخ‌دنده کوچک – وسط بالا */
.gear-gallery-small {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 150px;
  height: 150px;
  animation: gearSpinGallery 12s linear infinite;
}

/* پیچ و مهره‌های شناور */
.bolt {
  position: absolute;
  width: 30px;
  height: 30px;
  animation: boltFloat 5s ease-in-out infinite;
  fill: #c0c8d8;
  opacity: 0.6;
}

.bolt:nth-child(1) {
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}

.bolt:nth-child(2) {
  top: 80%;
  left: 80%;
  animation-delay: 1.5s;
}

.bolt:nth-child(3) {
  top: 50%;
  left: 40%;
  animation-delay: 3s;
}

.bolt:nth-child(4) {
  top: 10%;
  left: 70%;
  animation-delay: 4.5s;
}

.bolt:nth-child(5) {
  top: 75%;
  left: 15%;
  animation-delay: 2s;
}

@keyframes boltFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* انیمیشن‌های چرخش */
@keyframes gearSpinGallery {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes gearSpinGalleryReverse {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

/* ==================== محتوای گالری ==================== */
.gallery-container {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
}

/* سربرگ */
.gallery-header {
  text-align: center;
  margin-bottom: 4rem;
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(212, 175, 55, 0.1);
  color: var(--atlas-gold);
  padding: 0.4rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  letter-spacing: 2px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  margin-bottom: 1.5rem;
  animation: badgePulse 3s ease-in-out infinite;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--atlas-gold);
  border-radius: 50%;
  animation: dotBlink 1.5s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.3);
  }

  50% {
    box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
  }
}

@keyframes dotBlink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.3;
    transform: scale(1.8);
  }
}

.gallery-title {
  color: #fff;
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.gallery-title .gold-text {
  background: linear-gradient(135deg, var(--atlas-gold), var(--atlas-copper));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-subtitle {
  color: #ccd6e0;
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

/* دکمه‌های فیلتر */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  color: #ccd6e0;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.6rem 1.8rem;
  border-radius: 50px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--atlas-gold);
  color: var(--atlas-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--atlas-gold);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* گرید گالری */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
  transition: all 0.5s ease;
}

.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 175, 55, 0.15);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.2);
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-8px);
  border-color: var(--atlas-gold);
  box-shadow: 0 20px 40px rgba(212, 175, 55, 0.3),
    0 0 30px rgba(212, 175, 55, 0.1) inset;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  filter: brightness(0.85);
}

.gallery-item:hover img {
  transform: scale(1.1);
  filter: brightness(1);
}

/* overlay آیتم */
.item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 40%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.item-overlay .zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--atlas-gold);
  font-size: 1.2rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
}

.gallery-item:hover .zoom-icon {
  background: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
}

.item-caption {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.gallery-item:hover .item-caption {
  transform: translateY(0);
}

/* وضعیت مخفی در فیلتر */
.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

/* ==================== لایت باکس ==================== */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 5, 15, 0.98);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.gallery-lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.lightbox-caption {
  color: #ccd6e0;
  margin-top: 1.5rem;
  font-size: 1rem;
  text-align: center;
  direction: rtl;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--atlas-gold);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-size: 1.3rem;
  z-index: 10001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(212, 175, 55, 0.25);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.lightbox-close {
  top: 25px;
  right: 25px;
}

.lightbox-prev {
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--atlas-gold);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.3rem 1.2rem;
  border-radius: 50px;
  backdrop-filter: blur(4px);
}

/* ==================== اسلایدر سینمایی ==================== */
.gallery-showcase {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  max-height: 900px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  margin-bottom: 4rem;
}

.showcase-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.showcase-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.15);
  transition: opacity 1s cubic-bezier(0.25, 0.8, 0.25, 1), transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}

.showcase-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.showcase-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.showcase-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
}

.showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 3rem;
}

.showcase-content {
  text-align: center;
  max-width: 700px;
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.showcase-badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  color: var(--atlas-gold);
  padding: 0.3rem 1.2rem;
  border-radius: 50px;
  font-size: 0.8rem;
  letter-spacing: 3px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}

.showcase-title {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.showcase-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.showcase-btn {
  padding: 0.7rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.showcase-btn-product {
  background: rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--atlas-gold);
}

.showcase-btn-product:hover {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

/* Progress Bar */
.showcase-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.progress-bar {
  height: 100%;
  background: var(--atlas-gold);
  transition: width 0.1s linear;
}

/* ناوبری */
.showcase-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 3;
}

.showcase-nav:hover {
  background: rgba(212, 175, 55, 0.3);
  border-color: var(--atlas-gold);
  color: var(--atlas-gold);
}

.showcase-prev {
  left: 1.5rem;
}

.showcase-next {
  right: 1.5rem;
}

/* نشانگرها */
.showcase-dots {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.8rem;
  z-index: 3;
}

.showcase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.showcase-dot.active {
  background: var(--atlas-gold);
  border-color: var(--atlas-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  transform: scale(1.3);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .gallery-showcase {
    height: 60vh;
    min-height: 400px;
  }

  .showcase-title {
    font-size: 1.5rem;
  }

  .showcase-nav {
    width: 40px;
    height: 40px;
  }

  .showcase-prev {
    left: 0.5rem;
  }

  .showcase-next {
    right: 0.5rem;
  }
}


/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .gallery-industrial {
    padding: 4rem 1rem;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }

  .filter-buttons {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
  }
}

/* دکمهٔ رفتن به محصول در overlay */
.item-overlay .goto-product-btn {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--atlas-gold);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 3;
}

.item-overlay .goto-product-btn:hover {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
  border-color: var(--atlas-gold-light);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* ==== اصلاحات گالری جدید ==== */
.gallery-gears-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
}

.gallery-gear {
  position: absolute;
}

.gallery-gear-1 {
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  animation: gearSpinSlow 35s linear infinite;
}

.gallery-gear-2 {
  bottom: -120px;
  left: -80px;
  width: 350px;
  height: 350px;
  animation: gearSpinMedium 30s linear infinite reverse;
}

@keyframes gearSpinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes gearSpinMedium {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

.gallery-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gallery-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--atlas-gold);
  border-radius: 50%;
  animation: particleFloat 7s ease-in infinite;
  opacity: 0;
}

@keyframes particleFloat {
  0% {
    transform: translateY(105vh) scale(0);
    opacity: 0;
  }

  20% {
    opacity: 0.8;
  }

  80% {
    opacity: 0.2;
  }

  100% {
    transform: translateY(-10vh) scale(2);
    opacity: 0;
  }
}

/* دکمه‌های فیلتر جدید */
.gallery-filter-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.gallery-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  color: #ccd6e0;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.6rem 1.8rem;
  border-radius: 50px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--atlas-gold);
  color: var(--atlas-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

/* دکمهٔ محصول در overlay */
.gallery-product-btn {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--atlas-gold);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 3;
}

.gallery-product-btn:hover {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
  border-color: var(--atlas-gold-light);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}