/* =========================================
   1. Base Styles & Reset
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #fdfdfd;
  color: #333;
  line-height: 1.6;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.page-wrapper { flex: 1; }

/* 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;
}

/* =========================================
   2. Header & Navigation
   ========================================= */
header {
  background-color: white;
  color: #333;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-brand h1 {
  color: #8B4513;
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
}

.logo {
  height: 50px;
  width: auto;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

nav a {
  color: #333;
  text-decoration: none;
  padding: 0.5rem 0;
  font-weight: 600;
  transition: color 0.2s;
}

nav a:hover {
  text-decoration: underline;
  color: #8B4513;
}

nav a.active {
  color: #8B4513;
  font-weight: bold;
}

/* =========================================
   3. Hero Sections
   ========================================= */
/* Standard Hero */
.about-hero-section {
  position: relative;
  width: 100%;
  height: 350px; /* Default Height */
  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: 800px;
  padding: 2rem;
  z-index: 10;
}

.about-hero-overlay h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.about-hero-overlay p {
  font-size: 1.2rem;
  margin: 0;
}

.badge-logo-small {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
}
.badge-logo-small img { width: 60px; height: auto; }

/* =========================================
   [NEW] Simple Page Header (แบบพื้นหลังเรียบ)
   ========================================= */
.simple-page-header {
  background-color: #f4f1ea; /* สีครีมอ่อนๆ ตามรูปตัวอย่าง */
  padding: 2.5rem 2rem;        /* เว้นระยะบน-ล่าง ให้ดูโปร่ง (80px) */
  text-align: center;        /* จัดข้อความกึ่งกลาง */
  width: 100%;
  box-sizing: border-box;    /* จัดการ padding ไม่ให้กล่องล้น */
}

.simple-page-header h2 {
  color: #4a3b32;            /* สีน้ำตาลเข้ม (Dark Coffee) สำหรับหัวข้อ */
  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: 1.5rem 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(320px, 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; }

.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; }

/* Custom Solutions Grid */
.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 Subtitles (For Sustainability/Quality sections) */
.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 & Sustainability Lists */
.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 (Quality Page) */
.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 {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.3);
  text-align: center;
  font-size: 0.9rem;
}

.footer-bottom a { color: white; text-decoration: none; margin: 0 5px; }
.footer-bottom a:hover { text-decoration: underline; }

/* =========================================
   10. Responsive
   ========================================= */
@media (max-width: 768px) {
  nav ul { flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
  .header-brand { justify-content: center; width: 100%; }
  header { justify-content: center; }
  .footer-columns { flex-direction: column; }
  .stats-section { gap: 2rem; }
  .stat-item { flex: 1 1 100%; }
  .contact-info { flex: 1 1 100%; }
}

/* =========================================
   11. sub-category
   ========================================= */
.sub-category-list {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.sub-category-list li {
    margin-bottom: 5px;
}

.sub-category-list a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s;
}
.sub-category-list a:hover {
  color: #8b4513; /* สีของแบรนด์ */
  text-decoration: underline;
}
.btn-view-details {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 15px;
  background-color: #8b4513;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}
.btn-view-details:hover {
  background-color: #6b3410;
  color: #fff;
}
.product-img-container a {
  display: block;
}

/* =========================================
   [NEW] Product Catalog Table & Grid
   ========================================= */
.catalog-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px 0;
}

.product-group {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid #eaeaea;
}

.group-image {
    flex: 1 1 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.group-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.group-data {
    flex: 2 1 500px;
}

.group-data h3 {
    margin-top: 0;
    color: #4a3b32;
    border-bottom: 2px solid #a69f22;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.styled-table th, .styled-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.styled-table th {
    background-color: #f4f1ea;
    color: #4a3b32;
    font-weight: 700;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #faf9f7;
}

.styled-table tbody tr:hover {
    background-color: #f0ede6;
}

.weight-col {
    color: #a69f22;
    font-weight: 600;
}

@media (max-width: 768px) {
    .styled-table { font-size: 0.85rem; }
    .styled-table th, .styled-table td { padding: 10px; }
}

/* =========================================
   [NEW] Item Grid (สำหรับหน้า Fancy & Bakery)
   ========================================= */
.item-grid {
    display: grid;
    /* บังคับให้สร้าง 2 คอลัมน์ที่มีขนาดเท่ากัน (1fr 1fr) */
    grid-template-columns: repeat(2, 1fr);
    gap: 25px; /* ระยะห่างระหว่างกล่อง */
    padding: 20px 0;
    /* กำหนดความกว้างสูงสุดไม่ให้กล่องกว้างเกินไปบนจอใหญ่ */
    max-width: 900px; 
    margin: 0 auto; /* จัดให้อยู่กึ่งกลางหน้าจอ */
}

.item-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.item-image {
    width: 100%;
    height: 200px; /* เพิ่มความสูงรูปภาพเล็กน้อยเพื่อให้สมดุลกับความกว้าง */
    object-fit: contain; /* รูปจะไม่เบี้ยว */
    margin-bottom: 15px;
}

.item-card h4 {
    color: #4a3b32;
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.item-card .item-meta {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0;
}

.item-card .item-meta strong {
    color: #a69f22;
}

/* สไตล์สำหรับหัวข้อย่อยแบ่งกลุ่มสินค้า */
.section-title {
    color: #4a3b32;
    border-bottom: 2px solid #a69f22;
    padding-bottom: 10px;
    margin-top: 50px;
    margin-bottom: 10px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* -------------------------------------
       Responsive: มือถือแสดง 1 รายการต่อแถว
       ------------------------------------- */
    @media (max-width: 600px) {
        .item-grid {
            /* เมื่อหน้าจอเล็กกว่า 600px (เช่น มือถือ) ให้แสดง 1 คอลัมน์ */
            grid-template-columns: 1fr;
            gap: 15px;
        }
}

