/* Header styles with Bootstrap 5 integration */

/* Logo area */
.site-logo {
  display: inline-block;
  padding: 10px 0;
}

.site-logo img {
  max-height: 60px;
  width: auto;
}

/* Navigation */
.main-nav .nav-item {
  margin-left: 5px;
}

.main-nav .nav-link {
  color: var(--ezp-text-dark);
  font-weight: 500;
  padding: 8px 16px;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.main-nav .nav-link:hover {
  color: var(--ezp-pink);
  background-color: rgba(244, 122, 148, 0.1);
}

.main-nav .nav-link.active {
  color: var(--ezp-text-light);
  background-color: var(--ezp-brand-blue);
}

/* Search form */
.search-form .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--ezp-brand-blue);
}

.search-form .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background-color: var(--ezp-brand-blue);
  color: white;
}

.search-form .btn:hover {
  background-color: var(--ezp-dark-blue);
}

/* User area */
.user-actions .btn-link {
  color: var(--ezp-brand-blue);
  text-decoration: none;
  padding: 5px 10px;
  font-weight: 500;
}

.user-actions .btn-link:hover {
  color: var(--ezp-dark-blue);
  text-decoration: underline;
}

/* Shopping cart */
.cart-icon {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--ezp-pink);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 50%;
  min-width: 18px;
  text-align: center;
}

/* Categories menu */
.categories-menu {
  background-color: var(--ezp-dark-blue);
}

.categories-menu .nav-link {
  color: white;
  padding: 10px 15px;
  font-weight: 500;
}

.categories-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile nav toggle */
.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.5rem;
  margin: 8px 0;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 手機版頂部選單樣式 */
.mobile-header {
  background-color: var(--ezp-dark-blue);
  padding: 8px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-logo-mobile {
  display: flex;
  align-items: center;
}

.site-logo-mobile img {
  max-height: 40px;
  transition: all 0.3s ease;
}

.mobile-top-actions {
  display: flex;
  align-items: center;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  transition: all 0.2s ease;
}

.btn-icon:hover, .btn-icon:focus {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.btn-icon i {
  font-size: 1.2rem;
}

.cart-count {
  font-size: 0.75rem;
  min-width: 18px;
  height: 18px;
  line-height: 1;
  padding: 2px;
}

/* 手機版搜尋欄樣式 */
.mobile-search-container {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #fff;
  z-index: 1030;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mobile-hot-search {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.mobile-hot-search::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.mobile-keywords-scroll {
  display: inline-flex;
  flex-wrap: nowrap;
}

.mobile-keywords-scroll .badge {
  display: inline-block;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  background-color: #f8f9fa;
  color: #333;
  border: 1px solid #e9ecef;
}

/* 側邊選單樣式 */
.offcanvas-header {
  padding: 0.75rem 1rem;
}

.offcanvas-title {
  font-size: 1.1rem;
  font-weight: 500;
}

.offcanvas {
  width: 290px;
  max-width: 85vw;
}

.list-group-item {
  padding: 0 1rem;
  border-left: none;
  border-right: none;
}

.list-group-item a {
  color: var(--ezp-text-dark);
  transition: all 0.2s ease;
}

.list-group-item a:hover {
  color: var(--ezp-brand-blue);
}

.list-group-item a i {
  color: var(--ezp-brand-blue);
  opacity: 0.7;
}

/* 熱搜標籤 */
.mobile-hot-search .badge {
  background-color: #f0f0f0;
  border: 1px solid #e0e0e0;
  color: var(--ezp-dark-blue);
  font-weight: normal;
  transition: all 0.2s ease;
}

.mobile-hot-search .badge:hover {
  background-color: var(--ezp-light-blue);
  border-color: var(--ezp-light-blue);
  color: white;
}

/* Media queries for responsive design */
@media (max-width: 991.98px) {
  .main-nav .nav-item {
    margin-left: 0;
    margin-bottom: 5px;
  }
  
  .search-form {
    margin: 10px 0;
  }
  
  .user-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  .site-logo img {
    max-height: 50px;
  }
  
  /* 響應式調整 */
  .site-logo-mobile img {
    max-height: 36px;
  }
  
  .btn-icon {
    width: 32px;
    height: 32px;
  }
  
  .btn-icon i {
    font-size: 1rem;
  }
  
  /* 導航項目縮小 */
  .list-group-item a {
    font-size: 0.95rem;
    padding: 0.4rem 0;
  }
  
  /* 優化搜尋欄 */
  #mobileSearchBar .form-control {
    height: 40px;
    font-size: 0.95rem;
  }
  
  #mobileSearchBar .btn {
    padding: 0.375rem 0.75rem;
  }
  
  /* 為搜尋欄下方的內容添加間距 */
  .search-active #content {
    margin-top: 85px; /* 搜尋框高度 */
  }
  
  /* 搜尋容器動畫 */
  .mobile-search-container {
    transition: all 0.3s ease;
  }
}