:root {
  /* --tb-primary: #4e7a94;  
  --tb-secondary: #a78071; 
  --tb-menu-bg: #383838;  
  --tb-menu-fg: #f5f5f5;  
  --tb-menu-fg-hover: #fff;
  --tb-menu-item-hover: #1a1a1a;
  --tb-dd-bg: var(--tb-menu-bg);  
  --tb-dd-sep: #767676d1; */
  --tb-maxw: 1170px;
  --menu-border: #dddddd;
}

/* 導航欄 */
.tb-navbar {
  /*margin: 10px auto;*/
  padding-top: 20px;
  /*background: var(--color-primary);*/
}

.tb-container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 16px;
}

.tb-navbar-guide {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 6px;
  position: relative;
  z-index: 101; 
}
.tb-navbar-guide .tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  color: #444;
  text-decoration: none;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}
.tb-navbar-guide .tb-btn:hover {
  background: #fff;
  border-color: #cfcfcf;
}
.tb-navbar-guide .tb-btn i { color: #777; }
.tb-navbar-guide .tb-btn.tb-icon { padding: 7px 10px; }

.tb-lang .dropdown,
.tb-lang form { display: inline-block; }
.tb-lang .dropdown-toggle,
.tb-lang button,
.tb-lang select {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  padding: 7px 12px;
  color: #444;
  line-height: 1;
}

.tb-navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -40px;
  height: 120px;
  position: relative;
  z-index: 100; 
}
.tb-navbar-content .content-logo .tb-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.tb-navbar-content .content-logo img {
  max-height: 70px;
  height: auto;
  width: auto;
  display: block;
}
.tb-navbar-content .content-logo .tb-tagline {
  margin-top: 4px;
  font-size: 14px;
  letter-spacing: .15em;
  text-align: center;
  color: #000;
}
.tb-navbar-content .content-cart {
  min-width: 300px;
  /*margin-top: 20px;*/
  display: flex;
  justify-content: flex-end;
  height: 100%;
  /*background-color: red;*/
  align-items: end;
}


/* ------------------------------------------------------- 列表------------------------------------------------------- */
.tb-menu {
  background: var(--navbar-bg);
  /*position: relative;*/
  z-index: 2;
  /*margin-bottom: 30px;*/
}
.tb-menu .tb-menu-wrap {
  max-width: var(--tb-maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* 根清單（橫向） */
.tb-menu .tb-root {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 項目/連結 */
.tb-menu .tb-item {
  position: relative;
}
.tb-menu .tb-link {
  display: block;
  padding: 18px 20px;
  color: var(--navbar-text);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: .02em;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.tb-menu .tb-link:hover,
.tb-menu .tb-item:hover > .tb-link,
.tb-menu .tb-item:focus-within > .tb-link {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-text);
}
.tb-menu .tb-caret {
  margin-left: 6px;
  font-size: 12px;
  opacity: .85;
  transition: transform .15s ease;
}
.tb-menu .tb-item:hover .tb-caret,
.tb-menu .tb-item:focus-within .tb-caret {
  transform: rotate(180deg);
}

/* 下拉選單（單欄） */
.tb-menu .tb-item.has-dropdown .tb-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--navbar-bg);
  display: none;
  border: 1px solid rgba(var(--menu-border), .7);
  border-top: none; /* 和上方父項貼齊 */
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  z-index: 1000;
}
.tb-menu .tb-item.has-dropdown:hover > .tb-dropdown,
.tb-menu .tb-item.has-dropdown:focus-within > .tb-dropdown {
  display: block;
}

/* 下拉項目 */
.tb-menu .tb-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tb-menu .tb-sub > li {
  border-bottom: 1px solid rgba(var(--menu-border), .7);
}
.tb-menu .tb-sub > li:last-child {
  border-bottom: none;
}
.tb-menu .tb-sub-link {
  display: block;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: background .15s ease;
}
.tb-menu .tb-sub-link:hover,
.tb-menu .tb-sub-link:focus {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-text);
}

