/**
 * Home page skeleton loader + scroll fix
 * Красивый скелетон для главной страницы
 */

/* Исправление: sticky + top:-500px вызывало наложение карточек при скролле и тормоза */
body.home .services-cst,
body.page-template-templates-home-php .services-cst {
  position: relative !important;
  top: auto !important;
}

.home-skeleton-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #111;  /* как на странице Portfolio NEW */
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.home-loaded .home-skeleton-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-skeleton-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 120px 90px 80px;
}

/* Shimmer animation */
.home-skeleton-shimmer {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.home-skeleton-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0) 100%);
  animation: homeSkeletonShimmer 1.1s ease-in-out infinite;
}

@keyframes homeSkeletonShimmer {
  100% { transform: translateX(100%); }
}

/* Hero section */
.home-skeleton-hero {
  display: flex;
  gap: 60px;
  align-items: center;
  justify-content: space-between;
  min-height: 70vh;
  margin-bottom: 80px;
}

.home-skeleton-hero-left {
  flex: 0 1 420px;
}

.home-skeleton-hero-title {
  height: 56px;
  width: 85%;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.08);
}

.home-skeleton-hero-desc {
  height: 20px;
  width: 100%;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.home-skeleton-hero-desc:nth-child(3) {
  width: 70%;
}

.home-skeleton-hero-btns {
  display: flex;
  gap: 20px;
  margin-top: 36px;
}

.home-skeleton-hero-btn1 {
  width: 160px;
  height: 52px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 30px;
}

.home-skeleton-hero-btn2 {
  width: 180px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-hero-3d {
  flex: 1;
  min-height: 400px;
  max-width: 50%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 24px;
}

/* Services section */
.home-skeleton-services {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 60px;
  padding: 60px 80px;
  margin-bottom: 80px;
}

.home-skeleton-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.home-skeleton-service-item:last-child {
  border-bottom: none;
}

.home-skeleton-service-numb {
  width: 48px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-service-title {
  flex: 1;
  max-width: 400px;
  height: 42px;
  margin: 0 40px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.home-skeleton-service-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

/* Awards section */
.home-skeleton-awards {
  margin-bottom: 80px;
}

.home-skeleton-awards-title {
  width: 180px;
  height: 24px;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-awards-slider {
  display: flex;
  gap: 24px;
  overflow: hidden;
}

.home-skeleton-award-card {
  flex: 0 0 200px;
  height: 140px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

/* Portfolio section */
.home-skeleton-portfolio {
  margin-bottom: 80px;
}

.home-skeleton-portfolio-header {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
}

.home-skeleton-portfolio-title {
  width: 220px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-portfolio-video {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.home-skeleton-portfolio-slider {
  display: flex;
  gap: 30px;
}

.home-skeleton-portfolio-card {
  flex: 0 1 380px;
  display: flex;
  gap: 40px;
}

.home-skeleton-portfolio-card-text {
  flex: 1;
}

.home-skeleton-portfolio-card-line1 {
  height: 28px;
  width: 80%;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-portfolio-card-line2 {
  height: 16px;
  width: 100%;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.home-skeleton-portfolio-card-line2:last-of-type {
  width: 60%;
}

.home-skeleton-portfolio-card-img {
  width: 280px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

/* Partners grid */
.home-skeleton-partners {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}

.home-skeleton-partner-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

/* Reviews */
.home-skeleton-reviews {
  margin-bottom: 80px;
}

.home-skeleton-reviews-header {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 40px;
}

.home-skeleton-reviews-rating {
  width: 120px;
  height: 80px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.home-skeleton-reviews-text {
  flex: 1;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.home-skeleton-reviews-slider {
  display: flex;
  gap: 24px;
}

.home-skeleton-review-card {
  flex: 0 0 360px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

.home-skeleton-review-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.home-skeleton-review-line {
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 8px;
}

.home-skeleton-review-line:last-child {
  width: 70%;
}

/* Why choose - 4 cards */
.home-skeleton-why {
  margin-bottom: 80px;
}

.home-skeleton-why-title {
  width: 320px;
  height: 36px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-why-desc {
  width: 480px;
  height: 20px;
  margin-bottom: 50px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.home-skeleton-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.home-skeleton-why-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

.home-skeleton-why-video {
  aspect-ratio: 4/3;
  background: rgba(255, 255, 255, 0.08);
}

.home-skeleton-why-text {
  height: 48px;
  margin: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* Blog */
.home-skeleton-blog {
  margin-bottom: 80px;
}

.home-skeleton-blog-title {
  width: 160px;
  height: 24px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-blog-cards {
  display: flex;
  gap: 30px;
}

.home-skeleton-blog-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

.home-skeleton-blog-img {
  aspect-ratio: 16/10;
  background: rgba(255, 255, 255, 0.08);
}

.home-skeleton-blog-card-title {
  height: 24px;
  width: 80%;
  margin: 24px 24px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.home-skeleton-blog-card-desc {
  height: 14px;
  width: 90%;
  margin: 0 24px 24px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

/* Office section */
.home-skeleton-office {
  display: flex;
  gap: 60px;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 50px;
}

.home-skeleton-office-img {
  width: 45%;
  aspect-ratio: 4/3;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

.home-skeleton-office-text {
  flex: 1;
}

.home-skeleton-office-line {
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 12px;
}

.home-skeleton-office-line:nth-child(1) {
  width: 60%;
}

.home-skeleton-office-line:nth-child(2) {
  width: 100%;
}

.home-skeleton-office-line:nth-child(3) {
  width: 85%;
}

.home-skeleton-office-line:nth-child(4) {
  width: 70%;
}

/* Responsive */
@media (max-width: 1024px) {
  .home-skeleton-inner {
    padding: 100px 40px 60px;
  }

  .home-skeleton-hero {
    flex-direction: column;
    gap: 40px;
    min-height: auto;
  }

  .home-skeleton-hero-left {
    flex: none;
    width: 100%;
  }

  .home-skeleton-hero-3d {
    max-width: 100%;
    min-height: 300px;
  }

  .home-skeleton-services {
    padding: 40px 30px;
  }

  .home-skeleton-why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-skeleton-partners {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .home-skeleton-inner {
    padding: 80px 20px 40px;
  }

  .home-skeleton-hero-title {
    height: 40px;
  }

  .home-skeleton-hero-3d {
    min-height: 220px;
  }

  .home-skeleton-service-item {
    flex-wrap: wrap;
    gap: 16px;
  }

  .home-skeleton-service-title {
    flex: 1 1 100%;
    margin: 0;
    max-width: none;
  }

  .home-skeleton-awards-slider .home-skeleton-award-card {
    flex: 0 0 160px;
  }

  .home-skeleton-portfolio-slider .home-skeleton-portfolio-card {
    flex-direction: column;
  }

  .home-skeleton-portfolio-card-img {
    width: 100%;
  }

  .home-skeleton-why-grid {
    grid-template-columns: 1fr;
  }

  .home-skeleton-blog-cards {
    flex-direction: column;
  }

  .home-skeleton-office {
    flex-direction: column;
  }

  .home-skeleton-office-img {
    width: 100%;
  }
}
