/* Header */
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0px;
  }
  
  /* 搜尋框 */
  .search-box{
  display:flex;
  align-items:center;
  border:1px solid #ccc;
  border-radius:40px;
  overflow:hidden;
  width:50%;
  
  }
  @media (max-width:850px){
    .search-box{
  width:90%;
  margin-top:10px;
  }
  }
  .search-box input{
  border:none;
  outline:none;
  font-size: 20px;
   padding-left:20px;
  }
  
  .search-btn{
  border:none;
  background:#f5f5f5;
  padding:10px 10px;
  cursor:pointer;
  width: 60px;
  height: 52px;
  }
  
  .search-btn:hover{
  background:#e0e0e0;
  }
  


/* ===== 台灣文創風格 ===== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  background: #f5f3ef;   /* 米白色背景 */
  color: #3a3a3a;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}


h3{font-size: 22px;padding-bottom: 4px;}

/* ===== Header ===== */
header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  position:fixed;
  width:100%;
  top:0;
  z-index: 100;
}

.header-inner {
 /* max-width: 1200px;*/
  margin: auto;
  padding: 18px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: #2f7d6b; /* 台灣山林綠 */
  letter-spacing: 0px;
  padding-left: 5px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.logo img{ width: 40px;}

h1{font-size: 22px;}

nav a {
  margin-left: 22px;
  font-size: 16px;
  color: #555;
}

nav a:hover {
  color: #2f7d6b;
}

/* ===== 主容器 ===== */
.container {
  /*max-width: 1200px;*/
  margin: 110px auto;
  padding: 0 15px;
}

/* ===== 左右布局 ===== */
.layout {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

/* ===== 分類 ===== */
.sidebar {
  width: 250px;
  background: #ffffff;
  border-radius: 0px;
  border: 1px solid #e5e5e5;
  padding: 15px;
}

.sidebar h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #2f7d6b;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 6px 0;
  color: #666;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  letter-spacing: 0px;
  -webkit-transition: all 0.7s ease-in-out;
  text-indent: 5px;
}

.sidebar li:hover {
  color: #2f7d6b;
  background-color: #a7a7a7;
  -webkit-transition: opacity 0.5s ease-in-out;
  color: #ffffff;
}

.active-category {
  background-color: #000000;
  font-weight: bold;
  color: #ffffff!important;
}
/* ===== 商品區 ===== */
.products {
  flex: 1;
  width:100%;
}

/* 商品格 */
#productGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

/* 商品卡片 */
.card {
  text-align: center;
  transition: 0.25s;
  margin-bottom: 15px;
}

.card:hover {
  transform: translateY(-3px);


}

.card:hover .no_color {
  background-color: #000000;
  color:#fff;
}



.card img {
  width: 100%;
  object-fit: cover;
  margin-bottom: 2px;
  border-radius: 0px;

}


.card h4 {
  font-size: 14px;
  margin-bottom: 5px;
  text-align: left;
  line-height: 19px;
}

.card p {
  color: #2f7d6b;
  font-weight: bold;
  margin-bottom: 8px;
  float: left;
  font-size: 14px;
  margin-right: 8px;
}

.card button {
  background: #2f7d6b;
  color: #fff;
  border: none;
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  float: right;
}

.card button:hover {
  background: #27695a;
}


.no_color { 
  border:1px solid #000;
  padding-left: 3px;
  padding-right: 3px;
  margin-right: 3px;
  background-color: #ffffff;
  border-radius: 3px;
}

/* ===== 分頁 ===== */
.pagination {
  text-align: center;
  margin-top: 25px;
}

.pagination button {
  padding: 6px 14px;
  margin: 0 6px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button:hover {
  background: #f0f0f0;
}

/* ===== 購物車 ===== */
#cartItems p {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 10px;
  margin-bottom: 6px;
  border-radius: 4px;
}

input, textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding-left: 10px;
  margin-bottom: 5px;
  font-size: 14px;
}

#submitOrderBtn {
  background: #e26d5a;
  color: #fff;
  border: none;
  padding: 12px;
  width: 100%;
  font-size: 15px;
  border-radius: 4px;
  cursor: pointer;
}

#submitOrderBtn:hover {
  background: #c85b4a;
}

