.printsprout-options-selectors{
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}
.printsprout-group.ps-group-stock {
    order: 1;
}
.printsprout-group.ps-group-size{
order: 2;	
}
.printsprout-group.ps-group-qty {
    order: 3;
}
.printsprout-group.ps-group-grommets {
    order: 4;
}
.printsprout-group.ps-group-h-standcompatible {
    order: 5;
}
.printsprout-group.ps-group-needhstand {
    order: 6;
}
.printsprout-group.ps-group-coating {
    order: 7;
}
.printsprout-group.ps-group-roundcorners{
order: 8;	
}
.printsprout-group.ps-group-bundling {
    order: 9;
}
.printsprout-group.ps-group-foldtype {
    order: 10;
}
.printsprout-group.ps-group-doyouhaveafoldingsample {
    order: 11;
}
.printsprout-group.ps-group-includespremiummetalstand {
    order: 12;
}
.printsprout-group.ps-group-bindery {
    order: 12;
}
.printsprout-group.ps-group-paintcolor{
    order: 13;
}
.printsprout-group{
    order: 20;
}
.printsprout-group.ps-group-turnaround {
    order: 25;
}

#printsprout-price-display{
    order: 100;
}

.printsprout-group{
    display: flex;
}

.printsprout-group label{
    min-width: 160px;
}

.ps-tab-btn-secondary{
    text-align: center !important;
}

span.ps-tab-label{
    width: 100%;
}

/* --- Widget Container --- */
.printsprout-widget-container {
    margin-bottom: 1em;
}

.printsprout-loading {
    font-size: 1em;
}

/* --- Template Download Box --- */
.printsprout-template-download {
    margin-bottom: 2em;
    text-align: center;
    border: 1px solid #eee;
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.5em;
}

.printsprout-template-download h4 {
    margin-bottom: 0.5em;
}

.printsprout-template-download .fa-file-pdf-o {
    color: #0062ff;
    margin-right: 8px;
}

.printsprout-template-download div {
    margin-bottom: 1em;
    color: #555;
    font-size: 0.97em;
}

.printsprout-template-download span {
    font-size: 90%;
}

.printsprout-template-download button {
    padding: 0.5em;
    font-size: 1em;
    color: #fff;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

#download-template-vertical {
    background: #3182ce;
}

#download-template-horizontal {
    background: #38a169;
}

/* --- Upload Container --- */
.printsprout-uploads-container {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}

.printsprout-uploads-container h4 {
    margin-bottom: 1em;
}

/* --- Tabs --- */
.printsprout-upload-tabs {
    margin-bottom: 2em;
}

.ps-tab-nav {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 1em;
}

.ps-tab-btn {
    flex: 1;
    padding: 0.8em 0;
    border: none;
    background: #f8fafc;
    font-weight: bold;
    cursor: pointer;
    color: #555;
    border-bottom: 3px solid transparent;
}

.ps-tab-btn.active {
    color: #3182ce;
    border-bottom: 3px solid #3182ce;
}

.ps-tab-content {
    display: none;
}

.ps-tab-content.active {
    display: block;
}

/* --- Upload Box --- */
.printsprout-file-upload {
    margin-bottom: 1.5em;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1em;
}

.printsprout-file-upload label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.printsprout-file-upload input[type="file"] {
    display: block;
}

.printsprout-file-info {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

.printsprout-error-message {
    color: red;
    display: none;
    font-size: 0.9em;
}

/* --- Proofing Area --- */
#proofing-area,
.ps-back-proofing-area {
    margin-top: 1em;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.ps-proofing-title {
    margin-bottom: 0.6em;
}

.ps-pdf-pagination {
    display: none;
    text-align: center;
    margin-bottom: 8px;
}

.ps-pdf-pagination button {
    margin: 0 5px;
}

#proofing-canvas-front,
#proofing-canvas-back {
    border: 1px solid #eee;
    display: block;
    margin: auto;
}

.ps-approval-text {
    margin-left: 5px;
}

/* --- Progress --- */
.printsprout-progress-container {
    display: none;
    margin-top: 1em;
}

#printsprout-upload-progress {
    width: 100%;
}

#printsprout-progress-percentage {
    margin-left: 10px;
}


[x-cloak] { display: none !important; }

