/* ==========================================================================
   admin.css — styles for the admin photo / product forms (loaded after
   styles.css, which stays frozen). Everything here is scoped by a .pf- or
   .adm- prefix so nothing outside the admin forms can change.

   PHASE A NOTES (photo field, gallery, tile image) — for whoever builds on it
   ---------------------------------------------------------------------------
   All JS lives in public/app.js, section "admin: photo field, gallery & tile
   image". The editor itself is window.ImageEditor (imgedit.js / imgedit.css);
   every component below falls back to a plain file picker if it is missing.

   Photo field (one photo; product / listing / slide / department image)
     markup   photoFieldHTML(existingImage, idPrefix = 'pf', opts)
     wiring   const ctl = wirePhotoField(modal, onChange(dataUrl|null), idPrefix, opts)
     opts     label (HTML), kind 'product'|'group'|'slide'|'dept'|'tile' (picks the
              aspect: 1:1 / live hero slide / live .tile), aspect, recommended,
              lockAspect, outputMaxEdge, outputWidth, aspectPresets,
              onRemove(removed), clearCheckbox (selector|element; defaults to
              #pfClearPhoto for idPrefix 'pf' and is kept in sync with "Remove")
     ctl      getPending() -> unsaved data URL|null, isRemoved(), setImage(src)
              (show src as the saved photo, drop any unsaved one), clear()
     old names photoDropzoneHTML(img, prefix, label) / wirePhotoDropzone(modal,
              onPick, prefix) still work: thin wrappers over the above.
     ids      #<prefix>PhotoDrop (the .pf-photo wrapper), #<prefix>PhotoPreview,
              #<prefix>PhotoEmpty, #<prefix>PhotoInput, #<prefix>PhotoLabel
     classes  .pf-photo[data-state=empty|filled][data-kind] > .pf-photo-frame >
              (.pf-photo-img, .pf-photo-empty, .pf-photo-tools > .pf-tool,
              .pf-badge, .pf-photo-dropmsg) + .pf-photo-meta (.pf-photo-note,
              .pf-photo-undo). State classes on .pf-photo: .is-drag, .is-edited.
     sizing   the frame takes its shape from --pf-aspect (set inline) and is
              capped at --pf-max-h tall (default 260px): override per place with
              e.g. `.my-card .pf-photo{ --pf-max-h:320px }`.

   Gallery (extra photos; edit form only)
     markup   productGalleryHTML(product)
     wiring   wireProductGallery(modal, productId, { photoField: ctl, onMainChanged(image) })
     ids      #pfGalleryList, #pfGalleryAdd, #pfGalleryInput, #pfGalleryStatus
     classes  .pf-gallery (grid; .is-drop while files hover it) > .pf-gallery-thumb
              [data-img-id][data-path] (+ .is-busy .is-pending .is-error .is-confirm
              .is-dragging) with .pf-gt-actions, .pf-gt-move, .pf-gt-overlay
              (.pf-gt-confirm / .pf-gt-spinner / .pf-gt-error), then .pf-gallery-add.

   Tile image: openTileImageCropper(product) — no markup of its own any more
   (the editor overlay is the UI).

   The [hidden] attribute is honoured everywhere below (see the !important rule):
   several of these elements are flex/grid containers, which would otherwise
   ignore it.
   ========================================================================== */

.pf-photo [hidden], .pf-gallery-row [hidden]{ display:none !important; }

/* ---------- photo field ---------- */
/* Width follows the aspect so a wide banner fills the row while a square stays
   a sensible size; --pf-aspect is set inline by photoFieldHTML(). */
