/* =========================================
   🎨 DESIGN GUIDE STYLES (Optimized Version)
   ========================================= */

/* 1. Global & Shared Backgrounds */
body, 
.design-guide-wrapper,
.faq-header,
.faq-section {
    background-color: #fff8ec !important;
    color: #000;
}

/* 2. Typography Settings */
h5, .h5, .design-sub-title, .template-title, 
.placing-title, .diecut-title, .screen-title, .holesloops-title {
    font-weight: 800;
    color: #000;
    margin-bottom: 15px;
}

h5, .h5 { font-size: 22px; }
.template-title { font-size: 1.4rem; }

.design-main-title {
    text-align: center;
    font-weight: normal;
    font-size: 48px;
    margin-bottom: 80px;
}

/* 3. Layout Containers */
.design-guide-wrapper {
    padding: 80px 20px 40px;
}

.design-content-box {
    background-color: #ffffff;
    margin: 0 auto 40px;
    width: 100%;
    max-width: 1300px;
    padding: 40px 50px;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}

/* 4. Text Sections */
.design-description, 
.template-contact-text, 
.placing-contact-text, 
.diecut-contact-text, 
.screen-contact-text, 
.holesloops-contact-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 25px;
}

/* 5. Contact & Flex Layouts */
.design-flex-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.design-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 0 1 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.design-contact-list li:first-child {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* QR Code & Images Wrapper (Grouped) */
.design-qr-box {
    flex-shrink: 0;
    margin-top: -15px;
}


/* 6. Image Containers (Grouped for efficiency) */
.template-image-wrapper,
.placing-image-wrapper,
.diecut-image-wrapper,
.screen-image-wrapper,
.holesloops-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 20px 0 50px; /* เพิ่มระยะห่างระหว่างหัวข้อใหม่ */
}

.template-image-wrapper img,
.placing-image-wrapper img,
.diecut-image-wrapper img,
.screen-image-wrapper img,
.holesloops-image-wrapper img {
    max-width: 100%;
    height: auto;
}

/* 7. Links & Dividers */
.contact-link {
    color: #000;
    text-decoration: underline;
    font-weight: bold;
    transition: 0.2s;
}

.contact-link:hover {
    color: #fbab00;
}

.design-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 40px 0;
}

/* 8. FAQ Section */
.faq-header {
    text-align: center;
    padding: 60px 20px 30px;
}

.faq-header h1 {
    font-weight: normal;
    font-size: 48px;
}


.faq-item {
    border-bottom: 1px solid #aaa;
    padding: 25px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 800;
    font-size: 25px;
}

.faq-item:hover {
    color: #fbab00;
    transform: translateX(6px);
}


h5, .h5, .design-sub-title, .template-title, 
.placing-title, .diecut-title, .screen-title, .holesloops-title {
    font-weight: 800;
    color: #000;
    margin-bottom: 25px; 
    margin-top: 40px;    
}

/* --- 4. Text Sections --- */
/* เพิ่มระยะห่างระหว่างกลุ่มเนื้อหา (Section) */
.design-description, 
.template-contact-text, 
.placing-contact-text, 
.diecut-contact-text, 
.screen-contact-text, 
.holesloops-contact-text {
    font-size: 1.1rem;
    line-height: 1.8;    /* 🚩 ปรับให้อ่านง่ายขึ้น */
    color: #333;
    margin-bottom: 45px; /* 🚩 เพิ่มระยะห่างก่อนจะขึ้นหัวข้อถัดไป หรือก่อนขึ้นรูปภาพ */
}

/* --- 6. Image Containers --- */
/* ปรับระยะห่างของรูปภาพให้สมดุล */
.template-image-wrapper,
.placing-image-wrapper,
.diecut-image-wrapper,
.screen-image-wrapper,
.holesloops-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 10px 0 60px; /* 🚩 margin-bottom เป็น 60px เพื่อแยกแต่ละหัวข้อให้ขาดจากกัน */
}

.contact-underline {
    color: #000;              /* กำหนดสีตัวอักษรเป็นสีดำ */
    text-decoration: underline; /* เพิ่มขีดเส้นใต้ */
    text-decoration-color: #000; /* กำหนดสีของเส้นใต้เป็นสีดำ */
    cursor: pointer;          /* ทำให้เมาส์เป็นรูปมือ (กรณีอยากให้ดูเหมือนกดได้) */
}

/* เพิ่มเติม: สำหรับ Section ที่อยู่ล่างสุดของกล่องขาว */
.holesloops-image-wrapper {
    margin-bottom: 0; /* ตัวสุดท้ายไม่ต้องมีระยะล่าง */
}
@media (max-width: 768px) {
    /* 1. บังคับโครงสร้างภายนอกให้ชนขอบจอ โดยระบุเฉพาะหน้านี้เท่านั้น */
    .design-guide-wrapper,
    .design-guide-wrapper .container,
    .design-guide-wrapper .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: -40px !important;  
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. ปรับกล่องเนื้อหาขาวให้เต็ม 100% (ชิดขอบจอ) */
    .design-content-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 30px 15px !important; /* เว้นระยะเนื้อหาข้างใน 15px */
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important; /* ลบขอบมนเพื่อให้ชนขอบจอเนียนๆ */
        text-align: left !important;
    }

    /* 3. จัดการหัวข้อหลัก (ให้อยู่กึ่งกลางตามความต้องการเดิม) */
    .design-main-title { 
        font-size: 28px !important; 
        margin: 40px 0 !important;
        text-align: center !important;
        padding: 0 15px !important;
        line-height: 1.3;
    }

    /* 4. จัดการ Flex Container (Contact & QR Code) ให้ชิดซ้าย */
    .design-flex-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 20px !important;
    }

    .design-contact-list {
        width: 100% !important;
        text-align: left !important;
        padding-left: 0 !important;
    }

    .design-sub-title, 
    .template-title, 
    .template-contact-text,
    .design-template-section { 
        text-align: left !important; 
    }

    /* 5. จัดการรูปภาพทุกส่วนให้เต็มจอและไม่ขยับทะลุขอบ */
    .screen-image-wrapper {
        flex-direction: column !important;
    }

    .screen-image-wrapper img,
    .template-image-wrapper img,
    .placing-image-wrapper img,
    .diecut-image-wrapper img,
    .holesloops-image-wrapper img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 10px 0 !important; /* ให้รูปชิดซ้ายตามเนื้อหา */
    }

    /* 6. ส่วน FAQ ด้านล่าง (บทความที่น่าสนใจ) */
    .faq-header {
        padding: 35px 15px 10px !important;
    }

    .faq-header h1 { 
        font-size: 24px !important; 
        text-align: center !important; 
        font-weight: normal !important;
    }

    .faq-section { 
        padding: 10px 15px 40px !important; /* ลบ padding 16% เดิมออก */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .faq-item {
        padding: 18px 0 !important;
        text-align: left !important;
        font-size: 1.1rem !important;
        border-bottom: 1px solid #eee !important;
    }

    /* QR Code Box ในมือถือให้จัดกลางเพื่อความสวยงาม */
    .design-qr-box {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-top: 10px !important;
    }
}