.upload-label{text-transform: uppercase;}
.products-uploads-field-type-file_upload label {width: 100%;}
.products-uploads-dragandrophandler-container { display: block; width: 100%; margin-bottom: 20px !important;}
.products-uploads-dragandrophandler{
  border: 2px dotted var(--color-primary) !important;
  background-color: var(--color-background);
  width: 100%; padding: 20px; margin-bottom: 10px;
  text-align: center; vertical-align: middle;
  position: relative;
}
.products-uploads-dragandrophandler p{font-weight: bold; margin-bottom: 0;}
.products-uploads-text-browser a {
  display: inline-block;
  background: var(--color-primary);
  padding: 8px 16px;
  color:#fff !important;
  margin-top: 10px; text-transform: uppercase;
}
.products-uploads-text-browser a:hover { opacity:0.75; }

.products-uploads-drop-statusbar{
  width: 25%;
  padding: 4px; margin:  0 0 -1px -1px;
  display: flex; position: relative;
  flex-direction: column; font-size: 70%;
  border: 1px solid var(--color-border); background: #fff;
}

.products-uploads-files{display: flex;flex-direction: row;flex-wrap: wrap;align-content: flex-start;align-items: stretch;}
.products-uploads-drop-img { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; text-align: center; vertical-align: middle; }
.products-uploads-drop-img img { width: 100%; height: 100%; object-fit: cover; }
.products-uploads-drop-progressBar { width: 100%; display: block; font-size: 0; position: absolute; left: 0; bottom: 0; }
.products-uploads-drop-progressBar div { height: 4px; width: 0; background-color: #20cf00;  }
.products-uploads_file_upload_remove{
  position: absolute; top: 0; right: 0;
  display: inline-block;
  background: var(--color-danger); color: #fff;
  width: 20px; height: 20px;
  cursor: pointer; text-align: center; line-height: 20px; font-size: 20px;
}

.products-uploads-files .file-info{padding: 5px; position: absolute; z-index: 1; background-color: #fff; display: none;}
.products-uploads-drop-filename{display: block;}

.products-uploads-drop-statusbar.error{background: var(--color-danger-foreground);}
.products-uploads-drop-statusbar.error .products-uploads-drop-text-error{
  background: var(--color-danger); color: #ffffff; position: absolute; bottom: 0; left: 0; width: 100%;
  text-align: center; line-height: var(--line-height-lg);
}

dd.variation-Upload_Files a{display: inline-block !important; margin: 0 !important; }

#uploaded-lightbox-overlay {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center; align-items: center;
  z-index: 9999; text-align: center; overflow-x: auto;
  padding: 30px;
}

#uploaded-lightbox-overlay img {
  width: 100%; max-width: 400px; background: #fff;
  height: auto; margin: auto !important;
  border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}


/* =========================
   BASE WRAPPER
========================= */
#pfuwc-input-wrapper { margin: 20px 0; }
#pfuwc-input-wrapper p:last-child{margin-bottom: 0;}
/* =========================
   MAIN BUTTON (SHINE)
========================= */
.pfuwc-open-modal-btn {
    width: 100%; padding: 15px 25px; margin-bottom: 0;
    background: #53362c; color: #fff; font-weight: bold;
    border: none; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer; overflow: hidden;
    justify-content: space-between; align-items: center;
}
.pfuwc-open-modal-btn i{font-size: 1.5em; font-weight: 400; margin-right: 5px;}

.pfuwc-open-modal-btn::after {
    content: "";
    position: absolute; top: 0; left: -160%;
    width: 80%; height: 100%;
    background: linear-gradient(120deg,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.15) 35%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.15) 65%,
        rgba(255, 255, 255, 0) 80%);
    transform: skewX(-25deg); animation: shine 4s infinite ease-in-out;
}

@keyframes shine { 0% { left: -160%; } 60% { left: 160%; } 100% { left: 160%; } }

#upload-btn-notice{text-align: center;}
#upload-btn-notice i {margin-right: 5px; font-weight: normal; font-size: 1.5em; vertical-align: middle;}
#upload-btn-notice i {color: var(--color-warning, #F59E0B);}
#pfuwc-input-wrapper.full #upload-btn-notice i {color: var(--color-success, #10B981);}
#upload-btn-notice .upload-btn-counter{font-weight: bold; text-transform: uppercase; margin-top: 15px; vertical-align: middle;}
.upload-btn-notice {font-size: var(--font-size-xs, 0.85em);}

#pfuwc-input-wrapper.full .upload-btn-notice{display: none;}
#pfuwc-input-wrapper.full .upload-btn-counter i:before{content: "\EB80" !important;}

.uploaded-cards-container {
  display: flex; justify-content: center; align-items: flex-end; gap: 0px;
  margin-bottom: 0;
}