.pf-photo{
  --pf-max-h:260px;
  width:min(100%, calc(var(--pf-max-h) * var(--pf-aspect, 1)));
  outline:none;                       /* focus is only there so Ctrl/Cmd+V pastes here; the buttons carry their own rings */
}
.pf-photo-frame{
  position:relative; width:100%; aspect-ratio:var(--pf-aspect, 1); min-height:132px;
  border:2px dashed var(--line-strong); border-radius:10px; overflow:hidden;
  background:var(--line);             /* --line, not --bg-alt: this sits inside a --bg-alt modal */
  transition:border-color .15s, background-color .15s, box-shadow .15s;
}
.pf-photo[data-state="empty"] .pf-photo-frame:hover{ border-color:#ffffff; background:rgba(255,255,255,0.064); }
.pf-photo.is-drag .pf-photo-frame{
  border-color:#ffffff; background:rgba(255,255,255,0.112); box-shadow:0 0 0 3px rgba(255,255,255,0.2);
}
/* A photo is showing: solid hairline, and a faint checkerboard behind it so
   transparent PNGs read as transparent rather than as a dark patch. */
.pf-photo[data-state="filled"] .pf-photo-frame{
  border:1px solid var(--line-strong); background-color:#0e0e11;
  background-image:conic-gradient(rgba(255,255,255,.05) 25%, transparent 0 50%, rgba(255,255,255,.05) 0 75%, transparent 0);
  background-size:16px 16px;
}
.pf-photo-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:contain; display:block; }

