/* SP2 官方網站 - 全站樣式 */
:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --accent-hover: #c73a52;
  --gold: #d4af37;
  --bg: #f8f9fa;
  --text: #333;
  --text-light: #666;
  --white: #fff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --header-h: 70px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: var(--header-h);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== 導覽列（由 nav.js 注入） ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--primary);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 2px;
}

.logo span {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: 0.3s;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--accent);
  color: var(--white);
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.nav-icons a {
  position: relative;
  padding: 8px 10px !important;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--gold);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ========== 文章展示 ========== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #eee;
}

.article-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.article-meta span {
  margin-right: 12px;
}

.article-body h3 {
  font-size: 1.125rem;
  color: var(--primary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-body p {
  font-size: 0.9375rem;
  color: var(--text-light);
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-body .read-more {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  align-self: flex-start;
}

.article-body .read-more:hover {
  text-decoration: underline;
}

/* ========== 輪播圖 ========== */
.hero-carousel {
  position: relative;
  overflow: hidden;
  background: var(--primary);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--white);
}

.carousel-caption h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.carousel-caption p {
  font-size: 1rem;
  opacity: 0.9;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s;
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--accent);
}

.carousel-btn.prev {
  left: 16px;
}

.carousel-btn.next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}

.carousel-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* ========== 區塊通用 ========== */
.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-title p {
  color: var(--text-light);
}

/* ========== 分類捷徑 ========== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.category-card .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1rem;
  color: var(--primary);
}

/* ========== 商品卡片 ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #eee;
}

.product-info {
  padding: 16px;
}

.product-info h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.product-info .price {
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 700;
}

.product-info .price del {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 400;
  margin-left: 6px;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9375rem;
  transition: background 0.2s;
  font-family: inherit;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--white);
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.tag {
  display: inline-block;
  background: var(--gold);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* ========== 特色區塊 ========== */
.features {
  background: var(--primary);
  color: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}

.feature-item {
  text-align: center;
  padding: 20px;
}

.feature-item .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.feature-item h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.feature-item p {
  font-size: 0.875rem;
  opacity: 0.85;
}

/* ========== 頁尾 ========== */
.site-footer {
  background: #0f0f1a;
  color: rgba(255, 255, 255, 0.8);
  padding: 50px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-grid h4 {
  color: var(--white);
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-grid ul li {
  margin-bottom: 8px;
}

.footer-grid a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.875rem;
}

/* ========== 內頁通用 ========== */
.page-header {
  background: linear-gradient(135deg, var(--primary), #16213e);
  color: var(--white);
  padding: 40px 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.breadcrumb {
  font-size: 0.875rem;
  opacity: 0.8;
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* ========== 購物車 / 結帳 ========== */
.cart-table {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.cart-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 500;
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-product img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
}

.cart-summary {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.cart-summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-summary .total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-top: 12px;
}

/* ========== 表單 ========== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9375rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  align-items: start;
}

.checkout-box {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checkout-box h3 {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

/* ========== 帳戶頁 ========== */
.account-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
}

.account-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.account-sidebar a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: background 0.2s;
}

.account-sidebar a:hover,
.account-sidebar a.active {
  background: var(--accent);
  color: var(--white);
}

.account-content {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ========== 品牌列表 ========== */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.brand-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.brand-card:hover {
  transform: scale(1.03);
}

.brand-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 12px;
  background: #f0f0f0;
  border-radius: 50%;
}

/* ========== 篩選列 ========== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}

.filter-bar select {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: inherit;
}

/* ========== 懸浮聯絡方式（QR Code） ========== */
.float-contact {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.float-contact-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-contact-toggle:hover {
  transform: scale(1.08);
  background: var(--accent-hover);
}

.float-contact-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 260px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.float-contact-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.float-contact-panel h4 {
  text-align: center;
  margin-bottom: 12px;
  color: var(--primary);
}

.float-contact-panel .qr-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.float-contact-panel .qr-wrap img {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border: 1px solid #eee;
  border-radius: 4px;
}

.float-contact-panel .contact-list {
  font-size: 0.875rem;
}

.float-contact-panel .contact-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}

.float-contact-panel .contact-list a {
  color: var(--accent);
}

/* ========== 空狀態 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* ========== 響應式 ========== */
@media (max-width: 992px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--primary);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
  }

  .main-nav.open {
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
  }

  .main-nav ul {
    flex-direction: column;
    padding: 16px;
    align-items: stretch;
  }

  .main-nav a {
    display: block;
    padding: 12px 16px;
  }

  .nav-icons {
    margin-left: 0;
    justify-content: center;
    padding-bottom: 12px;
  }

  .carousel-slide img {
    height: 260px;
  }

  .carousel-caption h2 {
    font-size: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cart-table {
    font-size: 0.875rem;
  }

  .cart-table th:nth-child(3),
  .cart-table td:nth-child(3) {
    display: none;
  }
}

/* ========== Elementor 相容 ========== */
.sp2-main,
.elementor-content-area {
  width: 100%;
  min-height: 0;
}

body.elementor-page #sp2-main,
body.elementor-page .elementor {
  width: 100%;
}

.elementor-widget-shortcode .hero-carousel,
.elementor-widget-shortcode .section,
.elementor-widget-html .hero-carousel,
.elementor-widget-html .section {
  width: 100%;
}

.elementor-editor-active .float-contact,
.elementor-editor-preview .float-contact {
  display: none;
}

.elementor-element .elementor-widget-container {
  overflow: visible;
}

/* Elementor 原生容器內商品卡片 */
.elementor-element .tag {
  display: inline-block;
  background: #d4af37;
  color: #1a1a2e;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.elementor-element .btn.add-to-cart {
  display: inline-block;
  padding: 8px 16px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.sp2-features-section .elementor-heading-title {
  color: #ffffff;
}

.sp2-features-section .elementor-widget-text-editor,
.sp2-features-section .elementor-widget-text-editor p {
  color: rgba(255, 255, 255, 0.85);
}

.sp2-features-section .elementor-icon-box-title,
.sp2-features-section .elementor-icon-box-description {
  color: #ffffff;
}
