:root {
  --swiper-theme-color: var(--span);
}

.csray-home {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin-bottom: 8px;
}

/* —— Hero —— */
.csray-hero {
  width: 100%;
}

.swiper {
  width: 100%;
  height: 420px;
}

.image-slider {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--grey);
  background: var(--card);
}

.image-slider__image {
  position: relative;
  text-align: left;
  height: 100%;
}

.image-slider__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
}

.csray-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgb(10 10 10 / 88%) 0%,
    rgb(10 10 10 / 55%) 48%,
    rgb(10 10 10 / 25%) 100%
  );
  pointer-events: none;
}

.csray-hero__content {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: min(560px, 88%);
  padding: 40px 44px 48px;
}

.csray-hero__content h3 {
  margin: 0;
  font-family: "Unbounded", "SF Pro Display", sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-default);
  text-shadow: none;
}

.csray-hero__content p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-custom);
  text-wrap: pretty;
  max-width: 42ch;
  text-shadow: none;
}

/* Старые абсолютные стили слайда — гасим, контент в .csray-hero__content */
.image-slider__image > p,
.image-slider__image > h3 {
  display: none;
}

.image-slider .swiper-button-next::after,
.image-slider .swiper-button-prev::after {
  color: rgb(255 255 255 / 55%);
  font-size: 14px;
  font-weight: 500;
  transition: 0.25s ease-in-out;
}

.swiper-button-next:hover::after,
.swiper-button-prev:hover::after {
  color: rgb(255 255 255);
}

.swiper-button-next:active::after,
.swiper-button-prev:active::after {
  transform: scale(0.8);
}

.swiper-button-next,
.swiper-button-prev {
  bottom: 24px !important;
  right: 24px !important;
  top: unset !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50%;
  border: none;
}

.swiper-button-prev,
.swiper-rtl .swiper-button-next {
  left: auto !important;
  right: 64px !important;
}

.swiper-buttons {
  width: 80px;
  position: absolute;
  right: 24px;
  bottom: 22px;
  background: rgb(10 10 10 / 45%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: 45px;
  z-index: 1;
  border-radius: 50px;
  border: 1px solid rgb(255 255 255 / 6%);
}

.image-slider .swiper-pagination {
  bottom: 14px !important;
  right: 10px !important;
  border-radius: 25px !important;
  width: 100% !important;
  height: 9px;
  line-height: 4px;
}

.image-slider .swiper-pagination-bullet {
  width: 6px;
  height: 6px;
  line-height: 20px;
  font-size: 14px;
  background-color: rgb(255 255 255 / 80%);
  border-radius: 7px;
  transition: width 0.15s linear;
}

.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main {
  transform: scale(1);
  width: 18px;
}

.swiper-pagination-bullet-active {
  width: 20px !important;
  transition: width 0.15s linear;
}

.image-slider .swiper-pagination-fraction {
  font-size: 20px;
  color: #fff;
}

.image-slider .swiper-pagination-progressbar-fill {
  background-color: rgb(255 255 255 / 15%) !important;
  border-radius: 25px !important;
}

.autoplay-progress {
  background-color: rgb(10 10 10 / 55%);
  color: var(--span);
  backdrop-filter: blur(24px);
  border-radius: 50%;
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid rgb(255 255 255 / 6%);
}

.autoplay-progress svg {
  --progress: 0;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  stroke-width: 3px;
  stroke: var(--span);
  fill: none;
  stroke-dashoffset: calc(125.6px * (1 - var(--progress)));
  stroke-dasharray: 125.6;
  transform: rotate(-90deg);
}

/* CTA */
.swiper_action_svg {
  position: absolute;
  height: 24px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(0 0 0 / 18%);
  border-radius: 4px;
  left: 12px;
  transition: 0.25s ease-in-out;
  z-index: -1;
}

.swiper_btn svg {
  position: absolute;
  left: 20px;
  height: 8px;
  width: 8px;
  fill: white;
  transition: 0.25s ease-in-out;
}

.swiper_btn:hover svg {
  transform: rotate(45deg);
}

.swiper_btn:hover .swiper_action_svg {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  left: -12px;
}

.image-slider__image .swiper_btn,
.csray-hero__content .swiper_btn {
  display: inline-flex;
  position: relative;
  bottom: auto;
  left: auto;
  z-index: 2;
  align-items: center;
  justify-content: center;
  height: 48px;
  line-height: 48px;
  background: var(--span);
  padding: 0 22px 0 48px;
  border-radius: 14px;
  color: var(--text-default);
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.25s ease-in-out, transform 0.25s ease-in-out;
}

.csray-hero__content .swiper_btn:hover {
  background: var(--orange);
  transform: translateY(-1px);
}

/* —— Tiles grid —— */
.csray-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.csray-tile,
.card.right-swiper__sc,
.card.right-swiper__store,
.card.right-swiper__ds,
.card.right-swiper__site,
.card.right-swiper__server {
  display: flex;
  position: relative;
  height: 132px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 22px 22px;
  text-align: center;
  font-family: "Unbounded", "SF Pro Display", sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-default);
  background: var(--card);
  border: 1px solid var(--grey);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgb(255 255 255 / 3%) inset;
  transition: transform 0.25s ease-in-out, border-color 0.25s ease-in-out,
    background 0.25s ease-in-out, filter 0.25s ease-in-out;
}

