/*---------------------------------------
  LOGO / header
-----------------------------------------*/

.logo-wrapper {
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0; /* 桌機預設垂直空間 */
}

.logo-img {
  max-width: 260px; /* 桌機最大寬度 */
  height: auto;
}

@media (max-width: 991.98px) {
  .logo-wrapper {
    padding: 0.5rem 0;
  }

  .logo-img {
    max-width: 210px;
  }

  header.container {
    margin-top: 2rem !important;
    margin-bottom: 1.5rem !important;
  }
}

@media (max-width: 575.98px) {
  .logo-wrapper {
    padding: 0.5rem 0;
  }

  .logo-img {
    max-width: 150px;
  }

  header.container {
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
  }
}

.cart-data-title {
  font-size: 2rem;
}

/*====== 購物車標題手機大小 ====== */

@media (max-width: 991.98px) {
  .cart-data-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .cart-data-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
  .Shopping-cart-title {
    font-size: 1.1rem;
  }
}

/*---------------------------------------
 排版區塊
-----------------------------------------*/

.section-block {
  /*大圖展示間距*/
  margin-top: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 991.98px) {
  .section-block {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 575.98px) {
  .section-block {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

/*---------------------------------------
 🔘 購物車 icon / 按鈕          
-----------------------------------------*/

.amount-cart-btn {
  /*加總購物車按鈕*/
  position: fixed;
  top: 20px;
  right: 2rem;
  z-index: 1050;
  background-color: var(--light-gray);
  border-radius: 8px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
}

.fa-shopping-cart {
  font-size: 1.8rem;
}

.cart-badge {
  /*加總購物車計數*/
  position: absolute;
  top: -8px;
  right: -10px;
  max-width: 30px;
  width: 25px; /*固定正方形 */
  height: 25px;
  border-radius: 50%;
  background-color: var(--price-red);
  color: var(--text-inverse);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex; /* 居中對齊數字 */
  align-items: center;
  justify-content: center;
  line-height: 1; /* 避免字體撐高 */
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 576px) {
  .amount-cart-btn {
    top: 12px;
    right: 1rem;
    padding: 6px 8px;
    border-radius: 6px;
  }

  .fa-shopping-cart {
    font-size: 1.4rem;
  }

  .cart-badge {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }
}

.bg-danger-customer {
  color: var(--price-red);
}

/*---------------------------------------
 🔘 商品區樣式      
-----------------------------------------*/

/*====== 商品名稱 ====== */

.product-title {
  /*商品名稱*/
  font-size: 1.125rem; /* 預設手機字級 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .product-title {
    font-size: 1rem; /* 平板 */
  }
}

@media (min-width: 992px) {
  .product-title {
    font-size: 1.25rem; /* 桌機 */
  }
}

/*====== 商品價格區 ====== */

.products-price-outter {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.products-special-price {
  color: var(--price-red);
}

.products-special-price small {
  font-size: 0.9rem;
  color: var(--gray-800);
  margin-top: 0;
}

@media (min-width: 768px) {
  .products-special-price strong {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .products-special-price strong {
    font-size: 1.2rem;
  }
}

.products-selling-price small {
  color: var(--gray-400);
  text-decoration: line-through;
  font-weight: 300;
}

@media (max-width: 575.98px) {
  .products-selling-price small {
    font-size: 0.75rem;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .products-selling-price small {
    font-size: 0.8rem;
  }
}

@media (min-width: 992px) {
  .products-selling-price small {
    font-size: 0.9rem;
  }
}

/*====== 商品銷售頁+-====== */

.quantity-control {
  margin-top: 0.5rem;
}

.quantity-control .btn {
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  line-height: 1.5;
  border-radius: 4px;
}

.quantity-control input.quantity-input {
  width: 56px;
  font-size: 1rem;
}

@media (max-width: 575.98px) {
  .quantity-control .btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
  }

  .quantity-control input.quantity-input {
    width: 48px;
    font-size: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .quantity-control input.quantity-input {
    width: 50px;
    font-size: 0.875rem;
  }

  .quantity-control button {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
  }
}

/* 🔹平板：（768px~991px） */
@media (min-width: 768px) and (max-width: 991.98px) {
  .quantity-control .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  .quantity-control input.quantity-input {
    width: 52px;
    font-size: 0.9rem;
  }
}

@media (min-width: 992px) {
  .quantity-control .btn {
    font-size: 0.875rem;
    padding: 0.3rem 0.6rem;
  }

  .quantity-control input.quantity-input {
    width: 56px;
    font-size: 0.95rem;
  }
}

/*====== 商品區加入購物車按鈕-====== */

.add-to-cart {
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

/* 手機尺寸 */
@media (max-width: 575.98px) {
  .add-to-cart {
    font-size: 0.9rem;
    padding: 0.4rem 0.9rem;
  }
}

/* 平板尺寸 */
@media (min-width: 576px) and (max-width: 991.98px) {
  .add-to-cart {
    font-size: 0.95rem;
    padding: 0.45rem 0.9rem;
  }
}

/* 桌機尺寸 */
@media (min-width: 992px) {
  .add-to-cart {
    font-size: 1rem;
    padding: 0.5rem 1.25rem;
  }
}

.add-to-cart button {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/*彈跳modal大小*/
@media (max-width: 576px) {
  .modal-dialog {
    margin: 1rem; /* 減少兩側空間 */
  }
}

/*---------------------------------------
 🔘 Youtube embed    
-----------------------------------------*/
.youtube-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.youtube-embed iframe {
  position: absolute;
  width: 100%;
  height: 100%;
}

/*---------------------------------------
 🔘 Modal 裡的數量控制
-----------------------------------------*/
.modal .modal-minus,
.modal .modal-plus {
  width: 36px;
  height: 36px;
  font-size: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal .modal-qty {
  max-width: 70px;
  text-align: center;
}

/*---------------------------------------
 🔘 回到頂部按鈕      
-----------------------------------------*/
#gotoBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 2rem;
  z-index: 9999;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: var(--gray-800);
  color: white;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
}

@media (max-width: 576px) {
  #gotoBtn {
    position: fixed;
    bottom: 15px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: 1.2rem;
    background-color: var(--gray-800);
    color: white;
    border: none;
    z-index: 1999;
    display: none; /* 預設由 JS 控制出現 */
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }

  #gotoBtn svg {
    width: 25px;
    height: 25px;
    display: block;
    margin: auto;
  }
}

#gotoBtn:hover {
  background-color: var(--gray-600);
}

/*---------------------------------------
 🔘 通用 hover 效果  
-----------------------------------------*/
.bi:hover {
  /*icon hover效果*/
  opacity: 0.7;
}

.amount-cart-btn:hover {
  /*amount-cart-btn mouse-over */
  background-color: var(--text-body);
}

/*---------------------------------------
 🔘 Toast 提示訊息
-----------------------------------------*/

/* ====== 加入購物車成功 Toast ====== */

.toast-center-container {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1085; /* 必須高於 modal 的 backdrop（1055）、modal 本體（1050） */
  transform: translate(-50%, -50%);
  pointer-events: none; /* 讓它不影響點擊互動 */
}

.toast-center-container .toast {
  pointer-events: auto; /* Toast 本體要能點關閉鈕 */
}

.card-img-top {
  border-radius: 0;
}

/*---------------------------------------
 🔘 Toast 手機版稍微縮小
-----------------------------------------*/

@media (max-width: 576px) {
  .toast {
    font-size: 0.9rem; /* 字縮小 */
    padding: 0.25rem 0.75rem; /* 內距微調 */
    max-width: 80%; /* 限制最大寬度不要太滿版 */
  }

  .toast-center-container {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
