/* V6 does not load Bootstrap. Keep photo controls self-contained and keyboard accessible. */
.photo-field{margin:.4rem 0 1.25rem;max-width:100%;font-size:1rem}
.photo-field .photo-actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5rem;gap:.5rem}
.photo-field .photo-button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;position:relative;min-height:42px;margin:0;padding:.5rem .85rem;border:1px solid #217b80;border-radius:6px;background:#fff;color:#216a6e;font-family:inherit;font-size:.9rem;font-weight:600;line-height:1.4;text-align:center;text-decoration:none;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.photo-field .photo-button:hover{background:#eef6f5}
.photo-field .photo-button:focus-visible,.photo-field .photo-upload-button:focus-within{outline:2px solid #217b80;outline-offset:3px}
.photo-field .photo-button-secondary{border-color:#adb9b9;color:#465756}
.photo-field .photo-button-primary{background:#217b80;color:#fff}
.photo-field .photo-button-primary:hover{background:#19666a}
.photo-field .photo-upload-button{overflow:hidden}
/* The transparent input fills its label so touch, mouse and keyboard open the same native picker. */
.photo-field .photo-file-input{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}
.photo-field .photo-upload-hint{margin:.5rem 0 0;padding:0;color:#657170;font-size:.78rem;line-height:1.5}
.photo-field .photo-multiple-note{display:block;margin-top:.25rem}
.photo-field .photo-error{margin:.5rem 0 0;color:#a33b3b;font-size:.85rem;line-height:1.5}
.photo-field .photo-error:empty{display:none}
/* One masked thumbnail layout is shared by editing, basket and add-to-basket confirmation. */
.photo-thumbnail{display:inline-block;position:relative;max-width:100%;margin-bottom:.75rem;line-height:0}
.photo-thumbnail .photo-thumbnail-image{display:block;width:auto;height:auto;max-width:min(100%,var(--photo-thumbnail-size,150px));max-height:var(--photo-thumbnail-size,150px)}
.photo-thumbnail .photo-thumbnail-mask{display:block;position:absolute;inset:0;width:100%;height:100%;pointer-events:none;filter:brightness(0) invert(95%) drop-shadow(0 0 .5px #adb5bd)}
.photo-thumbnail[hidden],.photo-thumbnail-mask[hidden]{display:none!important}

/* The dialog is a separate visual surface, independent of the legacy product page's heading/button rules. */
.photo-field .photo-dialog{box-sizing:border-box;width:min(1000px,96vw);max-width:96vw;max-height:94dvh;margin:auto;border:1px solid #e0e8e7;border-radius:14px;padding:1.5rem;overflow:auto;background:#fff;color:#334443;box-shadow:0 20px 70px #0003}
.photo-dialog::backdrop{background:#102c2c88}
.photo-field .photo-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 0 .5rem}
.photo-field .photo-dialog-heading h2{margin:0;padding:0;color:#214f52;font-family:inherit;font-size:1.35rem;font-weight:600;line-height:1.3}
.photo-field .photo-position-hint{margin:0 0 1.25rem;padding:0;color:#657170;font-size:.875rem;line-height:1.5}
.photo-field .photo-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.5rem;align-items:start}
.photo-field .photo-crop-panel,.photo-field .photo-product-preview{min-width:0}
.photo-field .photo-frame{position:relative;width:100%;aspect-ratio:1;overflow:hidden;background:#f2f2f2;border-radius:8px}
.photo-field .photo-frame cropper-canvas{width:100%;height:100%;touch-action:none}
.photo-field .photo-mask{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;filter:brightness(0) invert(95%) drop-shadow(0 0 .5px #adb5bd)}
.photo-field .photo-frame img{-webkit-user-drag:none}

/* Related adjustments have equal touch targets and remain compact on smaller screens. */
.photo-field .photo-toolbar{display:grid;gap:.5rem;margin-top:.75rem}
.photo-field .photo-control-group{display:grid;grid-template-columns:3rem minmax(0,1fr);align-items:start;gap:.5rem}
.photo-field .photo-control-label{padding-top:.75rem;color:#657170;font-size:.8rem}
.photo-field .photo-control-buttons{display:flex;flex-wrap:wrap;gap:.375rem}
.photo-field .photo-toolbar button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;width:76px;min-height:44px;margin:0;padding:.5rem;border:1px solid #c9dada;border-radius:8px;background:#f4f8f8;color:#215e61;font-family:inherit;font-size:.85rem;font-weight:normal;line-height:1.4;cursor:pointer;touch-action:manipulation}
.photo-field .photo-toolbar button:hover{background:#e5f0ef;border-color:#86aaa9}
.photo-field .photo-toolbar button:active{background:#d5e7e5}
.photo-field .photo-toolbar button:focus-visible{outline:2px solid #217b80;outline-offset:2px}
.photo-field .photo-toolbar svg{display:block;width:18px;height:18px;flex:none}
.photo-field .photo-toolbar,.photo-field .photo-frame,.photo-field .photo-dialog button{-webkit-user-select:none;user-select:none}
.photo-field .photo-product-preview h3{margin:0 0 .75rem;padding:0;font-family:inherit;color:#214f52;font-size:1rem;font-weight:600;line-height:1.4}
.photo-field .photo-preview-stage{display:flex;align-items:center;justify-content:center;aspect-ratio:1;overflow:hidden;border:1px solid #e4eae9;border-radius:8px;background:#fafcfc}
.photo-field .photo-preview-stage:has(img[hidden])::before{content:"Your product preview will appear here.";max-width:220px;padding:1rem;color:#798785;font-size:.85rem;line-height:1.5;text-align:center}
.photo-field .photo-product-preview img{display:block;width:100%;height:auto}
.photo-field .photo-preview-status{min-height:1.5em;margin:.5rem 0 0;padding:0;color:#657170;font-size:.8rem;line-height:1.5}
.photo-field .photo-dialog-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:1.25rem;padding-top:1rem;border-top:1px solid #edf0ef}
.photo-field .photo-back{display:none}
.photo-field .photo-dialog[data-busy="true"] .photo-dialog-actions button{opacity:.5;pointer-events:none}
/* Do not reserve an empty preview column when the catalogue disables supplier previews. */
.photo-field .photo-dialog[data-preview-enabled="false"] .photo-editor-layout{grid-template-columns:minmax(0,1fr);max-width:480px;margin:0 auto}
@media(max-width:767.98px){
 .photo-field .photo-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;padding:1rem;border:0;border-radius:0}
 .photo-field .photo-dialog-heading h2{font-size:1.15rem}
 .photo-field .photo-editor-layout{display:block}
 .photo-field .photo-product-preview{display:none}
 .photo-field .photo-dialog[data-view="preview"] .photo-crop-panel{display:none}
 .photo-field .photo-dialog[data-view="preview"] .photo-product-preview{display:block}
 .photo-field .photo-back{display:inline-flex;margin-top:.75rem}
 .photo-field .photo-dialog-actions{position:sticky;bottom:-1rem;background:white;padding:.75rem 0}
}
/* Author display rules must not reveal controls and images marked hidden. */
.photo-field [hidden]{display:none!important}
