/**
 * Instagram内置浏览器滚动修复样式
 *
 * 解决在Instagram内置浏览器中主页无法滚动的问题
 * 问题描述：当用户通过Instagram个人简介中的链接访问网站时，
 * 网站主页（首页）无法上下滚动查看内容，但其他所有页面的滚动功能都正常工作。
 */

/* 这些样式只应该在Instagram内置浏览器中应用 */
/* 通过JavaScript动态添加.instagram-browser类到html元素 */
html.instagram-browser body,
html.instagram-browser {
  position: static !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: auto !important;
  height: auto !important;
  min-height: 100% !important;
  touch-action: auto !important;
  transform: none !important;
}

/* 确保App-header不会阻止滚动 */
html.instagram-browser .App-header {
  position: relative !important;
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保主页内容可滚动 */
html.instagram-browser .App {
  overflow: auto !important;
  height: auto !important;
  min-height: 100vh !important;
  position: relative !important;
  touch-action: auto !important;
}

/* 确保轮播图不会阻止滚动 */
html.instagram-browser .hero-carousel {
  position: relative !important;
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保产品部分可滚动 */
html.instagram-browser .products-section {
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保分类容器可滚动 */
html.instagram-browser .categories-container {
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保分类网格可滚动 */
html.instagram-browser .categories-grid {
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保产品网格可滚动 */
html.instagram-browser .products-grid {
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保导航栏不会阻止滚动 */
html.instagram-browser .navbar {
  position: fixed !important;
  z-index: 1000 !important;
}

/* 确保页面内容不会被导航栏遮挡 */
@media (max-width: 768px) {
  html.instagram-browser body {
    padding-bottom: 70px !important;
  }
}

/* 确保轮播图内容可见 */
html.instagram-browser .carousel-item {
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保hero内容可见 */
html.instagram-browser .hero-content {
  position: relative !important;
  overflow: visible !important;
  touch-action: auto !important;
}

/* 确保所有容器都可以滚动 */
html.instagram-browser .container,
html.instagram-browser .section,
html.instagram-browser section,
html.instagram-browser main,
html.instagram-browser div {
  touch-action: auto !important;
}

/* 移除可能阻止滚动的固定定位元素 */
html.instagram-browser .fixed-element {
  position: absolute !important;
}

/* 确保滚动条可见 */
html.instagram-browser ::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 7px;
}

html.instagram-browser ::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, .5);
  -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
