#loader-spin {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    z-index: 999999;
    left: 0px;
    right: 0px;
    text-align: center;
    width: 120px;
    height: 120px;
    margin: 0px auto;
    background:none;
}

#loader-spin img {
    height: 70px;
    margin: 0px auto;
}

.bg-overlay {
    position: fixed;
    display: block;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
}

.drawer.drawer-end .select2-selection--multiple .select2-selection__rendered {
    display: inline-block;
    padding: 4px;
    max-height: 100px;
    overflow-y: auto;
}

/* Custom smaller quantity input for purchase orders */
.quantity-input {
    width: 100px !important;
    text-align: center !important;
    border: 1px solid #17a2b8 !important;
    background-color: #ffffff !important;
    color: #495057 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Small badge modifier, matching the .btn-sm/.form-control-sm convention */
.badge-sm {
    --bs-badge-padding-x: 0.35rem;
    --bs-badge-padding-y: 0.25rem;
    --bs-badge-font-size: 0.75rem;
}

/* Create / Edit Zprint modal (shipstation_orders/partials/zprint_form_modal.blade.php):
   Z number badge in the lookup preview, one drop-target card per shape. */
.zp-lookup-z { min-width: 3.5rem; justify-content: center; font-variant-numeric: tabular-nums; }
.zp-shape-row { border: 1px dashed var(--bs-gray-300); transition: border-color .15s, background-color .15s; }
.zp-shape-row.has-file { border-style: solid; border-color: var(--bs-success); }
.zp-shape-row.is-dragover { border-color: var(--bs-primary); background: var(--bs-light-primary); }
.zp-shape-row.is-invalid { border-style: solid; border-color: var(--bs-danger); }
.zp-shape-row.is-invalid .zp-shape-error { display: block; }
.zp-shape-icon { width: 1.6rem; height: 1.6rem; flex-shrink: 0; border: 2px solid var(--bs-gray-600); border-radius: .25rem; }
.zp-shape-icon--circle { border-radius: 50%; }
.zp-shape-icon--rectangle { height: 1.1rem; }
.zp-shape-icon--other { border-style: dashed; }
.zp-shape-row.has-file .zp-shape-icon { border-color: var(--bs-success); }

/* Checkerboard behind transparent design PNGs: Lookup Tables thumbnails and image preview,
   and the shape-row thumbnails in the Zprint modal. */
.zp-checker {
    background-color: var(--bs-white);
    background-image:
        linear-gradient(45deg, var(--bs-gray-200) 25%, transparent 25%),
        linear-gradient(-45deg, var(--bs-gray-200) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--bs-gray-200) 75%),
        linear-gradient(-45deg, transparent 75%, var(--bs-gray-200) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.zp-thumb {
    display: inline-flex; flex-direction: column; align-items: center; gap: .3rem;
    padding: .3rem; border: 1px solid var(--bs-gray-300); border-radius: .475rem;
    background: var(--bs-body-bg); cursor: zoom-in; transition: border-color .15s, box-shadow .15s;
}
.zp-thumb:hover, .zp-thumb:focus-visible { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem var(--bs-light-primary); outline: none; }
.zp-thumb-img { display: block; width: 5.5rem; height: 8rem; object-fit: contain; border-radius: .3rem; }
.zp-thumb-img--none { display: flex; align-items: center; justify-content: center; color: var(--bs-gray-500); background: var(--bs-gray-100); }
.zp-thumb-frame { position: relative; display: block; }
/* Centred with inset + auto margins, not transform: .spinner-border animates transform (rotate),
   which would wipe out a translate and leave the spinner off-centre and wobbling. */
.zp-thumb-spinner { display: none; position: absolute; inset: 0; margin: auto; }
.zp-thumb.is-loading .zp-thumb-spinner { display: block; }
.zp-thumb.is-loading .zp-thumb-img { background: var(--bs-gray-100); }
.zp-thumb-label { font-size: .7rem; line-height: 1; color: var(--bs-gray-700); font-weight: 600; }
/* Zprint modal: one card per shape, with a large preview that is also the drop target. */
.zp-shape-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.zp-shape-card { display: flex; flex-direction: column; overflow: hidden; background: var(--bs-body-bg); }
.zp-legacy-design { border: 1px solid var(--bs-gray-300); }
.zp-shape-card-body { display: flex; flex-direction: column; gap: .5rem; flex-grow: 1; padding: .85rem 1rem 1rem; }
.zp-shape-stage { position: relative; height: 17rem; background: var(--bs-gray-100); border-bottom: 1px solid var(--bs-gray-200); }
.zp-shape-row.is-dragover .zp-shape-stage { background: var(--bs-light-primary); }
.zp-shape-dropzone {
    position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .35rem; border: 0; background: transparent; color: var(--bs-gray-600); transition: color .15s, background-color .15s;
}
.zp-shape-dropzone:hover { color: var(--bs-primary); background: var(--bs-light-primary); }
.zp-shape-dropzone .zp-shape-icon { width: 3rem; height: 3rem; margin-bottom: .5rem; border-color: currentColor; }
.zp-shape-dropzone .zp-shape-icon--rectangle { width: 3.6rem; height: 2.4rem; }
.zp-shape-thumb { position: absolute; inset: 0; display: block; padding: .75rem; cursor: zoom-in; }
.zp-shape-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 .15rem .35rem var(--bs-gray-400)); }
.zp-shape-thumb-hint { position: absolute; right: .6rem; bottom: .6rem; opacity: 0; transition: opacity .15s; }
.zp-shape-thumb:hover .zp-shape-thumb-hint, .zp-shape-thumb:focus-visible .zp-shape-thumb-hint { opacity: 1; }
.zp-thumb-loading {
    display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center;
    gap: .75rem; background: var(--bs-gray-100); animation: zp-fade-in .2s ease-out .15s both;
}
.zp-thumb-loading .spinner-border { width: 2.25rem; height: 2.25rem; }
.zp-shape-thumb.is-loading .zp-thumb-loading { display: flex; }
@keyframes zp-fade-in { from { opacity: 0; } to { opacity: 1; } }
.zp-shape-thumb img { transition: opacity .2s ease-out; }
.zp-shape-thumb.is-loading img { opacity: 0; }
.zp-shape-thumb-broken { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--bs-gray-500); }
.zp-shape-thumb.is-broken { background: var(--bs-gray-100); }
.zp-shape-thumb.is-broken img { visibility: hidden; }
.zp-shape-thumb.is-broken .zp-shape-thumb-broken { display: flex; }
.zp-viewer {
    position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
    padding: 1.75rem 1rem; animation: zp-fade-in .15s ease-out both;
}
.zp-viewer::before { content: ""; position: absolute; inset: 0; background: var(--bs-dark); opacity: .55; }
.zp-viewer-dialog {
    position: relative; display: flex; flex-direction: column; width: 100%; max-width: 60rem; height: 100%;
    overflow: hidden; box-shadow: var(--bs-box-shadow-lg);
}
/* Image viewers (in the Zprint modal, and the Lookup Tables preview modal) always fit the window:
   header and footer keep their size, the image area takes the rest, nothing scrolls. */
.zp-image-modal .modal-dialog { height: calc(100% - 3.5rem); }
.zp-image-modal .modal-content { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
:is(.zp-viewer-dialog, .zp-image-modal) .modal-header,
:is(.zp-viewer-dialog, .zp-image-modal) .modal-footer { flex-shrink: 0; }
:is(.zp-viewer-dialog, .zp-image-modal) .modal-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
:is(.zp-viewer-dialog, .zp-image-modal) .zp-preview-stage { flex: 1 1 auto; min-height: 0; }
:is(.zp-viewer-dialog, .zp-image-modal) .zp-preview-stage img {
    position: absolute; inset: 1.5rem; width: calc(100% - 3rem); height: calc(100% - 3rem); object-fit: contain;
}
.modal.zp-viewer-open { overflow: hidden; }
.zp-preview-stage { min-height: 8rem; border-radius: .475rem; }
