/* ============================================================
   โตโยต้าเมืองเลย — static landing (converted from WordPress)
   Design tokens mirrored from original theme (Plant) + customizer
   ============================================================ */
:root {
  --s-accent: #ea2527;
  --s-accent-hover: rgba(234, 37, 39, 0.64);
  --s-bg: #fff;
  --s-text: #222;
  --s-footer-bg: #441a24;
  --s-footer-text: rgba(255, 255, 255, 0.7);
  --s-header-height: 70px;
  --s-border-radius: 5px;
  --s-container: 1170px;
  --s-heading: "Anuphan", sans-serif;
  --s-body: "Sarabun", sans-serif;
  --s-slide-font: "Maledpan", sans-serif;
  --s-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

/* Maledpan (used inside sliders on the original site) served locally */
@font-face {
  font-family: "Maledpan";
  src: url("../assets/fonts/maledpan.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maledpan";
  src: url("../assets/fonts/maledpan-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--s-body);
  font-size: 16px;
  line-height: 1.625;
  color: var(--s-text);
  background: #fff;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
h1, h2, h3 {
  font-family: var(--s-heading);
  font-weight: 400;
  line-height: 1.3;
}
.s-container { max-width: var(--s-container); margin: 0 auto; padding: 0 16px; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  min-height: var(--s-header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--s-text);
}
.site-branding img { max-height: 42px; height: 42px; width: auto; }
.site-title { font-family: var(--s-heading); font-size: 1.3rem; color: var(--s-text); }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
  color: var(--s-text);
  text-decoration: none;
  font-family: var(--s-heading);
  font-size: 0.95rem;
  position: relative;
  padding: 6px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--s-accent);
  transition: right 0.25s ease;
}
.main-nav a:hover { color: var(--s-accent); }
.main-nav a:hover::after { right: 0; }

/* ===== Video hero ===== */
.video-hero { position: relative; overflow: hidden; background: #000; }
.video-hero video {
  display: block;
  width: 100%;
  height: min(86vh, 760px);
  min-height: 420px;
  object-fit: cover;
}
.video-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.22) 45%, rgba(255, 255, 255, 0.38) 100%);
  pointer-events: none;
}
.video-hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px 56px;
}
.video-hero-logo {
  width: 250px;
  max-width: 60%;
  margin-bottom: 26px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
}
.video-hero-text {
  margin: 0;
  max-width: 880px;
  font-family: var(--s-slide-font);
  color: #000;
  font-size: 1.3rem;
  line-height: 1.55;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8);
}
.video-play {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--s-slide-font);
  font-size: 1.05rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 60px;
  padding: 8px 22px 8px 9px;
  transition: background 0.3s, transform 0.3s;
}
.video-play:hover { background: var(--s-accent); transform: translateY(-2px); }
.play-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.play-badge svg { margin-left: 2px; }

/* ===== Image hero ===== */
.img-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(42, 42, 42, 0.82), rgba(0, 0, 0, 0.02)),
    url("../assets/images/hero-bg.jpg") center / cover no-repeat;
}
.img-hero-inside {
  max-width: 1190px;
  margin: 0 auto;
  padding: 72px 40px 130px;
  position: relative;
  z-index: 1;
}
.img-hero h1 {
  color: #fff;
  font-size: 60px;
  margin: 0 0 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.img-hero-sub {
  color: #fff;
  font-family: var(--s-heading);
  font-size: 30px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ===== Services ===== */
.services { padding-bottom: 46px; }
.sec-title {
  text-align: center;
  margin: 64px 0 8px;
  font-size: 2.1rem;
  position: relative;
  padding-bottom: 16px;
}
.sec-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: var(--s-accent);
}
.sec-subtitle { text-align: center; font-size: 18px; margin: 14px 0 5px; font-weight: 400; color: #555; }

.service-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 22px 16px 8px;
}
.service-tab {
  font-family: var(--s-slide-font);
  font-size: 0.95rem;
  color: var(--s-accent);
  background: #fff;
  border: 1.5px solid var(--s-accent);
  border-radius: 30px;
  padding: 7px 24px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.service-tab:hover { background: var(--s-accent-hover); color: #fff; }
.service-tab.active {
  background: var(--s-accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(234, 37, 39, 0.35);
}

.service-carousel {
  position: relative;
  max-width: 1027px;
  margin: 16px auto 0;
}
.car-viewport { overflow: hidden; }
.car-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}
.service-slide {
  flex: 0 0 100%;
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  overflow: hidden;
}
.service-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 44px 22px;
  background: linear-gradient(transparent, rgba(180, 24, 26, 0.55) 30%, rgba(160, 18, 20, 0.92));
  color: #fff;
  font-family: var(--s-slide-font);
  font-size: 1.5rem;
  line-height: 1.2;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  border: none;
  background: none;
  cursor: pointer;
  padding: 10px;
  line-height: 0;
  border-radius: 50%;
  transition: background 0.25s, transform 0.25s;
}
.car-arrow:hover { background: rgba(255, 255, 255, 0.75); }
.car-arrow.prev { left: 14px; }
.car-arrow.next { right: 14px; }
.car-arrow svg { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35)); }
.car-arrow:active { transform: translateY(-50%) scale(0.92); }

