/* ============================================================
   軟構造 Soft Structure
   Brand Design System - Vol. 04 / Book B
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;1,6..96,400&family=Marcellus&family=Cormorant:ital,wght@0,300;0,600;1,300&family=Bricolage+Grotesque:wght@400;600;800&family=IBM+Plex+Mono:wght@400;500&family=Noto+Serif+TC:wght@300;400;600;900&family=Noto+Sans+TC:wght@200;300;400;700&family=Archivo:wght@400;500;600&display=swap');

:root {
  /* Soft Structure CIS Colours */
  --ink-slate: #22282A;
  --chalk: #EFEDE7;
  --brass: #9C8352;
  --deep-plum: #43293A;
  --fog-grey: #B4B7B0;
  --line-color: #D9D7D1;
  
  /* Background / Foreground mapping */
  --bg-color: var(--chalk);
  --surface-color: var(--chalk);
  --text-color: var(--ink-slate);

  /* Spacing */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 40px; --s6: 48px; --s7: 64px; --s8: 96px;
  --s9: 128px; --s10: 160px;

  /* Typography */
  --f-display-en: "Marcellus", serif;
  --f-display-tc: "Noto Serif TC", serif;
  --f-body: "Noto Sans TC", sans-serif;
  --f-label: "Archivo", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-color);
  background: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.2s ease-in-out, color 1.2s ease-in-out;
}

/* ========== Typography ========== */
h1, h2, h3, h4 { 
  font-family: var(--f-display-tc); 
  font-weight: 900; 
  line-height: 1.25; 
  color: var(--text-color); 
  letter-spacing: 0.05em; 
}

.en-display { 
  font-family: var(--f-display-en); 
  font-weight: 400; 
  letter-spacing: 0.1em; 
}

h1 { font-size: clamp(48px, 8vw, 96px); }
h2 { font-size: clamp(28px, 4vw, 48px); margin-bottom: var(--s5); margin-top: var(--s7); }
h3 { font-size: 24px; margin-bottom: var(--s2); }

.label {
  font-family: var(--f-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: var(--s2);
  display: block;
}

a { color: var(--text-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--brass); }

/* ========== Navigation ========== */
.site-nav {
  position: fixed; 
  top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(239, 237, 231, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34, 40, 42, 0.08);
  padding: var(--s3) var(--s5);
  transition: background-color 1.2s ease-in-out, border-color 1.2s ease-in-out;
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
}

.brand {
  font-family: var(--f-display-tc); 
  font-size: 20px; 
  font-weight: 900; 
  letter-spacing: 0.14em;
  display: flex; flex-direction: column; line-height: 1.2;
  color: var(--text-color);
  transition: color 1.2s ease-in-out;
}
.brand .sub { 
  font-family: var(--f-display-en); 
  font-size: 10px; 
  letter-spacing: 0.32em; 
  color: var(--brass); 
}
.brand-logo { color: var(--ink-slate); transition: color 1.2s ease-in-out; }

.nav-links { display: flex; gap: var(--s5); list-style: none; }
.nav-links a { 
  font-family: var(--f-label); 
  font-size: 11px; 
  font-weight: 500; 
  letter-spacing: 0.16em; 
  text-transform: uppercase; 
  color: var(--text-color); 
  transition: color 1.2s ease-in-out;
}
.nav-links a:hover { color: var(--brass); }

/* ========== Full Bleed Hero ========== */
.hero-bleed {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bleed .hero-bg {
  position: absolute; inset: 0;
  background: url('../assets/images/khaki_room.jpg') center/cover no-repeat;
  filter: brightness(0.9);
  z-index: 1;
}

.hero-bleed .hero-content {
  position: relative; z-index: 2;
  text-align: center; color: var(--chalk);
  padding: var(--s4);
}
.hero-bleed .hero-content h1 { 
  color: var(--chalk); 
  text-shadow: 0 4px 30px rgba(0,0,0,0.2); 
}
.hero-bleed .hero-content .en-display { 
  font-size: clamp(18px, 3vw, 24px); 
  color: var(--chalk); 
  letter-spacing: 0.25em; 
  margin-bottom: var(--s4); 
}

/* ========== 50/50 Full Bleed Split Screen Layout ========== */
.editorial-section {
  width: 100vw;
  margin: 0;
  padding: 0;
}

.ed-intro {
  max-width: 60ch;
  margin: var(--s10) auto;
  text-align: center;
  font-size: 18px;
  line-height: 2;
  color: var(--text-color);
  padding: 0 var(--s5);
}

.ed-item {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  align-items: center;
  margin-bottom: 0;
  overflow: hidden;
}

.ed-img {
  flex: 0 0 50%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.ed-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ed-item:hover .ed-img img {
  transform: scale(1.05);
}

.ed-text {
  flex: 0 0 50%;
  padding: 8%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
}

.ed-text h3 {
  font-size: clamp(28px, 3vw, 42px);
  margin-bottom: var(--s3);
  line-height: 1.2;
}

.ed-text p {
  font-size: 15px;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: var(--s5);
  line-height: 1.9;
  max-width: 45ch;
}

.ed-link {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--f-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-slate);
  text-transform: uppercase;
  border-bottom: 1px solid var(--fog-grey);
  padding-bottom: 4px;
  transition: all 0.3s ease;
}
.ed-link:hover {
  color: var(--brass);
  border-color: var(--brass);
}

/* Alternate left/right */
@media (min-width: 900px) {
  .ed-item:nth-child(even) {
    flex-direction: row-reverse;
  }
}

@media (max-width: 899px) {
  .ed-item { 
    flex-direction: column; 
    min-height: auto; 
  }
  .hero-bleed { height: 75vh; }
  .ed-intro { font-size: 16px; margin-bottom: var(--s7); }
  .ed-img {
    width: 100vw;
    height: 60vh;
    flex: none;
  }
  .ed-text {
    width: 100vw;
    height: auto;
    flex: none;
    padding: var(--s5);
  }
}

/* ========== Dynamic Themes ========== */
body.theme-khaki {
  --bg-color: #B6A696; /* 深卡其色 */
  --surface-color: #C6B6A5; /* 淺一點的卡其色 */
  --text-color: #22282A;
}
body.theme-red {
  --bg-color: #352123;
  --surface-color: #4A3335;
  --text-color: #EFEDE7;
}
body.theme-blue {
  --bg-color: #1F2A33;
  --surface-color: #2A3845;
  --text-color: #EFEDE7;
}
body.theme-green {
  --bg-color: #263328;
  --surface-color: #354538;
  --text-color: #EFEDE7;
}

body.theme-red .site-nav,
body.theme-blue .site-nav,
body.theme-green .site-nav {
  background: rgba(34, 40, 42, 0.9);
  border-color: rgba(239, 237, 231, 0.08);
}

body.theme-red .brand-logo,
body.theme-blue .brand-logo,
body.theme-green .brand-logo {
  color: var(--chalk);
}

body.theme-khaki .brand-logo {
  color: var(--ink-slate);
}

/* ========== Footer ========== */
.site-footer {
  padding: 100px 40px; 
  background: var(--ink-slate); 
  color: var(--chalk); 
  text-align: center;
}
.footer-logo {
  font-family: var(--f-display-en); 
  font-size: 24px; 
  margin-bottom: 20px; 
  color: var(--brass);
}
.footer-copy {
  font-family: var(--f-label); 
  font-size: 11px; 
  letter-spacing: 0.2em; 
  opacity: 0.6;
}

/* ========== Collection Page (Reference Layout) ========== */
.space-block {
  display: flex;
  flex-direction: column;
}

.space-hero {
  position: relative;
  width: 100vw;
  height: 85vh;
  background-size: cover;
  background-position: center;
}

.space-hero-text {
  position: absolute;
  top: 15%;
  left: 8%;
  max-width: 500px;
  color: var(--text-color);
}

.space-hero-text .en-display {
  font-size: clamp(48px, 8vw, 84px);
  line-height: 1.1;
  margin-bottom: var(--s4);
}

.space-hero-text .sub-title {
  font-family: var(--f-label);
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: var(--s2);
  display: block;
}

.space-hero-text p {
  font-size: 15px;
  line-height: 1.8;
  opacity: 0.9;
}

.tight-products {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--fog-grey);
}

.prod-cell {
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-color);
  transition: background 0.3s;
}

