html {
  font-size: 16px;
}

@media (min-width: 768px) {
  html {
    font-size: 18px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
}

body {
  margin-bottom: 60px;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
}

/* 側邊欄樣式 */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1049;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

.sidebar-menu {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: white;
  z-index: 1050;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.sidebar-menu.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #dee2e6;
}

.sidebar-header h5 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.sidebar-header .btn-close {
  font-size: 1.5rem;
  padding: 0.5rem;
}

.sidebar-content {
  padding: 1rem 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-item {
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-nav-link,
.sidebar-nav-text {
  display: block;
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
  color: #212529;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.sidebar-nav-link:hover {
  background-color: #f8f9fa;
  color: #212529;
}

.sidebar-nav-text {
  color: #6c757d;
}

/* 確保選單按鈕在所有螢幕尺寸都顯示 */
.navbar-toggler {
  display: block !important;
}

/* 未讀訊息紅點樣式 */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background-color: #dc3545;
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: auto;
  line-height: 1;
}

/* 手機友善設計 */
@media (max-width: 576px) {
  .sidebar-menu {
    width: 280px;
    left: -280px;
  }
  
  .sidebar-nav-link,
  .sidebar-nav-text {
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
  }
}

/* 快捷按鈕區域樣式 */
.quick-actions {
  margin-top: 0.5rem;
}

.quick-action-btn {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
}

/* 有未讀徽章的按鈕使用 space-between 布局 */
.quick-action-btn:has(.unread-badge) {
  justify-content: space-between;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quick-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-action-btn svg {
  flex-shrink: 0;
}

/* 快捷按鈕中的未讀徽章樣式 */
.quick-action-btn .unread-badge {
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* 響應式設計 - 快捷按鈕 */
@media (min-width: 576px) {
  .quick-action-btn {
    min-height: 52px;
    font-size: 1.05rem;
  }
  
  .quick-actions {
    margin-top: 0.75rem;
  }
}

@media (min-width: 992px) {
  .quick-action-btn {
    min-height: 56px;
    font-size: 1.1rem;
  }
  
  .quick-actions .row {
    max-width: 600px;
  }
}

/* 商品列表網格布局 */
.listing-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0;
}

@media (min-width: 576px) {
  .listing-list {
    gap: 0.75rem;
  }
}

/* 商品列表卡片樣式 */
.listing-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin-bottom: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}

.listing-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: inherit;
  text-decoration: none;
}

.listing-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

.listing-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: #f0f0f0;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

.listing-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  min-width: 0;
}

.listing-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #212529;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.listing-card-price {
  font-size: 1.1rem;
  font-weight: bold;
  color: #0d6efd;
  margin-bottom: 0.5rem;
}

.listing-card-meta {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: auto;
}

.listing-card-time {
  margin-top: 0.25rem;
}

.listing-card-interest {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.listing-card-interest svg {
  flex-shrink: 0;
  color: #ffc107;
}

/* 商品列表頁面標題優化 */
.container-fluid h2 {
  font-weight: 600;
  color: #212529;
  letter-spacing: -0.02em;
}

/* 響應式設計 */
@media (min-width: 576px) {
  .listing-card-image,
  .listing-card-image-placeholder {
    height: 200px;
  }
  
  .listing-card-title {
    font-size: 1rem;
  }
  
  .listing-card-price {
    font-size: 1.15rem;
  }
  
  .listing-card-meta {
    font-size: 0.85rem;
  }
  
  .container-fluid h2 {
    font-size: 1.75rem;
  }
}

@media (min-width: 992px) {
  .listing-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .listing-card-image,
  .listing-card-image-placeholder {
    height: 220px;
  }
  
  .listing-card-content {
    padding: 1rem;
  }
  
  .listing-card-title {
    font-size: 1.05rem;
  }
  
  .listing-card-price {
    font-size: 1.2rem;
  }
  
  .container-fluid h2 {
    font-size: 2rem;
  }
}