
:root {
  --primary-color: #002259; /* Navy Blue from old site */
  --secondary-color: #dfb162; /* Gold from Add Line button */
  --secondary-hover: #c4994d;
  --text-color: #333333;
  --text-light: #666666;
  --bg-color: #ffffff;
  --light-bg: #f8f9fa;
  --border-color: #e0e0e0;
  --font-main: 'Prompt', sans-serif;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

button, input, select, textarea {
  font-family: inherit;
}

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

a:hover {
  color: var(--secondary-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.pagination .page-link {
  padding: 8px 16px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s;
}

.pagination .page-link:hover, .pagination .page-link.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Skeleton Loading */
.skeleton {
  background: #e2e5e7;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  background-size: 40px 100%;
  background-repeat: no-repeat;
  background-position: left -40px top 0;
  animation: shine 1s ease infinite;
}
@keyframes shine {
  to {
    background-position: right -40px top 0;
  }
}
.skeleton-card {
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.skeleton-img {
  height: 220px;
  width: 100%;
}
.skeleton-content {
  padding: 20px;
}
.skeleton-text {
  height: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
}
.skeleton-title {
  width: 70%;
  height: 20px;
  margin-bottom: 15px;
}

/* Floating Line Button */
.floating-line-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #00B900; /* LINE Green */
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 15px rgba(0, 185, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.floating-line-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-line-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 185, 0, 0.5);
  color: white;
}

/* Add Line Label Tooltip */
.floating-line-btn::before {
  content: 'ติดต่อเรา';
  position: absolute;
  right: 75px;
  background-color: white;
  color: #333;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

.floating-line-btn:hover::before {
  opacity: 1;
  visibility: visible;
  right: 75px;
}

/* Utilities */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #001538;
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  color: var(--primary-color);
}

/* Top Bar */
header {
  display: contents;
}

.top-bar {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.9rem;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar a {
  color: white;
}

.top-bar a:hover {
  color: var(--secondary-color);
}

.top-bar i {
  margin-right: 5px;
}

/* Navbar */
.navbar {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  padding-bottom: 15px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.navbar-brand img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.navbar-brand .brand-text {
  display: flex;
  flex-direction: column;
}

.navbar-brand .brand-name {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
  line-height: 1.2;
}

.navbar-brand .brand-desc {
  font-size: 0.8rem;
  color: var(--text-light);
}

.navbar-nav {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

.navbar-nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 10px 0;
  position: relative;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--primary-color);
}

.navbar-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

.navbar-cta {
  display: flex;
  align-items: center;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary-color);
}

@media (max-width: 992px) {
  .top-bar { display: none; }
  
  .navbar-nav, .navbar-cta {
    display: none;
  }
  
  .navbar.menu-active .container {
    flex-wrap: wrap;
    /* Height is already auto implicitly, so no jump */
  }
  
  .navbar-nav.active {
    display: flex;
    flex-direction: column;
    position: static;
    width: 100%;
    order: 3;
    padding: 20px 0 10px 0;
    gap: 15px;
    box-shadow: none;
    border-top: 1px solid #eee;
    margin-top: 10px;
  }
  
  .navbar-cta.active {
    display: flex;
    position: static;
    width: 100%;
    order: 4;
    padding: 10px 0 20px 0;
    z-index: 1001;
  }
  .navbar-cta.active .btn {
    width: 100%;
  }
  
  .nav-toggle {
    display: block;
  }
}

/* Footer */
.footer {
  background-color: var(--primary-color);
  color: white;
  padding: 60px 0 20px;
  margin-top: 50px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer h3 {
  color: var(--secondary-color);
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer p, .footer li {
  color: #cccccc;
  margin-bottom: 10px;
}

.footer ul {
  list-style: none;
}

.footer ul li a {
  color: #cccccc;
}

.footer ul li a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #999;
  font-size: 0.9rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

/* Sections */
.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-title p {
  color: var(--text-light);
}

/* Pulse Button Animation */
.pulse-btn {
  animation: pulse-shadow 2s infinite;
}

@keyframes pulse-shadow {
  0% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(255, 204, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); }
}

/* Hotline Banner Animation */
.hotline-banner {
  display: block;
  text-decoration: none;
  background-color: var(--primary-color);
  text-align: center;
  padding: 40px 20px;
  margin-top: 40px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.hotline-banner:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(255, 204, 0, 0.3);
}

.hotline-banner h2 {
  color: var(--secondary-color);
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.hotline-banner h3 {
  color: var(--secondary-color);
  font-size: 3rem;
  font-weight: bold;
  margin: 0;
  letter-spacing: 2px;
}

.hotline-icon-shake i {
  display: inline-block;
  animation: phone-shake 2s infinite cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes phone-shake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-15deg); }
  20%, 40%, 60%, 80% { transform: rotate(15deg); }
}

@media (max-width: 768px) {
  .hotline-banner {
    padding: 30px 15px;
  }
  .hotline-banner h2 {
    font-size: 1.5rem;
  }
  .hotline-banner h3 {
    font-size: 2.2rem;
  }
}

/* Animations */
.pulse-anim {
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(223, 177, 98, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(223, 177, 98, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(223, 177, 98, 0);
  }
}

/* Clients Slider */
.clients-section {
  background-color: var(--light-bg);
  padding: 60px 0;
  overflow: hidden;
}

.clients-slider {
  display: flex;
  overflow: hidden;
  width: 100%;
}

.clients-slider:hover .clients-track {
  animation-play-state: paused;
}

.clients-track {
  display: flex;
  flex-shrink: 0;
  width: max-content;
  gap: 80px;
  padding-right: 80px;
  align-items: center;
  animation: scrollClients 40s linear infinite;
}

.client-logo {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-logo img {
  width: auto;
  height: 100%;
  max-width: 260px;
  max-height: 100px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.client-logo img:hover {
  transform: scale(1.1);
}

@keyframes scrollClients {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Responsive Rules for All Pages */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
  .features-grid, .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 540px;
  }
  .features-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .clients-track {
    gap: 60px;
    padding-right: 60px;
  }
  .client-logo {
    height: 100px;
  }
  .clients-slider {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .container {
    max-width: 100%;
    padding: 0 15px;
  }
  .section-title h2 {
    font-size: 1.5rem;
  }
  .btn {
    width: 100%;
    margin-bottom: 10px;
  }
  .contact-container {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }
  .comparison-table, .comparison-table tbody, .comparison-table tr, .comparison-table td, .comparison-table th {
    display: block;
    width: 100%;
  }
  .comparison-table thead {
    display: none;
  }
  .comparison-table tr {
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    background: white;
    overflow: hidden;
  }
  .comparison-table td {
    padding: 15px 20px;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    border-right: none;
  }
  .comparison-table td:first-child {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    justify-content: center;
    border-radius: 0;
  }
  .comparison-table td:nth-child(2)::before { content: "เสาเข็มตอก"; font-weight: bold; color: #555; }
  .comparison-table td:nth-child(3)::before { content: "เสาเข็มเจาะ"; font-weight: bold; color: #555; }
  .comparison-table td:nth-child(4)::before { content: "ระบบไฮดรอลิก (MPA)"; font-weight: bold; color: var(--secondary-color); }
  .comparison-table td:last-child {
    border-bottom: none;
    border-radius: 0;
  }
}

/* Comparison Section */
.comparison-section {
  background-color: white;
  padding: 60px 40px;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 34, 89, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 12px;
  overflow: visible; /* Changed from hidden to allow badge to break out */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  margin-top: 40px;
  border: 1px solid var(--border-color);
}

.comparison-table th:first-child {
  border-top-left-radius: 12px;
}

.comparison-table th:last-child {
  border-top-right-radius: 12px;
}

.comparison-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.comparison-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.comparison-table th, .comparison-table td {
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 25px 20px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.comparison-table tbody tr:hover td {
  background-color: rgba(223, 177, 98, 0.05);
}

.comparison-table th:last-child, .comparison-table td:last-child {
  border-right: none;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 30px 20px;
  letter-spacing: 0.5px;
}

.comparison-table th.highlight {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 700;
  position: relative;
}

@keyframes pulseBadge {
  0% { transform: translateX(-50%) scale(1); box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3); }
  50% { transform: translateX(-50%) scale(1.1); box-shadow: 0 4px 20px rgba(220, 38, 38, 0.6); }
  100% { transform: translateX(-50%) scale(1); box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3); }
}

.comparison-table th.highlight::after {
  content: '★ แนะนำ';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.9rem;
  font-weight: bold;
  padding: 6px 16px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
  animation: pulseBadge 2s infinite ease-in-out;
  z-index: 10;
  border: 2px solid white;
  white-space: nowrap;
}

.comparison-table td:nth-child(4) {
  background-color: rgba(223, 177, 98, 0.12);
  font-weight: 700;
  color: #001538;
}

.check { color: #16a34a; font-weight: bold; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 8px;}
.cross { color: #dc2626; font-weight: bold; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 8px;}

/* FAQ Section */
.faq-section {
  padding: 80px 0;
  background-color: var(--light-bg);
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: white;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.03);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 20px 25px;
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-main);
  transition: background-color 0.3s;
}

.faq-question:hover {
  background-color: rgba(0, 34, 89, 0.02);
}

.faq-question i {
  color: var(--secondary-color);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 25px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background-color: white;
  color: var(--text-color);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  padding: 0 25px 25px 25px;
  max-height: 500px;
}


/* Font Awesome Overrides for font-display: swap */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 400;
  font-display: swap; /* FA Overrides */
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-regular-400.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-regular-400.ttf") format("truetype");
}
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 900;
  font-display: swap; /* FA Overrides */
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-solid-900.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-solid-900.ttf") format("truetype");
}
@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-style: normal;
  font-weight: 400;
  font-display: swap; /* FA Overrides */
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-brands-400.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-brands-400.ttf") format("truetype");
}
