/* Tai Tong Seng Trading — v2 "signboard" design
   One bold move: the vertical 大東成 signboard. Everything else stays quiet. */
:root {
  --paper: #f1f2f5;
  --tile: #ffffff;
  --ink: #151a5e;
  --ink-2: #2b2f45;
  --steel: #80859a;
  --line: #dcdfe6;
  --red: #e10600;
  --red-dark: #b80500;
  --r-tile: 22px;
  --r-img: 16px;
  --r-input: 10px;
  --max: 1240px;
  --wide: "Archivo", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--wide);
  font-stretch: 100%;
  color: var(--ink-2);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { color: var(--ink); font-stretch: 125%; letter-spacing: -0.015em; line-height: 1.08; }
h1 { font-size: clamp(34px, 5.2vw, 64px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 750; }
h3 { font-size: 19px; font-weight: 700; line-height: 1.25; }
p { max-width: 68ch; }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 242, 245, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 28px; height: 76px; position: relative; }
.brand img { height: 50px; width: auto; mix-blend-mode: multiply; }
nav.main { margin-left: auto; }
nav.main ul { list-style: none; display: flex; align-items: center; gap: 4px; }
nav.main a {
  position: relative; display: block; padding: 8px 14px;
  font-weight: 600; font-size: 15px; color: var(--ink-2);
}
nav.main a:hover, nav.main a.active { color: var(--ink); }
nav.main a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 6px; height: 6px;
  margin-left: -3px; border-radius: 50%; background: var(--red);
}
nav.main a.cta {
  margin-left: 10px; padding: 10px 20px; border-radius: 999px;
  background: var(--ink); color: #fff;
}
nav.main a.cta:hover { background: var(--red); }
nav.main a.cta.active::after { display: none; }
.menu-btn {
  display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--tile); color: var(--ink); font-size: 20px; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: 15.5px;
  border: 1.5px solid transparent; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--red); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--red); color: #fff; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Home hero: bento ---------- */
