/*
Theme Name:  IRONFORGE
Theme URI:   https://ironforge.tw
Author:      IRONFORGE Team
Author URI:  https://ironforge.tw
Description: 頂級運動器材品牌形象主題，整合 WooCommerce 電商功能，支援 ACF 自訂欄位後台管理。
Version:     1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ironforge
Tags:        woocommerce, custom-background, custom-logo, full-width-template, one-column, two-columns, e-commerce
*/

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --black:   #0a0a0a;
  --charcoal:#141414;
  --dark:    #1c1c1c;
  --mid:     #2a2a2a;
  --steel:   #3d3d3d;
  --silver:  #8a8a8a;
  --light:   #d4d4d4;
  --white:   #f5f5f5;
  --accent:  #e8441a;
  --accent2: #ff6b35;
  --gold:    #c9a84c;
  --font-display: 'Bebas Neue', 'Oswald', sans-serif;
  --font-heading: 'Oswald', sans-serif;
  --font-body:    'Noto Sans TC', sans-serif;
}

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

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; }

/* ===== LOADING SCREEN ===== */
#loader {
  position: fixed; inset: 0;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-logo {
  font-family: var(--font-display);
  font-size: 4rem;
  letter-spacing: 0.3em;
  color: var(--white);
  animation: pulseGlow 1.2s ease-in-out infinite alternate;
}
.loader-bar {
  width: 200px; height: 2px;
  background: var(--steel);
  margin: 20px auto 0;
  position: relative; overflow: hidden;
}
.loader-bar::after {
  content: '';
  position: absolute; left: -100%; top: 0;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: loadBar 1.5s ease forwards;
}
@keyframes loadBar { to { left: 0; } }
@keyframes pulseGlow {
  from { text-shadow: 0 0 10px rgba(232,68,26,0.3); }
  to   { text-shadow: 0 0 30px rgba(232,68,26,0.8), 0 0 60px rgba(232,68,26,0.3); }
}

/* ===== LOGO IMAGE ===== */
.site-logo--img {
  display: flex;
  align-items: center;
}
.site-logo-img {
  height: 44px;        /* 頁首 Logo 高度，可依需求調整 */
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  /* 若 Logo 是深色背景設計，可加以下讓它在深色頁首上顯示正常 */
  filter: brightness(1);
}
/* 亮色 Logo 加強白色顯示（如果 Logo 本身是白色透明底） */
.site-logo--img:hover .site-logo-img {
  opacity: 0.85;
  transition: opacity 0.2s;
}

/* Loading Screen Logo 圖片版 */
.loader-logo-img {
  height: 80px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  animation: pulseGlow 1.2s ease-in-out infinite alternate;
  filter: brightness(1.1);
}

/* ===== NAVIGATION ===== */
#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%;
  height: 70px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232,68,26,0.15);
  transition: all 0.3s;
}
#site-header.scrolled { background: rgba(10,10,10,0.98); }
.site-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.15em;
  color: var(--white);
}
.site-logo span { color: var(--accent); }
.primary-nav { display: flex; gap: 2.5rem; align-items: center; }
.primary-nav a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--silver);
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s;
}
.primary-nav a::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--accent); transition: width 0.3s;
}
.primary-nav a:hover { color: var(--white); }
.primary-nav a:hover::after { width: 100%; }
.nav-cta {
  background: var(--accent) !important;
  color: var(--white) !important;
  padding: 8px 20px;
  font-weight: 600 !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--accent2) !important; }

/* WooCommerce Cart Icon */
.nav-cart {
  position: relative;
  font-size: 1.2rem;
  color: var(--silver);
  transition: color 0.2s;
}
.nav-cart:hover { color: var(--white); }
.cart-count {
  position: absolute; top: -8px; right: -8px;
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--white); font-size: 1.4rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 16px 40px;
  background: var(--accent);
  color: var(--white);
  border: none;
  position: relative; overflow: hidden;
  transition: all 0.3s;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  display: inline-block;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); color: var(--white); }
