
/*  全站防止橫向捲動與元素撐破畫面 */
html, body {
  margin: 0;
  padding: 0;
 /*  max-width: 100%;*/
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  background: #e6e6e6;
}
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card {
  background: white;
  width: 1000px;
  margin: 0 auto;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

/* Hero 區固定高度 */
.hero {
  text-align: center;
  height: auto;
  background: #fff;
  /* padding-top: 30px;*/
}

.hero-bg{
  width: 100%;
}

.logo {
  height: 60px;
}
.hero h1 {
  font-size: 24px;
  margin: 10px 0 5px;
}
.subtitle {
  color: #e60012;
  font-weight: bold;
  font-size: 14px;
}

/* 紅色實線 */
.divider {
  height: 16px;
  background-color: #e60012;
  width: 100%;
  margin-top: -10px;
}

/* 主內容區塊，最大可撐高至 3168px */
.main-content {
  padding: 50px 50px;
  /* max-height: 2382px;*/
  box-sizing: border-box;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 20px;
}
.notice-icon {
 /*  width: 30px;
  margin-top: 4px;*/
   position: relative;
   top: 50px;
}
.notice h2 {
  color: #e60012;
  font-size: 16px;
  margin: 0;
}
.notice p {
  font-size: 13px;
  margin: 5px 0 0;
}


/*.brand-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 36px; /* 卡片間距 */
  /*margin: 3px;*/
  /*justify-content: center;
}*/

.brand-wrapper {
  width: 100%;
 /*  display: flex;*/
  justify-content: center;
}



.brand-grid {
   /* display: flex;
    flex-wrap: wrap;*/
    gap: 36px;
    margin: 3px;
    /*place-content: stretch space-between;*/
    align-items: flex-start;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    justify-content: center;     /*  讓 grid 自身置中 */
    max-width: 100%;            /*  控制總寬度避免撐滿 */
}


.brand-card {
  /* width: 150px;*/
  height: 183px;
  background: #fff;
  border-radius: 8px;
  text-align: center;
  /*box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);*/
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

    .brand-card img {
        width: 150px;
        height: 150px;
        object-fit: contain;
    }

.brand-card h3 {
  font-size: 20px;
  margin: 0;
  font-family: 'Microsoft JhengHei', sans-serif;
}


/* Footer 固定高度 */
.footer {
  background: #e60012;
  color: white;
  font-size: 16px;
  text-align: center;
  /* height: 90px;*/
  line-height: 1.6;
  padding-top: 20px;
  width: 1000px;
  margin: 0 auto;
}
.footer a {
  color: #fff;
  text-decoration: underline;
}


.footer-line {
  margin-bottom: 8px;
}
.footer-line:last-child {
  margin-bottom: 30px;
}

.footer a {
  color: white;
  text-decoration: underline;
}


/*  subhead 區塊樣式 */
.subhead-section {
  padding: 20px 0 10px 0px;
}
.subheadlog {
  display: block;
  margin-bottom: 10px;
}
.subhead-text {
  font-family: 'Microsoft JhengHei', sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.48px;
  text-align: left;
  margin: 0;
  /*ax-width: 880px;*/
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.tab {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  background: #e0e0e0;
  cursor: pointer;
}
.tab.active {
  /*background: #e60012;*/
  color: white;
}

.tab {
  width: 164px;
  height: 47px;
  border: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  cursor: pointer;
}

/* 各 tab 的 active 圖片 */
.tab.active[data-category="all"] {
  background-image: url('img/tab/tab-all-active.png');
}
.tab.active[data-category="convenience"] {
  background-image: url('img/tab/tab-convenience-active.png');
}
.tab.active[data-category="department"] {
  background-image: url('img/tab/tab-department-active.png');
}
.tab.active[data-category="food"] {
  background-image: url('img/tab/tab-food-active.png');
}
.tab.active[data-category="lifestyle"] {
  background-image: url('img/tab/tab-lifestyle-active.png');
}

/* 各 tab 的 non-active 圖片 */
.tab:not(.active)[data-category="all"] {
  background-image: url('img/tab/tab-all.png');
}
.tab:not(.active)[data-category="convenience"] {
  background-image: url('img/tab/tab-convenience.png');
}
.tab:not(.active)[data-category="department"] {
  background-image: url('img/tab/tab-department.png');
}
.tab:not(.active)[data-category="food"] {
  background-image: url('img/tab/tab-food.png');
}
.tab:not(.active)[data-category="lifestyle"] {
  background-image: url('img/tab/tab-lifestyle.png');
}



/* —— 全站容器流動縮放 & 桌機最大寬度 —— */
.card,
.footer {
  width: 1000px;
  max-width: 100%;    /* 當視窗小於 1000px，就自動縮到剛好 100% */
  margin: 0 auto;
}


.br1{
  display: none;
}



/* —— 768px 到 980px 之間，採用流動縮滿畫面 —— */
@media screen and (min-width: 768px) and (max-width: 980px) {
  .card,
  .footer {
    width: 100%;       /* 容器直接撐滿視窗，不切版 */
  }


  .brand-grid {  
    gap: 20px;

}
}
@media screen and (max-width: 710px) {
  .brand-grid {
      gap: 16px;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }


}

@media screen and (max-width: 650px) {

  .br1{
      display: inline;    
  }
  
  .footer-line{
      margin-bottom: 0px;
  }

  .tab  {
      width: 30%;
      background-repeat: repeat;
  }
  .tab.active
  {
          width: 30%;
      background-repeat: repeat;
  }


}


@media screen and (max-width: 576px) {

  .brand-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 36px;
    margin: 3px;
    justify-content: left;     /*  讓 grid 自身置中 */
}

  /* 整體版面縮放與最大寬度控制 */
  .card,
  .footer {
    width: 100%;
  }

  .main-content {
    padding: 20px 16px;
  }

  /* HERO 區塊標題多行顯示 */
  .hero {
    height: auto;
    /*padding: 20px 16px;*/
    margin-bottom: -4px;
  }

  .hero img,
  .hero .logo {
    width: 100%;
    height: auto;
    object-fit: contain;
  }


  .hero h1 {
    font-size: 20px;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
  }

  .subtitle {
    font-size: 12px;
    white-space: normal;
  }

  /* Tabs 區塊調整為 3 + 2 自動換行 */
  .tabs {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
      /*margin-left: 15px;*/
  }

  .tab {
    width: 30%;
    height: 40px;
    background-size: contain;
    background-position: center;
    background-repeat:repeat;
    font-size: 12px;
    border-radius: 12px;
  }


  .tab.active{
    width: 30%;
    height: 40px;
    background-size: contain;
    background-position: center;
    font-size: 12px;
  }

  /* 品牌區塊：卡片調為 3 欄 */
  .brand-wrapper {
    margin-left: 1.8%;
  }


  .brand-grid {
    /*justify-content: center;*/
    gap: 16px;
  }

  .brand-card {
    width: 30%;
     /*max-width: 120px;*/
    height: auto;
    padding: 8px 0;
  }

    .brand-card img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

  .brand-card h3 {
    font-size: 13px;
    margin-top: 6px;
  }

  /* Notice 區塊垂直排版 */
  .notice {
    flex-direction: column;
    gap: 6px;
  }

  .notice-icon {
    position: static;
    top: auto;
    margin-bottom: 8px;
  }

  .notice h2 {
    font-size: 14px;
  }

  .notice p {
    font-size: 12px;
  }

  /* Subhead 調整字體與對齊 */
  .subhead-text {
    font-size: 15px;
    /*text-align: center;*/
  }

   .footer {
    /* 確保文字置中，自動換行 */
    text-align: center;
    white-space: normal;
    line-height: 1.5;
  }

  /* 每一行都用獨立 .footer-line 來分割 */
  .footer-line {
    display: block;
    width: 100%;
    font-size: 12px;
  }


  /* 如果第一行有連結，確保換行時看起來整齊 */
  .footer-line a {
    display: inline-block;
    word-break: break-all;
    white-space: normal;
  }
}



@media screen and (min-width: 514px) and (max-width: 576px) {
  .tab {
    height: 47px;      /* 容器直接撐滿視窗，不切版 */
  }
  .tab.active {
    height: 47px;      /* 容器直接撐滿視窗，不切版 */
  }
}