.hero { padding: 28px 0 0; }
.bento {
  display: grid; gap: 14px;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 300px 230px;
}
.tile { background: var(--tile); border-radius: var(--r-tile); overflow: hidden; position: relative; }
.tile > img { width: 100%; height: 100%; object-fit: cover; }
.hero-main {
  grid-column: 1 / 8; grid-row: 1 / 3;
  padding: 48px 150px 44px 48px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-main p { font-size: 18px; margin: 20px 0 30px; max-width: 46ch; }
.signboard {
  position: absolute; top: 32px; right: 30px;
  writing-mode: vertical-rl; text-orientation: upright;
  font-family: "Noto Serif TC", serif; font-weight: 900;
  font-size: clamp(54px, 6vw, 88px); line-height: 1; letter-spacing: .06em;
  color: var(--red); user-select: none;
}
.signboard small {
  font-family: var(--wide); font-size: 13px; letter-spacing: .02em; font-weight: 600;
  text-orientation: mixed; color: var(--steel); margin-top: 14px;
}
.hero-a { grid-column: 8 / 13; grid-row: 1; }
.hero-b { grid-column: 8 / 11; grid-row: 2; }
.status {
  grid-column: 11 / 13; grid-row: 2;
  background: var(--ink); color: #fff; padding: 22px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 5px rgba(61,220,132,.2); }
.status.closed .dot { background: #ff6b66; box-shadow: 0 0 0 5px rgba(255,107,102,.2); }
.status b { display: block; font-size: 22px; font-stretch: 125%; line-height: 1.15; margin-top: 12px; }
.status span { font-size: 13.5px; color: #b9bce0; }
.status a { font-weight: 700; color: #fff; border-bottom: 1.5px solid rgba(255,255,255,.4); align-self: flex-start; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.head p { margin-top: 12px; color: var(--steel); font-size: 17px; }

/* company */
.company { display: grid; grid-template-columns: 1.35fr 1fr; gap: 64px; align-items: start; }
.statement { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.4; color: var(--ink); font-weight: 500; max-width: 32ch; }
.facts { border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--steel); }
.facts dd { color: var(--ink); font-weight: 700; text-align: right; }

/* product bento */
.pbento {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 250px 250px 230px;
  grid-template-areas: "san san bath elec" "san san bath tool" "pnt pnt oth oth";
}
.ptile { position: relative; border-radius: var(--r-tile); overflow: hidden; background: var(--tile); display: block; }
.ptile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ptile:hover img { transform: scale(1.035); }
.ptile .label {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  background: rgba(255,255,255,.94); border-radius: 14px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.ptile .label h3 { font-size: 17px; }
.ptile .label span { font-size: 13.5px; color: var(--steel); display: block; margin-top: 2px; }
.ptile .label i {
  flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--paper); color: var(--ink);
  display: grid; place-items: center; font-style: normal; font-weight: 700; transition: background .15s, color .15s;
}
.ptile:hover .label i { background: var(--red); color: #fff; }
.a-san { grid-area: san; } .a-bath { grid-area: bath; } .a-elec { grid-area: elec; }
.a-tool { grid-area: tool; } .a-pnt { grid-area: pnt; } .a-oth { grid-area: oth; }

/* brand strip */
.brandstrip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.brandstrip > * {
  background: var(--tile); border-radius: var(--r-img); height: 110px;
  display: grid; place-items: center; padding: 22px;
}
.brandstrip img { max-height: 46px; width: auto; mix-blend-mode: multiply; filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s; }
.brandstrip a:hover img { filter: none; opacity: 1; }
.brandstrip .word { font-size: 24px; font-weight: 800; font-stretch: 125%; color: var(--ink); opacity: .75; }

/* contact */
.visit { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.visit .tile { padding: 40px; }
.visit dl { margin: 10px 0 26px; }
.visit dl div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.visit dl div:last-child { border-bottom: 0; }
.visit dt { font-size: 14px; color: var(--steel); }
.visit dd { color: var(--ink); font-weight: 600; font-size: 17px; }
.visit dd a { border-bottom: 1.5px solid var(--red); }
.map { border-radius: var(--r-tile); overflow: hidden; min-height: 420px; background: var(--tile); }
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; filter: grayscale(.35) contrast(1.05); }

/* ---------- Inner pages ---------- */
.page-banner { padding: 64px 0 40px; }
.page-banner .wrap { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; }
.page-banner p { margin-top: 16px; color: var(--steel); font-size: 18px; max-width: 54ch; }
.crumbs { font-size: 14px; color: var(--steel); margin-bottom: 18px; }
.crumbs a { color: var(--ink); border-bottom: 1px solid var(--line); }
.page-banner .seal {
  writing-mode: vertical-rl; text-orientation: upright; color: var(--red);
  font-family: "Noto Serif TC", serif; font-weight: 900; font-size: 46px; line-height: 1; letter-spacing: .05em;
}
section.after-banner { padding-top: 0; }

.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--tile); border-radius: var(--r-tile); padding: 12px;
  display: flex; flex-direction: column; scroll-margin-top: 100px;
}
.card .thumb { aspect-ratio: 4 / 3; border-radius: var(--r-img); overflow: hidden; background: var(--paper); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 20px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--steel); font-size: 15px; }
.card ul { list-style: none; margin: 16px 0 0; flex: 1; }
.card li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.card .more { margin-top: 18px; align-self: flex-start; font-weight: 700; color: var(--ink); border-bottom: 1.5px solid var(--red); font-size: 15px; }
.tag-soon { margin-top: 18px; align-self: flex-start; font-size: 13.5px; color: var(--steel); }

.cat-tile { background: var(--tile); border-radius: var(--r-tile); padding: 12px; display: flex; flex-direction: column; }
.cat-tile .cover { aspect-ratio: 3 / 4; border-radius: var(--r-img); overflow: hidden; background: var(--paper); }
.cat-tile .cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.cat-tile:hover .cover img { transform: scale(1.03); }
.cat-tile .meta { padding: 16px 10px 8px; }
.cat-tile .meta small { color: var(--red); font-weight: 700; font-size: 14px; }
.cat-tile .meta h3 { margin: 2px 0 6px; font-size: 18px; }
.cat-tile .meta span { font-size: 14px; color: var(--steel); }

.feature { background: var(--tile); border-radius: var(--r-tile); padding: 34px; }
.feature .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--paper); color: var(--red); display: grid; place-items: center; margin-bottom: 22px; }
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: 8px; }
.feature p, .feature li { color: var(--steel); }
.feature ol { margin: 12px 0 0 20px; }

.brand-tile {
  aspect-ratio: 4 / 3; background: var(--tile); border-radius: var(--r-tile);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 26px; text-align: center;
}
.brand-tile img { max-height: 58px; max-width: 80%; width: auto; mix-blend-mode: multiply; }
.brand-tile .word { font-size: 28px; font-weight: 800; font-stretch: 125%; color: var(--ink); }
.brand-tile small { font-size: 14px; color: var(--steel); }
a.brand-tile:hover { outline: 1.5px solid var(--ink); }

/* enquiry */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
form.enquiry { background: var(--tile); border-radius: var(--r-tile); padding: 40px; }
form.enquiry h2 { margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 7px; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid transparent; border-radius: var(--r-input);
  font: inherit; font-size: 16px; background: var(--paper); color: var(--ink-2); transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); background: #fff; }
textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 14px; color: var(--steel); margin-top: 14px; }
.form-note a { color: var(--ink); border-bottom: 1.5px solid var(--red); }
.info-card { background: var(--ink); color: #fff; border-radius: var(--r-tile); padding: 40px; }
.info-card h3 { color: #fff; margin-bottom: 10px; }
.info-row { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.info-row:last-child { border-bottom: 0; }
.info-row small { display: block; color: #a9addb; font-size: 14px; }
.info-row a { color: #fff; border-bottom: 1.5px solid var(--red); }
.map-section { padding: 0 0 96px; }

/* CTA */
.cta-band { padding: 0 0 96px; }
.cta-band .inner {
  background: var(--ink); color: #fff; border-radius: var(--r-tile);
  padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #b9bce0; margin-top: 10px; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); font-size: 15px; color: var(--steel); }
footer.site .wrap { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding: 56px 20px 40px; }
footer.site h4 { color: var(--ink); font-size: 15px; margin-bottom: 12px; }
footer.site ul { list-style: none; }
footer.site li { padding: 3px 0; }
footer.site a:hover { color: var(--ink); }
.foot-logo img { height: 44px; width: auto; mix-blend-mode: multiply; margin-bottom: 14px; }
.copyright { border-top: 1px solid var(--line); padding: 20px; text-align: center; font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .bento { grid-template-columns: repeat(6, 1fr); grid-template-rows: auto 240px 200px; }
  .hero-main { grid-column: 1 / 7; grid-row: 1; padding: 40px 130px 40px 36px; min-height: 420px; }
  .hero-a { grid-column: 1 / 7; grid-row: 2; }
  .hero-b { grid-column: 1 / 4; grid-row: 3; }
  .status { grid-column: 4 / 7; grid-row: 3; }
  .company, .visit, .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pbento { grid-template-columns: repeat(2, 1fr); grid-template-rows: 280px 220px 220px 220px;
    grid-template-areas: "san san" "bath elec" "bath tool" "pnt oth"; }
  footer.site .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .menu-btn { display: block; }
  nav.main {
    display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 16px 18px;
  }
  nav.main.open { display: block; }
  nav.main ul { flex-direction: column; align-items: stretch; }
  nav.main a { padding: 14px 6px; border-bottom: 1px solid var(--line); }
  nav.main a.active::after { left: auto; right: 8px; bottom: auto; top: 50%; margin-top: -3px; }
  nav.main a.cta { margin: 12px 0 0; text-align: center; border-bottom: 0; }
  header.site .wrap { height: 66px; }
  .brand img { height: 42px; }
  section { padding: 64px 0; }
  .hero-main { padding: 30px 92px 30px 24px; min-height: 400px; }
  .signboard { right: 18px; top: 24px; font-size: 52px; }
  .signboard small { display: none; }
  .bento { grid-template-rows: auto 220px 190px; gap: 10px; }
  .status { padding: 16px; }
  .status b { font-size: 18px; }
  .grid-3, .grid-2, .field-row { grid-template-columns: 1fr; }
  .pbento { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 230px; grid-template-areas: none; }
  .pbento .ptile { grid-area: auto; }
  .brandstrip { grid-template-columns: repeat(2, 1fr); }
  .visit .tile, form.enquiry, .info-card, .cta-band .inner { padding: 28px; }
  .page-banner .seal { font-size: 32px; }
  footer.site .wrap { grid-template-columns: 1fr; }
}
/* ---------- Chat widget ---------- */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 20px 8px 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #fff; font: 700 15px var(--wide);
  box-shadow: 0 10px 30px rgba(21, 26, 94, .28);
}
.chat-launcher:hover { background: #20267a; }
.chat-launcher-mark {
  width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; font-family: "Noto Serif TC", serif; font-weight: 900; font-size: 18px;
}
.chat-launcher.is-open { display: none; }
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 61;
  padding: 0; /* it's a <section>; cancel the page-wide section padding */
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 110px));
  background: var(--tile); border-radius: var(--r-tile); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(21, 26, 94, .25);
}
.chat-panel[hidden] { display: none; }
.chat-head { background: var(--ink); color: #fff; padding: 18px 18px 16px 22px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.chat-head b { display: block; font-size: 17px; font-stretch: 125%; }
.chat-head span { display: block; font-size: 13px; color: #b9bce0; margin-top: 2px; }
.chat-close { background: rgba(255,255,255,.12); color: #fff; border: 0; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; flex: 0 0 32px; }
.chat-close:hover { background: var(--red); }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-msg.bot { align-self: flex-start; background: var(--tile); color: var(--ink-2); border-bottom-left-radius: 4px; }
.chat-msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.typing { color: var(--steel); }
.chat-msg.typing::after { content: "…"; animation: chat-dots 1.2s steps(3) infinite; }
@keyframes chat-dots { 0% { opacity: .3; } 50% { opacity: 1; } 100% { opacity: .3; } }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; background: var(--paper); }
.chat-chips[hidden] { display: none; }
.chat-chips button {
  border: 1.5px solid var(--line); background: var(--tile); color: var(--ink); border-radius: 999px;
  padding: 7px 12px; font: 600 13.5px var(--wide); cursor: pointer; text-align: left;
}
.chat-chips button:hover { border-color: var(--ink); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--tile); }
.chat-form textarea { min-height: 0; height: 44px; resize: none; overflow: hidden; padding: 11px 14px; font-size: 15px; line-height: 1.4; }
.chat-send { border: 0; border-radius: 999px; padding: 0 18px; background: var(--red); color: #fff; font: 700 14.5px var(--wide); cursor: pointer; }
.chat-send:disabled { opacity: .5; cursor: wait; }
@media (max-width: 720px) {
  .chat-launcher { right: 14px; bottom: 14px; }
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