.ps-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px dashed #d1d5db; /* gray-300 */
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563; /* gray-600 */
    transition: all 0.2s ease-in-out;
}

.ps-upload-button:hover {
    background-color: #f9fafb; /* gray-50 */
    border-color: #3b82f6; /* blue-500 */
}

/* Style for when a file has been selected */
.ps-upload-button.uploaded {
    background-color: #ecfdf5; /* green-50 */
    border-color: #10b981; /* emerald-500 */
    color: #065f46; /* green-800 */
    font-weight: 600;
}

#proofing-messages p { margin: 5px 0; padding: 5px; border-radius: 3px; }
#proofing-messages .error { background-color: #ffe0e0; border: 1px solid #ff9090; color: #c00; }
#proofing-messages .success { background-color: #e0ffe0; border: 1px solid #90ff90; color: #070; }
#proofing-messages .warning { background-color: #fff0d0; border: 1px solid #ffc080; color: #a50; }

/*
 * PrintSprout Proofing Styles v1.0
 * All classes are prefixed with 'ps-' to prevent conflicts.
 */

 :root {
    --ps-primary-color: #0ea5e9; /* Light Blue */
    --ps-primary-hover: #0284c7; /* Darker Light Blue */
    --ps-secondary-color: #64748b; /* Gray */
    --ps-light-gray: #f8fafc;
    --ps-border-color: #e2e8f0;
    --ps-white: #ffffff;
    --ps-text-dark: #1e293b;
    --ps-text-light: #475569;
    --ps-font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --ps-success-bg: #dcfce7;
    --ps-success-border: #86efac;
    --ps-success-text: #166534;
    --ps-info-bg: #e0f2fe;
    --ps-info-border: #7dd3fc;
    --ps-info-text: #0c4a6e;
}

/* --- Modal Trigger Button --- */
#printsprout-open-modal-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* --- Modal Overlay & Content --- */
.ps-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 41, 59, 0.75);
    z-index: 10000;
    display: none; /* JS will toggle this to 'flex' */
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    font-family: var(--ps-font-family);
}

.ps-modal-overlay.ps-is-visible {
    display: flex;
}

.ps-modal-content {
    background-color: var(--ps-light-gray);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 95vw;
    max-width: 1320px;
    height: 90vh;
    max-height: 850px;
    display: flex;
    overflow: hidden;
}

/* --- Two-Column Layout --- */
.ps-modal-left, .ps-modal-right {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.ps-modal-left {
    flex-basis: 65%;
}

.ps-modal-right {
    flex-basis: 35%;
    background-color: var(--ps-white);
    border-left: 1px solid var(--ps-border-color);
    overflow-x: auto;
}

/* --- Left Column: Canvas & Controls --- */
.ps-canvas-area {
    position: relative;
    width: 100%;         /* or 100%, or whatever works for your modal */
    height: 100%;        /* adjust as needed */
    overflow: auto;
    max-width: 796.95px;
    max-height: 700px;
    background: #fff;
    border: 1px solid #ddd;
    margin: 0 auto;
    display: flex;
    align-items: center;  /* <-- vertical centering */
    justify-content: center; /* <-- horizontal centering */
}

/* This will forcibly reset any accidental styling! */
.ps-canvas-area canvas {
    display: block;
    box-sizing: content-box !important;
    width: unset !important;
    height: unset !important;
    max-width: unset !important;
    max-height: unset !important;
    min-width: unset !important;
    min-height: unset !important;
    object-fit: unset !important;
    background: #fff;
    margin: 0 auto;
    /* (OPTIONAL) */
    border: 1px solid #f5f5f5;
}


/* Base style for the new HTML guideline labels */
.ps-guideline-label {
    position: absolute;
    display: none; 
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    z-index: 10;
}


/* The dotted connector line and dot */
.ps-guideline-label::after {
    content: '';
    position: absolute;
    left: 50%;
    height: var(--ps-connector-length, 35px);
    width: 1px;
    border-left: 1px dotted;
}
.ps-guideline-label::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background-color: currentColor;
}

.ps-guideline-label.ps-label-outside::after {
    top: 100%; /* Line starts at the bottom of the label */
}
.ps-guideline-label.ps-label-outside::before {
    top: calc(100% + var(--ps-connector-length, 35px)); /* Dot at the end of the line */
}