.uploaded-cards-container .uploaded-card {
  position: relative; width: 80px; height: 100px;
  border: 2px solid #ffffff; border-radius: 6px;
  background-color: #f5f5f5; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  background-size: cover; background-position: center; background-repeat: no-repeat; background-size: 65%;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e5e5e5'><path d='M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z'></path></svg>");
  transition: transform 0.3s ease, background-image 0.3s ease;
  pointer-events: none;
}
.uploaded-cards-container .card-1 {
  z-index: 1;
  transform-origin: right bottom;
  transform: rotate(-8deg) translate(16px, 0px);
}
.uploaded-cards-container .card-2 {
  z-index: 2; transform: rotate(0deg) scale(1.2);
}
.uploaded-cards-container .card-3 {
  z-index: 1; transform-origin: left bottom; transform: rotate(8deg) translate(-16px, 0px);
}
.uploaded-cards-container .uploaded-card.has-image {background-size: cover; }

#pfuwc-input-wrapper:hover .card-1{transform: rotate(-12deg) translate(8px, 0);}
#pfuwc-input-wrapper:hover .card-2{transform: rotate(0deg) scale(1.25);}
#pfuwc-input-wrapper:hover .card-3{transform: rotate(12deg) translate(-8px, 0);}

/* =========================
   MODAL
========================= */
.pfuwc-modal {
    position: fixed !important; inset: 0;
    padding: 10px; z-index: 999999;
    background: rgba(0,0,0,0.5);
    display: none;
}
.pfuwc-modal.processing::before, .pfuwc-modal .processing::before{display: none;}
.pfuwc-modal.active { display: block; }
.pfuwc-modal-container {
    width: 100%; height: 100%; padding: 15px;
    background: #fff; border-radius: var(--radius-lg, 6px);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.pfuwc-btn{
    background: var(--color-primary, #333333); color: #fff; transition: var(--transition, .3s ease);
    margin: 0; border: none; border-radius: var(--radius-md, 6px);
}

/* =========================
   HEADER
========================= */
.pfuwc-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #dddddd;
}
.modal-title {font-weight: bold; margin: 0; font-size: var(--font-size-sm, 1.15em)}
.pfuwc-modal button.pfuwc-modal-close {
    width: 24px !important; height: 24px !important; line-height: 24px !important;
	min-height: 24px !important; min-width: 24px !important;
	margin: 0; padding: 0 !important; border-radius: 99px;
	background-color: #000000; color: #fff; font-size: 24px; text-align: center;
}
.pfuwc-modal-close:hover {opacity: 0.8;}

/* =========================
   BODY LAYOUT
========================= */
.pfuwc-modal-body {
	display: flex; flex-direction: row; flex: 1;
	overflow: hidden; justify-content: flex-start; flex-wrap: nowrap;
}

/* =========================
   LEFT: GALLERY
========================= */
#pfuwc-modal .pfuwc-uploaded-wrapper {
    padding: 15px 0; border-right: 1px solid #dddddd;
    display: flex; flex-direction: column;
	flex: 1 1 33%; width: 30%;
}
#pfuwc-modal .uploaded-title {
	display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center;
	margin-bottom: 15px;
}
#pfuwc-modal .uploaded-title p {margin: 0;}
#pfuwc-modal .modal-counter {
	display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 99px;
	background-color: rgba(0,0,0, 0.2);
}
#pfuwc-modal.full .modal-counter{background-color: #10B981; color: #fff;}
#pfuwc-modal .modal-counter span{margin: 0 2px;}

#pfuwc-modal .uploaded-images-gallery {
    flex: 0 1 auto; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	align-content: start; grid-auto-rows: min-content;
	overflow-y: auto; scrollbar-gutter: stable; padding-right: 15px;
}
#pfuwc-modal .empty-gallery { display: none; text-align: center; opacity: 0.5; }
#pfuwc-modal.empty .empty-gallery{display: block;}

/* Gallery Item */
.pfuwc-gallery-item {
    position: relative; width: 100%;
    background: #f5f5f5;
    border-radius: var(--radius-md); border: 1px solid #eeeeee;
    aspect-ratio: 1 / 1; overflow: hidden;
    transition: var(--transition, 0.3s ease);
}
.pfuwc-gallery-item:hover img{ opacity: .7; }
.pfuwc-gallery-item img {width: 100%;height: 100%;object-fit: cover;}

/* Remove */
.pfuwc-gallery-item .remove {
    position: absolute; top: 4px; right: 4px;
    background: rgb(215 15 15 / 70%); color: #fff;
    width: 20px; height: 20px; line-height: 20px; font-size: 16px;
    border-radius: var(--radius-sm, 4px);
    display: flex; align-items: center; justify-content: center;
	cursor: pointer; transition: var(--transition, 0.3s ease);
}
.pfuwc-gallery-item .remove:hover{background: rgb(215 15 15);}