.prod-cell:hover {
  background: var(--bg-color);
}

.prod-cell .img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: rgba(0,0,0,0.05);
}

.prod-cell .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.prod-cell:hover .img-wrap img {
  transform: scale(1.02);
}

.prod-cell .info-wrap {
  padding: var(--s4) var(--s3);
  text-align: center;
}

.prod-cell .info-wrap h4 {
  font-family: var(--f-display-en);
  font-size: 16px;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.prod-cell .info-wrap p {
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.8;
  margin: 0;
}

/* ========== Product Detail Page ========== */
.product-detail-section {
  padding: 180px var(--s5) var(--s9);
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s8);
}

.pd-images {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.pd-images .main-img {
  width: 100%;
  aspect-ratio: 4/5;
  background: rgba(0,0,0,0.05);
  object-fit: cover;
}

.pd-info {
  position: sticky;
  top: 120px;
  align-self: start;
}
.pd-info h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: var(--s3);
}
.pd-info .pd-price {
  font-family: var(--f-label);
  font-size: 20px;
  color: var(--brass);
  margin-bottom: var(--s5);
}
.pd-info p {
  font-size: 16px;
  line-height: 2;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: var(--s6);
}

.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px;
  background: var(--text-color);
  color: var(--bg-color);
  font-family: var(--f-label);
  font-size: 12px;
  letter-spacing: 0.16em;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: var(--s6);
}
.btn-add:hover {
  background: var(--brass);
  color: #fff;
}

/* Checkout UI */
.checkout-box {
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  padding: var(--s4);
  background: rgba(255,255,255,0.03);
}
.checkout-box h4 {
  font-size: 16px;
  margin-bottom: var(--s3);
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.1));
  padding-bottom: 12px;
}

.pay-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--s4);
}
.pay-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  cursor: pointer;
  transition: border 0.3s;
}
.pay-opt:hover, .pay-opt.active {
  border-color: var(--brass);
}

@media (max-width: 899px) {
  .product-detail-section {
    grid-template-columns: 1fr;
    padding-top: 120px;
  }
  .pd-info { position: static; }
  .tight-products { grid-template-columns: repeat(2, 1fr); }
  .space-hero-text { position: relative; padding: var(--s5); left: 0; top: 0; background: var(--bg-color); width: 100vw; max-width: none; }
  .space-hero { height: 50vh; }
}

@media (max-width: 768px) {
  svg, video, canvas, iframe { max-width: 100% !important; height: auto !important; }
  .brand-logo, .hero-svg, .mark { max-width: 80vw !important; height: auto !important; }
}

@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr) !important; } }