/* ===== Branches ===== */
.branches { padding-bottom: 56px; }
.branch-map { max-width: 1400px; margin: 28px auto 0; padding: 0 8px; }
.branch-map img {
  width: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--s-footer-bg);
  color: var(--s-footer-text);
  font-size: 0.9rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 0;
  padding: 52px 0 36px;
  margin: 0 -14px;
}
.footer-col { flex: 1 1 280px; padding: 0 14px; }
.site-footer h2 { color: #fff; font-size: 1.15em; margin: 0 0 10px; }
.site-footer p { margin: 0; line-height: 1.8; }
.site-footer a { color: var(--s-footer-text); text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, 0.35); }
.site-footer a:hover { color: #99ccff; border-bottom-color: #99ccff; }
.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #bbc0c4;
  text-align: center;
  padding: 16px 0;
  font-size: 0.8rem;
}

/* ===== Floating chat ===== */
#s-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  color: #fff;
  background-color: var(--s-accent);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(234, 37, 39, 0.45);
  transition: transform 0.3s;
}
#s-chat:hover { transform: scale(1.06); }
#s-chat .ic-x { display: none; position: absolute; }
#s-chat.active .ic-chat { display: none; }
#s-chat.active .ic-x { display: block; }
#s-chat .c-desc {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #fff;
  color: #222;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}
#s-chat:hover .c-desc, #s-chat.active .c-desc { opacity: 1; visibility: visible; }
#s-chat .c-desc::after {
  content: "";
  position: absolute;
  left: 100%;
  top: calc(50% - 5px);
  border-style: solid;
  border-width: 5px 0 5px 5px;
  border-color: transparent transparent transparent #fff;
}
#s-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9999;
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.3s ease;
}
#s-chat-panel.active { opacity: 1; visibility: visible; transform: none; }
#s-chat-panel li { margin-top: 12px; }
.chat-item { display: block; line-height: 0; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.chat-item:hover { transform: scale(1.08); }
.chat-item svg { border-radius: 50%; }

/* ===== Responsive ===== */
@media (min-width: 992px) {
  :root { --s-header-height: 70px; }
}
@media (max-width: 991px) {
  :root { --s-header-height: 54px; }
  .site-branding img { max-height: 32px; height: 32px; }
  .site-title { display: none; }
  .main-nav { gap: 16px; }
  .main-nav a { font-size: 0.85rem; }
  .header-inner { padding: 0 16px; }
}
@media (max-width: 767px) {
  .img-hero-inside { padding: 40px 20px 72px; text-align: center; }
  .img-hero h1 { font-size: 26px; margin-bottom: 4px; }
  .img-hero-sub { font-size: 15px; }
  .video-hero video { height: 60vh; min-height: 340px; }
  .video-hero-content { padding: 24px 16px 48px; }
  .video-hero-logo { width: 160px; margin-bottom: 18px; }
  .video-hero-text { font-size: 0.95rem; line-height: 1.5; }
  .video-play { margin-top: 22px; font-size: 0.9rem; }
  .play-badge { width: 32px; height: 32px; }
  .sec-title { font-size: 1.55rem; margin-top: 44px; padding-bottom: 12px; }
  .sec-subtitle { font-size: 0.95rem; margin-top: 10px; }
  .service-tabs { gap: 8px; padding: 16px 12px 6px; }
  .service-tab { font-size: 0.85rem; padding: 6px 16px; }
  .service-slide { aspect-ratio: 16 / 10; border-radius: 0; }
  .service-slide-caption { font-size: 1.1rem; padding: 24px 18px 14px; }
  .car-arrow { padding: 6px; }
  .car-arrow.prev { left: 4px; }
  .car-arrow.next { right: 4px; }
  .car-arrow svg { width: 36px; height: 36px; }
  .branch-map { padding: 0 12px; margin-top: 18px; }
  .branches { padding-bottom: 40px; }
  .footer-row { flex-direction: column; gap: 22px; padding: 36px 0 26px; }
  .footer-col { flex: 1 1 auto; width: 100%; }
  #s-chat { width: 52px; height: 52px; bottom: 16px; right: 16px; }
  #s-chat-panel { bottom: 76px; right: 16px; }
}