/* 右側邊界保護（最後一個靠右彈出） */
.tb-menu .tb-item.has-dropdown:last-child .tb-dropdown {
  right: 0;
  left: auto;
}

/* 可選：active 樣式（若在 twig 加上 is-active 類名） */
.tb-menu .tb-item.is-active > .tb-link {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-text);
}


/* ------------------------------------------------------- 手機列表------------------------------------------------------- */

.tb-mobilebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 15px;
  background: #fff;
  border-bottom: 1px solid var(--menu-border);
  position: relative;
}

.tb-m-left, .tb-m-right {
  display: flex;
  align-items: center;
}

.tb-mbtn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  font-size: 20px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

.tb-mbtn .fa {
    font-size: 20px !important;
}

.tb-mobile-logo {
  position: absolute;
  left: 50%;
  top: 0;
  height: 70px;
  display: flex;
  align-items: center;
  transform: translateX(-50%);
  text-decoration: none;
  color: #222;
  font-weight: 700;
}

.tb-mobile-logo img {
  height: 60px;
  display: block;
  padding: 5px;
}

/* ---- Offcanvas 外層 ---- */
.tb-oc-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

.tb-oc-wrap.is-open {
  pointer-events: auto;
}

.tb-oc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tb-oc-wrap.is-open .tb-oc-overlay {
  opacity: 1;
}

/* ---- Offcanvas 面板 ---- */
.tb-oc {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 86%;
  max-width: 360px;
  background: var(--menu-bg);
  color: var( --menu-text);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.25);
}

.tb-oc-wrap.is-open .tb-oc {
  transform: translateX(0);
}

/* ---- Offcanvas 標頭 ---- */
.tb-oc-header {
  background: var(--color-primary);
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  font-size: 16px;
}

.tb-oc-close {
  border: 0;
  background: transparent;
  color: var(--menu-border);
  padding: 4px 6px;
  cursor: pointer;
}

.tb-oc-close .fa {
  font-size: 20px;
}

/* ---- 列表區 ---- */
.tb-oc-section {
  padding-bottom: 8px;
}

.tb-oc-header .tb-oc-home{
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.tb-oc-header .tb-oc-home:hover,
.tb-oc-header .tb-oc-home:focus{
  text-decoration: none;
}

.tb-oc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tb-oc-item {
  border-bottom: 1px solid rgba(var(--menu-border), .7);
}

.tb-oc-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-size: 14px;
  color: #eee;
  text-decoration: none;
}

.tb-oc-link:hover, .tb-oc-link:focus {
  background: color-mix(in srgb, var(--menu-hover-bg), transparent 10%);
  /*background: var(--tb-dd-bg);*/
  /*background: $000;*/
  color: var(--menu-hover-text);
}

.tb-oc-item.has-children > .tb-oc-sublist {
  list-style: none;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: #262626;
  color: var(--color-primary);
}


/* 展開中的父項目 */
.tb-oc-item.is-open > .tb-oc-link {
  /*background: color-mix(in srgb, var(--tb-primary), transparent 10%);*/
  background: #000;
  color: var(--menu-hover-text);
  font-weight: 600;
  text-decoration: none;
}

.tb-oc-item.is-open > .tb-oc-sublist {
  max-height: 600px; /* 依內容高度調整 */
}

.tb-oc-sublink {
  display: block;
  padding: 12px 24px;
  color: #ddd;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  padding-left: 30px;
}

.tb-oc-sublink:hover, .tb-oc-sublink:focus {
  background: rgba(255, 255, 255, 0.1);
  /*background: color-mix(in srgb, var(--tb-primary), transparent 120%);*/
  color: var(--menu-hover-text);
  text-decoration: none;
}

.tb-oc-lock {
  overflow: hidden !important;
}

@media (max-width: 1200px) {
    .tb-navbar {
      max-width: 970px;
    }
}

@media (min-width: 992px) {
  .tb-mobile-only {
    display: none !important;
  }
}

@media (max-width: 991px) {
    .tb-navbar {
    display: none;
      max-width: 750px;
    }
    
    .tb-navbar-content {
      height: 105px;
    }
    
    .tb-menu {
        display: none;
    }
}