.btn-secondary {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 15px 40px;
  background: transparent;
  color: var(--light);
  border: 1px solid var(--steel);
  transition: all 0.3s;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--white); color: var(--white); }

/* ===== SECTIONS ===== */
section { padding: 100px 5%; }
.section-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}
.section-sub {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--silver);
  max-width: 480px;
  margin-bottom: 3rem;
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: 100px 5% 60px;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 75% 50%, rgba(232,68,26,0.08) 0%, transparent 70%),
    linear-gradient(135deg, #0a0a0a 0%, #141414 50%, #0f0f0f 100%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}
.hero-line {
  position: absolute; left: 5%; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  animation: scanLine 4s ease-in-out infinite;
}
@keyframes scanLine {
  0%,100% { opacity:0.3; transform:scaleY(0.5); }
  50%      { opacity:1;   transform:scaleY(1); }
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 1.8s ease forwards;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 2s ease forwards;
}
.hero-title .accent  { color: var(--accent); }
.hero-title .outline { -webkit-text-stroke: 1px rgba(255,255,255,0.3); color: transparent; }
.hero-desc {
  font-size: 1rem; line-height: 1.8;
  color: var(--silver); max-width: 480px;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s 2.2s ease forwards;
}
.hero-btns {
  display: flex; gap: 1rem; flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 2.4s ease forwards;
}
.hero-stats {
  position: absolute; right: 5%; bottom: 10%;
  display: flex; gap: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s 2.6s ease forwards;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 3rem; line-height: 1;
}
.stat-num span { color: var(--accent); font-size: 1.5rem; }
.stat-label {
  font-family: var(--font-heading);
  font-size: 0.7rem; letter-spacing: 0.2em;
  color: var(--silver); text-transform: uppercase;
  margin-top: 4px;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== BRANDS STRIP ===== */
#brands-strip {
  padding: 50px 0;
  background: var(--charcoal);
  border-top: 1px solid var(--mid);
  border-bottom: 1px solid var(--mid);
  overflow: hidden;
}
.brand-track {
  display: flex; gap: 5rem; align-items: center;
  animation: scroll 20s linear infinite;
  width: max-content;
}
/* 文字模式 */
.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem; letter-spacing: 0.2em;
  color: var(--light); white-space: nowrap;
  transition: color 0.2s;
}
.brand-name:hover { color: var(--white); }

/* 圖片模式 */
.brand-track--images { gap: 4rem; }
.brand-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-img-wrap a {
  display: flex;
  align-items: center;
}
.brand-logo-img {
  height: 48px;           /* Logo 高度，可依需求調整 */
  width: auto;
  max-width: 160px;
  object-fit: contain;
  /* 統一調整為亮白色顯示（適合深色背景） */
  filter: brightness(0) invert(1);
  opacity: 0.75;
  transition: opacity 0.3s, filter 0.3s;
}
.brand-logo-img:hover,
.brand-img-wrap a:hover .brand-logo-img {
  opacity: 1;
  filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(232,68,26,0.6));
}

@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== PRODUCTS ===== */
#products-section { background: var(--charcoal); }
.products-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 4rem; flex-wrap: wrap; gap: 2rem;
}
.product-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--font-heading);
  font-size: 0.75rem; letter-spacing: 0.15em;
  text-transform: uppercase; padding: 8px 18px;
  background: transparent; color: var(--silver);
  border: 1px solid var(--steel); cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active,.filter-btn:hover {
  background: var(--accent); border-color: var(--accent); color: var(--white);
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5px;
}

