/* ============================================= */
/* MAGAZINE CAROUSEL CLEAN CSS — v1.8-R          */
/* ENHANCED: MOBILE + STAGGERED LOAD + DRAG/TOUCH */
/* ============================================= */

/* ===============================
   Carousel Container
=============================== */
.magnetic-carousel {
  position: relative;
  width: 100%;
  padding: 40px 0;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  transform: translateX(80px); /* initial cinematic offset */
  transition: opacity 0.8s ease, transform 1s ease;
  display: flex;
  flex-wrap: nowrap;
	 z-index: 9999;
}

.magnetic-carousel.loaded {
  opacity: 1;
  transform: translateX(0);
}


/* ===============================
   Track (flex container for items)
=============================== */
.magnetic-track {
  display: flex;
  gap: 35px;
  padding: 10px 0;
  transition: transform 0.25s ease-out;
}

/* ===============================
   Carousel Item
=============================== */
.mag-item {
  flex: 0 0 auto;      /* prevent shrinking */
  text-align: center;
  transition: transform 0.25s ease-out, filter 0.25s ease-out, opacity 0.4s ease;
  cursor: pointer;
  opacity: 0;           /* will fade-in with stagger */
  transform: scale(0.9);
}

.mag-item.loaded {
  opacity: 1;
  transform: scale(1);
}

.mag-item img {
  width: 140px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  transition: transform 0.25s ease-out, filter 0.25s ease-out;
}

.mag-item p {
  margin-top: 10px;
  font-weight: 600;
  color: #fff;
}

/* ===============================
   Hover Magnetic Effect
=============================== */
.magnetic-carousel:hover .mag-item {
  filter: brightness(0.65);
}

.magnetic-carousel:hover .mag-item:hover {
  transform: scale(1.18);
  filter: brightness(1.2);
  z-index: 50;
}

/* ===============================
   Scroll Wrapper for drag/swipe
=============================== */
.scroll-wrapper {
  overflow-x: auto;
  scroll-behavior: smooth;
  white-space: nowrap;
  cursor: grab;
  position: relative;
  width: 100%;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

.scroll-wrapper:active {
  cursor: grabbing;
}

.scroll-wrapper::-webkit-scrollbar {
  display: none; /* hide scrollbar */
}

/* ===============================
   Responsive: Mobile adjustments
=============================== */
@media (max-width: 992px) {
  .mag-item {
    width: 110px;       /* smaller items on tablet/mobile */
  }

  .magnetic-track {
    gap: 15px;
  }

  .magnetic-carousel {
    padding: 20px 0;
    transform: translateX(40px);
  }
}

@media (max-width: 576px) {
  .mag-item {
    width: 90px;
  }

  .magnetic-carousel {
    padding: 15px 0;
    transform: translateX(20px);
  }
}

/* Ensure items are visible on mobile */
@media (max-width: 768px) {
  .magnetic-carousel {
    padding: 20px 0;
    transform: translateX(0); /* remove cinematic offset on mobile */
  }

  .mag-item {
    width: 100px !important; /* safe fixed width */
    opacity: 1 !important;    /* ensure visibility even if JS delayed */
    transform: scale(1) !important;
  }

  .mag-item img {
    width: 100%;   /* scale to container */
    max-width: 100px;
  }

  .magnetic-track {
    gap: 15px;
    flex-wrap: nowrap; /* prevent wrapping */
  }

  .scroll-wrapper {
    overflow-x: scroll; /* allow horizontal scroll */
    cursor: grab;
  }
}
