/* === Product page: horizontal cards ===================================== */

/* Container: grid that wraps; 3 cols desktop, 2 tablet, 1 mobile */
#three-dr-uploader{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;
}
@media (max-width: 1024px){
  #three-dr-uploader{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  #three-dr-uploader{ grid-template-columns:1fr; }
}

/* Card */
#three-dr-uploader .three-dr-slot{
  margin:0; /* was margin-bottom */
  padding:10px;
  border:1px solid #eee;
  border-radius:8px;
  background:#fafafa;
  display:flex;
  flex-direction:column;
}

/* Inside each card: preview above controls for narrow widths */
#three-dr-uploader .three-dr-row{
  display:flex;
  flex-direction:column; /* was row */
  gap:8px;
  align-items:stretch;
}

/* Preview box fills the card width */
#three-dr-uploader .three-dr-thumb{
  width:100%;           /* was 220px */
  height:180px;         /* adjust to taste */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  overflow:hidden;
  background:#fff;
  border:1px dashed #cfd4d9;
  position:relative;
}

#three-dr-uploader .three-dr-thumb img.three-dr-preview{
  max-width:100%;
  max-height:100%;
  height:auto;
  width:auto;
  display:none;
}
#three-dr-uploader .three-dr-placeholder{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6b7280;
  font-size:12px;
}
#three-dr-uploader .three-dr-status{ margin-top:6px; font-size:12px; color:#666; }

/* === Modal (unchanged) =================================================== */
.three-dr-modal{position:fixed;inset:0;display:none;z-index:9999}
.three-dr-modal[aria-hidden="false"]{display:block}
.three-dr-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.three-dr-modal__panel{position:relative;z-index:1;max-width:min(92vw,1100px);max-height:92vh;margin:4vh auto;background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.25);display:flex;flex-direction:column}
.three-dr-modal__header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e5e7eb}
.three-dr-modal__title{font-weight:600}
.three-dr-modal__close{background:transparent;border:0;font-size:28px;line-height:1;cursor:pointer}
.three-dr-modal__body{position:relative;padding:12px 16px;overflow:hidden;display:flex;align-items:center;justify-content:center}
.three-dr-modal__body img{max-width:calc(92vw - 64px);max-height:calc(92vh - 170px);width:auto;height:auto;display:block}
.three-dr-modal__footer{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-top:1px solid #e5e7eb;gap:8px;flex-wrap:wrap}
.three-dr-modal__left,.three-dr-modal__right{display:flex;gap:8px;align-items:center}

/* Hide inline crop UI elements from slots (we only show status + buttons) */
#three-dr-uploader .three-dr-preview{display:block}

.three-dr-status--ok {
  color: #2e7d32; /* green */
  font-weight: 600;
}

.three-dr-status--error {
  color: #c62828; /* red */
  font-weight: 600;
}

/* Inline spinner shown during upload */
.three-dr-spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin: 0 6px 0 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: three-dr-spin 0.8s linear infinite;
  vertical-align: -2px;
}

.is-uploading .three-dr-spinner {
  display: inline-block;
}

@keyframes three-dr-spin {
  to { transform: rotate(360deg); }
}


/* default: hidden (you already have display:none; in your CSS) */

/* show + align when the slot actually has an image */
#three-dr-uploader .three-dr-slot.has-image .three-dr-actions {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  white-space: nowrap;
}
#three-dr-uploader .three-dr-slot.has-image .three-dr-actions .three-dr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  line-height: 1;
  padding: 6px 12px;
}
#three-dr-uploader .three-dr-actions{ display:none; gap:6px; margin-top:8px; } /* JS toggles to block */ 

