/* ==========================================================================
   3D-карусель «картины в багете» — переиспользуемый компонент.
   Работает в паре с js/carousel3d.js (initCarousel3D).
   ========================================================================== */

.c3d-root{
  position:relative;
  z-index:0;
  width:100%;
  padding:10px 0 6px;
  -webkit-tap-highlight-color:transparent;
}
.c3d-stage{
  position:relative;
  z-index:0;
  width:100%;
  height:540px;
  overflow:hidden;
  perspective:1000px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:grab;
  touch-action:pan-y;
  user-select:none;
  -webkit-user-select:none;
}
/* Фоновое свечение вынесено на .c3d-root (у него нет overflow:hidden) —
   раньше оно висело на .c3d-stage, который сам обрезает всё по своим
   границам, и мягкое пятно света превращалось в грубый прямоугольный
   блок с видимым краем. Здесь оно свободно растворяется в фоне страницы,
   и карусель выглядит парящей, а не запертой в рамке подсветки. */
.c3d-root::before{
  content:"";
  position:absolute;
  inset:6% 10%;
  z-index:-1;
  background:
    radial-gradient(42% 60% at 50% 42%, rgba(139,92,246,.28), transparent 75%),
    radial-gradient(34% 50% at 22% 60%, rgba(79,140,255,.22), transparent 75%),
    radial-gradient(30% 42% at 78% 58%, rgba(79,140,255,.16), transparent 75%);
  filter:blur(48px);
  pointer-events:none;
}
.c3d-root.dragging .c3d-stage{ cursor:grabbing; }

.c3d-cylinder{
  position:relative;
  transform-style:preserve-3d;
  will-change:transform;
}

.c3d-card{
  position:absolute;
  top:50%;
  left:50%;
  transform-style:preserve-3d;
}

/* ---- Стеклянная tech-карточка с фиолетово-синим неоновым ореолом —
   вместо деревянной рамки. Фото занимает всю карточку, название/цена
   лежат поверх на затемняющей подложке снизу (как в референсе — тёмное
   глянцевое стекло + мягкое неоновое свечение по контуру). ---- */
.c3d-frame{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  text-decoration:none;
  color:inherit;
  background:#100e18;
  border-radius:22px;
  padding:0;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:
    /* фиолетово-синий неоновый ореол по контуру карточки */
    0 0 26px 2px rgba(139,92,246,.55),
    0 0 55px 10px rgba(79,140,255,.4),
    0 0 95px 20px rgba(139,92,246,.22),
    inset 0 1px 0 rgba(255,255,255,.18),
    /* мягкая контактная тень под карточкой */
    0 30px 50px -16px rgba(0,0,0,.8);
  backface-visibility:hidden;
  transform-style:preserve-3d;
  transition:box-shadow .25s ease, filter .25s ease, border-color .25s ease;
  overflow:hidden;
}
.c3d-frame:hover{
  filter:brightness(1.06);
  border-color:rgba(255,255,255,.24);
  box-shadow:
    0 0 34px 4px rgba(139,92,246,.7),
    0 0 70px 14px rgba(79,140,255,.55),
    0 0 120px 26px rgba(139,92,246,.3),
    inset 0 1px 0 rgba(255,255,255,.22),
    0 30px 50px -16px rgba(0,0,0,.8);
}

.c3d-frame-inner{
  position:relative;
  flex:0 0 62%;
  background:#0b0a0e;
  border-radius:22px 22px 0 0;
  padding:0;
  box-shadow:none;
  min-height:0;
  overflow:hidden;
}
/* В режиме «фото» текстовой плашки нет — фото занимает всю карточку. */
.c3d-frame.photo-only .c3d-frame-inner{ flex:1 1 auto; border-radius:22px; }
.c3d-frame.photo-only{ cursor:pointer; }

.c3d-photo{
  width:100%;
  height:100%;
  background-size:cover;
  background-position:center;
  background-color:#1b1a21;
}

.c3d-plate{
  position:relative;
  z-index:4;
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:14px 18px 16px;
  text-align:left;
  color:#f4f1ea;
  /* Вместо плоского чёрного — тёмная подложка с мягким фиолетово-синим
     свечением по углам, в тон неоновой рамке, плюс тонкая светлая линия
     сверху, отделяющая текст от фото. */
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(139,92,246,.16), transparent 60%),
    radial-gradient(120% 160% at 100% 0%, rgba(79,140,255,.16), transparent 60%),
    linear-gradient(180deg, #17141f 0%, #100e18 100%);
  border-top:1px solid rgba(255,255,255,.08);
}
.c3d-plate-name{
  font-family:'Unbounded',sans-serif;
  font-weight:700;
  font-size:14.5px;
  line-height:1.2;
  margin-bottom:4px;
  letter-spacing:.2px;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.c3d-plate-meta{
  font-size:10px;
  opacity:.7;
  margin-bottom:5px;
  line-height:1.3;
  color:#cfc9bd;
}
.c3d-plate-price{
  font-family:'Unbounded',sans-serif;
  font-weight:700;
  font-size:13px;
  margin-bottom:8px;
  background:linear-gradient(135deg,#8b5cf6,#4f8cff);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.c3d-plate-btn{
  display:inline-block;
  align-self:flex-start;
  font-size:8.5px;
  letter-spacing:.5px;
  text-transform:uppercase;
  border:1px solid rgba(255,255,255,.35);
  color:#fff;
  padding:5px 12px;
  border-radius:20px;
  backdrop-filter:blur(4px);
  transition:background .2s ease, color .2s ease, border-color .2s ease;
}
.c3d-frame:hover .c3d-plate-btn{ background:linear-gradient(135deg,#8b5cf6,#4f8cff); border-color:transparent; color:#fff; }

.c3d-hint-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:4px;
  flex-wrap:wrap;
}
.c3d-hint{
  text-align:center;
  font-size:11.5px;
  color:var(--muted, #6b6459);
  letter-spacing:.4px;
}
.c3d-pause-btn{
  border:1px solid var(--panel-border, rgba(255,255,255,.1));
  background:var(--panel, rgba(255,255,255,.045));
  color:var(--muted, #6b6459);
  font-size:11.5px;
  letter-spacing:.3px;
  border-radius:20px;
  padding:5px 14px;
  cursor:pointer;
  transition:.2s ease;
}
.c3d-pause-btn:hover{ color:var(--text, #f4f1ea); border-color:rgba(255,255,255,.25); }

/* Видимый фокус для клавиатурной навигации по карусели */
.c3d-stage:focus-visible{
  outline:2px solid var(--glow1, #8b5cf6);
  outline-offset:4px;
  border-radius:12px;
}

@media (max-width:600px){
  .c3d-stage{ height:460px; }
  /* Карточка вертикальная и на мобильном у'же, поэтому шрифт названия
     должен быть НЕ больше десктопного — иначе многоточие/перенос
     обрезает текст агрессивнее, чем на десктопе. */
  .c3d-plate-name{ font-size:13px; white-space:normal; overflow:visible; text-overflow:clip; line-height:1.15; }
  .c3d-plate-meta{ font-size:9.5px; }
  .c3d-plate-price{ font-size:12px; }
  .c3d-plate-btn{ font-size:8px; padding:4px 8px; }
  .c3d-plate{ padding:12px 14px 12px; }
}
