/* SECTION */
.mareechi-gallery {
  width: 100%;
  padding: 40px 20px;
  background: #fff;
}

/* FRONTEND UPLOAD */
.frontend-upload {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}
.frontend-upload h3 {
  margin-top: 0;
}
.frontend-upload form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.frontend-upload select,
.frontend-upload input,
.frontend-upload button {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #ddd;
}
.frontend-upload button {
  background: #980711;
  color: #fff;
  border-color: #980711;
  cursor: pointer;
}
.frontend-upload button:hover {
  background: #7a060e;
}
#upload-status {
  font-weight: bold;
}
.reorder-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: #666;
}

/* TABS */
.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.gallery-tabs button {
  padding: 10px 22px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: .3s;
}
.gallery-tabs button.active,
.gallery-tabs button:hover {
  background: #980711;
  border-color: #980711;
  color: #fff;
}

/* GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px;
  justify-content: center;
}

/* IMAGE BOX */
.gallery-item {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: .4s;
}
.gallery-item:hover img {
  transform: scale(1.08);
}

/* ITEM CONTROLS (for editors) */
.item-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  padding: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity .3s;
  z-index: 2;
}
.gallery-item:hover .item-controls {
  opacity: 1;
}
.drag-handle {
  cursor: grab;
  color: #fff;
  font-size: 18px;
  padding: 0 6px;
  user-select: none;
}
.drag-handle:active {
  cursor: grabbing;
}
.item-controls select,
.item-controls button {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
  border: none;
}
.item-controls button.delete-image {
  background: #c0392b;
  color: #fff;
  cursor: pointer;
}

/* Sortable ghost */
.sortable-ghost {
  opacity: 0.4;
}
.sortable-chosen {
  cursor: grabbing;
}

/* HIDE FILTER */
.gallery-item.hide {
  display: none;
}

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.close {
  position: absolute;
  top: 20px;
  right: 35px;
  font-size: 45px;
  color: #fff;
  cursor: pointer;
}
.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 45px;
  color: #fff;
  cursor: pointer;
  padding: 20px;
}
.prev { left: 25px; }
.next { right: 25px; }
.prev:hover,
.next:hover,
.close:hover {
  color: #980711;
}
.image-count {
  position: absolute;
  bottom: 25px;
  color: #fff;
}

/* MOBILE */
@media (max-width: 700px) {
  .gallery-item {
    width: 100%;
    max-width: 340px;
    height: 220px;
  }
  .item-controls {
    opacity: 1;
  }
}
