  .cropper-container img,
  .cropper-canvas img,
  .cropper-view-box img,
  #editImage {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
  }

  .main-image-editor {
    background-color: #eeeeee;
  }

  .soft-shadow {
    box-shadow: 0 20px 40px rgb(4 137 245 / 11%);
    border: none;
    border-radius: 20px;
  }


  .psdropzone.highlight {
    background: rgba(74, 144, 226, 0.1);
    border-color: #0489f5;
    transform: scale(1.02);
  }

  .preview-frame-container {
    position: relative;
    width: 100%;
  }

  .preview-frame-container img.frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
        border-bottom-left-radius: 0px !important;
    border-bottom-right-radius: 0px !important;

  }

  .frame-fill {
    position: absolute;
    background: #fff;
  }

  .frame-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  #editImageContainer {
    max-height: 55vh;

    position: relative;
    overflow: hidden;
    background: #eeeeee;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
  }

  #editImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  #editFrameOverlay {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    height: 55vh;
  }
  
  .ps-upload-anim{
    position: relative;
    width: 96px;
    height: 96px;
    margin: 4px auto 10px;
    border-radius: 999px;
    outline: none;
  }
  .ps-upload-anim:focus-visible{
    box-shadow: 0 0 0 4px rgba(92, 103, 242, .22);
    border-radius: 999px;
  }
  .ps-upload-anim__pulse{
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(92,103,242,.35), rgba(239,91,161,.18) 55%, rgba(255,255,255,0) 70%);
    filter: blur(0.2px);
    animation: psPulse 1.8s ease-in-out infinite;
  }
  .ps-upload-anim__stack{
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
  }
  .ps-upload-anim__card{
    position: absolute;
    width: 58px;
    height: 44px;
    border-radius: 14px;
    box-shadow: 0 14px 22px rgba(2, 6, 23, .12);
    background: #fff;
    transform: translateZ(0);
  }
  .ps-upload-anim__card--a{
    transform: translate(-6px, 4px) rotate(-7deg);
    background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(147,51,234,.10));
    border: 1px solid rgba(15, 23, 42, .08);
  }
  .ps-upload-anim__card--b{
    transform: translate(4px, -2px) rotate(6deg);
    background: linear-gradient(135deg, rgba(239,91,161,.16), rgba(37,99,235,.10));
    border: 1px solid rgba(15, 23, 42, .08);
  }
  .ps-upload-anim__card--c{
    transform: translate(0, 0) rotate(0deg);
    background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(37,99,235,.10));
    border: 1px solid rgba(15, 23, 42, .08);
  }
  .ps-upload-anim__plus{
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #ef5ba1 100%);
    box-shadow: 0 10px 18px rgba(2, 6, 23, .18);
    animation: psFloat 2.6s ease-in-out infinite;
  }
  @keyframes psPulse{
    0%,100%{ transform: scale(0.98); opacity: .85; }
    50%{ transform: scale(1.03); opacity: 1; }
  }
  @keyframes psFloat{
    0%,100%{ transform: translateY(0); }
    50%{ transform: translateY(-4px); }
  }

  @media (max-height: 720px){
    .ps-upload-anim{ width: 84px; height: 84px; margin-bottom: 6px; }
    .ps-upload-anim__card{ width: 52px; height: 40px; }
  }


  .cropper-view-box,
  .cropper-face {
    border: none !important;
    background: #ffffff !important;
  }

  .cropper-crop-box {
    /* border: 2px dotted rgb(3, 146, 255) !important; */
  }

  #filtersSwiperContainer {
    background: var(--rail-bg);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 0.75rem 0.25rem;
    min-height: 120px;
    width: 100%;
    position: relative;
  }

  #filtersRail.swiper-wrapper {
    display: flex;
  }

  .filter-chip-wrapper {
    width: 70px !important;
    text-align: center;
    flex-shrink: 0;
    flex-grow: 0;
    height: auto;
    cursor: grab;
  }

  .filter-radio-input {
    display: none;
  }

  .filter-label-visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    user-select: none;
  }

  .filter-thumb-container {
    display: block;
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    background: #1f2937;
    position: relative;
    transition: all 0.2s ease;
  }

  .filter-radio-input:checked + .filter-label-visible .filter-thumb-container {
    outline: 3px solid #0489f5;
    box-shadow: 0 0 10px rgba(110, 86, 246, 0.5);
  }

  .filter-name {
    font-size: 12px;
    margin-top: 0.5rem;
    color: var(--muted);
  }

  .filter-radio-input:checked + .filter-label-visible .filter-name {
    color: #000;
    font-weight: 700;
  }

  #filtersSwiperContainer .swiper-button-prev,
  #filtersSwiperContainer .swiper-button-next {
    color: #0489f5 !important;
    top: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin-top: -10px !important;
  }

  #filtersSwiperContainer .swiper-button-prev::after,
  #filtersSwiperContainer .swiper-button-next::after {
    font-size: 14px !important;
  }

  .tool-btn {
    --h: 40px;
    height: var(--h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    touch-action: manipulation;
  }

  .tool-btn:active {
    transform: translateY(1px);
  }

  .tool-btn.primary {
    background: var(--cta-grad);
    color: #fff;
    border: 0;
  }

  .tool-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
  }

  .tools-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }

  .delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    border: none;
    width: 45px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
  }


  .delete-btn.preview-action {
    cursor: pointer;
  }

  .form-range {
    appearance: none;
    height: 35px;
    padding: 0 8px;
    background: transparent;
  }

  .form-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(currentColor, currentColor) left/var(--fill, 0%)
        100% no-repeat,
      rgba(0, 0, 0, 0.12);
  }

  .form-range::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
  }

  .form-range::-webkit-slider-thumb {
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0489f5;
    border: 0;
    margin-top: -10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  }

  .form-range:active::-webkit-slider-thumb {
    transform: scale(1.06);
  }

  .form-range::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #0489f5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  }

  #imageProcessingOverlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease;
  }

  #imageProcessingOverlay.is-active {
    opacity: 1;
    visibility: visible;
  }

  .nav-pills .nav-link.active,
  .nav-pills .show > .nav-link {
    background-color: #0489f5;
    border-radius: 12px;
    color: #fff !important;
  }

  .ps-neomorphism {
    background: linear-gradient(133.21deg, #f7f7f7 -2.44%, #f9f9f9 135.62%);
    box-shadow: -6px -6px 8px rgba(255, 255, 255, 0.8), -2px -1px 8px #ffffff,
      2px 2px 10px rgba(255, 255, 255, 0.25),
      -4px -4px 20px rgba(255, 255, 255, 0.8),
      1px 1px 5px rgba(185, 185, 185, 0.6), 4px 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
  }

  .cropper-modal {
    background-color: #fdfce8 !important;
    opacity: 1 !important;
  }  


  @media (min-width: 992px) {
    #editModal #editImageContainer {
      max-height: 70vh;
    }

    #previewSwiperWrapper .swiper-slide-preview {     
      width: 345px;     
    }
    #editFrameOverlay {
      height: 70vh;
    }
  
  }


  .preview-card.highlight-edited {

    /* border: 5px solid #0489f5 !important;
    border-radius: 0% !important; */

  }

  #previews.swiper-mode {
    padding: 0; 
    margin: 60px -15px; 
  }

  #previewSwiperWrapper .swiper-slide-preview {    
    flex-shrink: 0;
    margin-bottom: 60px;
  }

  #previewSwiperWrapper .collage-card {
    width: 100%;
    isolation: initial; 
  }

  #previewSwiperWrapper .collage-card img.frame {
    width: 100%;
  }

  .preview-list-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; 
  }

  .preview-list-item .collage-card {
    max-width: 300px; 
    margin: 0;
  }

  .css-swiper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;  
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;  
    scroll-behavior: smooth;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    padding: 20px 12px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    will-change: scroll-position;
  }

  .css-swiper::-webkit-scrollbar {
    height: 4px;
  }
  .css-swiper::-webkit-scrollbar-track {
    background: transparent;
  }
  .css-swiper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
  }

  .css-swiper.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  .css-swiper.no-snap {
    scroll-snap-type: none !important;
  }

  .css-swiper-slide {
    flex: 0 0 auto;
    width: 230px;
    scroll-snap-align: center; 
    transition: transform 0.2s ease-out;
  }


  @media (min-width: 400px) {
    .css-swiper-slide {
      width: 280px;
    }
  }

  @media (min-width: 768px) {
    .css-swiper-slide {
      width: 320px;
    }
  }


  .css-swiper.is-dragging .css-swiper-slide {
    transform: scale(0.98); 
  }

  .preview-card {
    pointer-events: auto;
    backface-visibility: hidden;
  }

  .css-swiper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    user-select: none;
    background: transparent;
    scrollbar-width: auto;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
  }

