body {
    font-family:Arial,Helvetica,sans-serif;
    direction: rtl;
}
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    touch-action: pan-x pan-y; /* חוסם pinch-zoom בכל הדף */
}


.container-fluid{
    height: 50px;
    margin-top: 100px;
}
@media(max-width: 994px){
    .container-fluid{
        height: 50px;
        margin-top: 50px;
    }
}



.gallery {
    width: 100%;
    overflow: hidden;
}

.gallery-wrapper {
    display: flex;
    flex-direction: column;
}

.dress-pair {
    direction: rtl !important;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.image-wrapper {
    max-width: 100vw; /* כל תמונה תופסת 100% מהקונטיינר שלה */
    height: 80vh; /* קובע את הגובה כאן */
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding-bottom: 0.5%;
}

@media (min-width: 994px) {
    .gallery-wrapper {
        display: grid;
        grid-template-columns: repeat(1, 1fr); /* שתי שמלות בשורה */
        gap: 0 px;
    }

    .dress-pair {
        display: flex;
        flex-direction: row;
        overflow-x: hidden;
    }

    .image-wrapper {
        min-width: 50%;
        height: auto;
        max-height: 150vh;
    }
    .image-wrapper img {
        padding: 0 0.2% 0.2% 0.2%;
    }
}


#back-to-top {
    position: fixed;
    bottom: 20px; /* מעל כפתור החזרה מהגלריה */
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(49, 48, 47, 0.114);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: none; /* מוסתר כברירת מחדל */
    z-index: 9999;
    transition: opacity 0.3s ease-in-out;
    text-align: center; /* יישור החץ למרכז */
    padding: 0; /* הסרת ריפוד מיותר */
    line-height: 50px; /* זהה לגובה הכפתור, למרכז אנכי */
}

#back-to-top:hover {
    color:#4b4942a8;
    background: rgba(255, 255, 255, 0.9); /* רקע כהה חצי-שקוף */
}

@media(max-width: 994px){
    #back-to-top{
        bottom: 20px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
        line-height: 40px; /* מרכז אנכית את החץ גם בטלפון */
        
    }
}



@media (min-width: 994px) {
    .image-wrapper {
        position: relative;
        overflow: hidden;
    }

    .image-wrapper::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: white;
        opacity: 0.6; /* כמה לבן */
        transition: opacity 0.5s ease;
        z-index: 2; /* מעל התמונה */
    }

    evening-gallery .image-wrapper::before{
        background: rgba(255, 255, 255, 0.388);
        opacity: 0.6; /* כמה לבן */
    }

    .image-wrapper:hover::before {
        opacity: 0; /* כשעוברים עם העכבר */
    }

    .image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: relative;
        z-index: 1;
    }
}




.pair { position: relative; }

/* הסקולר עצמו נשאר כמו שהיה (עם overflow-x) */
.dress-pair {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* הנקודות מעל הכל, ממורכזות, לא חוסמות החלקה */
.dots-container {
    direction: rtl;
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background-color .3s, transform .3s;
}
.dot.active { background: #fff; transform: scale(1.3); }

/* אם לא רוצים נקודות בדסקטופ */
@media (min-width: 995px) { .dots-container { display: none; } }




/* --- בסיס: עטיפת pair לא שוברת מבנה --- */
.pair { 
  position: relative; 
  width: 100%;
}

/* ה-scroller בפנים נשאר 100% רוחב */
.pair > .dress-pair {
  width: 100%;
}

/* --- מובייל: גלילה אופקית של תמונה-תמונה --- */
@media (max-width: 994px) {
  .pair > .dress-pair {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    direction: ltr;          /* כדי שתמיד נתחיל מהתמונה הראשונה */
    scroll-snap-stop: always;
  }

  .pair > .dress-pair .image-wrapper {
    flex: 0 0 100%;
    max-width: 100%;
    height: 80vh;            /* כמו שהיה לך */
    scroll-snap-align: start;
  }

  /* הנקודות נשארות צפות במובייל */
  .pair .dots-container {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
  }
}

/* --- דסקטופ: בדיוק כמו המבנה הישן --- */
@media (min-width: 995px) {
  /* הגלריה נשארת כמו שהייתה – אפשר להשאיר grid או block.
     אם grid עשה בעיות – בטל אותו: */
  /* .gallery-wrapper { display: block; } */

  .pair > .dress-pair {
    display: flex;           /* שתי תמונות זו ליד זו */
    flex-direction: row;
    overflow-x: hidden;      /* אין גלילה בדסקטופ */
  }

  .pair > .dress-pair .image-wrapper {
    flex: 0 0 50%;
    max-width: 50%;
    height: auto;
    max-height: 150vh;
  }

  .pair > .dress-pair .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0 0.2% 0.2% 0.2%;
  }

  /* מסתירים נקודות בדסקטופ (כמו שהיה קודם) */
  .pair .dots-container { display: none; }
}



.pagination {
    position: fixed;           /* כדי שיצוף */
    bottom: 10px;              /* מרחק מהחלק התחתון */
    transform: translateX(-50%);
    left: 50%;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;

    background-color: rgba(171, 161, 142, 0.708);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        backdrop-filter: blur(2px);       /* אפקט יוקרתי */
    border-radius: 4px;
    z-index: 500;                    /* מעל כל התמונות */

    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}



.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 10px;
    margin:auto;
    background-color: rgba(180, 163, 136, 0);
    border-radius: 4px, 4px, 4px, 4px;
    color: #ffffff;
    text-decoration: none;
    font-size: 25px !important;
    transition: 0.3s ease;
    font-weight: 400;
}

.pagination a:hover {
    background-color: rgba(236, 231, 219, 0.751);
    color: white;
}

.pagination .active {
    background-color: rgba(236, 231, 219, 0.751);
    color: white;
    cursor: default;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}


/* padding-top לזוג ראשון – מובייל בלבד */
@media (max-width: 994px) {
  .pair--first {
    padding-top: 50px;
  }
}

/* ============================
   LIGHTBOX
   ============================ */
#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
#lb-overlay.open {
  display: flex;
}

/* כפתור סגירה */
#lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  z-index: 100001;
  opacity: 0.8;
  transition: opacity 0.2s;
}
#lb-close:hover { opacity: 1; }

/* חצי דפדוף */
#lb-prev,
#lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 60px;
  line-height: 1;
  cursor: pointer;
  z-index: 100001;
  opacity: 0.6;
  padding: 0 12px;
  transition: opacity 0.2s;
  user-select: none;
}
#lb-prev { left: 10px; }
#lb-next { right: 10px; }
#lb-prev:hover,
#lb-next:hover { opacity: 1; }

/* אזור התמונה */
#lb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
}

#lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 3px;
  pointer-events: auto;
  transform-origin: center center;
  transition: transform 0.1s ease;
  user-select: none;
  display: block;
  cursor: grab;
}

#lb-img:active {
  cursor: grabbing;
}

/* cursor על הגלריה — רמז שאפשר ללחוץ */
.pair {
  cursor: pointer;
}

@media (max-width: 700px) {
  #lb-prev, #lb-next { font-size: 42px; }
  #lb-img { max-width: 96vw; max-height: 85vh; }
}