/* =========================================
   1. Base Styles & Reset
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

/* Global box-sizing & base layout tweaks to avoid overflow on small screens */
html { box-sizing: border-box; height: 100%; }
*, *::before, *::after { box-sizing: inherit; }

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #fdfdfd;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper { flex: 1; }

/* Make media elements fluid */
img, picture, video, svg { max-width: 100%; height: auto; display: block; }

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.content-section {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-alt {
  background-color: #f9f9f9;
}

.text-center { text-align: center; }
.text-brand { color: #8B4513; }
.mb-large { margin-bottom: 2.5rem; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2rem; }

hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 3rem 0;
}

/* =========================================
   Top Bar Styles (แถบบนสุด)
   ========================================= */

.top-bar {
  background-color: #8B4513; /* ใช้สีน้ำตาลเดียวกับ Footer/Brand Theme */
  color: #ffffff;
  padding: 10px 0; /* เพิ่มความสูงนิดหน่อยให้ดูโปร่ง */
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1050;
  position: relative;
}

.top-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ปรับฝั่งขวา (ติดต่อ) */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px; /* ระยะห่างระหว่างอีเมลกับเบอร์ */
}

.top-bar a {
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px; /* ระยะห่างระหว่างไอคอนกับตัวหนังสือ */
  transition: opacity 0.3s, color 0.3s;
}

.top-bar a:hover {
  opacity: 0.8;
  color: #f0c27b; /* เปลี่ยนเป็นสีทองอ่อนๆ ตอนเอาเมาส์ชี้ */
}

.top-bar .divider {
  color: rgba(255,255,255,0.4); /* สีเส้นคั่นจางๆ */
  font-weight: normal;
}

/* Responsive: มือถือ */
@media (max-width: 768px) {
  .top-bar-left {
    display: none; /* ซ่อนข้อความยาวๆ ในมือถือ */
  }
  
  .top-bar-container {
    justify-content: center; /* จัดกึ่งกลาง */
  }

  .top-bar-right {
    font-size: 0.85rem;
    gap: 10px;
    width: 100%;
    justify-content: center;
  }
  
  /* ในมือถืออาจจะซ่อนเส้นคั่นแล้วแยกบรรทัด หรือคงไว้ก็ได้ */
  .top-bar .divider { display: none; }
  .top-bar-right { flex-direction: column; gap: 5px; } /* เรียงลงมาเพื่อให้อ่านง่ายในจอมือถือเล็กๆ */
}

/* =========================================
   2. Header & Navigation (Modern & Responsive)
   ========================================= */
header {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(249, 0, 0, 0.1);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative; /* Essential for mobile menu positioning */
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}

.logo {
  height: 50px; /* Fixed height to prevent layout shifts */
  width: auto;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: hsl(25, 73%, 12%);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hamburger Button (Hidden on Desktop) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
  padding: 5px;
}

/* Desktop Menu Styles */
nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px;
}

nav a {
  text-decoration: none;
  color: #555;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding: 5px 0;
  border-bottom: 2px solid transparent; /* Prepare for hover effect */
}

nav a:hover, nav a.active {
  color: #a67c52;
  border-bottom: 2px solid #a67c52;
}

/* =========================================
   3. Hero Sections
   ========================================= */
/* Standard Hero */
.about-hero-section {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #333;
}

/* Modifier for Policy Page (Shorter Hero) */
.about-hero-section.policy-hero {
  height: 250px;
}

.about-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4);
}

.about-hero-overlay {
  position: absolute;
  color: white;
  max-width: 90%;
  padding: 1.25rem;
  z-index: 10;
}

.about-hero-overlay h1, .about-hero-overlay h2 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.about-hero-overlay p {
  font-size: 1.05rem;
  margin: 0;
}

.badge-logo-small {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
}
.badge-logo-small img { width: 60px; height: auto; }

.text-gold {
  color: #f39d1d; /* สีทองอ่อนที่ดูแพงและอ่านง่ายบนพื้นเข้ม */
  text-shadow: 0 2px 4px rgba(0,0,0,0.6); /* เพิ่มเงาเข้มขึ้นเพื่อให้ตัวหนังสือลอยเด่น */
}

/* หรือถ้าอยากให้เป็นสีน้ำตาลเข้ม ต้องมีพื้นหลังรองรับ */
.bg-brand-highlight {
  background-color: rgba(139, 69, 19, 0.85); /* สีน้ำตาลโปร่งแสง */
  color: #ffffff;
  padding: 5px 15px;
  border-radius: 4px;
  display: inline-block; /* ให้กรอบหุ้มพอดีคำ */
}


/* =========================================
   [NEW] Simple Page Header
   ========================================= */
