/* TST Website - Main Styles */
:root {
  --tst-blue: #003087;
  --tst-red: #c8102e;
  --tst-gray: #6c757d;
  --body-font: 'Noto Sans Thai', 'Noto Sans JP', sans-serif;
}

body {
  font-family: var(--body-font);
}

.navbar-brand img {
  max-height: 50px;
}

.btn-primary {
  background-color: var(--tst-blue);
  border-color: var(--tst-blue);
}

.btn-primary:hover {
  background-color: #002060;
  border-color: #002060;
}

/* Product group heading (all-products view) */
.prod-group-heading {
  font-weight: 700;
  color: var(--tst-blue);
  border-left: 4px solid var(--tst-red);
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

/* Inquiry modal — product banner */
.inq-product-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f0f4ff;
  border: 1px solid #c5d3f0;
  border-left: 4px solid var(--tst-blue);
  border-radius: 6px;
  padding: 0.65rem 1rem;
}
.inq-product-label {
  font-size: 0.78rem;
  color: #666;
  white-space: nowrap;
}
.inq-product-title {
  color: var(--tst-blue);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Product Inquiry Button */
.btn-inquiry {
  background-color: var(--tst-red);
  border-color: var(--tst-red);
  color: #fff;
}
.btn-inquiry:hover {
  background-color: #a00d25;
  border-color: #a00d25;
  color: #fff;
}

/* Banner company name overlay */
.banner-overlay {
  position: absolute;
  left: 5%;
  bottom: 18%;
  z-index: 10;
  text-align: left;
  pointer-events: none;
}
.banner-overlay .btn-banner-more {
  pointer-events: auto;
}
.banner-company-name {
  color: #7fd0fb;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
  margin-bottom: 1.2rem;
  line-height: 1.3;
  max-width: 520px;
}
.btn-banner-more {
  display: inline-block;
  background: #1565c0;
  color: #fff;
  border: none;
  padding: 0.55rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.btn-banner-more:hover {
  background: #0d47a1;
  color: #fff;
}
@media (max-width: 768px) {
  .banner-overlay { left: 4%; bottom: 10%; }
  .banner-company-name { font-size: 1.1rem; margin-bottom: 0.7rem; }
  .btn-banner-more { font-size: 0.82rem; padding: 0.35rem 1.1rem; }
}

/* Slideshow — natural aspect ratio, no cropping */
#mainSlideshow .carousel-inner {
  overflow: hidden;
  max-height: 600px;
}
#mainSlideshow .carousel-item img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 600px;
  object-fit: cover;
  object-position: center top;
}
@media (max-width: 768px) {
  #mainSlideshow .carousel-inner {
    max-height: 280px;
  }
  #mainSlideshow .carousel-item img {
    max-height: 280px;
  }
}

/* Product category — circle + spinning border */
.cat-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0.5rem;
  transition: transform 0.25s ease;
}
.cat-circle-wrap:hover {
  transform: translateY(-4px);
  color: var(--tst-blue);
}
.cat-spin-border {
  width: 229px;
  height: 229px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    #003087 0%, #7fd0fb 25%, #e8f6ff 50%, #7fd0fb 75%, #003087 100%
  );
  animation: catSpin 3.5s linear infinite;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 3-color alternating: blue(sec1) / green(sec2) / orange(sec3) */