.csray-tile__label {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 8px);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(13px, 1.15vw, 16px);
}

.card.right-swiper__sc:hover,
.card.right-swiper__store:hover,
.card.right-swiper__ds:hover,
.card.right-swiper__site:hover,
.card.right-swiper__server:hover,
.csray-tile:hover {
  filter: none;
  -webkit-filter: none;
  transform: translateY(-3px);
  border-color: var(--span);
}

.card.right-swiper__site,
.card.right-swiper__server,
.csray-tile--stat {
  cursor: default;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.card.right-swiper__site:hover,
.card.right-swiper__server:hover {
  transform: none;
  border-color: var(--grey);
}

.card.right-swiper__ds {
  align-items: center;
  justify-content: center;
  padding: 0;
}

.card.right-swiper__store {
  color: var(--span);
}

.card.right-swiper__sc img,
.card.right-swiper__store img {
  position: absolute;
  right: -40px;
  height: auto;
  width: 70%;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  opacity: 0.55;
  pointer-events: none;
}

.card.right-swiper__store img {
  right: -28px;
  width: 65%;
  opacity: 0.45;
}

.card.right-swiper__sc:before,
.card.right-swiper__store:before,
.card.right-swiper__ds:before,
.card.right-swiper__site:before,
.card.right-swiper__server:before {
  content: none;
}

.card.right-swiper__ds svg {
  width: 36px;
  height: auto;
  fill: #5865f2;
  transition: 0.25s ease-in-out;
}

.card.right-swiper__ds:hover svg {
  transform: scale(1.08);
}

.right-swiper__site svg,
.right-swiper__server svg,
.csray-tile--stat svg {
  position: absolute;
  width: 88px;
  height: auto;
  right: -12px;
  bottom: -8px;
  fill: var(--green);
  opacity: 0.12;
  pointer-events: none;
}

.right-swiper__server svg {
  fill: var(--span);
}

.swipe-count,
.swipe-count-server {
  font-family: "Unbounded", "SF Pro Display", sans-serif;
  font-size: 36px;
  color: var(--green);
  font-weight: 700;
  margin: 0;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.swipe-count-server {
  color: var(--span);
}

.swipe-title__count,
.swipe-title__count-server {
  font-size: 13px;
  color: var(--text-custom);
  opacity: 1;
  font-family: "SF Pro Display", sans-serif;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.swipe-title__count-server {
  color: var(--text-custom);
}

/* Legacy wrappers (если остались в кэше) */
.right-swiper__block,
.right-swiper__second,
.right-swiper__online {
  display: contents;
}

@media (max-width: 1100px) {
  .csray-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .swiper {
    height: 360px;
  }
}

@media (max-width: 768.9px) {
  .csray-home {
    gap: 14px;
  }

  .swiper {
    height: 320px;
  }

  .image-slider {
    border-radius: 18px;
  }

  .csray-hero__content {
    padding: 28px 24px 36px;
    gap: 12px;
    max-width: 100%;
  }

  .csray-hero__content h3 {
    font-size: 26px;
  }

  .csray-hero__content p {
    font-size: 14px;
  }

  .csray-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .csray-tile,
  .card.right-swiper__sc,
  .card.right-swiper__store,
  .card.right-swiper__ds,
  .card.right-swiper__site,
  .card.right-swiper__server {
    height: 112px;
    border-radius: 16px;
    padding: 18px;
    font-size: 14px;
  }

  .swipe-count,
  .swipe-count-server {
    font-size: 28px;
  }

  .swiper-buttons {
    display: none;
  }

  .swiper-button-next,
  .swiper-button-prev {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .csray-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .card.right-swiper__sc {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .csray-tile,
  .card.right-swiper__sc,
  .card.right-swiper__store,
  .card.right-swiper__ds,
  .csray-hero__content .swiper_btn {
    transition: none;
  }

  .csray-tile:hover,
  .card.right-swiper__sc:hover,
  .card.right-swiper__store:hover,
  .card.right-swiper__ds:hover {
    transform: none;
  }
}
