@media (max-width: 768px) {
/* ===== 页面Banner ===== */
.page-banner {
  width: 100%;
  height: 35vw;
  overflow: hidden;
}

.page-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 产品列表布局 ===== */
.product-list-section {
  padding: 20px 0;
  background-color: #fff;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ===== 左侧分类（PC端在移动端隐藏） ===== */
.product-sidebar {
  display: none;
}

/* ===== 移动端分类触发按钮 ===== */
.mobile-category-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background-color: #f5f0e8;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.mobile-category-trigger:active {
  background-color: #ebe4d9;
}

.mobile-category-trigger .trigger-arrow {
  transition: transform 0.3s ease;
}

.mobile-category-trigger.active .trigger-arrow {
  transform: rotate(180deg);
}

/* ===== 移动端分类弹框 ===== */
.mobile-category-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s ease;
}

.mobile-category-modal.open {
  visibility: visible;
  opacity: 1;
}

.mobile-category-modal .modal-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.mobile-category-modal .modal-container {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 85%;
  max-width: 340px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-category-modal.open .modal-container {
  transform: translateX(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:active {
  color: var(--text-dark);
}

.modal-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 左侧一级分类 */
.modal-sidebar {
  width: 30%;
  background-color: #f8f5f0;
  overflow-y: auto;
  flex-shrink: 0;
}

.modal-cat-item {
  padding: 14px 10px;
  font-size: 14px;
  color: var(--text-gray);
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.modal-cat-item.active {
  background-color: #fff;
  color: var(--primary-color);
  font-weight: 600;
  border-left-color: var(--primary-color);
}

/* 右侧二级分类 */
.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.modal-sub-group {
  margin-bottom: 20px;
}

.modal-sub-block {
  margin-bottom: 16px;
}

.modal-sub-block:last-child {
  margin-bottom: 0;
}

.modal-sub-group.hidden {
  display: none;
}

.modal-sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}

/* 有三级菜单的二级标题保留下边框 */
.modal-sub-title.has-children {
  border-bottom: 1px solid #f0f0f0;
}

.modal-sub-title.active {
  color: var(--primary-color);
}

.modal-sub-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.modal-sub-item {
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text-dark);
  background-color: #f5f0e8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.modal-sub-item:active {
  background-color: #ebe4d9;
}

.modal-sub-item.active {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 500;
}

/* 隐藏类 */
.hidden {
  display: none !important;
}

/* ===== 右侧产品网格 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background-color: transparent;
  border-radius: 8px;
  overflow: hidden;
}

.product-card .product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #f2ece7;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card .product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info {
  padding: 8px 0;
  text-align: left;
}

.product-info h4 {
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 600;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 25px;
}

.pagination a {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-gray);
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  padding: 0 10px;
}

.pagination a:hover,
.pagination a.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
}
