/* =====================================================================
   Custom additions for the Combest clone
   - Chinese font fallbacks
   - Language switcher
   - Banner slider (only slides when there is more than one image)
   - Product grid / list / detail helpers
   - Responsive tweaks
   ===================================================================== */

:root {
  --primary-font: 'Jost', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --secondary-font: 'Playfair Display', 'Noto Serif TC', 'Microsoft YaHei', 'PingFang SC', serif;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

/* ------------------------- Language switcher ------------------------- */
.lang-switch {
  display: flex;
  align-items: center;
  margin-left: 18px;
}
.lang-switch .lang-label {
  color: #fff;
  font-size: 0.7em;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 6px;
}
.header-t .lang-switch a {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 400;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  text-decoration: none;
  line-height: 1.4;
  margin-left: 4px;
  transition: all ease 0.3s;
}
.header-t .lang-switch a.active {
  font-size: 0.92em;
  font-weight: 700;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.header-t .lang-switch a:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* --------------------------- Banner slider --------------------------- */
.site-banner {
  position: relative;
  overflow: hidden;
}
.site-banner .banner-slide {
  position: relative;
  display: none;
}
.site-banner .banner-slide:first-child {
  display: block;
}
.site-banner.slider-ready .banner-slide {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.site-banner.slider-ready .banner-slide.active {
  opacity: 1;
}
.site-banner .banner-slide img,
.site-banner .wp-custom-header img {
  display: block;
  width: 100%;
  height: auto;
}
.site-banner .banner-dots {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 5;
  display: none;
}
.site-banner.slider-ready .banner-dots {
  display: block;
}
.site-banner .banner-dots .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 5px;
  border-radius: 100%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all ease 0.3s;
}
.site-banner .banner-dots .dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* Page banner (PROD / INTRO) with multiple images cross-fading */
header.page-header.page-banner {
  background: none !important;
  overflow: hidden;
}
header.page-header .page-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  z-index: -2;
}
header.page-header .page-banner-bg.active {
  opacity: 1;
}
header.page-header.page-banner .page-banner-dots {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 5;
}
header.page-header .page-banner-dots .dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin: 0 5px;
  border-radius: 100%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all ease 0.3s;
}
header.page-header .page-banner-dots .dot.active {
  background: var(--primary-color);
}

/* --------------------- Short loading cover -------------------- */
#site-loading {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}
#site-loading img {
  display: block;
  width: 320px;
  height: 320px;
  object-fit: contain;
}
#site-loading.hide {
  opacity: 0;
  pointer-events: none;
}

/* --------------------- Image placeholder while loading -------------------- */
.recent-post-section .grid article .post-thumbnail img,
.content-area .site-main .blog-list-item .post-thumbnail img,
.site-banner .banner-slide img,
#product-detail figure img,
.site-main .wp-block-image img,
.post-navigation .post-img img,
.intro-content figure img {
  background: #e8eaed url('/images/placeholder.svg') no-repeat center;
  background-size: 90px 68px;
}
/* --------------------- Mobile navigation fixes -------------------- */
@media (max-width: 767px) {
  .site-header .nav-menu {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-wrap .main-navigation button.toggle-btn {
    display: none !important;
  }
  .site-header .nav-menu li a {
    min-width: 0 !important;
    padding: 12px 14px !important;
    font-size: 1em !important;
  }
  .nav-wrap .nav-right {
    right: 8px;
  }
}
/* touch devices: category popup has no hover, hide it */
@media (hover: none), (pointer: coarse) {
  .site-header .nav-menu li.has-dropdown .category-popup {
    display: none !important;
  }
}
/* --------------------- Remove product detail prev/next hover effects -------------------- */
.post-navigation .nav-links .post-img {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
.post-navigation a:hover + .post-img,
.post-navigation .nav-links a:hover + .post-img {
  bottom: auto !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
.post-navigation a:hover > .post-title {
  color: #262525 !important;
}
.post-navigation a:hover {
  color: #262525 !important;
}
.post-navigation a:hover .meta-nav {
  color: #CCC6C8 !important;
}
/* --------------------- Category -> products flyout -------------------- */
.site-header .nav-menu li.has-dropdown .category-popup li.cat-item {
  position: relative;
}
.site-header .nav-menu li.has-dropdown .category-popup .cat-products-popup {
  position: absolute;
  left: calc(100% + 6px);
  top: -8px;
  min-width: 230px;
  width: max-content;
  max-width: none;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid #eceef1;
  padding: 8px;
  display: none;
  z-index: 9999;
  text-align: left;
}
.site-header .nav-menu li.has-dropdown .category-popup li.cat-item:hover .cat-products-popup,
.site-header .nav-menu li.has-dropdown .category-popup li.cat-item.open .cat-products-popup {
  display: block;
}
.site-header .nav-menu li.has-dropdown .category-popup .cat-products-popup ul {
  background: #fff;
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: 0;
}
.site-header .nav-menu li.has-dropdown .category-popup .cat-products-popup li a {
  white-space: nowrap;
}

/* --------------------- PROD nav hover category popup -------------------- */
.site-header .nav-menu li.has-dropdown {
  position: relative;
  padding-right: 0;
}
.site-header .nav-menu li.has-dropdown .category-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  min-width: 250px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid #eceef1;
  padding: 8px;
  display: none;
  z-index: 9999;
  text-align: left;
}
.site-header .nav-menu li.has-dropdown:hover .category-popup,
.site-header .nav-menu li.has-dropdown:focus-within .category-popup,
.site-header .nav-menu li.has-dropdown.open .category-popup {
  display: block;
}
.site-header .nav-menu li.has-dropdown .category-popup::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #eceef1;
  border-top: 1px solid #eceef1;
  -webkit-transform: translateX(-50%) rotate(45deg);
  transform: translateX(-50%) rotate(45deg);
}
.site-header .nav-menu li.has-dropdown .category-popup ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 1);
  border-radius: 0;
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  clip: auto !important;
  width: auto !important;
  top: auto !important;
  left: auto !important;
  box-shadow: none !important;
  -webkit-transition: none !important;
  transition: none !important;
  display: block;
}
.site-header .nav-menu li.has-dropdown .category-popup li {
  margin: 0;
}
.site-header .nav-menu li.has-dropdown .category-popup li a {
  display: block;
  padding: 10px 14px !important;
  color: #333 !important;
  font-weight: 500 !important;
  font-size: 1em !important;
  border-radius: 6px;
  white-space: nowrap;
}
.site-header .nav-menu li.has-dropdown .category-popup li a:hover {
  background: #f5f5f7 !important;
  color: var(--primary-color) !important;
}

