/* Cards is a separate presentation. Organize retains its existing markup/style. */
.saved-card-view { display: none; }
#savedGrid.saved-grid-cards .saved-card-view { display: block; }
#savedGrid.saved-grid-cards .product-image-wrap { display: none; }
#savedGrid.saved-grid-cards .product-card { filter: none; }
.saved-card-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  isolation: isolate;
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 16px;
}
.saved-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  box-sizing: border-box;
  border: 0;
  border-radius: 20px;
  background: transparent;
  transform-origin: top left;
  transition: transform 440ms cubic-bezier(.22,.8,.25,1);
  pointer-events: none;
}
.saved-card-photo img {
  /* Invisible slot bounds stay fixed; only the natural-proportion image is visible. */
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 20px;
  box-shadow: 0 7px 22px rgba(55,39,30,.11), 0 1px 3px rgba(55,39,30,.08);
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 180ms ease;
}
.saved-card-photo.is-ready img { opacity: 1; }
.saved-card-photo.is-unavailable { display: grid; place-items: center; color: #82766c; font: 13px var(--sans); }
.saved-card-view[data-count="3"] .saved-card-photo[data-slot="0"] { z-index: 1; transform: translate(0%,2%) scale(.58); }
.saved-card-view[data-count="3"] .saved-card-photo[data-slot="1"] { z-index: 2; transform: translate(28%,17%) scale(.72); }
.saved-card-view[data-count="3"] .saved-card-photo[data-slot="2"] { z-index: 3; transform: translate(3%,54%) scale(.43); }
.saved-card-view[data-count="2"] .saved-card-photo[data-slot="0"] { z-index: 1; transform: translate(0%,3%) scale(.6); }
.saved-card-view[data-count="2"] .saved-card-photo[data-slot="1"] { z-index: 2; transform: translate(24%,20%) scale(.76); }
.saved-card-view[data-count="1"] .saved-card-photo { z-index: 1; transform: none; border-width: 0; border-radius: 14px; box-shadow: none; }
.saved-card-view[data-count="1"] .saved-card-photo img { border-radius: 14px; box-shadow: none; }
/* Stack keeps its name and rotation order, but displays one centered photo at a time. */
:is(#savedGrid[data-card-layout="stack"] .saved-card-view:not([data-card-layout]), #savedGrid .saved-card-view[data-card-layout="stack"]) .saved-card-photo {
  z-index: 1;
  opacity: 0;
  transform: scale(.98);
  transform-origin: center;
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}
:is(#savedGrid[data-card-layout="stack"] .saved-card-view:not([data-card-layout]), #savedGrid .saved-card-view[data-card-layout="stack"]) .saved-card-photo[data-active="true"] {
  z-index: 2;
  opacity: 1;
  transform: scale(1);
}
:is(#savedGrid[data-card-layout="stack"] .saved-card-view:not([data-card-layout]), #savedGrid .saved-card-view[data-card-layout="stack"]) .saved-card-photo.is-ready img { transition: none; }
.saved-card-layout { display: flex; justify-content: flex-end; gap: 4px; margin: -10px 0 18px auto; width: fit-content; }
.saved-card-layout[hidden] { display: none; }
.saved-card-layout button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #82766c; font: 500 11px var(--sans); cursor: pointer; touch-action: manipulation; }
.saved-card-layout button.selected { color: #28231f; background: #eee8e1; border-color: rgba(100,80,65,.08); }
.saved-card-layout button svg { width: 17px; height: 17px; }
.saved-card-layout button:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.saved-card-controls { display: flex; align-items: center; justify-content: center; height: 44px; gap: 0; margin-top: 0; }
.saved-card-rotate { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 12px; border: 0; border-radius: 50%; background: transparent; color: #8d8177; cursor: pointer; touch-action: manipulation; }
.saved-card-rotate[hidden] { display: none; }
.saved-card-rotate svg { width: 15px; height: 15px; }
.saved-card-rotate:hover { background: #eee8e1; color: #27231f; }
.saved-card-rotate:active { background: #eadfd7; }
.saved-card-focus { min-width: 0; width: 56px; text-align: center; font: 500 10px var(--sans); letter-spacing: .025em; color: #82766c; }
.saved-card-controls.is-single { visibility: hidden; }
.saved-card-stage:focus-visible, .saved-card-rotate:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
#savedGrid.saved-grid-cards .product-info { padding-top: 3px; }
#savedGrid.saved-grid-cards .product-info { cursor: default; }
#savedGrid .product-info h2[role="button"] { cursor: pointer; }
#savedGrid .product-info h2[role="button"]:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  .saved-card-photo, .saved-card-photo img,
  :is(#savedGrid[data-card-layout="stack"] .saved-card-view:not([data-card-layout]), #savedGrid .saved-card-view[data-card-layout="stack"]) .saved-card-photo { transition: none; }
}