/* ===== WooCommerce Product Cards ===== */
.wc-product-card {
  background: var(--dark);
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.wc-product-card:hover { transform: scale(1.02); z-index: 2; }
.wc-product-card:hover .product-overlay { opacity: 1; }
.wc-product-card:hover .product-thumb-wrap img { transform: scale(1.05); }
.product-thumb-wrap {
  width: 100%; aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--dark) 0%, var(--mid) 100%);
  display: flex; align-items: center; justify-content: center;
}
.product-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-thumb-wrap .no-thumb { font-size: 6rem; }
.product-badge {
  position: absolute; top: 16px; left: 16px;
  font-family: var(--font-heading);
  font-size: 0.65rem; letter-spacing: 0.2em;
  text-transform: uppercase; padding: 4px 10px;
  background: var(--accent); color: var(--white); z-index: 2;
}
.product-overlay {
  position: absolute; inset: 0;
  background: rgba(232,68,26,0.15);
  display: flex; align-items: flex-end;
  padding: 1.5rem; opacity: 0; transition: opacity 0.3s;
  z-index: 3;
}
.product-overlay .add-to-cart {
  width: 100%; padding: 12px;
  background: var(--accent); color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.8rem; letter-spacing: 0.2em;
  text-transform: uppercase; border: none;
  transition: background 0.2s;
}
.product-overlay .add-to-cart:hover { background: var(--accent2); }
.product-card-body { padding: 1.5rem; }
.product-cat-label {
  font-family: var(--font-heading);
  font-size: 0.65rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--silver);
  margin-bottom: 0.5rem;
}
.product-card-name {
  font-family: var(--font-heading);
  font-size: 1.2rem; font-weight: 600;
  letter-spacing: 0.05em; margin-bottom: 0.75rem;
}
.product-price-row { display: flex; justify-content: space-between; align-items: center; }
.wc-price {
  font-family: var(--font-display);
  font-size: 1.6rem; color: var(--accent);
}
.wc-price del { color: var(--steel); font-size: 0.85rem; margin-left: 8px; }
.star-rating { color: var(--gold); font-size: 0.8rem; }

/* ===== FEATURES ===== */
#features-section { background: var(--black); }
.features-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 6rem; align-items: center; }
.feature-item {
  border-top: 1px solid var(--mid); padding: 2rem 0;
  cursor: pointer; transition: all 0.3s;
}
.feature-item:last-child { border-bottom: 1px solid var(--mid); }
.feature-item.active .feature-num  { color: var(--accent); }
.feature-item.active .feature-title { color: var(--white); }
.feature-item.active .feature-body  { max-height: 200px; opacity: 1; margin-top: 0.75rem; }
.feature-num {
  font-family: var(--font-display);
  font-size: 0.75rem; letter-spacing: 0.3em;
  color: var(--steel); transition: color 0.3s;
}
.feature-title {
  font-family: var(--font-heading);
  font-size: 1.2rem; font-weight: 600;
  letter-spacing: 0.05em; color: var(--light);
  transition: color 0.3s;
}
.feature-body {
  font-size: 0.9rem; line-height: 1.7;
  color: var(--silver); max-height: 0;
  overflow: hidden; opacity: 0;
  transition: all 0.4s ease;
}
.feature-visual {
  aspect-ratio: 1; background: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  font-size: 10rem; position: relative; overflow: hidden;
  clip-path: polygon(12% 0, 100% 0, 100% 88%, 88% 100%, 0 100%, 0 12%);
}
.feature-visual::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(232,68,26,0.1) 0%, transparent 70%);
}
.feature-icon-display { position: relative; z-index: 2; filter: drop-shadow(0 0 20px rgba(232,68,26,0.4)); }

/* ===== TESTIMONIALS ===== */
#testimonials-section { background: var(--black); }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem; margin-top: 4rem;
}
.testimonial-card {
  background: var(--charcoal);
  border: 1px solid var(--mid); padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
}
.testimonial-card:hover { border-color: rgba(232,68,26,0.4); transform: translateY(-4px); }
.quote-mark {
  font-family: var(--font-display);
  font-size: 5rem; line-height: 0.6;
  color: var(--accent); opacity: 0.3; margin-bottom: 1rem;
}
.testimonial-body { font-size: 0.95rem; line-height: 1.8; color: var(--light); margin-bottom: 1.5rem; }
.testimonial-author { display: flex; align-items: center; gap: 1rem; }
.author-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--mid); overflow: hidden;
  border: 2px solid var(--steel);
  display: flex; align-items: center; justify-content: center;
}
.author-name { font-family: var(--font-heading); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.05em; }
.author-role { font-size: 0.75rem; color: var(--silver); margin-top: 2px; }