/* --------------------- Home product grid: 4 per row -------------------- */
section.recent-post-section .container {
  max-width: 1440px;
}
section.recent-post-section .grid {
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 24px;
}
.recent-post-section .grid article .content-wrap {
  margin: 20px;
}
.recent-post-section .grid article .entry-title {
  font-size: 1.25em;
}
@media (max-width: 1200px) {
  section.recent-post-section .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  section.recent-post-section .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 15px;
  }
}
@media (max-width: 460px) {
  section.recent-post-section .grid {
    grid-template-columns: 1fr;
  }
}
/* --------------------- Home titles (darker + larger) -------------------- */
.recent-post-section .section-title {
  font-size: 2.5em;
  color: #262525;
  font-weight: 700;
}
.recent-post-section .grid article .content-wrap .entry-title {
  font-size: 1.6em;
}
.recent-post-section .grid article .content-wrap .entry-title a {
  color: #17171a;
  font-weight: 700;
}
.recent-post-section .grid article .content-wrap .entry-content p {
  color: #3d3d3d;
}
/* ------------------------- HOME product grid ------------------------- */
.recent-post-section { padding-bottom: 70px; }
.recent-post-section .section-title { margin-bottom: 25px; }
.recent-post-section .grid article {
  display: flex;
  flex-direction: column;
}
.recent-post-section .grid article .post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}
.recent-post-section .grid article .content-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.recent-post-section .grid article .entry-content p {
  margin-bottom: 0;
}
.recent-post-section .grid article .entry-footer {
  margin-top: auto;
  padding-top: 18px;
}
.recent-post-section .btn-wrap {
  text-align: center;
  margin-top: 30px;
}

