/* === CSS только для баннера на главной странице === */
:root {
  /* Базовые значения (для десктопа 1366px-1919px) */
  --circle-offset-x: 0;
  --circle-offset-y: 0;
  --circle-size: 300px;
  --card-size: 240px;
  --card-img-height: 280px;
  --arrow-vertical: 38%;
  --arrow-horizontal: -55px;
}

/* === Баннер === */
.main-banner-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  overflow: visible;
  aspect-ratio: 16/5;
}

.main-banner-wrapper .banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* === Круг-контейнер === */
.main-circle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--circle-size);
  height: var(--circle-size);
  margin-left: var(--circle-offset-x);
  margin-top: var(--circle-offset-y);
  z-index: 10;
  pointer-events: none;
}

/* === Карточка в кругу — базовые стили === */
.main-card-in-circle {
  pointer-events: auto;
  width: var(--card-size);
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  position: relative;
  margin: 0 auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.main-card-in-circle:active {
  cursor: grabbing;
}

.main-card-in-circle.card-dragging {
  cursor: grabbing;
  transition: none;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.main-card-in-circle:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* === Анимация переворота карточки === */
.main-card-in-circle.card-swipe-out {
  animation: cardSwipeOut 0.3s ease forwards;
}

.main-card-in-circle.card-swipe-in {
  animation: cardSwipeIn 0.3s ease forwards;
}

@keyframes cardSwipeOut {
  0% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.9) rotateY(-45deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) rotateY(-90deg);
  }
}

@keyframes cardSwipeIn {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateY(90deg);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.9) rotateY(45deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

/* Изображение в карточке */
.main-card-in-circle img {
  width: 100%;
  height: var(--card-img-height);
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: filter 0.3s ease, box-shadow 0.2s ease;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.main-card-in-circle img:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.main-card-in-circle.card-swipe-out img {
  filter: blur(5px) brightness(0.7);
}

.main-card-in-circle p {
  margin: 0.3rem 0 0;
  font-weight: 600;
  font-size: 1.15rem;
  color: #222;
  text-align: center;
  background: transparent;
  line-height: 1.3;
}

/* === Стрелки === */
.main-nav-arrow {
  position: absolute;
  top: var(--arrow-vertical);
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 15;
  pointer-events: auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.7;
  user-select: none;
  -webkit-user-select: none;
}

.main-nav-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
}

.main-nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.main-left-arrow { left: var(--arrow-horizontal); }
.main-right-arrow { right: var(--arrow-horizontal); }

/* === Индикатор перетаскивания === */
.main-circle-container::after {
  content: '↔';
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.main-circle-container:hover::after {
  opacity: 0.6;
}

/* === Отключаем выделение текста === */
.main-card-in-circle,
.main-card-in-circle * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* === MEDIA QUERIES === */

/* 📱 МОБИЛЬНЫЕ (≤576px) */
@media screen and (max-width: 576px) {
  :root {
    --circle-offset-x: 23%;
    --circle-offset-y: -18%;
    --circle-size: 90px;
    --card-size: 90px;
    --card-img-height: 80px;
    --arrow-vertical: 38%;
    --arrow-horizontal: -25px;
  }
  
  .main-banner-wrapper {
    aspect-ratio: auto;
    min-height: 200px;
    height: auto;
    padding-bottom: 180px;
  }
  
  .main-banner-wrapper .banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
  }
  
  .main-circle-container {
    top: 60%;
    width: var(--circle-size);
    height: var(--circle-size);
  }
  
  .main-card-in-circle {
    width: var(--card-size);
  }
  
  .main-card-in-circle img {
    height: var(--card-img-height);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  .main-card-in-circle p {
    font-size: 0.55rem;
    margin: 0.2rem 0 0;
    line-height: 1.2;
  }
  
  .main-nav-arrow {
    width: 26px;
    height: 26px;
  }
  
  .main-left-arrow { left: -30px; }
  .main-right-arrow { right: -30px; }
  
  .main-circle-container::after {
    font-size: 10px;
    bottom: -20px;
  }
}

/* 📱 Tablet small (577px–768px) */
@media screen and (min-width: 577px) and (max-width: 768px) {
  :root {
    --circle-offset-x: 0;
    --circle-offset-y: 5%;
    --circle-size: 230px;
    --card-size: 190px;
    --card-img-height: 180px;
    --arrow-vertical: 35%;
    --arrow-horizontal: -40px;
  }
  
  .main-banner-wrapper {
    aspect-ratio: auto;
    min-height: 220px;
    padding-bottom: 200px;
  }
  
  .main-banner-wrapper .banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
  }
  
  .main-circle-container {
    top: 55%;
  }
  
  .main-nav-arrow {
    width: 30px;
    height: 30px;
  }
}

/* 💻 Tablet / Small desktop (769px–1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  :root {
    --circle-offset-x: 5%;
    --circle-offset-y: -3%;
    --circle-size: 270px;
    --card-size: 220px;
    --card-img-height: 240px;
    --arrow-vertical: 37%;
    --arrow-horizontal: -50px;
  }
}

/* 🖥️ HD desktop (1025px–1919px) */
@media screen and (min-width: 1025px) and (max-width: 1919px) {
  :root {
    --circle-offset-x: 25%;
    --circle-offset-y: 0;
    --circle-size: 300px;
    --card-size: 240px;
    --card-img-height: 280px;
    --arrow-vertical: 38%;
    --arrow-horizontal: -55px;
  }
}

/* 🖥️ FullHD (1920px–2559px) */
@media screen and (min-width: 1920px) and (max-width: 2559px) {
  :root {
    --circle-offset-x: 0;
    --circle-offset-y: 0;
    --circle-size: 300px;
    --card-size: 360px;
    --card-img-height: 380px;
    --arrow-vertical: 40%;
    --arrow-horizontal: -60px;
  }
}

/* 🖥️ UltraHD / 4K (≥2560px) */
@media screen and (min-width: 2560px) {
  :root {
    --circle-offset-x: 23%;
    --circle-offset-y: 0;
    --circle-size: 380px;
    --card-size: 310px;
    --card-img-height: 350px;
    --arrow-vertical: 42%;
    --arrow-horizontal: -75px;
  }
  .main-card-in-circle p { font-size: 1.3rem; }
}

/* === Доступность === */
@media (prefers-reduced-motion: reduce) {
  .main-card-in-circle,
  .main-nav-arrow,
  .main-card-in-circle img {
    transition: none !important;
    animation: none !important;
  }
}