/* ===== Footer ===== */
footer {
  margin-top: 50px;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  padding: 18px;
  font-size: 13px;
  color: #777;
}

.layout{
  display:flex;
  gap:20px;
}

.sidebar{
  width:220px;
}

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

.sidebar li{
  padding:6px 0;
}

.products{
  flex:1;
}

#productGrid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:15px;
}

.card img{
  width:100%;
}

.stock{
  color:#888;
  font-size:13px;
}

/* 手機分類按鈕 */
.mobile-category-bar{
  display:none;
  position:sticky;
  top:0;
  background:white;
  padding:10px;
  border-bottom:1px solid #ddd;
  z-index:10;
  margin-bottom:15px;
}

.mobile-category-bar button{
  padding:8px 14px;
  font-size:16px;
  width: 90px;
    height: 40px;
    background-color: #000;
    color: #fff;
}

/* overlay */
#overlay{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.4);
  z-index:999;
}

/* RWD */
@media (max-width:850px){
  .layout{
    flex-direction:column;
  }

  .mobile-category-bar{
    display:block;
  }

  #productGrid{
    grid-template-columns:repeat(2,1fr);
  }

  .sidebar{
    position:fixed;
    overflow:auto;
    top:0px;
    left:0;
    width:250px;
    height:100%;
    background:white;
    box-shadow:0 0 10px rgba(0,0,0,0.2);
    transform:translateX(-100%);
    transition:0.3s;
    z-index:100000;
    padding:20px;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  #overlay.show{
    display:block;
  }
}

.pagination{
  margin-top:20px;
  text-align:center;
}

.pagination button{
  margin:0 5px;
  cursor:pointer;
  background-color: #fff;
  padding:5px 10px;
  font-size: 24px;
}

.pagination span{
  margin:0 5px;
  cursor:pointer;
  background-color: #fff;
  padding:5px 10px;
  font-size: 20px;

}

.pagination .active{
  color:#fff;
  font-weight:bold;
  padding: 3px 10px;
  background-color: red;
}

.in-cart-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background:#f28989;
  color: white;
  font-weight: bold;
  font-size: 14px;
  padding: 4px 6px;
  width:auto;
  display: none;
  border-radius: 0px;
}

.card.in-cart .in-cart-badge {
  display: block;
}





/* ===== RWD ===== */
@media (max-width: 768px) {
    header {
        position:relative;
        width:100%;
        top:0;
        z-index: 100;
      }

      .container {
        margin: 10px auto;

      }
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  #productGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
  }

  nav {
    margin-top: 10px;
  }
  .cart-row {
    flex-wrap: wrap;
  }

  .qty-control{margin-top: 5px;}
  
}

/* ===== 購物車數量控制 ===== */
.cart-row {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-control button {
  margin: 0 4px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

.qty-control span {
  margin: 0 6px;
  font-weight: bold;
}

.qty-control .remove {
  background: #e26d5a;
  color: #fff;
  border: none;
  margin-left: 8px;
}


.detail-info .price {
  font-size: 20px;
  color: rgb(255, 0, 0);
  margin: 10px 0;
}



.detail-info button {
width: 140px;
height: 40px;
    background-color: #55a196;
    color: #ffffff;
    font-size: 16px;
    border:1px solid #fff;
    cursor: pointer;
    margin-bottom: 10px;
    border-radius: 4px;

  }

.add-btn {
  background: #ff6b6b;
  color: #fff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
}

.add-btn:hover {
  background: #ff4d4d;
}

/* ===== 商品細節頁 ===== */

.detail-layout{
  display: flex;
  gap: 15px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.detail-image{
  flex: 0 0 auto;
}

.detail-image img{
  border-radius: 0px;
}

.thumbnail-row{
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.thumb{
  width: 70px;
  height: 70px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: 0.2s;
}

.thumb:hover{
  transform: scale(1.05);
}

.active-thumb{
  border: 2px solid #e26d5a;
}

.detail-info{
  flex: 1;
  min-width: 280px;
}

.detail-info .price{
  font-size: 22px;
  color: #f42809;
  margin: 12px 0;
}

#totalPrice{
   padding-bottom: 20px;
   color: #ff0000;
}




