/**
 * Nheoweb Infinity Scroll for Elementor
 * Ultra High-Performance 60FPS CSS Hardware-Accelerated Seamless Infinite Loop
 */

:root {
  --nheoweb-infinity-duration: 50s;
  --nheoweb-infinity-row-gap: 20px;
  --nheoweb-infinity-col-gap: 24px;
  --nheoweb-infinity-tilt-angle: 15deg;
  --nheoweb-infinity-tilt-scale: 1.25;
  --nheoweb-infinity-fade-size: 90px;
}

.nheoweb-infinity-scroll {
  position: relative;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  isolation: isolate;
  contain: layout paint;
}

/* FULL HEIGHT (100VH) */
.nheoweb-infinity-scroll.nheoweb-infinity--full-height {
  height: 100vh;
  min-height: 100vh;
}

/* FULL WIDTH BREAKOUT (100VW) */
.nheoweb-infinity-scroll.nheoweb-infinity--full-width {
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  max-width: 100vw !important;
}

/* =========================================
   STAGE CONTAINER
   ========================================= */
.nheoweb-infinity-stage {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* TILTED MODE */
.nheoweb-infinity--tilted .nheoweb-infinity-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170%;
  height: 180%;
  transform: translate3d(-50%, -50%, 0) rotate(var(--nheoweb-infinity-tilt-angle, 15deg)) scale(var(--nheoweb-infinity-tilt-scale, 1.25));
  transform-origin: center center;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  will-change: transform;
}

/* VERTICAL MODE */
.nheoweb-infinity--vertical .nheoweb-infinity-stage {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
}

/* HORIZONTAL MODE */
.nheoweb-infinity--horizontal .nheoweb-infinity-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

/* =========================================
   COLUMNS (VERTICAL & TILTED)
   ========================================= */
.nheoweb-infinity-columns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: var(--nheoweb-infinity-col-gap, 24px);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.nheoweb-infinity-column {
  flex: 1 1 0px;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--nheoweb-infinity-row-gap, 20px);
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  contain: layout paint;
}

.nheoweb-infinity-column .nheoweb-infinity-group {
  display: flex;
  flex-direction: column;
  gap: var(--nheoweb-infinity-row-gap, 20px);
  flex-shrink: 0;
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Direction: UP */
.nheoweb-infinity-column.nheoweb-dir-up .nheoweb-infinity-group {
  animation: nheowebScrollUp var(--nheoweb-infinity-duration, 25s) linear infinite;
}

/* Direction: DOWN */
.nheoweb-infinity-column.nheoweb-dir-down .nheoweb-infinity-group {
  animation: nheowebScrollDown var(--nheoweb-infinity-duration, 25s) linear infinite;
}

/* Keyframes Vertical */
@keyframes nheowebScrollUp {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, calc(-100% - var(--nheoweb-infinity-row-gap, 20px)), 0);
  }
}

