:root{
  --rmp-border:#e2e8f0;
  --rmp-dash:#cbd5e1;
  --rmp-bg:#f8fafc;
  --rmp-spinner:#6b7280;
  --rmp-x:#1f2937;
}
.rmp-wrap{margin:14px 0}
.rmp-row{display:flex;gap:16px;flex-wrap:wrap}
.rmp-uploader{width:100%;max-width:360px}
.rmp-drop{
  border:2px dashed var(--rmp-dash);
  border-radius:12px;
  padding:18px;
  text-align:center;
  background:var(--rmp-bg);
  cursor:pointer;
  transition:.2s;
}
.rmp-drop.over{background:#eef2ff;border-color:#a5b4fc}
.rmp-icon{width:36px;height:36px;margin:0 auto 8px;background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="1.5"><rect x="3" y="5" width="18" height="14" rx="2" ry="2"/><circle cx="12" cy="12" r="3"/></svg>') no-repeat center/contain}
.rmp-icon.video{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="1.5"><rect x="3" y="5" width="14" height="14" rx="2"/><polygon points="16,9 21,7 21,17 16,15"/></svg>')}
.rmp-label{font-weight:600;margin-bottom:2px}
.rmp-sub{font-size:12px;color:#64748b}
.rmp-list{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.rmp-tile{
  position:relative;
  width:96px;height:96px;
  border:1px solid var(--rmp-border);
  border-radius:10px; overflow:hidden;
  background:#fff;
  display:flex;align-items:center;justify-content:center;
}
.rmp-tile img,.rmp-tile video{max-width:100%;max-height:100%;display:block}
.rmp-remove{
  position:absolute;top:4px;right:4px;
  width:20px;height:20px;border-radius:50%;
  border:0;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.1);
  font-size:14px;line-height:20px;color:var(--rmp-x);cursor:pointer
}
.rmp-spinner{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
}
.rmp-tile.uploading::after{
  content:''; width:34px;height:34px;border-radius:50%;
  border:3px solid #e5e7eb; border-top-color: var(--rmp-spinner);
  animation:rmp-spin 1s linear infinite; position:absolute;
}
@keyframes rmp-spin{to{transform:rotate(360deg)}}

.rmp-gallery{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.rmp-gallery .rmp-item img{border-radius:8px;border:1px solid var(--rmp-border)}
.rmp-videos .rmp-video{max-width:220px;border-radius:8px;border:1px solid var(--rmp-border);margin:6px 6px 0 0}

/* מצב כפתור שליחה נעול */
.rmp-disabled { opacity: .5 !important; pointer-events: none !important; }

/* טוסט קטן למעלה */
#rmp-toast{
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: #111; color:#fff; padding:10px 14px; border-radius:8px;
  font-size:14px; box-shadow:0 6px 20px rgba(0,0,0,.2);
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  z-index: 99999;
}
#rmp-toast.show{ opacity: 0.97; }

/* מונה ליד כפתור השליחה */
.rmp-counter{ font-size:13px; color:#ff6600; margin-inline-start:8px; }



/* מצב כפתור שליחה נעול */
.rmp-disabled { opacity: .5 !important; pointer-events: none !important; }

/* טוסט */
#rmp-toast{
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: #111; color:#fff; padding:10px 14px; border-radius:8px;
  font-size:14px; box-shadow:0 6px 20px rgba(0,0,0,.2);
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  z-index: 99999;
}
#rmp-toast.show{ opacity: 0.97; }

/* מונה */
.rmp-counter{ font-size:13px; color:#ff6600; margin-inline-start:8px; }

/* יחוס לאריח */
.rmp-tile {
  position: relative !important;
}

/* כפתור X – מיקום קבוע + איפוס השפעות תבנית + מראה עדין */
.rmp-tile .rmp-remove {
  /* מיקום (עם פולי־פיל ל־RTL/LTR) */
  position: absolute !important;
  inset-block-start: 6px !important;  /* top */
  inset-inline-end: 6px !important;   /* right ב-LTR / left ב-RTL */
  top: 6px !important;                /* fallback לדפדפנים ישנים */
  right: 6px !important;
  left: auto !important;

  /* איפוס השפעות תבנית */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  text-indent: 0 !important;
  line-height: 1 !important;

  /* מראה עדין */
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,.5) !important;
  color: #fff !important;
  font-size: 14px !important;
  cursor: pointer !important;
  z-index: 20 !important;

  transition: background .2s ease, transform .2s ease !important;
}

/* אפקט ריחוף */
.rmp-tile .rmp-remove:hover {
  background: rgba(0,0,0,.75) !important;
  transform: scale(1.15);
}

/* ביטול before/after גלובליים של תבניות */
.rmp-tile .rmp-remove::before,
.rmp-tile .rmp-remove::after {
  content: none !important;
}


/* ===== RMP Lightbox — one-column layout (meta under stage) ===== */

#rmp-lightbox{
  position:fixed; inset:0; display:none;
  background:rgba(0,0,0,.9); color:#fff; z-index:99999;
  overscroll-behavior: contain; /* מונע גלילת רקע בדפדפנים תומכים */
}
#rmp-lightbox.open{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}

/* Wrapper column */
#rmp-lightbox .rmp-lb-body{
  display:flex; flex-direction:column; align-items:center; gap:14px;
  max-width:min(1100px,96vw); width:100%; padding:0 12px;
}

/* Stage */
#rmp-lightbox .rmp-lb-stage{
  position:relative; display:flex; align-items:center; justify-content:center;
  max-width:100%;
  min-height:50vh;           /* מייצב גובה ומונע "קפיצות" בין גדלים */
  background:#000;
}
#rmp-lightbox .rmp-lb-media img,
#rmp-lightbox .rmp-lb-media video{
  width:92vw; max-width:100%;
  max-height:76vh;
  object-fit: contain;        /* תצוגה יפה לכל יחס */
  border-radius:8px; box-shadow:0 10px 30px rgba(0,0,0,.35);
  opacity:0; transition: opacity .18s ease-in; /* פייד־אין */
}
#rmp-lightbox .rmp-lb-media.is-ready img,
#rmp-lightbox .rmp-lb-media.is-ready video{ opacity:1; }

