﻿
.scrollable-element {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  
  /* Gradient hint at top/bottom */
  background:
    /* Top fade */
    linear-gradient(white 30%, rgba(255,255,255,0)),
    /* Bottom fade */
    linear-gradient(rgba(255,255,255,0), white 70%) bottom,
    /* Your actual background */
    linear-gradient(white, white) content-box;
  background-repeat: no-repeat;
  background-size: 100% 20px, 100% 20px, 100% 100%;
}

    .containerslider {
      max-width: 960px;
      margin: 20px auto 60px;
      padding: 0 15px;
    }

    /* اسلاید اصلی */
    .slider-main {
      position: relative;
      background: #000;
      border-radius: 8px;
      overflow: hidden;
      user-select: none;
      box-shadow: 0 4px 12px rgb(0 0 0 / 0.2);
      touch-action: pan-y; /* اجازه اسکرول عمودی در موبایل */
    }
    .slider-main .media-wrapper {
      position: relative;
      width: 100%;
      padding-top: 56.25%; /* 16:9 aspect */
      background: #111;
      touch-action: none; /* جلوگیری از رفتار پیش‌فرض مرورگر هنگام swipe */
    }
    .slider-main img,
    .slider-main video,
    .slider-main iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      cursor: pointer;
      background: black;
      border-radius: 8px 8px 0 0;
    }

    /* دکمه‌های ناوبری اصلی */
    .btn-nav-slider {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      color: white;
      background: rgba(0, 0, 0, 0.4);
      border: none;
      font-size: 2rem;
      padding: 10px 14px;
      cursor: pointer;
      border-radius: 50%;
      transition: background 0.3s ease;
      user-select: none;
      z-index: 10;
    }
    .btn-nav-slider:hover {
      background: rgba(0, 0, 0, 0.8);
    }
    .btn-prev-slider {
      right: 10px;
    }
    .btn-next-slider {
      left: 10px;
    }

    /* گالری thumbneilslider */
    .thumbneilslider {
      margin-top: 10px;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 6px;
      scroll-behavior: smooth;
    }
    .thumbneilslider::-webkit-scrollbar {
      height: 8px;
    }
    .thumbneilslider::-webkit-scrollbar-track {
      background: #ddd;
      border-radius: 4px;
    }
    .thumbneilslider::-webkit-scrollbar-thumb {
      background: #888;
      border-radius: 4px;
    }

    .thumbneil {
      flex: 0 0 auto;
      width: 80px;
      height: 45px;
      border-radius: 4px;
      overflow: hidden;
      border: 3px solid transparent;
      cursor: pointer;
      background: black;
      position: relative;
    }
    .thumbneil video,
    .thumbneil img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .thumbneil.active {
      border-color: #0078d7;
      box-shadow: 0 0 8px #0078d7;
    }

    /* آیکن پلی روی thumbneilslider ویدئو */
    .thumbneil .play-icon {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 24px;
      height: 24px;
      pointer-events: none;
      fill: white;
      opacity: 0.85;
      filter: drop-shadow(0 0 1px black);
    }

    /* واکنش‌گرایی */
    @media (max-width: 720px) {
      .containerslider {
        max-width: 100%;
        margin: 10px auto 50px;
        padding: 0 10px;
      }
      .thumbneilslider {
        gap: 6px;
      }
      .thumbneil {
        width: 60px;
        height: 34px;
      }
      .btn-nav-slider {
        font-size: 1.6rem;
        padding: 8px 10px;
      }
    }
    @media (max-width: 400px) {
      .btn-nav-slider {
        font-size: 1.2rem;
        padding: 6px 8px;
      }
      .thumbneil {
        width: 50px;
        height: 28px;
      }
    }

    /* lightbax تمام صفحه */
    .lightbax {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.95);
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 10000;
      user-select: none;
      overflow: hidden;
    }
    .lightbax.active {
      display: flex;
    }
    .lightbax-content {
      max-width: 90vw;
      max-height: 80vh;
      position: relative;
      border-radius: 8px;
      background: black;
      overflow: hidden;
      box-shadow: 0 0 30px #000;
    }
    .lightbax-content img,
    .lightbax-content video,
    .lightbax-content iframe {
      max-width: 100%;
      max-height: 80vh;
      display: block;
      border-radius: 8px;
      object-fit: contain;
    }
    .lightbax-close {
      position: fixed;
      top: 25px;
      right: 25px;
      font-size: 2.5rem;
      color: white;
      background: rgba(0,0,0,0.3);
      border-radius: 50%;
      width: 44px;
      height: 44px;
      text-align: center;
      line-height: 44px;
      cursor: pointer;
      user-select: none;
      z-index: 1010;
      transition: background 0.3s ease;
    }
    .lightbax-close:hover {
      background: rgba(0,0,0,0.7);
    }
    /* دکمه‌های ناوبری lightbax */
    .lightbax .btn-nav-slider {
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      color: white;
      font-size: 1.5rem;
      background: rgba(0, 0, 0, 0.5);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      line-height: 27px;
      text-align: center;
      user-select: none;
      transition: background 0.3s ease;
      z-index: 1010;
    }
    .lightbax .btn-nav-slider:hover {
      background: rgba(0, 0, 0, 0.85);
    }
    .lightbax .btn-prev-slider {
      right: 30px;
    }
    .lightbax .btn-next-slider {
      left: 30px;
    }

    /* thumbneilslider در lightbax */
    .lightbax-thumbneilslider {
      margin-top: 15px;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 8px;
      max-width: 90vw;
      user-select: none;
      position:absolute;
      bottom:10px;
    }
    .lightbax-thumbneilslider::-webkit-scrollbar {
      height: 8px;
    }
    .lightbax-thumbneilslider::-webkit-scrollbar-track {
      background: #222;
      border-radius: 4px;
    }
    .lightbax-thumbneilslider::-webkit-scrollbar-thumb {
      background: #555;
      border-radius: 4px;
    }
    .lightbax-thumbneil {
      flex: 0 0 auto;
      width: 90px;
      height: 50px;
      border-radius: 5px;
      overflow: hidden;
      border: 3px solid transparent;
      cursor: pointer;
      background: black;
      position: relative;
      transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }
    .lightbax-thumbneil video,
    .lightbax-thumbneil img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .lightbax-thumbneil.active {
      border-color: #0af;
      box-shadow: 0 0 10px #0af;
    }
    .lightbax-thumbneil .play-icon {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 28px;
      height: 28px;
      pointer-events: none;
      fill: white;
      opacity: 0.8;
      filter: drop-shadow(0 0 1px black);
    }

    /* آیکن پلی SVG */
    svg.play-icon {
      display: block;
    }
    



    
/* Lightbox counter and description */
.lightbox-counter {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  /*background: rgba(0, 0, 0, 0.7);*/
  background: rgb(95 92 92 / 70%);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 10;
}

.lightbox-description {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 15px;
  text-align: center;
  font-size: 0.95rem;
  border-radius: 0 0 8px 8px;
  z-index: 10;
}

@media (max-width: 720px) {
  .lightbox-counter {
    font-size: 0.8rem;
    padding: 4px 12px;
  }
  .lightbox-description {
    font-size: 0.85rem;
    padding: 8px 12px;
    position:fixed;
    bottom:80px;    
  }
}
    
    
/* Lightbox cursor and wheel behavior */
.lightbax-content {
  cursor: zoom-out;
}

.lightbax-content:hover {
  cursor: zoom-out;
}

.lightbax .btn-nav,
.lightbax-thumbneils,
.lightbax-thumbneilslider {
  cursor: default;
}

/* Prevent scrolling when lightbox is open */
body.lightbax-open {
  overflow: hidden;
}
    