/* Photo Studio */

.photo-studio {
  --studio-accent: #e7c8a0;
  --studio-panel: #161616;
  --studio-line: rgb(255 255 255 / 12%);
  position: relative;
  z-index: 90;
}

.photo-studio [hidden] {
  display: none !important;
}

.photo-studio__dock-wrap {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 91;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.photo-studio__dock {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--studio-line);
  border-radius: 999px;
  background: rgb(15 15 15 / 92%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgb(0 0 0 / 35%);
  transition: transform 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
}

.photo-studio__dock:hover {
  transform: translateY(-2px);
  border-color: rgb(255 255 255 / 22%);
}

.photo-studio__dock-toggle {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid var(--studio-line);
  border-radius: 999px;
  background: rgb(15 15 15 / 92%);
  color: var(--muted, #aaa);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 28px rgb(0 0 0 / 35%);
}

.photo-studio__dock-toggle:hover {
  color: #fff;
  border-color: rgb(255 255 255 / 22%);
}

/* Компактный режим: только ♥ и счётчик */
.photo-studio.is-dock-collapsed .photo-studio__dock {
  padding: 0.65rem;
  gap: 0.35rem;
}

.photo-studio.is-dock-collapsed .photo-studio__dock-text {
  display: none;
}

.photo-studio.is-dock-collapsed .photo-studio__dock-toggle {
  display: none;
}

.photo-studio.is-dock-collapsed .photo-studio__dock-wrap:hover .photo-studio__dock-toggle,
.photo-studio.is-dock-collapsed .photo-studio__dock-wrap:focus-within .photo-studio__dock-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-studio__dock-icon {
  color: #f87171;
  font-size: 1.05rem;
}

.photo-studio__dock-count {
  min-width: 1.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--studio-accent);
  color: #1a1208;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.photo-studio__panel {
  position: fixed;
  inset: auto 1rem 4.5rem 1rem;
  z-index: 92;
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  background: var(--studio-panel);
  box-shadow: 0 18px 50px rgb(0 0 0 / 45%);
  overflow: hidden;
}

@media (min-width: 720px) {
  .photo-studio__panel {
    inset: auto 1rem 4.5rem auto;
    width: min(440px, calc(100vw - 2rem));
  }
}

.photo-studio__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--studio-line);
  flex-shrink: 0;
}

.photo-studio__panel-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
}

.photo-studio__close {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--studio-line);
  border-radius: 6px;
  background: rgb(255 255 255 / 6%);
  color: #f5f5f4;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.photo-studio__close:hover {
  color: #fff;
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 28%);
}

.photo-studio__tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--studio-line);
  flex-shrink: 0;
  background: rgb(0 0 0 / 20%);
}

.photo-studio__tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #d4d4d4;
  font: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
}

.photo-studio__tab.is-active {
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 18%);
  color: #fff;
}

.photo-studio__next-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--studio-line);
}

.photo-studio__next-actions .photo-studio__actions {
  margin-top: 0.35rem;
}

.photo-studio__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.9rem 1rem 1rem;
  overflow: auto;
}

.photo-studio__panel-foot {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--studio-line);
  flex-shrink: 0;
  background: rgb(0 0 0 / 35%);
}

.photo-studio__foot-nav,
.photo-studio__foot-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.photo-studio__foot-nav .photo-studio__btn,
.photo-studio__foot-tools .photo-studio__btn {
  flex: 1 1 auto;
  min-width: 6.5rem;
}

.photo-studio__controls--stack {
  display: grid;
  gap: 0.55rem;
}

.photo-studio__controls--stack label {
  display: grid;
  gap: 0.3rem;
}

.photo-studio__controls--stack input[type="text"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: rgb(255 255 255 / 6%);
  color: inherit;
  font: inherit;
}

.photo-studio__inline-actions {
  display: flex;
  align-items: flex-end;
}

.photo-studio__inline-actions .photo-studio__btn {
  width: 100%;
}

.photo-studio__hint {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.photo-studio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.photo-studio__thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
}

.photo-studio__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-studio__thumb.is-active {
  outline: 2px solid var(--studio-accent);
  outline-offset: 1px;
}

.photo-studio__thumb-remove,
.photo-studio__pick {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.photo-studio__thumb-remove {
  top: 0.25rem;
  right: 0.25rem;
  width: 1.35rem;
  height: 1.35rem;
  background: rgb(0 0 0 / 65%);
  color: #fff;
  font-size: 0.85rem;
}

.photo-studio__pick {
  top: 0.45rem;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.modula-item:hover .photo-studio__pick,
.portfolio-card:hover .photo-studio__pick,
.photo-studio__pick.is-on,
.photo-studio__pick:focus-visible {
  opacity: 1;
}

.photo-studio__pick.is-on {
  background: #be123c;
  transform: scale(1.05);
}

.photo-studio__ghost {
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
}

.photo-studio__controls {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.photo-studio__controls--row {
  grid-template-columns: 1fr 1fr;
}

.photo-studio__controls label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.photo-studio__controls select,
.photo-studio__controls input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--studio-line);
  border-radius: 6px;
  background: #111;
  color: var(--text);
  font: inherit;
}

.photo-studio__design-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.photo-studio__design-card {
  padding: 0.55rem;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #111;
  cursor: pointer;
}

.photo-studio__design-card.is-active {
  border-color: var(--studio-accent);
}

.photo-studio__design-card span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.photo-studio__mini-layout {
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  background: #2a2a2a;
}

.photo-studio__actions {
  display: flex;
  gap: 0.5rem;
}

.photo-studio__btn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.photo-studio__btn--primary {
  border-color: transparent;
  background: var(--studio-accent);
  color: #1a1208;
  font-weight: 600;
}

.photo-studio__wall-preview {
  aspect-ratio: 16 / 9;
  margin-bottom: 0.75rem;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.photo-studio__wall-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Печать без window.open — скрытый iframe */
.photo-studio__print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Предпросмотр на странице — без всплывающих окон */
.photo-studio__print-preview {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(0 0 0 / 72%);
}

.photo-studio__print-preview[hidden] {
  display: none !important;
}

.photo-studio__print-preview-dialog {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  height: min(90vh, 900px);
  background: #1a1a1a;
  border: 1px solid var(--studio-line, rgb(255 255 255 / 12%));
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgb(0 0 0 / 45%);
}

.photo-studio__print-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--studio-line, rgb(255 255 255 / 12%));
}

.photo-studio__print-preview-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.photo-studio__print-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.photo-studio__print-preview-actions .photo-studio__btn {
  flex: 0 0 auto;
}

.photo-studio__print-preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.photo-studio__crop {
  margin: 0 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--studio-line, rgb(255 255 255 / 12%));
  border-radius: 10px;
  background: rgb(0 0 0 / 22%);
}

.photo-studio__crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-top: 0.65rem;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.photo-studio__crop-stage[data-orient="portrait"] {
  aspect-ratio: 4 / 5;
}

.photo-studio__crop-stage[data-orient="landscape"] {
  aspect-ratio: 16 / 9;
}

.photo-studio__crop-stage[data-orient="square"] {
  aspect-ratio: 1 / 1;
}

.photo-studio__crop-stage.is-dragging {
  cursor: grabbing;
}

.photo-studio__crop-stage img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: cover;
  object-position: 50% 50%;
}


.photo-studio__print-preview.is-fullscreen {
  padding: 0;
  background: #000;
}

.photo-studio__print-preview.is-fullscreen .photo-studio__print-preview-dialog,
.photo-studio__print-preview-dialog:fullscreen,
.photo-studio__print-preview-dialog:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: 0;
}