/* Arrows — fixed mid-screen */
#rmp-lightbox .rmp-lb-prev,
#rmp-lightbox .rmp-lb-next{
  position:fixed; top:50%; transform:translateY(-50%);
  width:48px; height:48px; border-radius:50%; border:0;
  background:rgba(255,255,255,.18); color:#fff; font-size:22px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 20px rgba(0,0,0,.25); z-index:100001;
}
#rmp-lightbox .rmp-lb-prev{ left:24px; }
#rmp-lightbox .rmp-lb-next{ right:24px; }
#rmp-lightbox .rmp-lb-prev:hover,
#rmp-lightbox .rmp-lb-next:hover{ background:rgba(255,255,255,.28); }

/* RTL: קדימה בשמאל, אחורה בימין */
html[dir="rtl"] #rmp-lightbox .rmp-lb-prev{ right:24px; left:auto; }
html[dir="rtl"] #rmp-lightbox .rmp-lb-next{ left:24px; right:auto; }

/* Counter — top center */
#rmp-lightbox .rmp-lb-counter{
  position:fixed; top:16px; left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,.55); color:#fff; padding:6px 10px; border-radius:999px;
  font-weight:600; z-index:100001; pointer-events:none;
}

/* Close button */
#rmp-lightbox .rmp-lb-close{
  position:fixed; top:18px; right:18px;
  background:rgba(255,255,255,.18); border:0; border-radius:50%;
  width:36px; height:36px; color:#fff; font-size:22px; cursor:pointer; z-index:100001;
}

/* Meta (under the stage) */
#rmp-lightbox .rmp-lb-meta{
  width:100%; max-width:min(1100px,96vw);
  display:flex; flex-direction:column; gap:8px;
  text-align:start;
}
#rmp-lightbox .rmp-lb-head{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
#rmp-lightbox .rmp-lb-title{ font-weight:700; }
#rmp-lightbox .rmp-lb-date{ opacity:.85; font-size:13px; }

#rmp-lightbox .rmp-lb-caption{
  background:rgba(0,0,0,.45);
  border-radius:12px;
  padding:12px 14px;
  white-space:pre-line;
  line-height:1.5;
  /* קיפול ברירת מחדל לטקסטים ארוכים — ניתן להסרה אם לא רוצים */
  max-height: 11.5em; overflow: hidden;
}
#rmp-lightbox .rmp-lb-caption.is-expanded{ max-height:none; }

/* Stars (fill width) */
#rmp-lightbox .rmp-stars-wrap{ position:relative; display:inline-block; line-height:1; }
#rmp-lightbox .rmp-stars-bg,
#rmp-lightbox .rmp-stars-fill{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  letter-spacing:2px; font-size:16px;
}
#rmp-lightbox .rmp-stars-bg{ color:rgba(255,255,255,.25); }
#rmp-lightbox .rmp-stars-fill{
  color:#ffd166; position:absolute; top:0; left:0; white-space:nowrap; overflow:hidden;
}

/* Thumbs strip (current review only) */
#rmp-lightbox .rmp-lb-thumbs{
  display:flex; gap:8px; flex-wrap:wrap; margin-top:6px;
}
#rmp-lightbox .rmp-lb-thumbs button{
  width:70px; height:70px; border-radius:10px; overflow:hidden; border:1px solid rgba(255,255,255,.25);
  background:#111; padding:0; cursor:pointer; opacity:.9;
}
#rmp-lightbox .rmp-lb-thumbs button.is-active{ outline:2px solid #fff; opacity:1; }
#rmp-lightbox .rmp-lb-thumbs img,
#rmp-lightbox .rmp-lb-thumbs video{ width:100%; height:100%; object-fit:cover; }

/* Mobile tweaks */
@media (max-width: 900px){
  #rmp-lightbox .rmp-lb-prev{ left:12px; } 
  #rmp-lightbox .rmp-lb-next{ right:12px; }
  #rmp-lightbox .rmp-lb-counter{ top:10px; }
}
/* במובייל פס התמונות מיותר */
@media (max-width: 800px){
  #rmp-lightbox .rmp-lb-thumbs{ display:none !important; }
}
/* RTL מובייל */
@media (max-width: 900px){
  html[dir="rtl"] #rmp-lightbox .rmp-lb-prev{ right:12px; left:auto; }
  html[dir="rtl"] #rmp-lightbox .rmp-lb-next{ left:12px; right:auto; }
}

.rmp-stars-wrap.rtl .rmp-stars-fill {
  direction: rtl;
  unicode-bidi: bidi-override;
  text-align: right;
}
.rmp-stars-wrap.rtl .rmp-stars-fill {
  direction: rtl;
  unicode-bidi: bidi-override;
  text-align: right;
  left: auto;
  right: 0;
}
