/* GlassCase gallery — cleaned & fixed */

/* Box sizing reset */
.glass-case,
.glass-case *,
.glass-case *::before,
.glass-case *::after {
  box-sizing: border-box !important;
}

/* Root */
.glass-case { position: relative; padding: 0; margin: 0; border: 0; }

/* Display area and container */
.gc-display-area {
  position: absolute;
  overflow: hidden;
  border: 1px solid #EBEBEB;
  padding: 2px;
  background-color: #fff;
}
.gc-display-container {
  position: relative;
  overflow: hidden;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}
.gc-display-display {
  position: relative;
  height: 100%;
  width: 100%;
  max-height: 100%;
  max-width: 100%;
  cursor: crosshair;
  opacity: 1;
}

/* Lens */
.gc-lens {
  position: absolute;
  overflow: hidden;
  z-index: 1000;
  cursor: crosshair;
  background: #CECECE;
  opacity: .5 !important;
  -ms-filter: "alpha(Opacity=50)";
  filter: alpha(opacity=50) !important;
  -moz-opacity: .5;
  -khtml-opacity: .5;
}

/* Zoom */
.gc-zoom {
  position: absolute;
  overflow: hidden; /* FIX */
  width: 100%;
  height: auto;
  z-index: 1040 !important;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #fff;
}
.gc-zoom-inner {
  cursor: crosshair;
  border: 0 !important;
  left: -2px !important;
  top: -2px !important;
  margin: 0 !important;
  z-index: 1010 !important;
}
.gc-zoom-container {
  position: relative;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}
.gc-zoom-container img { position: relative; max-width: none !important; }

/* Caption */
.gc-caption-container {
  position: absolute;
  overflow: hidden;
  width: 100%;
  padding: 2px;
  z-index: 1050 !important;
  background-color: rgba(255,255,255,.5);
  line-height: 1.6;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  color: #333;
  font-size: .9em;
}
.gc-caption-container div { position: relative; padding: 0 12px; }
.gc-caption-intop { left: 0; top: 0; }
.gc-caption-inbottom { left: 0; bottom: 0; }
.gc-caption-outtop,
.gc-caption-outbottom {
  width: 100%;
  border: 2px solid #7f7f7f;
  background: #fff;
}
.gc-caption-outtop   { top: 0;    left: -2px; transform: translate(0, -100%); }
.gc-caption-outbottom{ bottom: 0; left: -2px; transform: translate(0,  100%); }

/* Alignment helpers */
.gc-alignment-center { text-align: center; }
.gc-alignment-left   { text-align: left; }
.gc-alignment-right  { text-align: right; }

/* Thumbs area */
.gc-thumbs-area { position: absolute; overflow: hidden; background-color: transparent; }
.gc-thumbs-area-prev,
.gc-thumbs-area-next { position: absolute; z-index: 1010; }

.gc-thumbs-area.gc-hz .gc-thumbs-area-prev { top: 0; left: 0; height: 100%; min-height: 100%; width: 5%; }
.gc-thumbs-area.gc-hz .gc-thumbs-area-next { top: 0; right: 0; height: 100%; min-height: 100%; width: 5%; }

.gc-thumbs-area.gc-vt .gc-thumbs-area-prev { left: 0; top: 0;    width: 100%; min-width: 100%; height: 5%; }
.gc-thumbs-area.gc-vt .gc-thumbs-area-next { left: 0; bottom: 0; width: 100%; min-width: 100%; height: 5%; }

.gc-thumbs-area-prev:hover,
.gc-thumbs-area-next:hover { opacity: 1; cursor: pointer; }

.gc-thumbs-area-next .gc-disabled,
.gc-thumbs-area-prev .gc-disabled,
.gc-thumbs-area-next .gc-disabled:hover,
.gc-thumbs-area-prev .gc-disabled:hover {
  opacity: .3;
  -ms-filter: "alpha(Opacity=30)";
  filter: alpha(opacity=30);
  -moz-opacity: .3;
  -khtml-opacity: .3;
  cursor: default;
}

