/* ================================
   FULLSCREEN MODAL – TEMPLATE PDF
   ================================ */

#shopTemplateModal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

/* overlay + blur */
#shopTemplateModal .modal-backdrop-custom {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
}

/* contenitore centrale */
#shopTemplateModal .modal-dialog {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* card */
#shopTemplateModal .modal-content {
  width: 100%;
  max-width: 720px;
  border-radius: 18px;
  border: none;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.modal-header{
  padding: 1.4rem 1.8rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* header */
#shopTemplateModal .modal-header {
    padding: 1.4rem 1.8rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#shopTemplateModal .modal-title {
  font-size: 1.3rem;
  font-weight: 700;
}

/* body */
#shopTemplateModal .modal-body {
  padding: 1.6rem 1.8rem;
}

/* intro */
.shop-template-intro {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 1rem;
}

/* warning */
.shop-template-warning {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  color: #664d03;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

/* DROPZONE */
.shop-template-dropzone {
  border: 2px dashed #cfd4da;
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-template-dropzone:hover {
  border-color: #0d6efd;
  background: #f8f9ff;
}

.shop-template-dropzone input {
  display: none;
}

.shop-template-dropzone .icon {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.shop-template-dropzone .hint {
  font-size: 0.9rem;
  color: #666;
}

/* file name */
.shop-template-file {
  margin-top: 0.8rem;
  font-weight: 600;
  color: #0d6efd;
  font-size: 0.9rem;
}

/* checkbox */
.shop-template-confirm {
  margin-top: 1.2rem;
  font-size: 0.9rem;
}

/* footer */
#shopTemplateModal .modal-footer {
  padding: 1.2rem 1.8rem;
  border-top: 1px solid #eee;
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

#shopTemplateModal .btn {
  min-width: 120px;
}

#shopTemplateModal .btn-primary {
  font-weight: 600;
}

/* ===== MODAL TEMPLATE – BACKDROP BLUR ===== */


/* evita bordi / glitch */
.modal {
  backdrop-filter: none;
}

/* ===== MODAL CONTENT LOOK ===== */

#shopTemplateModal .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

#shopTemplateModal .modal-header {
  border-bottom: none;
}

#shopTemplateModal .modal-footer {
  border-top: none;
}
.modal:not(.show) {
  display: none !important;
}

/* ===========================
   MODALI SHOP: overlay blur
   =========================== */

/* Fullscreen overlay + blur sul backdrop di bootstrap */
.modal-backdrop.show {
  opacity: 0.55;              /* scurisci un po' */
}

/* Modale centrato e ben responsive */
#shopSelectTemplateModal .modal-dialog,
#shopTemplateModal .modal-dialog {
  width: calc(100% - 24px);
  max-width: 980px; /* cambia se vuoi più largo */
  margin: 12px auto;
}

/* Content "pulito" e con un minimo di stile */
#shopSelectTemplateModal .modal-content,
#shopTemplateModal .modal-content {
  border-radius: 18px;
  overflow: hidden;
}

/* ===========================
   LISTA TEMPLATE (modal 2)
   =========================== */

#shopSelectTemplateList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-template-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  cursor: pointer;
  background: #fff;
}

.shop-template-row:hover {
  border-color: rgba(0,0,0,.22);
}

.shop-template-row input[type="radio"] {
  transform: scale(1.2);
}

.shop-template-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  flex: 0 0 auto;
}

.shop-template-meta {
  flex: 1;
  min-width: 0;
}

.shop-template-title {
  font-weight: 800;
  line-height: 1.2;
}

.shop-template-desc {
  font-size: 0.92rem;
}

.shop-template-price {
  font-weight: 900;
  white-space: nowrap;
}
.modal-footer {
  margin-top: 15px;
    width: 100%;
    display: flex;
    gap: 8px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.modal-footer .btn {
    flex: 1 1 120px;
    max-width: 440px;
}

/* ===== Backdrop blur (Bootstrap 5) ===== */
.modal-backdrop.show {
  opacity: 0.55;

}

/* ===== Modale 2: forziamo centratura e dimensioni ===== */
#shopSelectTemplateModal.modal {
  z-index: 1060; /* sopra quasi tutto */
}

#shopSelectTemplateModal .modal-dialog {
  max-width: 980px;
  width: min(980px, calc(100% - 24px));
  margin: 12px auto;
}

#shopSelectTemplateModal .modal-content {
  border-radius: 18px;
  overflow: hidden;
}

/* Se qualche CSS globale ti ha rotto l'allineamento, qui lo rimettiamo */
#shopSelectTemplateModal .modal-dialog.modal-dialog-centered {
  min-height: calc(100% - 24px);
  display: flex;
  align-items: center;
}

/* ===== Lista template bella ===== */
#shopSelectTemplateList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-template-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  cursor: pointer;
  background: #fff;
}

.shop-template-row:hover { border-color: rgba(0,0,0,.22); }

.shop-template-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.shop-template-meta { flex: 1; min-width: 0; }

.shop-template-title { font-weight: 800; line-height: 1.2; }

.shop-template-desc { font-size: 0.92rem; }

.shop-template-price { font-weight: 900; white-space: nowrap; }

/* =========================================================
   FIX MINIMO: Modal 2 centrato + click ok (non rompe modal 1)
   ========================================================= */

#shopSelectTemplateModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2100 !important; /* sopra al tuo #shopTemplateModal (2000) */
}

#shopSelectTemplateModal .modal-dialog {
  margin: 0 auto !important;
  width: min(980px, calc(100% - 24px)) !important;
  max-width: 980px !important;
}

/* centratura verticale robusta */
#shopSelectTemplateModal .modal-dialog.modal-dialog-centered {
  min-height: calc(100% - 24px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 0 !important;
}

#shopSelectTemplateModal .modal-content {
    border-radius: 18px;
    overflow: hidden;
    background-color: white;
    padding: 20px;
}

/* se il backdrop custom o altre regole mettono overlay sopra, questo salva i click */
.modal-backdrop {
  z-index: 2050 !important;
}

/* (opzionale) se il tuo CSS crea overlay interno, disattivalo SOLO per modal 2 */
#shopSelectTemplateModal .modal-backdrop-custom {
  display: none !important;
}