@keyframes nheowebScrollDown {
  0% {
    transform: translate3d(0, calc(-100% - var(--nheoweb-infinity-row-gap, 20px)), 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* =========================================
   ROWS (HORIZONTAL MODE)
   ========================================= */
.nheoweb-infinity-rows {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--nheoweb-infinity-row-gap, 20px);
  width: 100%;
}

.nheoweb-infinity-row {
  display: flex;
  flex-direction: row;
  gap: var(--nheoweb-infinity-col-gap, 24px);
  overflow: hidden;
  width: 100%;
  contain: layout paint;
}

.nheoweb-infinity-row .nheoweb-infinity-group {
  display: flex;
  flex-direction: row;
  gap: var(--nheoweb-infinity-col-gap, 24px);
  flex-shrink: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Direction: LEFT */
.nheoweb-infinity-row.nheoweb-dir-left .nheoweb-infinity-group {
  animation: nheowebScrollLeft var(--nheoweb-infinity-duration, 25s) linear infinite;
}

/* Direction: RIGHT */
.nheoweb-infinity-row.nheoweb-dir-right .nheoweb-infinity-group {
  animation: nheowebScrollRight var(--nheoweb-infinity-duration, 25s) linear infinite;
}

/* Keyframes Horizontal */
@keyframes nheowebScrollLeft {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(calc(-100% - var(--nheoweb-infinity-col-gap, 24px)), 0, 0);
  }
}

@keyframes nheowebScrollRight {
  0% {
    transform: translate3d(calc(-100% - var(--nheoweb-infinity-col-gap, 24px)), 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* =========================================
   ITEM / CARD STYLING (FLAT & CLEAN - NO DEFAULT SHADOW)
   ========================================= */
.nheoweb-infinity-item {
  width: 100%;
  height: auto;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  background-color: transparent;
  display: block;
  contain: paint layout;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  box-shadow: none;
}

.nheoweb-infinity-row .nheoweb-infinity-item {
  width: 320px;
  flex-shrink: 0;
}

.nheoweb-infinity-item-inner {
  width: 100%;
  height: 100%;
  display: block;
}

.nheoweb-infinity-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateZ(0);
}

/* CHẾ ĐỘ TỰ NHIÊN THEO ẢNH: Chiều ngang = Cột, Chiều cao co giãn 100% trọn vẹn, không crop */
.nheoweb-infinity-scroll[data-aspect="auto"] .nheoweb-infinity-item {
  aspect-ratio: auto !important;
  height: auto !important;
}

.nheoweb-infinity-scroll[data-aspect="auto"] .nheoweb-infinity-img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

/* KHI CHỦ ĐỘNG CHỌN TỈ LỆ KHÁC AUTO (4/3, 16/9, 1/1...) */
.nheoweb-infinity-scroll:not([data-aspect="auto"]) .nheoweb-infinity-item {
  height: auto;
  display: flex;
}

.nheoweb-infinity-scroll:not([data-aspect="auto"]) .nheoweb-infinity-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HERO BACKGROUND MODE */
.nheoweb-infinity--as-background {
  pointer-events: none;
  user-select: none;
}

.nheoweb-infinity--as-background .nheoweb-infinity-stage,
.nheoweb-infinity--as-background .nheoweb-infinity-column,
.nheoweb-infinity--as-background .nheoweb-infinity-item {
  pointer-events: none !important;
}

/* PAUSE ON HOVER */
.nheoweb-infinity--pause-hover:hover .nheoweb-infinity-group {
  animation-play-state: paused !important;
}

/* =========================================
   FADE EDGES MASK
   ========================================= */
.nheoweb-infinity--fade-vertical {
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black var(--nheoweb-infinity-fade-size, 90px),
    black calc(100% - var(--nheoweb-infinity-fade-size, 90px)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black var(--nheoweb-infinity-fade-size, 90px),
    black calc(100% - var(--nheoweb-infinity-fade-size, 90px)),
    transparent 100%
  );
}

.nheoweb-infinity--fade-horizontal {
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black var(--nheoweb-infinity-fade-size, 90px),
    black calc(100% - var(--nheoweb-infinity-fade-size, 90px)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black var(--nheoweb-infinity-fade-size, 90px),
    black calc(100% - var(--nheoweb-infinity-fade-size, 90px)),
    transparent 100%
  );
}

/* =========================================
   OVERLAY TINT LAYER
   ========================================= */
.nheoweb-infinity-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* =========================================
   FOREGROUND HERO CONTENT (TEXT & BUTTONS)
   ========================================= */
.nheoweb-infinity-content-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 3;
}

.nheoweb-infinity-content {
  position: relative;
  width: 100%;
  max-width: 780px;
  pointer-events: auto;
  box-sizing: border-box;
}

.nheoweb-infinity-logo {
  display: block;
  margin-bottom: 16px;
  line-height: 1;
}

.nheoweb-infinity-logo a,
.nheoweb-infinity-logo img {
  display: inline-block;
  vertical-align: middle;
}

.nheoweb-infinity-logo-img {
  width: 65px;
  max-width: 100%;
  height: auto;
  display: inline-block;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.nheoweb-infinity-logo a:hover .nheoweb-infinity-logo-img {
  transform: scale(1.06);
}

.nheoweb-infinity-subtitle {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  line-height: 1.4;
}

.nheoweb-infinity-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0 0 18px 0;
  word-break: break-word;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.nheoweb-infinity-desc {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 30px 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.nheoweb-infinity-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.nheoweb-infinity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  outline: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nheoweb-infinity-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* =========================================
   RESPONSIVE COLUMNS VISIBILITY & STAGE
   ========================================= */
/* Desktop */
.nheoweb-infinity-scroll[data-desktop-cols="1"] .nheoweb-infinity-column:nth-child(n+2),
.nheoweb-infinity-scroll[data-desktop-cols="2"] .nheoweb-infinity-column:nth-child(n+3),
.nheoweb-infinity-scroll[data-desktop-cols="3"] .nheoweb-infinity-column:nth-child(n+4),
.nheoweb-infinity-scroll[data-desktop-cols="4"] .nheoweb-infinity-column:nth-child(n+5),
.nheoweb-infinity-scroll[data-desktop-cols="5"] .nheoweb-infinity-column:nth-child(n+6) {
  display: none !important;
}

/* Tablet (1024px) */
@media (max-width: 1024px) {
  .nheoweb-infinity--tilted .nheoweb-infinity-stage {
    width: 150%;
    height: 170%;
  }

  .nheoweb-infinity-title {
    font-size: 36px;
  }

  .nheoweb-infinity-scroll[data-tablet-cols="1"] .nheoweb-infinity-column:nth-child(n+2),
  .nheoweb-infinity-scroll[data-tablet-cols="2"] .nheoweb-infinity-column:nth-child(n+3),
  .nheoweb-infinity-scroll[data-tablet-cols="3"] .nheoweb-infinity-column:nth-child(n+4),
  .nheoweb-infinity-scroll[data-tablet-cols="4"] .nheoweb-infinity-column:nth-child(n+5),
  .nheoweb-infinity-scroll[data-tablet-cols="5"] .nheoweb-infinity-column:nth-child(n+6) {
    display: none !important;
  }

  .nheoweb-infinity-scroll[data-tablet-rows="1"] .nheoweb-infinity-row:nth-child(n+2),
  .nheoweb-infinity-scroll[data-tablet-rows="2"] .nheoweb-infinity-row:nth-child(n+3) {
    display: none !important;
  }
}

/* Mobile (767px) */
@media (max-width: 767px) {
  .nheoweb-infinity--tilted .nheoweb-infinity-stage {
    width: 130%;
    height: 160%;
  }

  .nheoweb-infinity-title {
    font-size: 26px;
    margin-bottom: 12px;
  }

  .nheoweb-infinity-desc {
    font-size: 14px;
    margin-bottom: 22px;
  }

  .nheoweb-infinity-buttons {
    gap: 12px;
  }

  .nheoweb-infinity-btn {
    font-size: 14px;
    padding: 10px 20px !important;
  }

  .nheoweb-infinity-scroll[data-mobile-cols="1"] .nheoweb-infinity-column:nth-child(n+2),
  .nheoweb-infinity-scroll[data-mobile-cols="2"] .nheoweb-infinity-column:nth-child(n+3),
  .nheoweb-infinity-scroll[data-mobile-cols="3"] .nheoweb-infinity-column:nth-child(n+4),
  .nheoweb-infinity-scroll[data-mobile-cols="4"] .nheoweb-infinity-column:nth-child(n+5) {
    display: none !important;
  }

  .nheoweb-infinity-scroll[data-mobile-rows="1"] .nheoweb-infinity-row:nth-child(n+2),
  .nheoweb-infinity-scroll[data-mobile-rows="2"] .nheoweb-infinity-row:nth-child(n+3) {
    display: none !important;
  }

  .nheoweb-infinity-row .nheoweb-infinity-item {
    width: 220px;
  }
}

/* =========================================
   EDITOR EMPTY PLACEHOLDER
   ========================================= */
.nheoweb-infinity-scroll-empty {
  min-height: 380px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9fafb;
  padding: 40px 20px;
  text-align: center;
}

.nheoweb-infinity-empty-box i {
  font-size: 48px;
  color: #3b82f6;
  margin-bottom: 12px;
}

.nheoweb-infinity-empty-box h4 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.nheoweb-infinity-empty-box p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}
