.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    color: white;
}

.media-img-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
}

.media-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-actions {
    display: flex;
    flex-wrap: wrap;   /* 🔥 allow wrapping */
    gap: 4px;
    justify-content: flex-start;
}
.primary {
    border: 2px solid #4caf50;
}

.variant-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap; /* 🔥 allows better collapse */
    padding: 15px;
    border-bottom: 1px solid #333;
}

.variant-info {
    width: 180px;
    font-weight: bold;
    color: white;
}

.variant-images-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.image-type-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.image-type-label {
    font-size: 12px;
    color: #aaa;
}

.image-type-content {
    display: flex;
    gap: 6px;
}

/* Smaller cards inside row */
.media-card {
    width: 150px;
}

.media-img-wrapper {
    height: 70px;
}

/* Small dropzone */
.dropzone.small {
    width: 80px;
    height: 70px;
    border: 2px dashed #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

.dropzone.small:hover {
    border-color: #4caf50;
}
.media-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* LEFT (Descriptions) */
.media-left {
    width: 300px;  /* fixed sidebar feel */
}

/* RIGHT (Variants) */
.media-right {
    flex: 1;
}

/* Optional: scroll if long */
.media-right {
    max-height: 80vh;
    overflow-y: auto;
}
.staff-media-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* LEFT SIDE (carousel preview) */
.staff-preview {
    width: 40%;
    min-width: 0;
}

/* RIGHT SIDE (media manager) */
.staff-editor {
    flex: 1;
}

/* Optional: scroll editor independently */
.staff-editor {
    max-height: 90vh;
    overflow-y: auto;
}

/* =========================================
   📱 MOBILE FIXES (MEDIA PAGE)
========================================= */
@media (max-width: 768px) {

  /* 🔥 Stack ALL major layouts */
  .media-layout,
  .staff-media-layout,
  .variant-row {
    flex-direction: column !important;
    gap: 15px;
  }

  /* 🧱 Remove fixed widths */
  .media-left,
  .staff-preview,
  .variant-info {
    width: 100% !important;
    min-width: unset !important;
  }

  /* 📦 Grid becomes responsive */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  /* 🖼 Cards scale properly */
  .media-card {
    width: 100%;
  }

  /* 🖼 Image sizing */
  .media-img-wrapper {
    height: 100px;
  }

  /* 🎯 Actions easier to tap */
  .media-actions {
    justify-content: space-between;
  }

  .media-actions button,
  .media-actions .btn {
    flex: 1 1 auto;
    font-size: 14px;
    padding: 6px;
  }

  /* 🧾 Variant image rows wrap nicely */
  .variant-images-row {
    justify-content: space-between;
  }

  .image-type-column {
    width: 48%;
  }

  /* 📦 Dropzone usability */
  .dropzone.small {
    width: 100%;
    height: 80px;
    font-size: 20px;
  }

  /* 📜 Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }
}