/* --------------------------- PROD listing ---------------------------- */
.content-area .site-main .blog-list-item {
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  border-bottom: 3px solid transparent;
  margin-bottom: 30px;
  display: flex;
  flex-flow: row wrap;
  transition: all ease 0.35s;
}
.content-area .site-main .blog-list-item:hover {
  border-bottom-color: var(--primary-color);
  transform: translateY(-3px);
}
.content-area .site-main .blog-list-item .post-thumbnail {
  flex: 0 0 42%;
  max-width: 42%;
}
.content-area .site-main .blog-list-item .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content-area .site-main .blog-list-item .content-wrap {
  flex: 1;
  padding: 30px;
  margin: 0;
}
@media (max-width: 767px) {
  .content-area .site-main .blog-list-item .post-thumbnail {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ------------------------- Product detail ---------------------------- */
.single-product .entry-content {
  text-align: center;
}
.single-product .entry-content .product-name {
  font-size: 1.6em;
  font-family: var(--secondary-font);
  font-weight: 400;
  margin: 10px 0 35px;
}
.single-product .entry-content figure {
  margin: 0 0 30px;
}
.single-product .entry-content img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
.post-navigation.pagination {
  margin: 30px 0 50px;
}
.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 1;
}
.post-navigation .nav-next {
  text-align: right;
}
.post-navigation .post-img {
  margin: 10px 0 0;
}
.post-navigation .post-img img {
  max-width: 120px;
  height: auto;
  border-radius: 4px;
}

/* --------------------------- Intro page ------------------------------ */
.intro-content figure {
  margin: 0 0 30px;
}
.intro-content img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* ----------------------------- Sidebar ------------------------------- */
.widget-area .widget {
  margin-bottom: 35px;
}
.widget-area .widget-title {
  font-family: var(--secondary-font);
  font-weight: 400;
  font-size: 1.333em;
  margin-top: 0;
}

/* ------------------------- Search modal ------------------------------ */
.header-search-wrap {
  position: relative;
}
.search-form-wrap.search-modal {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  right: -6px !important;
  left: auto !important;
  bottom: auto !important;
  width: 400px;
  max-width: 82vw;
  background: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22) !important;
  border: 1px solid #eceef1 !important;
  padding: 10px 15px !important;
  z-index: 9999 !important;
  display: none !important;
  animation: none !important;
}
.search-form-wrap.search-modal .search-form-inner {
  padding-right: 0 !important;
}
.search-form-wrap.search-modal::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #eceef1;
  border-top: 1px solid #eceef1;
  transform: rotate(45deg);
}
body.showing-search-modal .search-form-wrap.search-modal {
  display: block !important;
}
body.showing-search-modal .site-header {
  margin-top: 0 !important;
}
.search-form-wrap .search-form-inner form.search-form {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 15px !important;
  margin: 0 !important;
}
.search-form-wrap .search-form-inner form.search-form > label {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  margin: 0;
}
.search-form-wrap .search-form-inner .search-field {
  width: 100% !important;
  border: 1px solid #d9dce1 !important;
  border-radius: 6px !important;
  padding: 9px 12px !important;
  font-size: 14px !important;
  color: #333 !important;
  background: #fff !important;
  outline: none;
  box-shadow: none !important;
}
.search-form-wrap .search-form-inner .search-field:focus {
  border-color: var(--primary-color) !important;
}
.search-form-wrap .search-form-inner .search-submit {
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
  background: #fff !important;
  color: #e61c1d !important;
  border: 1px solid #e61c1d !important;
  border-radius: 6px !important;
  padding: 9px 18px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-indent: 0 !important;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none !important;
}
.search-form-wrap .search-form-inner .search-submit:hover {
  background: #e61c1d !important;
  color: #fff !important;
}
.search-form-wrap .search-form-inner .close {
  display: none !important;
}

/* ----------------------- Misc / responsive --------------------------- */
.nav-wrap {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 999 !important;
}
.nav-wrap .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
}
.nav-wrap .main-navigation {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}
.site-header .nav-menu {
  justify-content: center;
}
.nav-wrap .nav-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.site-header .nav-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}
.site-header .nav-menu li {
  position: relative;
}
.site-header .nav-menu li a {
  display: inline-block;
  padding: 14px 20px;
  min-width: 92px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15em;
  letter-spacing: 1px;
}
.site-header .nav-menu li.current-menu-item > a,
.site-header .nav-menu li a:hover {
  color: var(--primary-color);
}
.site-header .nav-menu li.current-menu-item > a {
  background: #fff;
  border-radius: 3px;
}
@media (max-width: 767px) {
  .site-header .nav-menu li a {
    padding: 12px 12px;
    min-width: 72px;
    text-align: center;
    font-size: 1.1em;
  }
  .lang-switch {
    margin-left: 6px;
  }
}

.site-banner img {
  width: 100%;
  height: auto;
  display: block;
}
.banner-no-slide {
  cursor: default;
}

/* Back-to-top icon without loading the full icon library. */
.back-to-top .back-to-top-symbol {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
}

/* Homepage transparent intro video */
.home-intro-video {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff !important;
  isolation: isolate;
  opacity: 1;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.home-intro-video.is-visible {
  visibility: visible;
}
.home-intro-video video {
  display: block;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  object-fit: cover;
}
.home-intro-video.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.start-play-intro {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: 33vw;
  height: 33vh;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease, visibility .35s ease;
}
.start-play-intro video { display: block; width: 100%; height: 100%; object-fit: contain; }
.start-play-intro.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.home-intro-skip {
  position: absolute;
  z-index: 10002;
  top: 5vh;
  right: 5vw;
  padding: .55rem 1rem;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 3px;
  color: #fff;
  background: rgba(0,0,0,.4);
  cursor: pointer;
  font: inherit;
}

/* Full-screen intro shown when entering the rotating magnetic series. */
.series-intro-video {
  position: fixed;
  inset: 0;
  z-index: 10010;
  overflow: hidden;
  background: #000;
  opacity: 1;
  transition: opacity .35s ease;
}
.series-intro-video video {
  display: block;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}
.series-intro-video.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.series-intro-skip {
  position: absolute;
  top: 5vh;
  right: 5vw;
  z-index: 1;
  padding: .55rem 1rem;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 3px;
  color: #fff;
  background: rgba(0, 0, 0, .4);
  cursor: pointer;
  font: inherit;
}
