@charset "utf-8";
/*
  index.css｜首頁專用樣式（index-nav、index-catalog、banner 自訂內容等）。
  僅 index.php 額外載入；輪播系統請看 slider.css；多頁共用區塊請放 section.css。
*/

/* =========== index ========== */

.banner-text {
  position: relative;
  z-index: 2;
}

/* 第 1 頁自訂：商品圖 + Model */
.slide-inner:has(.banner-products) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4vw, 48px);
  padding: 15px 40px;
}

.banner-products {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(50px, 2vw, 100px);
}

.banner-products a {
  font-size: 90%;
}

.banner-product-item {
  flex: 1;
  max-width: clamp(250px, 25vw, 350px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.banner-product-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.banner-product-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.banner-models {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.banner-models img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
}


@media (min-width: 768px) {
  .banner-products {
    gap: clamp(24px, 3vw, 48px);
  }

  .banner-product-item:nth-child(1),
  .banner-product-item:nth-child(3) {
    flex: 0 1 22%;
    max-width: 240px;
  }

  .banner-product-item:nth-child(2) {
    flex: 0 1 48%;
    max-width: 780px;
  }
}

@media (max-width: 767px) {
  .slide-inner:has(.banner-products) {
    gap: 50px;
  }

  .banner-products {
    gap: 30px;
  }

  .banner-product-item {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
  .banner-product-item img {
height: 230px;
  }
}

/* index-nav */

.index-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(15px, 2vw, 20px);
}

.index-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--text-padding);
  background-color: var(--primary-gray-bg);
  border-radius: 12px;
  gap: 1rem;
}

.index-nav-item:first-child {
  background-image: linear-gradient(
    -45deg,
    var(--primary-color-800) 0%,
    var(--third-color) 100%
  );
  border: none;
  box-shadow: 3px 3px 15px rgba(19, 19, 19, 0.08);
}

.index-nav-item:first-child .nav-text h5,
.index-nav-item:first-child a {
  color: #fff !important;
}

.index-nav-item i {
  width: 80px;
  height: 80px;
  background-color: #fff;
  color: var(--secondary-color);
  aspect-ratio: auto 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  font-size: 2rem;
  box-shadow: 5px 10px 33px -12px var(--secondary-color);
  position: relative;
  z-index: 1;
}

.index-nav-item i::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 9px;
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  z-index: -1;
  transform: rotate(3deg);
  transition: transform 0.4s ease;
}

.index-nav-item .nav-text {
  padding: var(--text-padding);
}

.nav-text h5 {
  font-weight: 500;
  font-size: larger;
  padding-bottom: 16px;
  margin: 0;
}

.nav-text p {
  margin: 0;
  height: 80px;
}

.index-nav-item a {
  font-weight: 600;
  border-bottom: 1px dashed;
}

.index-nav-item:hover {
  cursor: pointer;
}

.index-nav-item:hover a {
  font-weight: 700;
  color: var(--secondary-color-700);
  transform: scale(1.02) translateY(-2px);
  transition: all 0.2s ease;
  border-bottom: 1px solid;
}

.index-nav-item:hover i::after {
  transform: rotate(18deg);
}

@media only screen and (max-width: 1080px) {
  .index-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media only screen and (max-width: 767px) {
  .index-nav {
    grid-template-columns: repeat(1, 1fr);
  }

  .nav-text p {
    height: 50px;
  }
}

/* index-news */

.index-news .tab-card > div {
  display: block;
}

.index-news img {
  border-radius: 12px;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center;
}

/* index-catalog */

.index-catalog {
  position: relative;
  counter-reset: catalog-item;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(15px, 2vw, 20px);
}

.index-catalog::after {
  content: "";
  position: absolute;
  top: -21px;
  left: 50%;
  transform: translateX(-50%);
  width: 76%;
  height: 1px;
  background-color: var(--primary-color);
  z-index: 1;
}

.index-catalog > div {
  position: relative;
  counter-increment: catalog-item;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 12px;
  gap: 25px;
  box-shadow:
    rgba(0, 0, 0, 0.1) 0px 0px 5px 0px,
    rgba(0, 0, 0, 0.4) 0px 0px 2px 0px;
}

.index-catalog > div::before {
  content: counter(catalog-item);
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 2;
}

.catalog-text {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 0px 30px 20px 45px;
}

.index-catalog > div h5 {
  font-size: larger;
  margin: 20px 20px 0 20px;
  text-align: center;
}

.catalog-text a {
  position: relative;
  border-bottom: 1px dashed var(--border-color);
}

.catalog-text a::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 3px;
  height: 8px;
  border-right: 2px solid var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  transform: rotate(40deg);
}

@media only screen and (max-width: 767px) {
  .index-catalog {
    margin-top: 0 !important;
    grid-template-columns: 1fr;
  }

  .index-catalog::after {
    top: 45%;
    transform: translateY(-50%);
    left: 11px;
    width: 1px;
    height: 76%;
  }

  .index-catalog > div {
    margin-left: 35px;
            margin-right: 4px;
    align-items: flex-start !important;
    gap: 15px;
  }

  .index-catalog > div::before {
    top: 50%;
    transform: translateY(-50%);
    left: -38px;
  }
}
