@charset "utf-8";

/* 首頁搜尋群組與商品內容共用外側 4% 留白。 */
.home-product-search {
    width: 100%;
    margin-bottom: 40px;
    padding: 22px;
    border: 1px solid #e3e6e8;
    border-radius: 6px;
    background: #f6f7f8;
}
.home-product-search form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.7fr);
    gap: 16px;
    align-items: end;
    width: 100%;
}
.home-search-field {
    display: block;
    min-width: 0;
    margin: 0;
}
.home-search-label {
    display: block;
    min-height: 21px;
    margin-bottom: 8px;
    color: #586168;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}
.home-product-search select,
.home-product-search input[type="text"] {
    width: 100%;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #d5d9dd;
    border-radius: 4px;
    background-color: #fff;
    color: #4d555b;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
}
.home-product-search select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23616a70' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.home-product-search select:disabled {
    color: #939ba1;
    background-color: #fafafa;
    cursor: default;
    opacity: 1;
}
.home-search-keyword {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}
.home-search-keyword .home-search-field {
    flex: 1;
}
.home-search-keyword button {
    flex: 0 0 56px;
    height: 47px;
    margin: 0 0 .5px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #cb0505;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background-color .3s linear;
}
.home-search-keyword button:hover,
.home-search-keyword button:focus-visible {
    background: #000;
}
.home-search-keyword button img {
    display: block;
    width: 20px;
    height: 20px;
    margin: auto;
    filter: brightness(0) invert(1);
}
.home-product-search select:focus-visible,
.home-product-search input:focus-visible,
.home-product-search button:focus-visible {
    outline: 2px solid #cb0505;
    outline-offset: -3px;
}
.home-product-search button:focus-visible {
    outline-color: #fff;
    outline-offset: -5px;
}
@media screen and (max-width: 767px) {
    .home-product-search {
        margin-bottom: 28px;
        padding: 14px;
    }
    .home-product-search form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }
    .home-search-keyword {
        grid-column: 1 / -1;
    }
    .home-product-search select,
    .home-product-search input[type="text"] {
        height: 46px;
        padding-left: 12px;
    }
    .home-search-keyword button {
        flex-basis: 48px;
        height: 45px;
    }
}

/* 確保外層項目高度一致，並隱藏溢出部分 */
.in-banner .owl-carousel .item {
  position: relative;
  height: 500px;
  overflow: hidden;
}
/* 讓圖片與影片完美填滿容器且不變形 */
.in-banner .owl-carousel .item img,
.in-banner .owl-carousel .item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 關鍵：像背景一樣填滿並裁切，不撐開高度 */
  display: block;
}
#promotion-popup {
  display: none;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 720px);
}
#promotion-popup img,
    #promotion-popup video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 86vh;
  margin: 0 auto;
}
.fancybox__container:has(#promotion-popup) {
  --fancybox-bg: rgba(0, 0, 0, 0.38);
}
#promotion-popup > .f-button.is-close-btn {
  --f-button-width: 36px;
  --f-button-height: 36px;
  --f-button-border-radius: 50%;
  --f-button-color: #fff;
  --f-button-hover-color: #fff;
  --f-button-bg: rgba(45, 45, 45, 0.72);
  --f-button-hover-bg: rgba(203, 5, 5, 0.9);
  --f-button-active-bg: #cb0505;
  --f-button-svg-width: 19px;
  --f-button-svg-height: 19px;
  top: 10px;
  right: 10px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  opacity: 1;
}
@media screen and (max-width: 767px) {
  /* 手機版維持橫幅原始比例，避免固定 500px 高度造成圖片被放大裁切。 */
  .in-banner .owl-carousel .item {
    height: auto;
    aspect-ratio: 1763 / 666;
    min-height: 0;
  }
  .in-banner .owl-carousel .item > a {
    display: block;
    height: 100%;
  }
  .in-banner .owl-carousel .item img,
      .in-banner .owl-carousel .item video {
    height: 100%;
    object-fit: cover;
  }
  #promotion-popup > .f-button.is-close-btn {
    --f-button-width: 32px;
    --f-button-height: 32px;
    top: 7px;
    right: 7px;
  }
}