/* Thumbs list */
.glass-case ul {
  position: relative;
  top: 0; left: 0;
  margin: 0; border: 0; padding: 0;
  height: 100%;
  list-style: none;
}
.glass-case ul li {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border: 1px solid #EBEBEB;
  padding: 2px;
  background-color: #fff;
}
.gc-thumbs-area.gc-hz li { display: inline; float: left; max-width: 100%; max-height: 100%; margin-right: 5px; }
.gc-thumbs-area.gc-vt li { margin-bottom: 5px; }
.glass-case ul li .gc-li-display-container { position: relative; overflow: hidden; height: 100%; width: 100%; display: inline-block; }
.glass-case ul li:hover { border-color: #4f4f4f; cursor: pointer; }
.glass-case ul li.gc-active,
.glass-case ul li.gc-active:hover { border-color: #000; cursor: default; }
.glass-case ul li .gc-li-display-container img { position: relative; top: 50%; left: 50%; }

/* Overlay */
.gc-overlay-area {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2147483647 !important;
  background-color: rgba(51,51,51,.95);
}
.gc-overlay-gcontainer { position: relative; width: 100%; height: 100%; padding: 0; }
.gc-overlay-container { position: relative; overflow: auto; width: 100%; height: 100%; padding: 0; }
.gc-overlay-container-display { position: absolute; overflow: auto; width: 100%; height: 100%; padding: 0; }
.gc-ocd-top { top: 0; } .gc-ocd-bottom { bottom: 0; }
.gc-overlay-fit { padding: 4em 5.5em 1em; overflow: hidden; }
.gc-overlay-display { position: relative; top: 0; left: 0; display: block; cursor: crosshair; }
.gc-overlay-display-center  { max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.gc-overlay-display-vcenter { top: 50%; transform: translateY(-50%); }
.gc-overlay-display-hcenter { left: 50%; transform: translateX(-50%); }

/* Icons */
.gc-icon {
  font-family: "FontAwesome";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: absolute;
  z-index: 1020;
  cursor: pointer;
  color: #000;
  height: 1em; width: 1em; line-height: 0;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,.1);
  opacity: .9;
}
.gc-icon:before { line-height: 1; }
.gc-icon:hover { opacity: 1; }
.gc-disabled .gc-icon,
.gc-disabled .gc-icon:hover { opacity: .1; cursor: default; }

.gc-icon-next { top: 50%; right: 5px; display: flex; align-items: center; justify-content: center; }
.gc-icon-next:before { content: "\f105"; }
.gc-icon-next-vt {
  bottom: 0; left: 50%; width: 110%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 26px rgba(0,0,0,.3); border-bottom: 1px solid #DDD;
}
.gc-icon-next-vt:before { position: absolute; content: "\f107"; }
.gc-display-area .gc-icon-next { font-size: 2em !important; }
.gc-thumbs-area-next .gc-icon-next { right: 0; font-size: 2em !important; }
.gc-thumbs-area-next .gc-icon-next-vt { font-size: 1.5em !important; }
.gc-overlay-area .gc-icon-next {
  position: relative; right: 0; font-size: 30px;
  background-color: transparent; color: #fff; box-shadow: none !important;
  width: 50px; opacity: 1 !important; height: 35px; border-radius: 100px;
}
.gc-overlay-area .gc-icon-next:before { padding-left: 12px; margin-top: -4px; }

.gc-icon-prev { top: 50%; left: 5px; display: flex; align-items: center; justify-content: center; }
.gc-icon-prev:before { position: absolute; top: 0; left: 10px; content: "\f104"; }
.gc-icon-prev-vt {
  top: 0; left: 55%; width: 110%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 26px rgba(0,0,0,.3); border-top: 1px solid #DDD;
}
.gc-icon-prev-vt:before { position: absolute; content: "\f106"; }
.gc-thumbs-area-prev { margin-left: -5px !important; }
.gc-display-area .gc-icon-prev,
.gc-thumbs-area-prev .gc-icon-prev { font-size: 2em !important; }
.gc-thumbs-area-prev .gc-icon-prev-vt { font-size: 1.5em !important; }
.gc-overlay-area .gc-icon-prev {
  position: relative; left: 0; font-size: 30px;
  background-color: transparent; color: #fff; box-shadow: none !important;
  width: 50px; opacity: 1 !important; height: 35px; border-radius: 100px;
}
.gc-overlay-area .gc-icon-prev:before { padding-left: 8px; }

.gc-icon-download { display: none !important; }
.gc-icon-download:before { position: absolute; top: -4px; left: -2px; content: "\e064"; }
.gc-icon-close   { position: relative; font-size: 25px; float: right; display: flex; align-items: center; justify-content: center; background-color: transparent; color: #fff; }
.gc-icon-close:before { position: absolute; content: "\f00d"; }
.gc-icon-enlarge { position: relative; float: right; margin-right: .25em; font-size: 25px; display: flex; align-items: center; justify-content: center; background-color: transparent; color: #fff; }
.gc-icon-enlarge:before { position: absolute; content: "\f065"; }
.gc-icon-compress { position: relative; float: right; margin-right: .25em; font-size: 25px; display: flex; align-items: center; justify-content: center; background-color: transparent; color: #fff; }
.gc-icon-compress:before { position: absolute; content: "\f066"; } /* FIX */

.gc-loading {
  position: absolute; top: 50%; left: 50%;
  width: 31px; height: 31px; margin-left: -15px; margin-top: -15px;
  background-image: url(../images/loader.gif);
}
.gc-loading3 {
  position: absolute; top: 50%; left: 50%;
  margin-left: -15px; margin-top: -15px;
  font-size: .25em; text-indent: -9999em;
  border-top: 1.1em solid rgba(102,153,102,.2);
  border-right: 1.1em solid rgba(102,153,102,.2);
  border-bottom: 1.1em solid rgba(102,153,102,.2);
  border-left: 1.1em solid #696;
  animation: loadGC 1.1s infinite linear;
}
.gc-loading3, .gc-loading3:after { border-radius: 50%; width: 30px; height: 30px; }

@keyframes loadGC {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utilities */
.gc-hide    { display: none; z-index: 0; opacity: 0; }
.gc-noscroll{ overflow: hidden; }
.gc-start   { display: none; z-index: 0; opacity: 0; }

/* عزل ويدجت الصور عن RTL بدون العبث بحسابات التحريك */
html[dir="rtl"] .glass-case { direction: ltr !important; }
html[dir="rtl"] .glass-case * { direction: ltr !important; }

/* ثبّت اتجاه المصغرات كذلك (إن وُجدت) */
html[dir="rtl"] .gc-thumbs-area,
html[dir="rtl"] .gc-thumbs-container { direction: ltr !important; }

/* لا تغيّر مواضع أو تحويلات الويدجت الداخلية - اتركها للسكربت */
html[dir="rtl"] .gc-display-container,
html[dir="rtl"] .gc-display-display,
html[dir="rtl"] .gc-display-display img {
  max-width: 100% !important;
  max-height: 100% !important;
}
/* اجعل نافذة الزوم تظهر يسار الصورة عند RTL */
html[dir="rtl"] .glass-case { overflow: visible !important; } /* كي لا يُقص الزوم */

html[dir="rtl"] .glass-case .gc-zoom,
html[dir="rtl"] .glass-case .gc-zoom-wrap,
html[dir="rtl"] .glass-case .gc-zoom-window {
  left: auto !important;                 /* ألغِ الوضع الافتراضي (يمين الصورة) */
  right: calc(100% + 12px) !important;   /* ضعها يسار الصورة مع هامش بسيط */
  top: 0 !important;
}

/* لو كان السكربت يضيف margin-left ديناميكيًا، عطّله في RTL */
html[dir="rtl"] .glass-case .gc-zoom[style*="margin-left"],
html[dir="rtl"] .glass-case .gc-zoom-wrap[style*="margin-left"] {
  margin-left: 0 !important;
}

/* على الشاشات الصغيرة: خَف الزوم الخارجي كي لا يخرج من العرض */
@media (max-width: 992px) {
  html[dir="rtl"] .glass-case .gc-zoom,
  html[dir="rtl"] .glass-case .gc-zoom-wrap,
  html[dir="rtl"] .glass-case .gc-zoom-window {
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;  /* اجعله يملأ الإطار فوق الصورة */
  }
}