.cat-sec2 .cat-spin-border {
  background: conic-gradient(from 0deg,
    #1a6b2c 0%, #38b74c 25%, #d4f4dc 50%, #38b74c 75%, #1a6b2c 100%
  );
}
.cat-sec3 .cat-spin-border {
  background: conic-gradient(from 0deg,
    #c45c00 0%, #f8941c 25%, #fff0d8 50%, #f8941c 75%, #c45c00 100%
  );
}
.cat-spin-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  animation: catSpinRev 3.5s linear infinite;
}
.cat-spin-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
}
.cat-no-img .cat-spin-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4ff;
}
/* hover: color per sec class */
.cat-sec1:hover { color: #0070c0; }
.cat-sec2:hover { color: #38b74c; }
.cat-sec3:hover { color: #f8941c; }
/* no-img inner bg per sec */
.cat-sec2.cat-no-img .cat-spin-inner { background: #e8f8ec; }
.cat-sec3.cat-no-img .cat-spin-inner { background: #fff4e0; }
/* section title + category name colors (matches old site) */
.pageTopic { color: #7fd0fb; }
.sec1 { color: #7fd0fb; }
.sec2 { color: #38b74c; }
.sec3 { color: #f8941c; }
.cat-name {
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}
@keyframes catSpin {
  to { transform: rotate(360deg); }
}
@keyframes catSpinRev {
  to { transform: rotate(-360deg); }
}
@media (max-width: 576px) {
  .cat-spin-border { width: 140px; height: 140px; padding: 8px; }
}

/* Card hover */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}

/* Recruitment form */
.pdpa-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
}

/* Two-row header */
.header-top {
  background: #fff;
  border-bottom: 1px solid #d5d6d5;
  padding: 14px 0;
}
.header-brand {
  color: var(--tst-blue) !important;
}
.header-logo {
  height: 60px;
  width: auto;
}
.company-name-th {
  font-size: 0.8rem;
  color: #555;
  font-weight: 400;
}
.company-name-en {
  font-size: 1.2rem;
  color: var(--tst-blue);
  font-weight: 700;
  line-height: 1.2;
}
.header-group-logo {
  height: 50px;
  width: auto;
  opacity: 0.9;
}
.header-group-wrap {
  display: flex;
  align-items: center;
}
.group-logo-text {
  display: none;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #003087;
  letter-spacing: 0.12em;
  white-space: nowrap;
  border: 2px solid #003087;
  padding: 5px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1.2;
}

/* Navigation bar row */
.header-nav {
  background-color: var(--tst-blue);
  padding: 0;
}
.header-nav .navbar-nav .nav-link {
  color: rgba(255,255,255,0.88) !important;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  transition: background 0.2s, color 0.2s;
}
.header-nav .navbar-nav .nav-link::after {
  display: none;
}
.header-nav .navbar-nav .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
}
.header-nav .navbar-nav .nav-link.active {
  color: #7fd0fb !important;
  background: rgba(127,208,251,0.18);
  font-weight: 600;
}

/* Language flag switcher — circular */
.lang-switcher {
  margin-left: 0.5rem;
}
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0.75;
  transition: opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.lang-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lang-btn:hover,
.lang-btn.active {
  opacity: 1;
  box-shadow: 0 0 0 2px #7fd0fb;
  border-color: #7fd0fb;
}
/* CSS-only Japan flag (circular) */
.flag-jp {
  display: block;
  width: 34px;
  height: 34px;
  background: #fff;
  position: relative;
  border-radius: 50%;
}
.flag-jp::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #bc002d;
}
/* CSS-only China flag (circular) */
.flag-ch {
  display: block;
  width: 34px;
  height: 34px;
  background: #de2910;
  position: relative;
  border-radius: 50%;
}
.flag-ch::before {
  content: '★';
  position: absolute;
  top: 50%; left: 7px;
  transform: translateY(-50%);
  color: #ffde00;
  font-size: 13px;
  line-height: 1;
}

/* Section headings */
.section-title {
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--tst-blue);
  border-radius: 2px;
}
.section-title.text-center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* Product cards */
.product-card-img {
  height: 200px;
  object-fit: cover;
  object-position: center;
}

/* News cards */
.news-cover-img {
  height: 180px;
  object-fit: cover;
}

/* Breadcrumb */
.breadcrumb-area {
  background: #f5f6fa;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

/* Page topic bar (matches PHP .row_2 style) */
.page-topic-bar {
  background: #f5f6fa;
  border-bottom: 1px solid #e9ecef;
  padding: 1.5rem 0 1rem;
  margin-bottom: 0;
}
.page-topic-bar .pageTopic {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

/* Contact page sections */
.contact-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.contact-section:last-child { border-bottom: none; }
.contact-box { padding: 1rem 0; }
.contact-plant-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tst-blue);
}
.contact-box a { color: var(--tst-blue); text-decoration: none; }
.contact-box a:hover { text-decoration: underline; }

/* About page sections */
.about-section {
  padding: 3rem 0 2rem;
  background: #fff;
}
.about-content p { line-height: 1.9; color: #444; }
.history-section { padding: 2rem 0 3rem; background: #f9fafb; }
.history-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
  height: 100%;
}
.history-card.active { border-color: var(--tst-blue); }
.history-year {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--tst-blue);
  margin-bottom: 0.5rem;
}
.history-body p { font-size: 0.9rem; color: #555; margin: 0; }

/* Footer */
.footer {
  background: #1a1a2e;
  color: #c0c6cf;
}
.footer h6 {
  color: #e0e3e8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.footer-links { padding: 0; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a { color: #9ca5b0; text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-label { color: #9ca5b0; font-size: 0.85rem; margin-bottom: 0.25rem; font-weight: 500; }
.footer-addr { color: #9ca5b0; font-size: 0.85rem; line-height: 1.7; }
.footer-contact-info { font-size: 0.85rem; color: #9ca5b0; }
.footer-divider { border-color: rgba(255,255,255,0.1); margin-top: 2rem; }
.footer-copy { text-align: center; color: #6c7a8a; font-size: 0.82rem; margin: 0; }
.footer-logo {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Product grid (matches PHP box1col1-4 pattern) */
.product-grid-section { background: #f9fafb; }
.product-card-item {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}
.product-card-link { text-decoration: none; color: inherit; }
.product-img-wrap {
  width: 100%;
  padding-top: 75%;
  position: relative;
  overflow: hidden;
}
.product-img-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-card-item:hover .product-img-wrap img { transform: scale(1.05); }
.no-img-placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #f0f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
}
.product-card-title {
  padding: 0.7rem 0.75rem 0.25rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: #222;
  margin: 0;
  flex: 1;
}
.product-card-desc {
  padding: 0 0.75rem 0.5rem;
  font-size: 0.82rem;
  color: #666;
  margin: 0;
}
.product-card-btns {
  padding: 0.5rem 0.75rem 0.75rem;
}
/* 4-color border accent per PHP box1col1-4 */
.prod-col1 { border-top: 3px solid #003087; }
.prod-col2 { border-top: 3px solid #7fd0fb; }
.prod-col3 { border-top: 3px solid #c8102e; }
.prod-col4 { border-top: 3px solid #38b74c; }

/* Selected category ring */
.cat-circle-wrap.cat-selected .cat-spin-border {
  outline: 4px solid #003087;
  outline-offset: 3px;
}
.fontUpper { text-transform: uppercase; }

/* Product circles — slightly smaller than category circles */
.prod-circle-wrap { display: flex; flex-direction: column; align-items: center; }
.prod-circle-wrap .cat-spin-border {
  width: 180px;
  height: 180px;
  padding: 10px;
}
.prod-name {
  font-size: 0.88rem;
  max-width: 180px;
}
@media (max-width: 576px) {
  .prod-circle-wrap .cat-spin-border { width: 130px; height: 130px; padding: 7px; }
  .prod-name { max-width: 130px; font-size: 0.78rem; }
}

/* BoxNews list style (matches PHP .boxNews) */
.box-news {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.box-news--detail { display: block; }
.news-thumb-wrap {
  width: 120px;
  min-width: 120px;
  flex-shrink: 0;
}
.news-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.news-text { flex: 1; min-width: 0; }
.news-topic {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tst-blue);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.news-desc { color: #555; font-size: 0.9rem; margin-bottom: 0.35rem; }
.news-date { color: #888; font-size: 0.8rem; display: block; margin-bottom: 0.6rem; }
.btn-tst-more {
  display: inline-block;
  background: var(--tst-blue);
  color: #fff;
  border: none;
  padding: 0.3rem 1.2rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-tst-more:hover { background: #002060; color: #fff; }

/* Content sections */
.content-section { padding: 2rem 0 3rem; }

/* Responsive */
@media (max-width: 768px) {
  .carousel-item img {
    height: 250px;
  }
  .product-card-img {
    height: 160px;
  }
}
