
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
    padding: 0;
    height: 56px;
  }
  
  .mobile-bottom-bar .bar-btn {
    flex: 1 1 0;
    border: none;
    background: none;
    font-size: 0.8em;
    color: #1976d2;
    font-weight: bold;
    padding: 4px 2px;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1.1;
    position: relative;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
  }
  
  .mobile-bottom-bar .icon {
    font-size: 1.2em;
    margin-bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 20px;
    width: 100%;
  }
  
  /* 購物車圖示容器 */
  .mobile-bottom-bar .cart-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px; /* 限制容器寬度與圖示一致 */
    height: 20px; /* 限制容器高度與圖示一致 */
  }
  
  /* 購物車SVG圖示 */
  .mobile-bottom-bar .cart-svg-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(32%) sepia(91%) saturate(2000%) hue-rotate(208deg) brightness(95%) contrast(92%);
  }
  
  /* 手機版購物車數量徽章 */
  .mobile-cart-count {
    position: absolute;
    top: -6px; /* 調整為更靠近圖示 */
    right: -6px; /* 調整為更靠近圖示 */
    background: #ff4444;
    color: white;
    border-radius: 50%;
    min-width: 14px; /* 稍微縮小尺寸 */
    height: 14px; /* 稍微縮小尺寸 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px; /* 調整字體大小 */
    font-weight: bold;
    line-height: 1;
    animation: cartBounce 0.3s ease;
  }
  
  @keyframes cartBounce {
    0% {
      transform: scale(0.8);
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
    }
  }
  
  .mobile-bottom-bar .bar-btn.primary {
    color: #fff;
    background: #1976d2;
    border-radius: 0;
  }
  
  .mobile-bottom-bar .bar-btn.buy {
    color: #fff;
    background: #e60012;
    border-radius: 0;
  }
  
  .mobile-bottom-bar .bar-btn:active {
    background: #f0f4fa;
  }
  
  .mobile-bottom-bar .bar-btn.primary:active {
    background: #1565c0;
  }
  
  .mobile-bottom-bar .bar-btn.buy:active {
    background: #c5000f;
  }
  
  /* 覆蓋追蹤按鈕的特殊樣式，讓它與其他按鈕保持一致 */
  .mobile-bottom-bar .bar-btn.btn-track {
    background: none !important;
    color: #1976d2 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 4px 2px !important;
    min-width: auto !important;
    transform: none !important;
    font-size: 0.8em !important;
    font-weight: bold !important;
    border: none !important;
    transition: background 0.15s !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    line-height: 1.1 !important;
  }
  
  .mobile-bottom-bar .bar-btn.btn-track:hover {
    background: #f5f5f5 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .mobile-bottom-bar .bar-btn.btn-track:active {
    background: #f0f4fa !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .mobile-bottom-bar .bar-btn.btn-track::before {
    display: none !important;
  }
  
  /* 確保所有按鈕文字都完美對齊 */
  .mobile-bottom-bar .bar-btn {
    gap: 1px;
  }
  
  /* 特別處理較長的文字按鈕 */
  .mobile-bottom-bar .bar-btn:nth-child(2), /* 追蹤清單 */
  .mobile-bottom-bar .bar-btn:nth-child(4) { /* 加入購物車 */
    font-size: 0.75em;
  }
}