/* ================= Cosmaprof — public site styles ================= */
/* Palette: cream #FBFAF7 · beige #F1ECE2 · navy #123E73 · dark #0E2D55 · accent #1E5FAE */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FBFAF7;
  color: #171B21;
  font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; }
.serif { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; }

.container { max-width: 1296px; margin: 0 auto; padding: 0 48px; }

/* ---- Top bar ---- */
.topbar { background: #123E73; color: #DCE7F5; font-size: 13px; }
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 11px; padding-bottom: 11px; gap: 14px; flex-wrap: wrap;
}
.topbar-info { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.topbar-info .sep { opacity: .4; }
.lang { display: flex; gap: 6px; align-items: center; }
.lang a {
  color: #DCE7F5; border: 1px solid rgba(255,255,255,.35);
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 100px;
}
.lang a.active { background: #fff; color: #123E73; border-color: #fff; font-weight: 700; }
#themeToggle { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #DCE7F5; width: 28px; height: 28px; border-radius: 100px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin-left: 2px; transition: background-color .2s ease; }
#themeToggle:hover { background: rgba(255,255,255,.18); }
#themeToggle svg { width: 14px; height: 14px; }
#themeToggle .icon-sun { display: none; }
html[data-theme="dark"] #themeToggle .icon-moon { display: none; }
html[data-theme="dark"] #themeToggle .icon-sun { display: block; }

/* ---- Nav ---- */
.nav { border-bottom: 1px solid #EBE6DB; background: #FBFAF7; position: sticky; top: 0; z-index: 50; }
.nav .container { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; gap: 20px; }
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-family: 'IBM Plex Sans', 'IBM Plex Sans Thai', sans-serif; font-weight: 700; font-size: 23px; letter-spacing: .14em; color: #123E73; }
.brand span { font-size: 10px; letter-spacing: .34em; color: #9A9488; margin-top: 5px; text-transform: uppercase; }
.nav-links { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.nav-links a { font-size: 15px; color: #3A3F47; font-weight: 500; padding-bottom: 4px; position: relative; }
.nav-links a.active { color: #123E73; font-weight: 600; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: #123E73; transition: width .25s ease; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.brand { transition: transform .2s ease; }
.brand:hover { transform: translateX(2px); }
.nav-cta { font-size: 14px; font-weight: 600; color: #123E73; border: 1.5px solid #123E73; padding: 10px 20px; border-radius: 100px; white-space: nowrap; }
.nav-toggle { display: none; }

/* ---- Buttons ---- */
.btn-primary { display: inline-block; background: #123E73; color: #fff; font-size: 15px; font-weight: 600; padding: 15px 28px; border-radius: 100px; border: none; cursor: pointer; }
.btn-ghost { display: inline-block; border: 1.5px solid #C9D4E2; color: #123E73; font-size: 15px; font-weight: 600; padding: 14px 26px; border-radius: 100px; background: none; cursor: pointer; }
.btn-link { display: inline-block; font-size: 15px; font-weight: 600; color: #141A22; padding-bottom: 3px; border-bottom: 2px solid #141A22; }
.btn-white { display: inline-block; background: #fff; color: #123E73; font-size: 15px; font-weight: 600; padding: 14px 26px; border-radius: 100px; }
.btn-outline-white { display: inline-block; border: 1.5px solid rgba(255,255,255,.5); color: #fff; font-size: 15px; font-weight: 600; padding: 14px 26px; border-radius: 100px; }

/* ---- Generic section bits ---- */
.kicker { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #1E5FAE; font-weight: 600; margin-bottom: 14px; }
.section { padding: 84px 0; }
.beige { background: #F1ECE2; }
.navy { background: #123E73; color: #EAF1FA; }

/* ---- Page hero (inner pages) ---- */
.page-hero { background: #F1ECE2; }
.page-hero .container { padding-top: 76px; padding-bottom: 76px; }
.page-hero.has-bg { position: relative; background-size: cover; background-position: center; display: flex; align-items: center; min-height: 340px; }
.page-hero.has-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(251,250,247,.96) 0%, rgba(251,250,247,.88) 34%, rgba(251,250,247,.5) 62%, rgba(251,250,247,0) 90%); }
.page-hero.has-bg .container { position: relative; z-index: 1; width: 100%; }
.page-hero h1 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 48px; line-height: 1.25; margin-bottom: 18px; color: #141A22; max-width: 820px; }
.page-hero p { font-size: 18px; line-height: 1.75; color: #5C636C; margin: 0; max-width: 680px; }

/* ---- Home hero ---- */
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; padding-top: 78px; padding-bottom: 70px; }
.hero h1 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 52px; line-height: 1.22; letter-spacing: -.01em; margin-bottom: 26px; color: #141A22; }
.hero .sub { font-size: 18px; line-height: 1.75; color: #5C636C; margin: 0 0 36px; max-width: 560px; }
.hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---- Placeholder / images ---- */
.ph { background: repeating-linear-gradient(45deg, #EEEAE1 0 13px, #F5F2EB 13px 26px); border: 1px solid #E7E2D8; display: flex; align-items: flex-end; padding: 20px; color: #A29B8D; font-family: 'IBM Plex Sans', monospace; font-size: 12px; overflow: hidden; }
.ph.cover { padding: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.hero-img { height: 480px; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #EBE6DB; border-bottom: 1px solid #EBE6DB; }
.stats > div { padding: 34px 8px; border-right: 1px solid #EBE6DB; }
.stats .v { font-family: 'IBM Plex Sans', 'IBM Plex Sans Thai', sans-serif; font-weight: 600; font-size: 38px; color: #123E73; line-height: 1; }
.stats .l { font-size: 14px; color: #6E7B86; margin-top: 10px; }

/* ---- Section headers ---- */
.sec-head { max-width: 660px; margin-bottom: 48px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head h2 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 36px; line-height: 1.3; margin-bottom: 12px; color: #141A22; }
.navy .sec-head h2 { color: #fff; }
.sec-head p { font-size: 16px; color: #6E7B86; margin: 0; }
.navy .sec-head p { color: #B9CDE8; }
.navy .kicker { color: #8FB4E2; }

/* ---- Card grids (services / values) ---- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #E7E2D8; border: 1px solid #E7E2D8; }
.grid3 .cell { background: #FBFAF7; padding: 34px 30px; min-height: 180px; }
.grid3 .n { font-family: 'IBM Plex Sans', monospace; font-size: 14px; color: #1E5FAE; font-weight: 600; letter-spacing: .1em; margin-bottom: 18px; }
.grid3 h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; color: #141A22; }
.grid3 p { font-size: 15px; line-height: 1.66; color: #6E7B86; margin: 0; }

/* ---- Standards ---- */
.std-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.std-card { background: #FBFAF7; border: 1px solid #E7E2D8; padding: 30px 26px; min-height: 210px; }
.std-card .bar { width: 34px; height: 3px; background: #1E5FAE; margin-bottom: 22px; }
.std-card .std-logo { height: 60px; margin-bottom: 18px; display: flex; align-items: center; }
.std-card .std-logo img { max-height: 60px; max-width: 130px; width: auto; object-fit: contain; }
.std-card .code { font-family: 'IBM Plex Sans', 'IBM Plex Sans Thai', sans-serif; font-weight: 700; font-size: 26px; color: #123E73; line-height: 1.05; }
.std-card .name { font-size: 13px; color: #9A9488; margin: 6px 0 16px; }
.std-card p { font-size: 14px; line-height: 1.6; color: #6E7B86; margin: 0; }

/* ---- Why us ---- */
.why { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; }
.why-list { display: grid; grid-template-columns: 1fr 1fr; gap: 38px 40px; }
.why-list .item { border-top: 1px solid #E7E2D8; padding-top: 20px; }
.why-list h3 { font-size: 18px; font-weight: 600; margin-bottom: 9px; color: #141A22; }
.why-list p { font-size: 15px; line-height: 1.62; color: #6E7B86; margin: 0; }

/* ---- Category chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips a { border: 1px solid rgba(255,255,255,.28); color: #DCE7F5; font-size: 15px; padding: 11px 20px; border-radius: 100px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; }
.filterbar a { background: #fff; color: #3A3F47; border: 1px solid #DDD7CC; font-size: 14px; font-weight: 500; padding: 9px 18px; border-radius: 100px; }
.filterbar a.active { background: #123E73; color: #fff; border-color: #123E73; font-weight: 600; }

/* ---- Product grid ---- */
.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.prod-card { background: #fff; border: 1px solid #EBE6DB; }
.prod-card .thumb { height: 220px; }
.prod-card .body { padding: 22px 22px 24px; }
.prod-card .cat { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #1E5FAE; font-weight: 600; margin-bottom: 10px; }
.prod-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: #141A22; line-height: 1.4; }
.prod-card .meta { font-size: 13px; color: #9A9488; margin: 0; }

/* ---- Articles ---- */
.feature { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; background: #fff; border: 1px solid #EBE6DB; }
.feature .thumb { height: 360px; }
.feature .body { padding: 20px 44px 20px 0; }
.badge { display: inline-block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #fff; background: #123E73; padding: 4px 11px; border-radius: 100px; }
.badge.accent { background: #1E5FAE; }
.feature h2 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 30px; line-height: 1.35; margin: 14px 0; color: #141A22; }
.feature p { font-size: 16px; line-height: 1.7; color: #6E7B86; margin: 0 0 20px; }
.art-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.art-card { background: #fff; border: 1px solid #EBE6DB; display: block; }
.art-card .thumb { height: 200px; }
.art-card .body { padding: 24px 24px 26px; }
.art-card .cat { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #1E5FAE; font-weight: 600; margin-bottom: 10px; }
.art-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; color: #141A22; line-height: 1.4; }
.art-card p { font-size: 14px; line-height: 1.6; color: #6E7B86; margin: 0 0 16px; }
.art-card .meta { font-size: 13px; color: #9A9488; }

/* ---- Article single ---- */
.article-body { max-width: 760px; margin: 0 auto; padding: 64px 48px 80px; }
.article-body h2 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-size: 26px; margin: 34px 0 14px; color: #141A22; }
.article-body p { font-size: 17px; line-height: 1.85; color: #3F4750; margin: 0 0 20px; }
.article-cover { height: 420px; margin-bottom: 40px; }

/* ---- Promotions ---- */
.promo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.promo-card { background: #fff; border: 1px solid #EBE6DB; display: flex; overflow: hidden; }
.promo-card .thumb { width: 180px; flex-shrink: 0; }
.promo-card .body { padding: 28px; flex: 1; }
.promo-card h3 { font-size: 20px; font-weight: 600; margin: 14px 0 9px; color: #141A22; line-height: 1.35; }
.promo-card p { font-size: 15px; line-height: 1.66; color: #6E7B86; margin: 0 0 16px; }
.note { background: #EAF1FA; border: 1px solid #C6D9F0; padding: 22px 28px; font-size: 15px; color: #3A4B63; line-height: 1.6; }

/* ---- FAQ accordion ---- */
.faq { max-width: 900px; margin: 0 auto; padding: 64px 48px 80px; }
.faq details { border-bottom: 1px solid #E7E2D8; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 0; font-size: 19px; font-weight: 600; color: #141A22; line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 26px; font-weight: 300; color: #123E73; line-height: 1; flex-shrink: 0; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { font-size: 16px; line-height: 1.8; color: #5C636C; margin: 0; padding: 0 0 28px; max-width: 760px; }

/* ---- CTA band ---- */
.cta-band { text-align: center; padding: 88px 0; }
.cta-band h2 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 40px; line-height: 1.3; margin-bottom: 14px; color: #141A22; }
.navy.cta-band h2 { color: #fff; }
.cta-band p { font-size: 18px; color: #6E7B86; margin: 0 auto 34px; max-width: 560px; }
.navy.cta-band p { color: #B9CDE8; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
.form-field { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: #3A3F47; margin-bottom: 8px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 13px 15px; border: 1px solid #DDD7CC; background: #fff;
  font-size: 15px; border-radius: 6px; font-family: inherit; color: #3A3F47;
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: #123E73; }
.info-card { background: #123E73; color: #EAF1FA; padding: 36px 34px; margin-bottom: 24px; }
.info-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 22px; color: #fff; }
.info-block { margin-bottom: 20px; }
.info-block .lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #8FB4E2; font-weight: 600; margin-bottom: 6px; }
.info-block a, .info-block p { font-size: 15px; color: #fff; margin: 0 0 3px; line-height: 1.7; }
.channels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.channels a { text-align: center; border: 1.5px solid #C9D4E2; color: #123E73; font-size: 14px; font-weight: 600; padding: 14px; border-radius: 8px; }
.map-ph { height: 200px; align-items: center; justify-content: center; }
.alert-success { background: #EAF1FA; border: 1px solid #C6D9F0; padding: 36px 32px; }
.alert-success .tick { width: 44px; height: 44px; border-radius: 100px; background: #123E73; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 18px; }
.alert-success h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: #141A22; }
.alert-success p { font-size: 15px; line-height: 1.7; color: #5C636C; margin: 0 0 20px; }
.field-error { color: #B4232A; font-size: 14px; margin: 0 0 16px; }

/* ---- Footer ---- */
.footer { background: #0E2D55; color: #A9BBD2; }
.footer .container { padding-top: 60px; padding-bottom: 30px; }
.footer-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer .fbrand { font-family: 'IBM Plex Sans', 'IBM Plex Sans Thai', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .14em; color: #fff; margin-bottom: 16px; }
.footer .ftag { font-size: 14px; line-height: 1.7; margin: 0 0 18px; max-width: 320px; }
.footer .fsocial { display: flex; gap: 16px; font-size: 13px; }
.footer .fsocial a { color: #8FB4E2; }
.footer h4 { color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.footer .fcol a { display: block; font-size: 14px; margin-bottom: 11px; color: #A9BBD2; }
.footer address { font-style: normal; font-size: 14px; line-height: 1.75; color: #A9BBD2; }
.footer .copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 22px; font-size: 13px; color: #7D92B0; }

/* ---- Hero carousel ---- */
.hero-carousel { position: relative; overflow: hidden; }
.hero-track { display: flex; transition: transform .6s ease; }
.hero-slide { position: relative; min-width: 100%; display: flex; align-items: center; min-height: 540px; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-bg-ph { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, #EEEAE1 0 13px, #F5F2EB 13px 26px); }
.hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(251,250,247,.96) 0%, rgba(251,250,247,.88) 32%, rgba(251,250,247,.5) 58%, rgba(251,250,247,0) 86%); }
.hero-content { position: relative; z-index: 2; width: 100%; }
.hero-text { max-width: 560px; padding: 72px 0; }
.hero-slide h1 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 48px; line-height: 1.22; letter-spacing: -.01em; margin-bottom: 24px; color: #141A22; }
.hero-slide .sub { font-size: 18px; line-height: 1.75; color: #41474F; margin: 0 0 32px; max-width: 520px; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 100px; border: 1px solid #D9D3C7; background: rgba(251,250,247,.9); color: #123E73; font-size: 26px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }
.hero-arrow:hover { background: #123E73; color: #fff; border-color: #123E73; }
.hero-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 9px; z-index: 5; }
.hero-dots button { width: 9px; height: 9px; border-radius: 100px; border: none; background: #C9C2B4; cursor: pointer; padding: 0; transition: width .25s, background .25s; }
.hero-dots button.active { background: #123E73; width: 26px; }

/* ---- Hover interactions ---- */
.btn-primary, .btn-ghost, .btn-white, .btn-outline-white, .nav-cta, .btn-link,
.nav-links a, .footer .fcol a, .footer .fsocial a, .chips a, .filterbar a,
.channels a, .lang a, .art-card, .prod-card, .promo-card {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover { background: #0E2D55; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18,62,115,.28); }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.16); color: #0E2D55; }
.btn-ghost:hover { background: #123E73; color: #fff; border-color: #123E73; transform: translateY(-2px); }
.btn-outline-white:hover { background: #fff; color: #123E73; border-color: #fff; transform: translateY(-2px); }
.nav-cta:hover { background: #123E73; color: #fff; transform: translateY(-1px); }
.btn-link:hover { color: #1E5FAE; border-color: #1E5FAE; transform: translateX(3px); }
.nav-links a:hover { color: #123E73; transform: none; }
.footer .fcol a:hover { color: #fff; transform: translateX(3px); }
.footer .fsocial a:hover { color: #fff; }
.chips a:hover { background: #fff; color: #123E73; border-color: #fff; transform: translateY(-2px); }
.filterbar a:hover { border-color: #123E73; color: #123E73; transform: translateY(-1px); }
.channels a:hover { background: #123E73; color: #fff; border-color: #123E73; transform: translateY(-2px); }
.prod-card:hover, .art-card:hover, .promo-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(20,26,34,.1); }

/* ---- Certificate lightbox ---- */
.std-card { transition: transform .2s ease, box-shadow .2s ease; }
.std-card.has-cert { cursor: pointer; }
.std-card.has-cert:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20,26,34,.1); }
.std-card .cert-link { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 600; color: #123E73; }
.std-card.has-cert:hover .cert-link { color: #1E5FAE; }
.cert-lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(14,26,45,.82); padding: 40px; }
.cert-lightbox.open { display: flex; }
.cert-lightbox .cert-box { position: relative; max-width: 860px; max-height: 92vh; background: #fff; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.cert-lightbox .cert-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #EEF2F6; }
.cert-lightbox .cert-head b { font-size: 16px; color: #123E73; letter-spacing: .02em; }
.cert-lightbox .cert-close { background: none; border: none; font-size: 28px; line-height: 1; color: #64748B; cursor: pointer; padding: 0 4px; }
.cert-lightbox .cert-close:hover { color: #123E73; }
.cert-lightbox .cert-box img { max-width: 100%; max-height: calc(92vh - 58px); width: auto; object-fit: contain; display: block; margin: 0 auto; background: #F4F6F9; }

/* ---- Product card clamp + popup ---- */
.prod-card { cursor: pointer; }
.prod-card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-card .meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-card .prod-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: #123E73; }
.prod-card:hover .prod-more { color: #1E5FAE; }
.prod-lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(14,26,45,.82); padding: 40px; }
.prod-lightbox.open { display: flex; }
.prod-box { position: relative; background: #fff; border-radius: 12px; overflow: hidden; max-width: 820px; width: 100%; max-height: 90vh; display: grid; grid-template-columns: 1fr 1fr; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.prod-box-img { background: #F4F6F9; }
.prod-box-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-box-img.noimg { background: repeating-linear-gradient(45deg, #EEEAE1 0 13px, #F5F2EB 13px 26px); min-height: 280px; }
.prod-box-body { padding: 40px 36px; overflow-y: auto; }
.prod-box-body .cat { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #1E5FAE; font-weight: 600; margin-bottom: 12px; }
.prod-box-body h3 { font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif; font-size: 26px; font-weight: 600; color: #141A22; margin-bottom: 16px; line-height: 1.3; }
.prod-box-body .pb-desc { font-size: 15px; line-height: 1.75; color: #5C636C; margin: 0 0 16px; }
.prod-box-body .pb-moq { font-size: 14px; color: #9A9488; margin: 0 0 24px; }
.prod-close { position: absolute; top: 12px; right: 14px; z-index: 2; background: rgba(255,255,255,.92); border: none; width: 36px; height: 36px; border-radius: 100px; font-size: 24px; line-height: 1; color: #64748B; cursor: pointer; }
.prod-close:hover { color: #123E73; }

/* ---- Story carousel (About) ---- */
.story-carousel { position: relative; overflow: hidden; }
.story-track { display: flex; transition: transform .6s ease; }
.story-slide { min-width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.story-dots { display: flex; gap: 9px; justify-content: center; margin-top: 34px; }
.story-dots button { width: 9px; height: 9px; border-radius: 100px; border: none; background: #C9C2B4; cursor: pointer; padding: 0; transition: width .25s, background .25s; }
.story-dots button.active { background: #123E73; width: 26px; }

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .container { padding: 0 28px; }
  .hero-img { height: 320px; }
  .hero-arrow { display: none; }
  .hero-slide { min-height: 440px; }
  .hero-slide h1 { font-size: 36px; }
  .why { grid-template-columns: 1fr; gap: 32px; }
  .story-slide { grid-template-columns: 1fr; gap: 32px; }
  .std-grid { grid-template-columns: repeat(2, 1fr); }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .art-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature .body { padding: 24px 28px 32px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
  .nav .container { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; background: none; border: 1.5px solid #123E73; color: #123E73; border-radius: 8px; padding: 8px 12px; font-size: 20px; cursor: pointer; line-height: 1; }
  .nav-cta { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid3, .std-grid, .prod-grid, .art-grid, .promo-grid, .form-row, .why-list, .footer-cols { grid-template-columns: 1fr; }
  .promo-card { flex-direction: column; }
  .promo-card .thumb { width: 100%; height: 160px; }
  .prod-box { grid-template-columns: 1fr; max-height: 88vh; }
  .prod-box-img img { max-height: 220px; }
  .prod-box-img.noimg { min-height: 160px; }
  .page-hero h1 { font-size: 34px; }
  .page-hero.has-bg { min-height: 260px; }
  .page-hero.has-bg::before { background: linear-gradient(90deg, rgba(251,250,247,.97) 0%, rgba(251,250,247,.92) 55%, rgba(251,250,247,.62) 100%); }
  .hero-slide { min-height: 400px; }
  .hero-slide h1 { font-size: 30px; }
  .hero-text { padding: 48px 0; }
  .hero-overlay { background: linear-gradient(90deg, rgba(251,250,247,.97) 0%, rgba(251,250,247,.92) 55%, rgba(251,250,247,.6) 100%); }
  .section { padding: 56px 0; }
  .cta-band h2, .sec-head h2 { font-size: 28px; }
}

/* ==================== Dark mode ==================== */
html[data-theme="dark"] body { background: #10151F; color: #D7DEE8; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 { color: #F1F1EE !important; }
html[data-theme="dark"] p { color: #ABB6C4 !important; }
html[data-theme="dark"] .nav { background: #10151F; border-bottom-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .brand b { color: #8FB4E2; }
html[data-theme="dark"] .brand span { color: #6C7688; }
html[data-theme="dark"] .nav-links a { color: #C7D4E6; }
html[data-theme="dark"] .nav-links a.active { color: #8FB4E2; }
html[data-theme="dark"] .nav-links a::after { background: #8FB4E2; }
html[data-theme="dark"] .nav-cta { color: #8FB4E2; border-color: #3A4658; }
html[data-theme="dark"] .nav-cta:hover { background: #2E6FD6; border-color: #2E6FD6; color: #fff; }
html[data-theme="dark"] .nav-toggle { color: #C7D4E6; border-color: #3A4658; }
html[data-theme="dark"] .beige { background: #161C29; }
html[data-theme="dark"] .page-hero:not(.has-bg) { background: #161C29; }
html[data-theme="dark"] .page-hero.has-bg::before { background: linear-gradient(90deg, rgba(16,21,31,.96) 0%, rgba(16,21,31,.88) 34%, rgba(16,21,31,.5) 62%, rgba(16,21,31,0) 90%); }
html[data-theme="dark"] .hero-overlay { background: linear-gradient(90deg, rgba(16,21,31,.96) 0%, rgba(16,21,31,.88) 32%, rgba(16,21,31,.5) 58%, rgba(16,21,31,0) 86%); }
html[data-theme="dark"] .ph { background: repeating-linear-gradient(45deg, #1B2331 0 13px, #202939 13px 26px); border-color: #2A3344; color: #6C7688; }
html[data-theme="dark"] .grid3, html[data-theme="dark"] .art-grid, html[data-theme="dark"] .prod-grid { background: #2A3344; border-color: #2A3344; }
html[data-theme="dark"] .grid3 .cell, html[data-theme="dark"] .prod-card, html[data-theme="dark"] .art-card, html[data-theme="dark"] .promo-card, html[data-theme="dark"] .feature, html[data-theme="dark"] .std-card { background: #1A2130; border-color: #2A3344; }
html[data-theme="dark"] .std-card .name { color: #6C7688; }
html[data-theme="dark"] .prod-card .cat, html[data-theme="dark"] .art-card .cat { color: #6FA3E8; }
html[data-theme="dark"] .prod-card .meta, html[data-theme="dark"] .art-card .meta { color: #7A869A; }
html[data-theme="dark"] .note { background: #16233A; border-color: #24405E; color: #B9CDE8; }
html[data-theme="dark"] .filterbar a, html[data-theme="dark"] .channels a { background: #1A2130; border-color: #2A3344; color: #C7D4E6; }
html[data-theme="dark"] .filterbar a.active { background: #2E6FD6; border-color: #2E6FD6; color: #fff; }
html[data-theme="dark"] .form-field input, html[data-theme="dark"] .form-field select, html[data-theme="dark"] .form-field textarea { background: #1A2130; border-color: #2A3344; color: #D7DEE8; }
html[data-theme="dark"] .form-field label { color: #C7D4E6; }
html[data-theme="dark"] .btn-ghost { color: #8FB4E2; border-color: #3A4658; }
html[data-theme="dark"] .btn-link { color: #E7E4DC; border-color: #E7E4DC; }
html[data-theme="dark"] .stats, html[data-theme="dark"] .stats > div { border-color: #2A3344; }
html[data-theme="dark"] .stats .l { color: #7A869A; }
html[data-theme="dark"] .alert-success { background: #16233A; border-color: #24405E; }
html[data-theme="dark"] .alert-success p { color: #B9CDE8 !important; }
html[data-theme="dark"] .prod-box, html[data-theme="dark"] .cert-lightbox .cert-box { background: #1A2130; }
html[data-theme="dark"] .prod-box-img, html[data-theme="dark"] .prod-box-img.noimg { background: #202939; }
html[data-theme="dark"] .prod-close, html[data-theme="dark"] .cert-close { background: rgba(26,33,48,.92); color: #C7D4E6; }
html[data-theme="dark"] .pb-moq, html[data-theme="dark"] .pb-desc { color: #ABB6C4 !important; }
html[data-theme="dark"] .job-card { background: #1A2130 !important; border-color: #2A3344 !important; }
html[data-theme="dark"] .job-card h3 { color: #F1F1EE; }
html[data-theme="dark"] .job-card > div > div { color: #7A869A !important; }