.simple-page-header {
  background-color: #f4f1ea;
  padding: 5rem 2rem;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.simple-page-header h2 {
  color: #4a3b32;
  font-size: 3rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
}

.simple-page-header p {
  color: #8c7b70;
  font-size: 1.25rem;
  font-weight: 400;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .simple-page-header { padding: 3rem 1.5rem; }
  .simple-page-header h2 { font-size: 2rem; }
  .simple-page-header p { font-size: 1rem; }
}

/* =========================================
   4. Components (Grids, Stats, Icons)
   ========================================= */
.stats-section {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2.5rem 2rem;
  background: #f4f4f4;
  text-align: center;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.stat-item {
  flex: 1 1 200px;
  font-weight: 700;
  color: #333;
  font-size: 1.1rem;
  padding: 15px;
  border-radius: 8px;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-item span {
  display: block;
  font-size: 2.5rem;
  color: #A0522D;
  margin-bottom: 0.2rem;
}

.stat-item i { font-size: 2rem; margin-bottom: 5px; }

.two-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.column { flex: 1 1 300px; }
.icon-brand { color: #8B4513; margin-right: 10px; }

/* =========================================
   5. Page Specific: Products
   ========================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-top: 1rem;
}

.product-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border-bottom: 4px solid #8B4513;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-img-container {
  height: 240px;
  overflow: hidden;
  border-bottom: 1px solid #eee;
}

.product-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-img-container img { transform: scale(1.05); }

.product-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-content h3 {
  color: #8B4513;
  margin-top: 0;
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.product-content p { color: #555; margin-bottom: 1.5rem; }

/* Buttons and inline CTA styles */
.btn { display: inline-block; padding: 10px 18px; border-radius: 6px; text-decoration: none; cursor: pointer; }
.btn-primary { background: #8B4513; color: #fff; border: 2px solid #8B4513; font-weight: 700; }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; font-weight: 700; }

.card-image { height: 200px; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-content a { color: #8B4513; font-weight: bold; text-decoration: none; }
.product-content a:hover { text-decoration: underline; }

.intro-text { max-width: 800px; margin: 0 auto 2rem auto; font-size: 1.1rem; color: #555; }
.sustainability-list { margin-top: 1rem; }
.accent-link { color: #8B4513; font-weight: 700; text-decoration: underline; }
.contact-address { font-style: normal; background: #fdfdfd; padding: 1.25rem; border-left: 5px solid #8b4513; margin-top: 1rem; }
.simple-page-cta { background: #f4f1ea; display: inline-block; padding: 12px 30px; border-radius: 30px; color: #8B4513; font-weight: 700; border: 1px solid #e0d8cc; }
.lead-text { max-width: 800px; margin: 0 auto; font-size: 1rem; color: #555; }
.lead-sm { font-size: 1.05rem; }
.reading { line-height: 1.8; }

.feature-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.feature-tag {
  background: #f8f1eb;
  color: #8B4513;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid #e6d8cf;
}

.app-section {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
  color: #666;
}
.app-section strong { color: #333; display: block; margin-bottom: 5px; }

.solutions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.solution-item {
    flex: 1 1 300px;
    background: white;
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-top: 4px solid #8B4513;
    transition: transform 0.3s;
}
.solution-item:hover { transform: translateY(-5px); }

.solution-icon {
    color: #8B4513;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.solution-item h4 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* =========================================
   6. Page Specific: Policies & Quality
   ========================================= */
.policy-block {
    margin-bottom: 4rem;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #8B4513;
}

.policy-block h2 {
    color: #8B4513;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.policy-subtitle {
    color: #8B4513;
    margin-bottom: 10px;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}
.policy-subtitle:first-of-type { margin-top: 0; }

.security-list, .sustainability-list { list-style: none; padding: 0; }

.security-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.security-list li {
    background: #f9f9f9;
    padding: 1rem;
    border-left: 4px solid #8B4513;
    font-weight: 600;
    color: #333;
}

.sustainability-item {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid #eee;
}
.sustainability-item strong { color: #333; }

.certification-badges {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.badge-item {
  font-size: 1.1rem;
  font-weight: 700;
  color: #8B4513;
  border: 2px solid #8B4513;
  padding: 0.5rem 1.5rem;
  border-radius: 5px;
  background: white;
  display: inline-block;
}

/* =========================================
   7. Page Specific: About (Vision & Markets)
   ========================================= */
.vision-container {
  background-color: #fff;
  border: 1px solid #eee;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  border-top: 4px solid #8B4513;
}

.vision-highlight {
  font-size: 1.3rem;
  font-weight: bold;
  color: #8B4513;
  font-style: italic;
  margin: 0;
}

.market-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.market-tag {
  background: #f4ece6;
  color: #8B4513;
  padding: 5px 15px;
  border-radius: 15px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* =========================================
   8. Page Specific: Contact
   ========================================= */
.contact-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  padding-top: 1rem;
  padding-bottom: 3rem;
}

.contact-wrapper.single-column { justify-content: center; }

.contact-info {
  flex: 0 1 600px;
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.contact-info h3 {
  color: #8B4513;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.contact-info > p { text-align: center; margin-bottom: 2rem; }

.info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 10px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.info-item:hover { background-color: #f9f9f9; }

.info-item .icon-box {
  width: 45px;
  height: 45px;
  background-color: #f4ece6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

.info-item .icon-box i { font-size: 1.2rem; color: #8B4513; }

.info-item h4 {
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
}

.info-item p { margin: 0; color: #555; line-height: 1.6; }
.info-item a { color: #555; text-decoration: none; transition: color 0.3s; }
.info-item a:hover { color: #8B4513; text-decoration: underline; }

/* =========================================
   9. Footer
   ========================================= */
.site-footer {
  margin-top: auto;
  background-color: #8B4513;
  color: white;
  padding: 3rem 2rem 1rem 2rem;
  font-size: 0.95rem;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: auto;
  gap: 2rem;
}

.footer-column {
  flex: 1 1 220px;
  margin-bottom: 1rem;
}

.footer-column h3, .footer-column h4 {
  color: white;
  margin-top: 0;
  margin-bottom: 1rem;
}

.footer-column ul { list-style: none; padding: 0; }
.footer-column ul li { margin-bottom: 0.5rem; }
.footer-column a { color: white; text-decoration: none; opacity: 0.9; }
.footer-column a:hover { text-decoration: underline; opacity: 1; }
.footer-column i { color: white; margin-right: 8px; }

.social-icons { display: flex; gap: 15px; margin-top: 1rem; }
.social-icons img { height: 24px; width: auto; opacity: 0.9; }
.social-icons a:hover img { opacity: 1; }

/* =========================================
   Footer Bottom (Left/Right Layout)
   ========================================= */
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
  color: #ddd;

  /* ใช้ Flexbox จัดซ้ายขวา */
  display: flex;
  justify-content: space-between; /* ดันเนื้อหาไปชิดขอบซ้ายและขวา */
  align-items: center;
  flex-wrap: wrap; /* ยอมให้ปัดบรรทัดถ้าจอเล็ก */
  
  /* จัดความกว้างให้ตรงกับเนื้อหาด้านบน */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copyright {
  text-align: left;
}

.footer-policy-links {
  text-align: right;
  display: flex;
  align-items: center;
  gap: 10px; /* ระยะห่างระหว่างลิงก์ */
}

.footer-bottom a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

.footer-bottom a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.separator {
  color: rgba(255,255,255,0.4);
}

/* =========================================
   10. Responsive & Mobile Menu
   ========================================= */
@media (max-width: 768px) {
  
  /* --- Mobile Navigation --- */
  .mobile-menu-btn {
    display: block; /* Show hamburger button */
  }

  .header-container {
    padding: 10px 15px;
  }

  .brand-name {
    font-size: 1.1rem; /* Smaller font for mobile */
  }

  nav#main-nav {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #eee;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
  }

  nav#main-nav.active {
    display: block; /* Show when toggled */
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav li {
    width: 100%;
    text-align: left;
  }

  nav a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #f9f9f9;
    font-size: 1rem;
  }
  
  nav a:hover, nav a.active {
    background-color: #fcf9f6;
    color: #a67c52;
    padding-left: 25px; /* Indent effect on active/hover */
    border-bottom: 1px solid #f9f9f9;
  }

  /* --- General Responsive Fixes --- */
  .about-hero-section {
    flex-direction: column !important;
    height: auto !important;
    padding: 0 !important;
    background-color: #333;
  }
  
  .about-hero-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
  }
  
  .about-hero-overlay {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 1.5rem;
    text-align: center;
    background-color: #333;
  }
  
  .about-hero-overlay h1 { font-size: 1.6rem; }
  
  .footer-columns { flex-direction: column; text-align: center; }
  .stats-section { gap: 2rem; }
  .stat-item { flex: 1 1 100%; }
}


/* Responsive: มือถือ */
@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column; /* เรียงลงมาเป็นแนวตั้ง */
    gap: 15px; /* เว้นระยะห่างบรรทัด */
    text-align: center;
  }
  
  .footer-copyright, 
  .footer-policy-links {
    text-align: center;
    justify-content: center;
    width: 100%;
  }
}