/* For labels INSIDE the canvas (pointing UP) */
.ps-guideline-label.ps-label-inside::after {
    bottom: 100%; /* Line starts at the top of the label */
}
.ps-guideline-label.ps-label-inside::before {
    bottom: calc(100% + var(--ps-connector-length, 35px)); /* Dot at the end of the line */
}

/* Specific styles for the Safety Area label */
.ps-label-safety {
    color: #15803d; /* Dark Green */
    background-color: #dcfce7; /* Light Green */
    border: 1px solid #86efac;
}
.ps-label-safety::after { border-left-color: #15803d; }

/* Specific styles for the Bleed Area label */
.ps-label-bleed {
    color: #0c4a6e; /* Dark Blue */
    background-color: #e0f2fe; /* Light Blue */
    border: 1px solid #7dd3fc;
}
.ps-label-bleed::after { 
    border-left-color: #0c4a6e;
}

#proofing-canvas-front,
#proofing-canvas-back {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background-color: #fff;
    background-repeat: repeat;
}


.ps-canvas-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
}

.ps-zoom-controls {
    display: inline-flex;
    align-items: center;
    background-color: var(--ps-white);
    border: 1px solid var(--ps-border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}
.ps-zoom-btn {
    background: none; border: none; padding: 0.5rem 0.75rem; font-size: 1rem; cursor: pointer; color: var(--ps-text-light);
}
.ps-zoom-btn:hover { background-color: var(--ps-light-gray); }
.ps-zoom-level {
    padding: 0 1rem; font-size: 0.875rem; color: var(--ps-text-dark);
    border-left: 1px solid var(--ps-border-color); border-right: 1px solid var(--ps-border-color);
}

/* --- Right Column: Header, Uploads, Actions --- */
.ps-modal-header {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem;
}
.ps-h2 {
    font-size: 1.5rem; font-weight: 700; color: var(--ps-text-dark); margin: 0; line-height: 1.2;
}
.ps-modal-close-btn {
    background: none; border: none; font-size: 2rem; line-height: 1; color: var(--ps-secondary-color); cursor: pointer; padding: 0;
}
.ps-modal-close-btn:hover { color: var(--ps-text-dark); }

.ps-product-info { margin-bottom: 1.5rem; }
.ps-product-title { font-weight: 600; font-size: 1rem; color: var(--ps-text-dark); margin: 0 0 0.25rem 0; }
.ps-product-specs { font-size: 0.875rem; color: var(--ps-text-light); margin: 0; }

.ps-upload-section { margin-bottom: 1rem; }
.ps-upload-title { font-weight: 600; color: var(--ps-text-dark); margin: 0 0 0.5rem 0; font-size: 0.875rem; }

.ps-upload-box {
    display: block;
    border: 2px dashed #cbd5e1; /* Dashed border for empty state */
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--ps-text-light);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--ps-light-gray);
    position: relative; /* Needed for the hidden input */
}

.ps-upload-box:hover {
    border-color: var(--ps-primary-color);
    color: var(--ps-text-dark);
}

/* Style the empty state placeholder */
.ps-upload-placeholder {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ps-upload-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
}

.ps-upload-text {
    font-weight: 500;
}

/* Hide the actual file input */
.ps-upload-box .ps-file-input {
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
    position: absolute;
    z-index: -1;
}

/* --- State-change logic --- */
/* By default, the placeholder is shown and the preview is hidden */
.ps-upload-box .ps-file-preview {
    display: none;
}
.ps-upload-box .ps-upload-placeholder {
    display: flex;
}

/* When the .has-file class is added to the box... */
.ps-upload-box.has-file {
    border-style: solid;
    border-color: var(--ps-border-color);
    padding: 0.5rem; /* Adjust padding for the filled state */
    background-color: var(--ps-light-gray);
}

.ps-upload-box.has-file .ps-file-preview {
    display: flex; /* Show the preview */
}
.ps-upload-box.has-file .ps-upload-placeholder {
    display: none; /* Hide the placeholder */
}

