:root {
    --primary-color: #2e7d32;
    --primary-light: #e8f5e9;
    --primary-dark: #1b5e20;
    --accent-color: #558b2f;
    --text-color: #333333;
    --bg-color: #f8faf8;
    --card-bg: #ffffff;
    --table-border: #e2ebe2;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation Links */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Main Content Wrapper */
.main-wrapper {
    background: var(--card-bg);
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
}

/* Hero Section Split Layout (Kyubac Style) */
.hero-section {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    border-bottom: 2px solid #edf2ed;
    padding-bottom: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image-wrapper {
        order: -1;
    }
}

.hero-content h1 {
    color: var(--primary-dark);
    font-size: 2.8em;
    margin: 0 0 10px 0;
    font-weight: 800;
}

.hero-content .tagline {
    font-size: 1.4em;
    color: var(--accent-color);
    font-style: italic;
    margin: 0 0 25px 0;
    font-weight: 500;
}

.hero-content .intro-text {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 20px;
}

.hero-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.product-img:hover {
    transform: scale(1.03);
}

/* Section Headings */
h2 {
    color: var(--primary-dark);
    font-size: 1.8em;
    border-left: 6px solid var(--primary-color);
    padding-left: 15px;
    margin-top: 40px;
    margin-bottom: 25px;
}

/* Ingredients Layout */
.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .ingredients-grid {
        grid-template-columns: 1fr;
    }
}

.ingredient-card {
    background: #fbfdfb;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2ebe2;
    transition: all 0.2s ease;
}

.ingredient-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.ingredient-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

/* Benefits List From Sack Label (653225_2.jpg) */
.benefits-list {
    list-style: none;
    padding: 0;
}

.benefits-list li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 18px;
    font-size: 1.1em;
}

.benefits-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.3em;
}

/* Standardized Table Styling */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid var(--table-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 1em;
}

th {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: bold;
    padding: 12px 15px;
    border: 1px solid var(--table-border);
}

td {
    padding: 12px 15px;
    border: 1px solid var(--table-border);
    background-color: #fff;
}

tr:nth-child(even) td {
    background-color: #fbfdfb;
}

.legal-notice {
    font-size: 0.9em;
    color: #666;
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #ccc;
}

.file-ref {
    font-size: 0.85em;
    color: #999;
    margin-top: 15px;
    text-align: center;
}

/* สไตล์เพิ่มเติมสำหรับจัดการสไลด์ภาพซ้อนกัน */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.carousel-container .product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.carousel-container .product-img.active {
    position: relative;
    opacity: 1;
    z-index: 2;
}

/* สไตล์โครงสร้างและพื้นหลังของ Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

/* กล่องควบคุมเนื้อหาภายใน Modal เพื่อให้จัดวางปุ่มซ้ายขวาได้ */
.modal-wrapper-inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 40px 60px;
}

/* สไตล์รูปภาพขยายด้านใน Modal */
.modal-content {
    max-width: 85%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    object-fit: contain;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ปุ่มปิด (X) */
.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10001;
}

.modal-close:hover {
    color: #bbb;
}

/* ปุ่มลูกศร เลื่อนซ้าย-ขวา */
.modal-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 50px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    user-select: none;
    transition:
        background 0.2s,
        color 0.2s;
    z-index: 10000;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e8f5e9;
}

.modal-btn-prev {
    left: 20px;
}

.modal-btn-next {
    right: 20px;
}

@media (max-width: 768px) {
    .modal-wrapper-inner {
        padding: 40px 20px;
    }

    .modal-content {
        max-width: 95%;
    }

    .modal-btn {
        font-size: 35px;
        padding: 5px 10px;
    }

    .modal-btn-prev {
        left: 5px;
    }

    .modal-btn-next {
        right: 5px;
    }
}