/* Photo editing controls: deliberately scoped beyond the legacy form resets. */
.woocreate-designer .woocreate-photo-tools {
    --pg-photo-green: #009b43; --pg-photo-tint: #eaf7ee;
    --pg-photo-surface: var(--wc-ui-surface, #fff); --pg-photo-ink: var(--wc-ui-text, #242c29);
    --pg-photo-line: var(--wc-ui-border, #dce3de); --pg-photo-muted: #65736a;
    display: grid; gap: 14px; width: 100%; min-width: 0; margin-top: 14px; align-self: start;
    color: var(--pg-photo-ink); font: inherit;
}
.woocreate-designer .woocreate-photo-tools * { box-sizing: border-box; }
.woocreate-designer .woocreate-photo-tools button {
    font: inherit; color: inherit; box-shadow: none !important; text-transform: none; letter-spacing: normal;
    min-width: 0; margin: 0; cursor: pointer;
}
.woocreate-designer .woocreate-photo-tools .woocreate-image-filters {
    width: 100%; min-width: 0; border: 1px solid var(--pg-photo-line); border-radius: 8px; overflow: hidden;
    background: var(--pg-photo-surface); color: var(--pg-photo-ink);
}
.woocreate-designer .woocreate-photo-tools .woocreate-image-filters.is-open { border-color: var(--pg-photo-green); }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 13px 12px;
    border: 0 !important; border-radius: 0 !important; background: var(--pg-photo-surface) !important;
    text-align: left; font-size: 16px; font-weight: 600;
}
.woocreate-designer .woocreate-photo-tools .is-open .woocreate-filter-toggle { background: var(--pg-photo-tint) !important; }
.woocreate-designer .woocreate-photo-tools .pg-photo-icon {
    width: 21px; height: 21px; flex: 0 0 21px; fill: none !important; stroke: currentColor !important;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-chevron { margin-left: auto; display: flex; transition: transform .15s; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-chevron svg { width: 17px; height: 17px; }
.woocreate-designer .woocreate-photo-tools .is-open .woocreate-filter-chevron { transform: rotate(180deg); }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-body { display: grid; gap: 11px; padding: 12px; }
.woocreate-designer .woocreate-photo-tools [hidden] { display: none !important; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-functions { display: grid; gap: 8px; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 61px; padding: 11px 10px;
    border: 1px solid var(--pg-photo-line) !important; border-radius: 8px !important;
    background: var(--pg-photo-surface) !important; text-align: left; line-height: 1.35;
}
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function.is-selected { border-color: var(--pg-photo-green) !important; background: var(--pg-photo-tint) !important; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function > svg { color: var(--pg-photo-green) !important; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function-label { display: block; font-size: 14px; font-weight: 600; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function small { display: block; font-size: 11px; margin-top: 3px; color: var(--pg-photo-muted) !important; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-detail-title { font-size: 13px; font-weight: 600; margin-top: 4px; }
.woocreate-designer .woocreate-photo-tools .woocreate-photo-detail,
.woocreate-designer .woocreate-photo-tools .woocreate-filter-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--pg-photo-muted) !important; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; margin-bottom: 2px; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-card {
    position: relative; display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 0;
    min-width: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important;
    font-size: 12px; line-height: 1.35; text-align: center; overflow: visible;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-card > span:last-child { display: block; overflow-wrap: anywhere; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-thumb {
    display: block; width: 100%; aspect-ratio: 4/3; border-radius: 5px !important; overflow: hidden;
    outline: 1px solid var(--pg-photo-line); background: repeating-conic-gradient(#f4f5f4 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-thumb img,
.woocreate-designer .woocreate-photo-tools .woocreate-filter-thumb canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-card.is-selected .woocreate-filter-thumb { outline: 2px solid var(--pg-photo-green); }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-card.is-selected::after {
    content: '✓'; position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
    display: grid; place-items: center; background: var(--pg-photo-green); color: #fff; font: 600 12px/1 sans-serif;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-compare {
    display: flex; align-items: center; gap: 7px; justify-self: start; min-height: 32px; padding: 4px 0;
    border: 0 !important; border-radius: 0 !important; background: transparent !important; font-size: 12px; text-decoration: underline;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-compare svg { width: 17px; height: 17px; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.woocreate-designer .woocreate-photo-tools .woocreate-filter-actions button {
    width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--pg-photo-line) !important;
    border-radius: 8px !important; background: var(--pg-photo-surface) !important; font-size: 12px;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-actions button:last-child {
    background: var(--pg-photo-green) !important; border-color: var(--pg-photo-green) !important; color: #fff !important;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-status { margin: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.woocreate-designer .woocreate-photo-tools button:disabled { opacity: .5; cursor: default; }
.woocreate-designer .woocreate-photo-tools :focus-visible { outline: 2px solid #1465c0; outline-offset: 3px; }
.woocreate-designer .woocreate-photo-tools[aria-busy="true"] .woocreate-filter-status:not([hidden])::before {
    content: ''; display: inline-block; width: 11px; height: 11px; margin-right: 7px; border: 2px solid #c9ddcf;
    border-top-color: var(--pg-photo-green); border-radius: 50%; animation: pg-photo-spin 1s linear infinite;
}
.woocreate-designer .woocreate-remove-background,
.woocreate-designer .woocreate-crop-button { border-radius: 8px !important; }
.woocreate-designer .woocreate-designer__properties:has(.woocreate-photo-tools) { background: var(--wc-ui-surface, #fff) !important; }
.woocreate-designer [data-designer-properties]:has(.woocreate-photo-tools) > .woocreate-remove-background,
.woocreate-designer [data-designer-properties]:has(.woocreate-photo-tools) > .woocreate-crop-button {
    width: 100%; min-height: 44px; padding: 11px 12px; margin: 0 0 9px; font-size: 14px;
    border: 1px solid var(--wc-ui-border, #dce3de) !important; background: var(--wc-ui-surface, #fff) !important;
}
.woocreate-designer:not(.is-mobile-upload-sheet-open) .woocreate-designer__properties:has(.woocreate-photo-tools) {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.woocreate-designer .woocreate-mobile-upload-workspace:has(.woocreate-photo-tools) { display: flex !important; flex-direction: column; align-items: center; height: auto !important; min-height: 0 !important; }
.woocreate-designer.is-mobile-upload-sheet-open [data-designer-properties]:has(.woocreate-photo-tools) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.woocreate-designer.is-mobile-upload-sheet-open .woocreate-mobile-upload-workspace:has(.woocreate-photo-tools) {
    display: flex !important;
    height: auto !important;
}
.woocreate-designer .woocreate-mobile-upload-workspace > .woocreate-photo-tools { width: min(100%, 440px); flex-shrink: 0; }
.woocreate-designer.woocreate-ui-theme-dark .woocreate-photo-tools { --pg-photo-tint: #193d29; --pg-photo-muted: #b6c5bc; }
/* Keep the workspace columns unchanged when a photo is selected. Controls
   must fit the existing properties panel rather than resize the canvas. */
.woocreate-designer .woocreate-photo-tools .woocreate-filter-toggle,
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function,
.woocreate-designer [data-designer-properties]:has(.woocreate-photo-tools) > .woocreate-remove-background,
.woocreate-designer [data-designer-properties]:has(.woocreate-photo-tools) > .woocreate-crop-button {
    box-sizing: border-box; max-width: 100%; min-width: 0; white-space: normal;
    overflow-wrap: anywhere;
}
.woocreate-designer .woocreate-photo-tools .woocreate-photo-function > span {
    min-width: 0; overflow-wrap: anywhere;
}
.woocreate-designer .woocreate-photo-tools .woocreate-filter-chevron { flex-shrink: 0; }
@keyframes pg-photo-spin { to { transform: rotate(360deg); } }
@media (pointer: coarse) {
    .woocreate-designer .woocreate-photo-tools .woocreate-filter-compare,
    .woocreate-designer .woocreate-photo-tools .woocreate-filter-actions button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .woocreate-designer .woocreate-photo-tools .woocreate-filter-chevron { transition: none; }
    .woocreate-designer .woocreate-photo-tools[aria-busy="true"] .woocreate-filter-status::before { animation: none; }
}

/* The same action buttons for cropping and photo editing, on desktop and mobile. */
.woocreate-designer .woocreate-crop-actions,
.woocreate-designer.is-mobile-upload-sheet-open .woocreate-mobile-upload-crop-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.woocreate-designer .woocreate-crop-actions button,
.woocreate-designer.is-mobile-upload-sheet-open .woocreate-mobile-upload-crop-actions button,
.woocreate-designer .woocreate-photo-tools .woocreate-filter-actions button {
    box-sizing: border-box; width: 100%; min-width: 0; height: auto; min-height: 38px; margin: 0; padding: 8px 10px;
    border: 1px solid #dce3de !important; border-radius: 8px !important; background: #fff !important;
    color: #242c29 !important; -webkit-text-fill-color: #242c29 !important;
    font: inherit; font-size: 12px; font-weight: 400; line-height: 1.4; text-transform: none; letter-spacing: normal;
    box-shadow: none !important; cursor: pointer;
}
.woocreate-designer .woocreate-crop-actions .woocreate-crop-actions__apply,
.woocreate-designer.is-mobile-upload-sheet-open .woocreate-mobile-upload-crop-actions button:last-child,
.woocreate-designer .woocreate-photo-tools .woocreate-filter-actions button:last-child {
    background: #009b43 !important; border-color: #009b43 !important;
    color: #fff !important; -webkit-text-fill-color: #fff !important;
}
@media (pointer: coarse) {
    .woocreate-designer .woocreate-crop-actions button,
    .woocreate-designer.is-mobile-upload-sheet-open .woocreate-mobile-upload-crop-actions button,
    .woocreate-designer .woocreate-photo-tools .woocreate-filter-actions button { min-height: 44px; }
}