.ps-file-input { display: none; }
.ps-file-preview { display: flex; align-items: center; width: 100%; }
.ps-file-thumbnail {
    width: 2.5rem; height: 2.5rem; object-fit: cover; border: 1px solid var(--ps-border-color);
    border-radius: 0.25rem; margin-right: 0.75rem; background-color: white;
}
.ps-file-name {
    flex-grow: 1; font-size: 0.875rem; color: var(--ps-text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ps-design-link { margin-top: 1rem; margin-bottom: auto; }
.ps-design-link a { color: var(--ps-text-light); text-decoration: none; font-size: 0.875rem; }
.ps-design-link a:hover { text-decoration: underline; color: var(--ps-primary-color); }

.ps-modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* --- Generic Component Styles --- */
.ps-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.625rem 1rem; font-size: 0.875rem; font-weight: 600;
    border-radius: 0.375rem; border: 1px solid transparent; cursor: pointer;
    transition: all 0.2s ease-in-out; text-decoration: none;
    margin-bottom: 12px;
}

.ps-btn-primary {
    background-color: var(--ps-primary-color); color: var(--ps-white); border-color: var(--ps-primary-color);
}
.ps-btn-primary:hover { background-color: var(--ps-primary-hover); border-color: var(--ps-primary-hover); }

.ps-btn-secondary {
    background-color: var(--ps-white); color: var(--ps-text-dark); border-color: var(--ps-border-color);
}
.ps-btn-secondary:hover { background-color: var(--ps-light-gray); border-color: var(--ps-secondary-color); }

.ps-btn.ps-btn-preview { flex-grow: 1; }
.ps-btn.ps-btn-finish { flex-grow: 1; }

.ps-icon-eye { /* Basic SVG icon */
    display: inline-block; width: 1em; height: 1em; margin-right: 0.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231e293b'%3E%3Cpath d='M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z' /%3E%3Cpath fill-rule='evenodd' d='M.664 10.59a1.651 1.651 0 010-1.18l.88-1.452A1.65 1.65 0 013.437 7h13.126c.433 0 .845.214 1.092.59l.88 1.451a1.651 1.651 0 010 1.18l-.88 1.452a1.651 1.651 0 01-1.092.59H3.437a1.651 1.651 0 01-1.893-.59l-.88-1.452zM10 14a4 4 0 100-8 4 4 0 000 8z' clip-rule='evenodd' /%3E%3C/svg%3E");
    background-size: contain;
}

.ps-proofing-viewer {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}



.ps-pdf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}
.ps-pdf-page-info {
    font-size: 0.875rem;
    color: var(--ps-text-light);
}
.ps-proofing-messages {
    font-size: 0.8rem;
    padding: 0rem;
    border-radius: 0.25rem;
    margin-top: 0rem;
}
.ps-proofing-messages .success { color: #166534; }
.ps-proofing-messages .error { color: #b91c1c; font-weight: bold; }
.ps-proofing-messages .warning { color: #b45309; }
.ps-proofing-messages .info { color: #475569; }

.ps-approval-label {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.ps-modal-footer-content {
    margin-top: auto; /* Pushes this section to the bottom */
    padding-top: 1.5rem;
}

.ps-validation-summary {
    background-color: rgb(255, 250, 240); /* Light Red */
    border: 1px solid #ed8936;  /* Red border */
    color: #c05621;             /* Dark Red text */
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
}

.ps-validation-summary h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #c05621;
}

.ps-validation-summary ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.ps-validation-summary li {
    margin-bottom: 0.5rem;
}
.ps-validation-summary li:last-child {
    margin-bottom: 0;
}


.product .summary .cart:not(.variations_form):not(.grouped_form), .product .summary .cart .woocommerce-variation-add-to-cart{
    flex-direction: column;;
}


.ps-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px; /* Adds space between the buttons */
}

.ps-zoom-level {
    font-weight: 600;
    min-width: 50px; /* Prevents layout shifts */
    text-align: center;
}

.ps-zoom-btn {
    /* Base styles for all zoom buttons */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #dcdcdc;
    background-color: #ffffff;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.ps-zoom-btn:hover {
    background-color: #f5f5f5;
    border-color: #c0c0c0;
}

/* Specific styling for the new Reset button */
.ps-zoom-btn-reset {
    background-color: #2c3338; /* A darker background to stand out */
    color: #ffffff;
    border-color: #2c3338;
    gap: 6px; /* Space between the icon and the text */
}

.ps-zoom-btn-reset:hover {
    background-color: #444;
    border-color: #444;
}

.ps-zoom-btn-reset svg {
    /* Ensures the icon inherits the button's white text color */
    fill: currentColor; 
}