/* ===== CTA BANNER ===== */
#cta-section {
  padding: 100px 5%; text-align: center;
  background: var(--charcoal); position: relative; overflow: hidden;
}
#cta-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(232,68,26,0.12) 0%, transparent 70%);
}
.cta-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  letter-spacing: 0.03em; margin-bottom: 1rem; position: relative;
}
.cta-sub { font-size: 1rem; color: var(--silver); margin-bottom: 3rem; position: relative; }

/* ===== FOOTER ===== */
#site-footer {
  background: var(--black);
  border-top: 1px solid var(--mid);
  padding: 60px 5% 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem; margin-bottom: 4rem;
}
.footer-logo { font-family: var(--font-display); font-size: 2.5rem; letter-spacing: 0.15em; margin-bottom: 1rem; }
.footer-logo span { color: var(--accent); }
.footer-desc { font-size: 0.85rem; color: var(--silver); line-height: 1.8; }
.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--light); margin-bottom: 1.5rem;
}
.footer-menu li { margin-bottom: 0.75rem; }
.footer-menu a { font-size: 0.85rem; color: var(--silver); transition: color 0.2s; }
.footer-menu a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--mid); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-copy { font-size: 0.8rem; color: var(--steel); }
.social-links { display: flex; gap: 1rem; }
.social-link {
  width: 36px; height: 36px;
  border: 1px solid var(--mid);
  display: flex; align-items: center; justify-content: center;
  color: var(--silver); transition: all 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); }

/* ===== WOOCOMMERCE OVERRIDES ===== */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  background: var(--charcoal) !important;
  border-top-color: var(--accent) !important;
  color: var(--white) !important;
}
.woocommerce button.button,
.woocommerce a.button {
  background: var(--accent) !important;
  color: var(--white) !important;
  font-family: var(--font-heading) !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  border-radius: 0 !important;
  transition: background 0.2s !important;
}
.woocommerce button.button:hover,
.woocommerce a.button:hover { background: var(--accent2) !important; }

/* ===== SINGLE PRODUCT ===== */
.woocommerce div.product .product_title {
  font-family: var(--font-display) !important;
  font-size: 3rem !important; color: var(--white) !important;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--accent) !important;
  font-family: var(--font-display) !important;
  font-size: 2rem !important;
}
.woocommerce div.product .woocommerce-product-details__short-description {
  color: var(--silver) !important; line-height: 1.8 !important;
}
.woocommerce #content div.product,
.woocommerce div.product,
.woocommerce-page #content div.product,
.woocommerce-page div.product {
  background: var(--charcoal);
  padding: 3rem; margin-top: 100px;
}

/* ===== CART / CHECKOUT ===== */
.woocommerce-cart table.cart,
.woocommerce-checkout #order_review {
  background: var(--charcoal) !important;
  color: var(--white) !important;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
  background: var(--dark) !important;
  border: 1px solid var(--mid) !important;
  color: var(--white) !important;
  border-radius: 0 !important;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus { border-color: var(--accent) !important; outline: none !important; }

/* ===== BREADCRUMBS ===== */
.woocommerce .woocommerce-breadcrumb {
  color: var(--silver) !important;
  font-size: 0.8rem !important;
  padding: 80px 5% 0 !important;
}
.woocommerce .woocommerce-breadcrumb a { color: var(--accent) !important; }

/* ===== ARCHIVE ===== */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  background: var(--dark) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .features-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .primary-nav { display: none; }
  .primary-nav.open {
    display: flex; flex-direction: column;
    position: fixed; top: 70px; left: 0; right: 0;
    background: var(--charcoal);
    padding: 2rem 5%; gap: 1.5rem;
    border-bottom: 1px solid var(--mid);
  }
  .menu-toggle { display: block; }
  .hero-stats { position: static; margin-top: 3rem; flex-wrap: wrap; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
