/* Fix for iOS Safari touch issues on grid items */
/* The first row of .cg-item elements can have touch events intercepted */
/* by elements above (like swiper carousels) due to z-index stacking */

/* Ensure the section containing the grid has proper stacking */
.modules-color-grid {
  position: relative;
  z-index: 5;
}

/* Ensure the grid container has a proper stacking context */
.cg-list {
  position: relative;
  z-index: 1;
}

/* On mobile, ensure touch targets work correctly */
@media (max-width: 991px) {
  /* Ensure each grid item creates a stacking context */
  .cg-item {
    position: relative;
    z-index: 1;
  }

  /* Ensure the inner container is properly stacked */
  .cg-item-inner {
    position: relative;
    z-index: 1;
  }

  /* Make the "查看更多" link more touchable on mobile */
  /* Keep absolute positioning but ensure it's clickable */
  .cg-item-more {
    z-index: 10;
    /* Ensure pointer events work */
    pointer-events: auto !important;
    /* Add touch-action to ensure smooth touch handling on iOS */
    touch-action: manipulation;
    /* Increase touch target padding for iOS (44px minimum recommended) */
    padding: 10px 15px;
    /* Ensure the link is visible and interactive */
    cursor: pointer;
  }

  /* Prevent swiper elements from capturing touch events for content below */
  .modules-swiper {
    position: relative;
    z-index: 1;
  }
}
