.fp-customizer {
  margin: 18px 0 14px;
  padding: 14px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
}

.fp-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.fp-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fp-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e9e9e9;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}

.fp-stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

.fp-pillow {
  position: relative;
  width: min(520px, 100%);
}

.fp-pillow-img {
  width: 100%;
  height: auto;
  display: block;
}

.fp-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 18px;
  padding: 64px 58px;
    pointer-events: auto;
 z-index: 5;
}

/* 2x2 / 3x3 переключается классом */
.fp-grid.is-2x2 { grid-template-columns: repeat(2, 1fr); }
.fp-grid.is-3x3 { grid-template-columns: repeat(3, 1fr); }

/* Ячейка */
.fp-cell {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.18);
  pointer-events: auto;
  touch-action: none;
  outline: 2px dashed rgba(255,255,255,0.9);
  outline-offset: -10px;
}

/* Квадрат */
.fp-cell::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.fp-cell-inner {
  position: absolute;
  inset: 0;
  cursor: grab;
}

/* Фото как background */
.fp-photo {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  transform: translate3d(0,0,0);
}

/* Панель */
.fp-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.fp-zoom {
  width: 100%;
}

.fp-hint {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.8;
}

@media (max-width: 420px) {
  .fp-grid { padding: 52px 40px; gap: 12px; }
  .fp-title { font-size: 16px; }
}

.fp-loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  background:rgba(0,0,0,0.25);
  color:#fff;
  z-index:2;
}
/* input file всегда кликабельный поверх ячейки */
.fp-file{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
  z-index: 6;
}

/* иконка загрузки в пустой ячейке */
.fp-upload-icon{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:8px;
  z-index:5;
  pointer-events:none; /* чтобы клик уходил в input */
  color: rgba(255,255,255,0.95);
  font-weight:600;
}

.fp-upload-icon .fp-plus{
  width:44px;
  height:44px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.20);
  font-size:26px;
  line-height:1;
}

/* когда есть фото — скрываем иконку */
.fp-cell.has-photo .fp-upload-icon{
  display:none;
}
