.rdv-collage{width:100%;}
.rdv-card{border:1px solid rgba(0,0,0,.08);border-radius:14px;padding:18px;background:#fff;}
.rdv-head{margin-bottom:14px;}
.rdv-title{margin:0 0 6px;font-size:22px;line-height:1.2;}
.rdv-sub{margin:0;opacity:.8;font-size:14px;line-height:1.45;}

.rdv-templates{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0 16px;}
@media (max-width: 860px){.rdv-templates{grid-template-columns:1fr;}}

.rdv-template{
  -webkit-appearance:none !important; appearance:none !important;
  background:#fff !important; border:1px solid rgba(0,0,0,.10) !important;
  border-radius:14px !important; box-shadow:none !important;
  padding:10px !important; width:100% !important;
  display:flex !important; flex-direction:column !important; gap:10px !important;
  cursor:pointer !important; text-align:left !important;
  transition:border-color .15s ease, transform .15s ease;
}
.rdv-template:hover{transform:translateY(-1px) !important;}
.rdv-template.is-active{border-color:rgba(0,0,0,.35) !important;}
.rdv-template__thumb{width:100%;aspect-ratio:4/3;border-radius:12px;overflow:hidden;background:rgba(0,0,0,.03);}
.rdv-template__thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.rdv-template__name{font-weight:800;font-size:14px;margin:0;}

.rdv-actions{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap;margin-top:6px;}
.rdv-actions__left{flex:1 1 280px;}
.rdv-actions__right{display:flex;gap:12px;align-items:center;flex-wrap:wrap;}
.rdv-fileLabel{display:block;font-weight:800;margin-bottom:6px;}
.rdv-fileHint{display:block;font-size:12px;opacity:.7;margin-top:6px;}

.rdv-primary,.rdv-cta{border-radius:999px !important;padding:10px 18px !important;font-weight:800 !important;}
.rdv-cart{margin:0 !important;}
.rdv-status{margin-top:10px;font-size:13px;opacity:.85;}

.rdv-preview{margin-top:16px;}
.rdv-preview__label{font-weight:800;font-size:13px;margin-bottom:8px;opacity:.9;}
.rdv-preview__frame{width:100%;border:1px solid rgba(0,0,0,.08);border-radius:12px;overflow:hidden;background:#fff;}
#rdv_preview_canvas{width:100%;height:auto;display:block;}
.rdv-hint{margin-top:8px;font-size:12px;opacity:.7;}
.rdv-status.is-success{font-weight:800;}


/* === RDV Collage: hide native Woo add-to-cart on pages where customizer is present === */
body.rdv-collage-page form.cart:not(.rdv-cart),
body.rdv-collage-page .single_add_to_cart_button,
body.rdv-collage-page .quantity,
body.rdv-collage-page .woocommerce-variation-add-to-cart,
body.rdv-collage-page .wcpay-payment-request-button,
body.rdv-collage-page .wc-stripe-payment-request-button {
  display: none !important;
}


/* === RDV Collage: processing overlay === */
.rdv-processing-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}
.rdv-processing-card{
  width: min(520px, calc(100% - 32px));
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  text-align: left;
  font-family: inherit;
}
.rdv-processing-row{ display:flex; gap:14px; align-items:center; }
.rdv-spinner{
  width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid rgba(0,0,0,.12);
  border-top-color: rgba(0,0,0,.75);
  animation: rdvSpin 1s linear infinite;
  flex: 0 0 auto;
}
@keyframes rdvSpin{ to { transform: rotate(360deg);} }
.rdv-processing-title{ margin:0; font-size:16px; font-weight:700; line-height:1.25; }
.rdv-processing-sub{ margin:6px 0 0; font-size:13px; color:rgba(0,0,0,.68); line-height:1.35; }
.rdv-processing-progress{
  margin-top: 12px; height: 10px; width: 100%;
  background: rgba(0,0,0,.08);
  border-radius: 999px; overflow: hidden;
}
.rdv-processing-bar{
  height: 100%; width: 35%;
  background: rgba(0,0,0,.72);
  border-radius: 999px;
  animation: rdvBar 1.2s ease-in-out infinite alternate;
}
@keyframes rdvBar{
  from { transform: translateX(-30%); width: 35%; }
  to   { transform: translateX(110%); width: 55%; }
}
.rdv-processing-done .rdv-spinner{ display:none; }
.rdv-processing-check{
  display:none; width:34px; height:34px; border-radius:999px;
  background:#16a34a; color:#fff;
  align-items:center; justify-content:center; font-weight:900;
  flex:0 0 auto;
}
.rdv-processing-done .rdv-processing-check{ display:flex; }


/* === RDV Collage: safety layout reset (prevents theme container conflicts) === */
body.rdv-collage-page .rdv-collage,
body.rdv-collage-page .rdv-card{
  max-width: none !important;
}
body.rdv-collage-page .rdv-collage *{
  box-sizing: border-box;
}


/* Arrange UI */
.rdv-arrange{ margin-top:14px; padding-top:10px; border-top:1px solid rgba(0,0,0,.08); }
.rdv-arrange__title{ font-weight:600; margin-bottom:4px; }
.rdv-arrange__sub{ font-size:12px; opacity:.75; margin-bottom:10px; }
.rdv-slots{ display:grid; grid-template-columns:repeat(auto-fill,minmax(70px,1fr)); gap:8px; margin-bottom:10px; }
.rdv-slot{ border:1px solid rgba(0,0,0,.15); background:#fff; border-radius:10px; padding:6px; cursor:pointer; position:relative; min-height:68px; }
.rdv-slot.is-active{ outline:2px solid #ff6a3d; border-color:#ff6a3d; }
.rdv-slot__num{ position:absolute; top:4px; left:6px; font-size:12px; font-weight:700; background:rgba(255,255,255,.85); padding:1px 5px; border-radius:999px; }
.rdv-slot__thumb{ width:100%; height:56px; border-radius:8px; overflow:hidden; background:rgba(0,0,0,.04); display:flex; align-items:center; justify-content:center; }
.rdv-slot__thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.rdv-tray__title{ font-weight:600; margin:6px 0; }
.rdv-tray{ display:flex; flex-wrap:wrap; gap:8px; }
.rdv-tray__item{ width:70px; height:70px; border-radius:10px; border:1px solid rgba(0,0,0,.15); overflow:hidden; background:#fff; padding:0; position:relative; cursor:grab; }
.rdv-tray__item img{ width:100%; height:100%; object-fit:cover; display:block; }
.rdv-tray__item.is-used{ opacity:.7; }
.rdv-tray__badge{ position:absolute; bottom:4px; right:4px; font-size:11px; font-weight:700; background:rgba(0,0,0,.65); color:#fff; padding:1px 5px; border-radius:999px; }