/* =========================
   RIGHT: DROPZONE
========================= */
.process-state, .upload-state-full{
	position: absolute; top: 0; left: 0;
	flex-direction: column;justify-content: center;align-items: center;
	width: 100%; height: 100%; z-index: 999; cursor: not-allowed;
	background-color: rgb(0 0 0 / 70%); color: #fff;
	font-size: var(--font-size-sm); text-transform: uppercase; text-align: center;
}
#pfuwc-modal.loading .process-state, #pfuwc-modal.full .upload-state-full {display: flex !important;}

.upload-state-full{background-color: #fff; color: inherit; text-transform: unset;}
.upload-state-full p{margin: 20px 0;}
.upload-state-full i{color: #10B981;}

#pfuwc-modal .process-state #pfuwc-try-again-btn{background-color: #fec7c7; color: var(--color-primary, #111111);}
#pfuwc-modal.loading.uploading .process-state .uploading{display: block !important;}
#pfuwc-modal.loading.processing .process-state .processing{display: block !important;}
#pfuwc-modal.loading.try-again .process-state #pfuwc-try-again-btn{display: block !important;}

#pfuwc-modal .loader {
  width: 32px; height: 32px; margin-bottom: 10px;
  border: 4px solid #f3f3f3; border-top: 4px solid #0099ff;
  animation: pfuwc-spin 0.5s linear infinite; border-radius: 99px;
}
@keyframes pfuwc-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.pfuwc-dropzone-area {
	position: relative; width: 70%; flex: 1 1 70%;
	display: flex; flex-direction: column;
	height: 100%; min-height: 0; padding: 15px 0 0 15px;
}

/* Drag State */
.pfuwc-drag-state {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px dashed #ddd; border-radius: var(--radius-md, 8px); text-align: center;
	transition: var(--transition, all 0.3s ease);
}
.pfuwc-drag-state.dragover {
	border-color: transparent;
	background-color: #f0f0f0;
	background-image: linear-gradient(90deg, #111111 50%, transparent 50%), linear-gradient(90deg, #111111 50%, transparent 50%), linear-gradient(0deg, #111111 50%, transparent 50%), linear-gradient(0deg, #111111 50%, transparent 50%);
	background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
	background-size: 15px 2px, 15px 2px, 2px 15px, 2px 15px;
	background-position: left top, right bottom, left bottom, right top;
	animation: border-dance 0.4s infinite linear;
}
@keyframes border-dance {
	0% { background-position: left top, right bottom, left bottom, right top; }
	100% { background-position: left 15px top, right 15px bottom, left bottom 15px, right top 15px; }
}

.drag-icon { font-size: 2em; margin-bottom: 10px; }
.drag-or { opacity: 0.5; margin: 0 0 20px 0; }
.drag-browse-btn:hover{transform: scale(1.05);}

/* =========================
   CROP AREA
========================= */
.pfuwc-crop-state { flex: 1; min-height: 0; display: flex; }
.crop-container { flex: 1; min-height: 0; width: 100%; position: relative; }
.crop-container .cropper-container { width: 100% !important; height: 100% !important; }
.crop-container img { max-width: 100%; }

/* =========================
   ACTIONS
========================= */
.pfuwc-upload-actions { display: flex; gap: 10px; margin-top: 15px; }
.pfuwc-upload-btn { width: 100%; flex: 1; }
.pfuwc-cancel-btn { background: #f3f3f3; color: #111; }
.pfuwc-upload-actions > *:hover { opacity: .9; }

@media (max-width: 850px){
	.uploaded-images-gallery {
		display: grid; grid-auto-flow: column; grid-auto-columns: 90px; align-items: start;
		grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
		padding: 0; overflow-x: auto; overflow-y: hidden;
		scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
	}
	.pfuwc-modal-body{ flex-direction: column; }
	.pfuwc-uploaded-wrapper{
		width: 100%; flex: 0 0 auto; max-width: none; border: none; order: 2;  padding: 20px 0 0 0;
	}

	.pfuwc-dropzone-area{
		width: 100%; flex: 1; order: 1; height: 100%; padding: 15px 0 0 0;
	}
}




/* LEAVE POPUP */
#uploadsLeaveModal {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; padding: 20px;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999999999;
  justify-content: center; align-items: center;
	transition: var(--transition, all 0.3s ease)
}

#uploadsLeaveModal .modal-box {
  position: relative; background: #ffffff;
  padding: 30px; max-width: 480px; width: 100%;
}
@media (max-width: 550px){
	#uploadsLeaveModal .modal-box{ padding: 20px; }
}

#uploadsLeaveModal #ulm-btn-close {
	position: absolute; right: 10px; top: 10px;
	width: 28px !important;
    height: 28px !important;
    line-height: 24px !important;
    min-height: 24px !important;
    min-width: 24px !important;
    margin: 0 !important; padding: 1px 7px !important;
    background-color: var(--color-primary); color: #fff;
    font-size: 24px; text-align: center;
}

#uploadsLeaveModal .modal-actions { display: flex; gap: 10px; margin-top: 30px; }
#uploadsLeaveModal .button{margin: 0; flex: 1;}
#uploadsLeaveModal #ulm-btn-leave{ background-color: #999;}