.css-swiper::-webkit-scrollbar {
  height: 5px;
}

.css-swiper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 100px;
  margin: 0 60px;
}

.css-swiper::-webkit-scrollbar-thumb {
  background: rgba(89, 0, 255, 0.2);
  border-radius: 100px;
  transition: background 0.3s ease;
}

.css-swiper:hover::-webkit-scrollbar-thumb {
  background: rgba(89, 0, 255, 0.6); 
}


.css-swiper-slide {
  flex: 0 0 auto;
  width: 280px;
  scroll-snap-align: center;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.css-swiper-slide:hover {
  transform: translateY(-4px);
}

.preview-action.btn-light {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px); 
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.2s ease;
}

.preview-action.btn-light:hover {
  background: #ffffff !important;
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important;
}


/* Make the modal body a flex container to center the editor */
#editModal .modal-body {
    background-color: #fdfce8;
}

/* Force the image column to be full width and centered */
#editModal .col-lg-4.main-image-editor {
    padding: 0 !important;
}

#editImageContainer {
    margin: auto;
}

/* Ensure the container is the reference point for absolute children */
#editImageContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #fdfce8; /* Light grey placeholder */
}



/* ===== Edit panel (replaces Bootstrap modal) ===== */
#editModal.ps-edit-panel {
  min-height: 340px;
  max-height: 75vh;
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 16px;
}
#editModal.ps-edit-panel.d-none { display: none !important; }
#editModal.ps-edit-panel .ps-edit-panel-inner { margin: 0 auto; }
#editModal.ps-edit-panel .ps-edit-panel-content { background: transparent; border: 0; box-shadow: none; }
/* Outside crop box → no cropper interaction */
#editModal .cropper-drag-box {
  pointer-events: none !important;
}