/* Empty state: the whole frame is one real <button>, so Enter/Space/click all browse. */
.pf-photo-empty{
  position:absolute; inset:0; width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; padding:12px; background:none; border:none; cursor:pointer; color:var(--muted); font:inherit; text-align:center;
}
.pf-photo-empty strong{ color:var(--ink); font-size:13.5px; font-weight:700; }
.pf-photo-empty span{ font-size:12px; line-height:1.4; max-width:30ch; }
.pf-photo-empty:hover{ color:var(--ink); }
.pf-photo-empty:focus-visible{ outline:2px solid #ffffff; outline-offset:-6px; border-radius:8px; }

/* Hover / focus toolbar. Always on for touch (no hover to reveal it). */
.pf-photo-tools{
  position:absolute; z-index:2; top:8px; right:8px; display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end;
  opacity:0; pointer-events:none; transition:opacity .15s;
}
.pf-photo-frame::after{                 /* soft scrim so the white buttons read on bright photos */
  content:''; position:absolute; inset:0 0 auto 0; height:60px; pointer-events:none; opacity:0; transition:opacity .15s;
  background:linear-gradient(rgba(0,0,0,.5), transparent);
}
.pf-photo[data-state="filled"] .pf-photo-frame:hover .pf-photo-tools,
.pf-photo[data-state="filled"]:focus-within .pf-photo-tools{ opacity:1; pointer-events:auto; }
.pf-photo[data-state="filled"] .pf-photo-frame:hover::after,
.pf-photo[data-state="filled"]:focus-within .pf-photo-frame::after{ opacity:1; }
@media (hover:none){
  .pf-photo[data-state="filled"] .pf-photo-tools{ opacity:1; pointer-events:auto; }
  .pf-photo[data-state="filled"] .pf-photo-frame::after{ opacity:1; }
}
/* "Upload a file / Paste image" — covers the photo frame when Replace (or the empty frame) is clicked. */
.pf-source{
  position:absolute; inset:0; z-index:4; display:flex; align-items:center; justify-content:center; padding:10px;
  background:rgba(0,0,0,.72); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
}
.pf-source-box{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; max-width:100%; }
.pf-source-btn{
  display:inline-flex; align-items:center; gap:7px; padding:10px 15px; border-radius:999px; cursor:pointer;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.34); color:#fff;
  font:700 13px/1 Inter, sans-serif; transition:background .15s, border-color .15s, color .15s;
}
.pf-source-btn:hover{ background:var(--btn-bg); border-color:var(--btn-bg); color:var(--btn-ink); }
.pf-source-btn:focus-visible{ outline:2px solid #ffffff; outline-offset:2px; }
.pf-source-hint{ flex-basis:100%; margin:4px 0 0; text-align:center; font-size:11.5px; line-height:1.4; color:#cfd2d8; }
@media (pointer:coarse){ .pf-source-btn{ padding:13px 18px; font-size:14px; } }

.pf-tool{
  display:inline-flex; align-items:center; gap:5px; padding:7px 11px; border-radius:999px; cursor:pointer;
  background:rgba(0,0,0,.82); border:1px solid rgba(255,255,255,.22); color:#fff;
  font:600 12px/1 Inter, sans-serif; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  transition:background .15s, border-color .15s;
}
.pf-tool:hover{ background:var(--btn-bg); border-color:var(--btn-bg); color:var(--btn-ink);}
.pf-tool-danger:hover{ background:var(--brand-red-dark); border-color:var(--brand-red-dark); }
.pf-tool:focus-visible{ outline:2px solid #ffffff; outline-offset:2px; }
.pf-tool[aria-disabled="true"]{ opacity:.5; cursor:not-allowed; }
.pf-tool[aria-disabled="true"]:hover{ background:rgba(0,0,0,.82); border-color:rgba(255,255,255,.22); }
@media (pointer:coarse){ .pf-tool{ padding:10px 14px; font-size:13px; } }

.pf-badge{
  position:absolute; z-index:2; left:8px; bottom:8px; padding:3px 8px; border-radius:999px;
  background:var(--brand-red); color:#fff; font:700 10.5px/1.3 Inter, sans-serif; letter-spacing:.06em; text-transform:uppercase;
}
.pf-photo-dropmsg{
  position:absolute; inset:0; z-index:3; display:none; align-items:center; justify-content:center; pointer-events:none;
  background:rgba(255,255,255,0.224); color:#fff; font-weight:700; font-size:14px; text-align:center; padding:12px;
}
.pf-photo.is-drag .pf-photo-dropmsg{ display:flex; }

.pf-photo-meta{
  display:flex; align-items:center; gap:10px; min-height:18px; margin-top:6px; font-size:12px; color:var(--muted);
}
.pf-photo-undo{
  background:none; border:none; padding:0; font:inherit; font-weight:600; color:var(--ink); text-decoration:underline; cursor:pointer;
}
.pf-photo-undo:hover{ color:#ffffff; }

/* ---------- gallery ---------- */
.pf-gallery{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(88px, 1fr)); gap:10px;
  border-radius:10px; transition:background-color .15s, outline-color .15s;
}
.pf-gallery.is-drop{ outline:2px dashed #ffffff; outline-offset:6px; background:rgba(255,255,255,0.056); }

/* Specificity bump (.pf-gallery .x) on purpose: styles.css still carries the
   old fixed 72px thumbnail rules for these same class names. */
.pf-gallery .pf-gallery-thumb{
  position:relative; width:auto; height:auto; aspect-ratio:1; border-radius:8px; overflow:hidden; cursor:grab;
  background:var(--line); border:1px solid var(--line-strong); transition:transform .12s, box-shadow .12s, opacity .12s;
}
.pf-gallery .pf-gallery-thumb:hover{ box-shadow:0 2px 10px rgba(0,0,0,.35); }
.pf-gallery .pf-gallery-thumb img{ width:100%; height:100%; object-fit:cover; display:block; user-select:none; -webkit-user-drag:none; }
.pf-gallery .pf-gallery-thumb.is-dragging{ opacity:.4; transform:scale(.95); }
.pf-gallery .pf-gallery-thumb[hidden]{ display:none !important; }
.pf-gallery-unhide{ margin:6px 0 0; padding:0; background:none; border:0; color:var(--accent, #f2b300); font:inherit; font-size:12.5px; text-decoration:underline; cursor:pointer; text-align:left; }
.pf-gallery .pf-gallery-thumb.is-busy{ cursor:progress; }
.pf-gallery .pf-gallery-thumb.is-busy img, .pf-gallery .pf-gallery-thumb.is-pending img{ opacity:.55; }
.pf-gallery .pf-gallery-thumb.is-pending, .pf-gallery .pf-gallery-thumb.is-error{ cursor:default; }
.pf-gallery .pf-gallery-thumb.is-error{ border-color:var(--brand-red); }

/* Per-thumb buttons: edit / main / remove stacked at the right, move arrows
   bottom-left — placed so neither group covers the other even at the 88px minimum. */
.pf-gt-actions, .pf-gt-move{ position:absolute; z-index:2; display:flex; gap:3px; opacity:0; transition:opacity .12s; }
.pf-gt-actions{ top:4px; right:4px; flex-direction:column; }
.pf-gt-move{ bottom:4px; left:4px; }
.pf-gallery-thumb:hover .pf-gt-actions, .pf-gallery-thumb:hover .pf-gt-move,
.pf-gallery-thumb:focus-within .pf-gt-actions, .pf-gallery-thumb:focus-within .pf-gt-move{ opacity:1; }
@media (hover:none){ .pf-gt-actions, .pf-gt-move{ opacity:1; } }
.pf-gallery-thumb.is-confirm .pf-gt-actions, .pf-gallery-thumb.is-confirm .pf-gt-move,
.pf-gallery-thumb.is-busy .pf-gt-actions, .pf-gallery-thumb.is-busy .pf-gt-move{ display:none; }
.pf-gt-actions button, .pf-gt-move button{
  width:22px; height:22px; padding:0; display:flex; align-items:center; justify-content:center; cursor:pointer;
  border-radius:50%; border:none; background:rgba(0,0,0,.72); color:#fff;
}
.pf-gt-actions button:hover, .pf-gt-move button:hover:not(:disabled){ background:var(--btn-bg); color:var(--btn-ink);}
.pf-gt-actions button:focus-visible, .pf-gt-move button:focus-visible,
.pf-gt-overlay button:focus-visible, .pf-gallery-add:focus-visible{ outline:2px solid #ffffff; outline-offset:2px; }
.pf-gt-move button:disabled{ opacity:.35; cursor:default; }
@media (pointer:coarse){
  .pf-gallery{ grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); }
  .pf-gt-actions button, .pf-gt-move button{ width:30px; height:30px; }
}

/* Overlays share one look: remove-confirm, spinner, upload error. */
.pf-gt-overlay{
  position:absolute; inset:0; z-index:3; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  padding:6px; background:rgba(14,14,17,.84); color:#fff; font-size:11.5px; font-weight:600; line-height:1.3; text-align:center;
}
.pf-gt-overlay > div{ display:flex; gap:5px; flex-wrap:wrap; justify-content:center; }
.pf-gt-overlay button{
  padding:4px 9px; border-radius:999px; border:1px solid rgba(255,255,255,.3); background:rgba(255,255,255,.1);
  color:#fff; font:600 11px/1.2 Inter, sans-serif; cursor:pointer;
}
.pf-gt-overlay button:hover{ background:rgba(255,255,255,.22); }
.pf-gt-overlay button.is-danger{ background:var(--brand-red); border-color:var(--brand-red); }
.pf-gt-overlay button.is-danger:hover{ background:var(--brand-red-dark); }
.pf-gt-error{ background:rgba(110,10,28,.9); }
.pf-gt-error span{ display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.pf-gt-spinner{ background:rgba(14,14,17,.4); }
.pf-gt-spinner i{
  width:22px; height:22px; border-radius:50%; border:2.5px solid rgba(255,255,255,.3); border-top-color:#fff;
  animation:pf-spin .7s linear infinite;
}
@keyframes pf-spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .pf-gt-spinner i{ animation-duration:1.8s; } }

/* The "+" tile — now a real button (keyboard + screen reader friendly). */
.pf-gallery .pf-gallery-add{
  width:auto; height:auto; aspect-ratio:1; flex-direction:column; gap:3px; padding:0; font:600 11.5px/1.2 Inter, sans-serif;
  background:transparent; border:2px dashed var(--line-strong); border-radius:8px; color:var(--muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.pf-gallery .pf-gallery-add:hover{ border-color:#ffffff; color:#ffffff; }

.pf-gallery-status{ margin:8px 0 0; font-size:12px; line-height:1.45; color:var(--muted); }
.pf-gallery-status.is-error{ color:#ff8a97; }


/* ==========================================================================
   PHASE B — the redesigned product form (openProductForm in app.js)
   Shell classes (.adm-*) are shared by every admin form that adopts the look.

   markup  .adm-form > .adm-head (title + .adm-pill "Unsaved changes")
                     > .adm-layout > .adm-media (sticky: Photos card + live
                                       storefront preview) + .adm-fields (cards)
                     > .adm-actions (sticky bar: Delete · error · Cancel · Save)
   Cards   .adm-card (+ .adm-card-title, .adm-card-hint); <details class="adm-card adm-collapse"> for the rare sections.
   Fields  reuse the site's .form-row / .form-grid-2; .adm-grid-3 for three across;
           .adm-err (inline message), .adm-chips/.adm-chip (margin, markup, % off),
           .adm-warns, .adm-switch (toggle), .adm-check (checkbox row).
   Confirm .adm-ask (layered over the form by admConfirm()).
   The modal itself widens through .product-form-modal.adm-wide (set by prepFormModal()).
   ========================================================================== */

.adm-form [hidden], .adm-ask [hidden]{ display:none !important; }   /* several of these are flex containers, which ignore [hidden] on their own */
.product-form-modal.adm-wide{ max-width:1040px; max-height:92vh; scroll-padding-bottom:84px; }
.adm-form{ padding:26px 28px 0; }
.adm-head{ display:flex; align-items:flex-start; gap:14px; padding-right:44px; margin-bottom:20px; }
.adm-head h3{ margin:0; font-size:21px; font-weight:800; letter-spacing:-.01em; }
.adm-sub{ margin:3px 0 0; font-size:13px; color:var(--muted); }
.adm-pill{
  align-self:center; margin-left:auto; padding:5px 11px; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap;
  color:#ffd27a; background:rgba(255,184,48,.12); border:1px solid rgba(255,184,48,.35);
}
.adm-pill::before{ content:''; display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:#ffb830; vertical-align:1px; }

.adm-layout{ display:grid; grid-template-columns:minmax(0, 1fr); gap:18px; align-items:start; }
@media (min-width:860px){
  .adm-layout{ grid-template-columns:300px minmax(0, 1fr); gap:22px; }
  /* The live preview card stays in view while the long field column scrolls
     (the photos above it scroll away). The column is stretched to the full
     height of the fields so the card has room to travel. */
  .adm-media{ align-self:stretch; }
  .adm-previewcard{ position:sticky; top:14px; }
}
.adm-media, .adm-fields{ display:flex; flex-direction:column; gap:16px; min-width:0; }

.adm-card{ margin:0; padding:16px 18px 6px; border-radius:12px; background:rgba(255,255,255,.025); border:1px solid var(--line); }
.adm-card-title{ margin:0 0 12px; display:flex; align-items:baseline; gap:8px; font-size:13px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--ink); }
.adm-card-title small{ font-size:11.5px; font-weight:600; letter-spacing:0; text-transform:none; color:var(--muted); margin-left:auto; }
.adm-card-hint{ margin:-6px 0 12px; font-size:12.5px; line-height:1.5; color:var(--muted); }
.adm-card .form-row{ margin-bottom:14px; }
.adm-card .form-row label{ display:flex; align-items:baseline; gap:6px; }
.adm-card .form-row label small{ font-size:11.5px; font-weight:500; color:var(--muted); opacity:.85; }
.adm-grid-3{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
@media (max-width:560px){ .adm-grid-3{ grid-template-columns:1fr 1fr; } .adm-grid-3 .form-row:last-child{ grid-column:1 / -1; } }

/* inputs: the site only styles <input> inside .form-row, so selects/textareas get the same dark skin here */
.adm-form select, .adm-form textarea, .adm-form .form-row input{
  width:100%; border:1px solid transparent; border-radius:8px; padding:10px 12px; font:inherit; font-size:14px;
  background:var(--line); color:var(--ink); transition:border-color .12s, box-shadow .12s;
}
.adm-form select{
  -webkit-appearance:none; appearance:none; padding-right:36px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9fa8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:16px;
}
.adm-form option{ background:#111111; color:var(--ink); }
.adm-form textarea{ resize:vertical; min-height:96px; line-height:1.5; }
.adm-form input:hover, .adm-form select:hover, .adm-form textarea:hover{ border-color:var(--line-strong); }
.adm-form input:focus-visible, .adm-form select:focus-visible, .adm-form textarea:focus-visible{ outline:none; border-color:#ffffff; box-shadow:0 0 0 3px rgba(255,255,255,0.224); }
.adm-form input[aria-invalid="true"], .adm-form select[aria-invalid="true"]{ border-color:#f23645; box-shadow:0 0 0 3px rgba(242,54,69,.18); }
.adm-err{ display:block; margin-top:5px; font-size:12.5px; line-height:1.4; color:#ff8a97; }
.adm-stars{ margin-left:auto; color:#ffb830; letter-spacing:1px; font-size:13px; }

/* price insights */
.adm-card .profit-readout{ margin:0 0 10px; }
.adm-chips{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px; min-height:0; }
.adm-chips:empty{ display:none; }
.adm-chip{ padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; background:var(--line); color:var(--ink); font-variant-numeric:tabular-nums; }
.adm-chip.is-good{ color:#3ddcb6; background:rgba(8,153,129,.16); }
.adm-chip.is-bad{ color:#ff7b88; background:rgba(242,54,69,.16); }
.adm-chip.is-deal{ color:#ffd27a; background:rgba(255,184,48,.14); }
.adm-warns{ list-style:none; margin:0 0 12px; padding:0; display:flex; flex-direction:column; gap:6px; }
.adm-warns li{ padding:8px 12px 8px 34px; border-radius:8px; font-size:12.5px; line-height:1.45; color:#ffd9a0; background:rgba(255,184,48,.1); border:1px solid rgba(255,184,48,.28); position:relative; }
.adm-warns li::before{ content:'!'; position:absolute; left:11px; top:8px; width:16px; height:16px; border-radius:50%; background:#ffb830; color:#1a1305; font-weight:800; font-size:11px; line-height:16px; text-align:center; }

/* toggle switch + checkbox row */
.adm-switch{ display:flex; align-items:center; gap:12px; margin:2px 0 14px; cursor:pointer; }
.adm-switch input{ position:absolute; opacity:0; width:1px; height:1px; }
.adm-switch-ui{ position:relative; flex:0 0 42px; height:24px; border-radius:999px; background:var(--line-strong); transition:background-color .15s; }
.adm-switch-ui::after{ content:''; position:absolute; left:3px; top:3px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.4); transition:transform .15s; }
.adm-switch input:checked + .adm-switch-ui{ background:var(--btn-bg); }
.adm-switch input:checked + .adm-switch-ui::after{ transform:translateX(18px); }
.adm-switch input:focus-visible + .adm-switch-ui{ box-shadow:0 0 0 3px rgba(255,255,255,0.32); }
.adm-switch-text{ display:flex; flex-direction:column; gap:1px; }
.adm-switch-text b{ font-size:13.5px; font-weight:700; }
.adm-switch-text small{ font-size:12px; color:var(--muted); }
.adm-check{ display:flex; align-items:flex-start; gap:10px; margin:0 0 14px; font-size:13px; line-height:1.4; cursor:pointer; }
.adm-check input{ flex:0 0 auto; width:16px; height:16px; margin-top:1px; accent-color:#ffffff; }

/* collapsible sections */
.adm-collapse{ padding:0; }
.adm-collapse > summary{ list-style:none; display:flex; align-items:center; gap:10px; padding:14px 18px; cursor:pointer; border-radius:12px; }
.adm-collapse > summary::-webkit-details-marker{ display:none; }
.adm-collapse > summary::after{ content:''; width:8px; height:8px; margin-left:auto; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); transition:transform .15s; }
.adm-collapse[open] > summary::after{ transform:rotate(225deg); }
.adm-collapse > summary:hover{ background:rgba(255,255,255,.03); }
.adm-collapse > summary:focus-visible{ outline:2px solid #ffffff; outline-offset:-2px; }
.adm-collapse > summary .adm-card-title{ margin:0; }
.adm-collapse-hint{ font-size:12px; color:var(--muted); }
.adm-collapse[open] > :not(summary){ margin-left:18px; margin-right:18px; }
.adm-collapse[open] > summary + *{ margin-top:2px; }
.adm-collapse[open]{ padding-bottom:6px; }
.adm-badge{ padding:2px 9px; border-radius:999px; font-size:11.5px; font-weight:700; color:#3ddcb6; background:rgba(8,153,129,.16); }
.adm-collapse .sponsor-btn-row{ margin-bottom:14px; }

/* photo + preview column */
.adm-media .adm-card{ padding-bottom:14px; }
.adm-media .pf-photo{ --pf-max-h:300px; margin:0 auto; }
.adm-media .pf-photo-row{ margin-bottom:12px; }
.adm-media .pf-gallery-row{ margin:0; }
.adm-previewcard{ padding-bottom:16px; }
.adm-preview{ pointer-events:none; user-select:none; -webkit-user-select:none; display:flex; justify-content:center; }
.adm-preview .card{ width:100%; max-width:228px; margin:0; }
.adm-preview .card-admin{ display:none !important; }
.adm-preview .card-img.adm-noimg img{ object-fit:contain; padding:18%; opacity:.9; }

/* sticky action bar */
.adm-actions{
  position:sticky; bottom:0; z-index:5; display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  margin:22px -28px 0; padding:14px 28px 16px; background:linear-gradient(to bottom, rgba(0,0,0,.9), var(--bg-alt) 40%);
  border-top:1px solid var(--line); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.adm-actions-left, .adm-actions-right{ display:flex; align-items:center; gap:8px; }
.adm-actions-right{ margin-left:auto; }
.adm-err-summary{ margin:0; flex:1 1 220px; order:3; font-size:13px; color:#ff8a97; }
@media (min-width:700px){ .adm-err-summary{ order:0; flex:0 1 auto; } }
.adm-del-confirm{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; }

/* buttons */
.adm-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; height:40px; padding:0 18px; border-radius:8px;
  border:1px solid transparent; background:var(--line); color:var(--ink); font:700 14px/1 Inter, sans-serif; cursor:pointer;
  transition:background-color .12s, border-color .12s, opacity .12s;
}
.adm-btn:disabled{ opacity:.5; cursor:default; }
.adm-btn:focus-visible{ outline:2px solid #ffffff; outline-offset:2px; }
.adm-btn-sm{ height:32px; padding:0 12px; font-size:12.5px; }
.adm-btn-ghost{ background:transparent; border-color:var(--line-strong); }
.adm-btn-ghost:hover:not(:disabled){ background:var(--line); }
.adm-btn-primary{ background:var(--btn-bg); color:var(--btn-ink); padding:0 24px; }
.adm-btn-primary:hover:not(:disabled){ background:var(--btn-bg-hover); color:var(--btn-ink);}
.adm-btn-danger{ background:#b3122b; color:#fff; }
.adm-btn-danger:hover:not(:disabled){ background:#cf1634; }
.adm-btn-quiet-danger{ background:transparent; color:#ff8a97; padding:0 12px; }
.adm-btn-quiet-danger:hover:not(:disabled){ background:rgba(242,54,69,.12); }
.adm-spin{ display:none; width:15px; height:15px; border-radius:50%; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; animation:pf-spin .7s linear infinite; }
.adm-btn.is-busy .adm-spin{ display:inline-block; }

/* confirm layered over the form */
.adm-ask{ position:fixed; inset:0; z-index:30; display:grid; place-items:center; padding:20px; background:rgba(0,0,0,.55); }
.adm-ask-card{ width:min(380px, 100%); padding:20px; border-radius:12px; background:var(--bg-alt); border:1px solid var(--line-strong); box-shadow:var(--shadow-lg); }
.adm-ask-card h4{ margin:0 0 6px; font-size:16px; }
.adm-ask-card p{ margin:0 0 16px; font-size:13.5px; color:var(--muted); line-height:1.5; }
.adm-ask-btns{ display:flex; justify-content:flex-end; gap:8px; }

@media (max-width:859px){
  .adm-form{ padding:20px 16px 0; }
  .adm-actions{ margin:18px -16px 0; padding:12px 16px 14px; }
  .adm-actions-left{ order:2; }
  .adm-actions-right{ flex:1 1 100%; }
  .adm-actions-right .adm-btn{ flex:1 1 0; }
}
@media (prefers-reduced-motion:reduce){ .adm-switch-ui, .adm-switch-ui::after, .adm-collapse > summary::after{ transition:none; } .adm-spin{ animation-duration:1.8s; } }

/* ---------- the other admin forms adopting the shell (multi-size listing, slides) ---------- */
.adm-form-narrow .adm-fields{ gap:14px; }
.adm-form .variant-headers{ margin-bottom:6px; }
.adm-form .variant-row input{ min-width:0; }
.adm-form .variant-row{ margin-bottom:8px; }
.adm-form #addVariantRow{ margin:4px 0 14px; }
.adm-form .variant-remove{ background:var(--line); border:1px solid transparent; border-radius:8px; color:var(--muted); height:40px; width:34px; cursor:pointer; }
.adm-form .variant-remove:hover:not(:disabled){ color:#ff8a97; border-color:rgba(242,54,69,.4); }
.adm-card > .adm-err{ margin:-4px 0 14px; }
.adm-slides{ display:flex; flex-direction:column; gap:10px; }
.adm-slides .adm-slide{ padding:10px 12px; border-radius:12px; background:rgba(255,255,255,.025); border:1px solid var(--line); gap:14px; }
.adm-slides .adm-slide.is-off{ opacity:.7; }
.adm-slides .slide-row-thumb{ width:84px; height:48px; border-radius:8px; flex:0 0 auto; }
.adm-slides .slide-row-title{ display:flex; align-items:center; gap:8px; font-size:14px; }
.adm-slides .slide-row-sub{ margin-top:2px; }
.adm-badge-off{ color:var(--muted); background:var(--line); }
.adm-slides .slide-row-actions{ gap:6px; }
.adm-form-narrow > .adm-actions{ margin-top:16px; }


/* "Photoshop" button on existing product photos (shown only where Photoshop is installed) */
.pf-tool[hidden]{ display:none; }
.pf-gt-actions .pf-gt-ps{ display:none; }
.pf-gallery.has-ps .pf-gt-actions .pf-gt-ps{ display:flex; }
.ps-run{ position:fixed; inset:0; z-index:100002; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.72); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.ps-run-box{ width:min(380px, calc(100vw - 32px)); padding:24px 22px 20px; border-radius:16px; background:#14151a; border:1px solid rgba(255,255,255,.14); color:#f2f3f5; text-align:center; display:flex; flex-direction:column; align-items:center; gap:8px; box-shadow:0 20px 60px rgba(0,0,0,.6); }
.ps-run-box strong{ font:700 16px/1.3 Inter, sans-serif; }
.ps-run-msg{ margin:0; font:500 13.5px/1.4 Inter, sans-serif; color:#e4e6ea; }
.ps-run-sub{ margin:0; font:400 12px/1.45 Inter, sans-serif; color:#aeb2ba; }
.ps-run-cancel{ margin-top:8px; padding:8px 18px; border-radius:999px; border:1px solid rgba(255,255,255,.28); background:transparent; color:#fff; font:600 13px/1 Inter, sans-serif; cursor:pointer; }
.ps-run-cancel:hover{ background:rgba(255,255,255,.12); }
.ps-run-spin{ width:30px; height:30px; border-radius:50%; border:3px solid rgba(255,255,255,.18); border-top-color:#fff; animation:ps-run-spin .9s linear infinite; }
@keyframes ps-run-spin{ to{ transform:rotate(360deg); } }

/* Photoshop: how-to-do-it chooser + manual session */
.ps-choose{ align-items:stretch; text-align:left; }
.ps-choose > strong, .ps-choose > .ps-run-sub{ text-align:center; }
.ps-opt{ display:flex; flex-direction:column; gap:3px; width:100%; padding:12px 14px; border-radius:12px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06); color:#fff; text-align:left; cursor:pointer; font:inherit; }
.ps-opt b{ font:700 14px/1.2 Inter, sans-serif; } .ps-opt small{ font:400 11.8px/1.4 Inter, sans-serif; color:#b4b8c0; }
.ps-opt:hover:not(:disabled){ background:rgba(255,255,255,.14); } .ps-opt:disabled{ opacity:.45; cursor:default; }
.ps-pick{ margin:4px 0 0; padding:8px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.12); display:flex; flex-direction:column; gap:6px; font:500 12.5px/1.3 Inter, sans-serif; color:#e4e6ea; }
.ps-pick legend{ padding:0 4px; font:600 11.5px/1 Inter, sans-serif; color:#aeb2ba; } .ps-pick label{ display:flex; gap:7px; align-items:center; cursor:pointer; }
.ps-choose .ps-run-cancel{ align-self:center; }
.ps-man-back{ text-align:center; } .ps-man-back b{ width:100%; text-align:center; }

/* the main photo and the extras swap by dragging one onto the other */
.pf-main-draggable{ cursor:grab; }
.pf-photo.is-swap .pf-photo-frame, .pf-gallery .pf-gallery-thumb.is-swap{ outline:3px solid var(--brand-red, #e5173f); outline-offset:-3px; box-shadow:0 0 0 4px rgba(229,23,63,.25); }