/* Inside crop box → full interaction */
#editModal .cropper-crop-box,
#editModal .cropper-crop-box * {
  pointer-events: auto !important;
}
/* ===== Kill long-press selection + copy callout inside editor UI ===== */
#editorSection,
#editorSection * ,
#editModal,
#editModal * {
  -webkit-touch-callout: none !important;   /* iOS: disables Copy/Select callout */
  -webkit-user-select: none !important;    /* iOS Safari */
  user-select: none !important;            /* Modern browsers */
  -webkit-tap-highlight-color: transparent;/* removes grey/blue tap flash */
}

/* Prevent image drag ghost + callout on images */
#editorSection img,
#editModal img {
  -webkit-user-drag: none !important;
  user-drag: none !important;
}

/* If you have real text inputs, allow selection there */
#editorSection input[type="text"],
#editorSection textarea,
#editModal input[type="text"],
#editModal textarea {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* Disable text selection/callouts inside the editor */
#editorSection, 
#editorSection * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}

/* Extra: make buttons feel more “app-like” */
#editorSection button,
#editorSection .tool-btn {
  -webkit-tap-highlight-color: transparent;
}

/* Overlay that copies cropper-canvas transform */
.ps-ghost-canvas{
  position:absolute;
  left:0; top:0;
  pointer-events:none;
  z-index: 9999; /* above cropper-canvas */
  /* We'll set width/height + transform from JS */
  outline: 0;
}

/* Edge markers (simple example) */
.ps-edge{
  position:absolute;
  background: rgba(35, 160, 255, 0.95);
  opacity:.85;
}

.ps-edge--top, .ps-edge--bottom { height: 1px; left:0; right:0; }
.ps-edge--left, .ps-edge--right { width: 1px; top:0; bottom:0; }

.ps-edge--top{ top:0; }
.ps-edge--bottom{ bottom:0; }
.ps-edge--left{ left:0; }
.ps-edge--right{ right:0; }

/* If you want “gap” indication later */
.ps-edge.is-gap{ background: rgba(255,60,60,.95); }
.ps-ghost-canvas { pointer-events: none; }

.ps-edge {
  pointer-events: none; /* default: don't block cropper */
}

/* Only when there is a gap, allow touching that side */
.ps-edge.is-gap {
  pointer-events: auto;
  cursor: grab;
}
.ps-edge.is-gap:active { cursor: grabbing; }

/* Inside crop box → full interaction */
#editModal .cropper-crop-box,
#editModal .cropper-crop-box * {
  pointer-events: auto !important;
}

