/* ----- ส่วนหัว ----- */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6a11cb 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(-30deg);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

/* ----- Animation Effects ----- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Decorative Elements ----- */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idXJsKCNwYXR0ZXJuKSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIvPjwvc3ZnPg==');
    opacity: 0.4;
}

/* ----- Responsive Adjustments ----- */
@media (max-width: 768px) {
    header {
        padding: 40px 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 10px;
    }
    
    header h1 {
        font-size: 1.7rem;
        line-height: 1.4;
    }
    
    header p {
        font-size: 0.9rem;
    }
}

/* ************************ */

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* General Section Styling */
.section {
    padding: 80px 0;
    background-color: var(--white-color);
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
}

.section:nth-of-type(even) {
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-family: var(--font-family-secondary);
    font-size: 2.8rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 5px;
}

.section-title p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Pricing Section */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.pricing-card {
    background-color: var(--white-color);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.pricing-card.popular {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 5px rgba(0, 123, 255, 0.2), var(--shadow-medium);
    transform: translateY(-10px);
}

.popular-badge {
    position: absolute;
    top: -1px;
    right: -3px;
    background-color: var(--accent-color);
    color: var(--white-color);
    padding: 3px 12px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom-left-radius: 15px;
    /* transform: rotate(45deg) translate(20px, -20px); */
    transform-origin: 100% 0%;
}

.pricing-card h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 600;
}

.pricing-card h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    text-align: left;
}

.pricing-features li {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
}

.pricing-features li i {
    color: var(--accent-color);
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-card {
    background-color: var(--white-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: inline-block;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 20px;
    border-radius: 50%;
}

.feature-card h3 {
    font-size: 1.6rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: var(--secondary-color);
    font-size: 1rem;
}

/* Reviews Section */
#reviewText {
    font-size: 1.2rem;
    padding: 0.9rem;
    height: 100px; /* หรือใช้ rows ก็ได้ แต่กำหนด height จะควบคุมได้แม่นกว่า */
    resize: vertical; /* อนุญาตให้ผู้ใช้ขยายเองในแนวตั้ง */
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.reviews-card {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.reviews-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.reviews-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 3px solid var(--primary-color);
}

.reviews-author {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
}

.reviews-role {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.reviews-text {
    font-style: italic;
    color: var(--dark-color);
    line-height: 1.8;
    flex-grow: 1;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    background-color: var(--white-color);
    padding: 50px;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
}

.contact-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-right: 20px;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 15px;
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-text h4 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.contact-text p,
.contact-text a {
    color: var(--secondary-color);
    font-size: 1rem;
    display: block;
}

.contact-text a:hover {
    color: var(--primary-color);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.contact-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* Responsive adjustments for index.php content sections */
@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    .contact-form {
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    .section-title h2 {
        font-size: 2rem;
    }
    .pricing-card {
        padding: 30px;
    }
    .feature-card, .reviews-card {
        padding: 25px;
    }
    .contact-container {
        padding: 30px;
    }
}

@media (max-width: 576px) {
    .section-title h2 {
        font-size: 1.8rem;
    }
    .pricing-grid, .features-grid, .reviews-grid {
        grid-template-columns: 1fr;
    }
    .pricing-card, .feature-card, .reviews-card, .contact-container {
        margin: 0 15px; /* Add horizontal margin on very small screens */
    }
}

/* เกี่ยวกับ "จุดเด่นของเรา" */
/* ส่วนสำหรับ Section โดยรวม */
.features-section {
    padding: 60px 0; /* เพิ่ม padding ด้านบน-ล่าง เพื่อให้มีพื้นที่รอบๆ */
    background-color: #f8f9fa; /* สีพื้นหลังของ Section อาจปรับเปลี่ยนได้ */
}

.features-section .section-title {
    text-align: center;
    margin-bottom: 40px;
}

.features-section .section-title p {
    font-size: 18px;
    color: #666;
}

/* ส่วนสำหรับ Grid Container */
.features-grid {
    display: grid; /* ใช้ Grid Layout */
    gap: 20px; /* ระยะห่างระหว่าง Card */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* ค่าเริ่มต้นสำหรับจอขนาดกลางและเล็ก: จัดให้พอดี 250px หรือขยายเต็มพื้นที่ */
    justify-items: center; /* จัดให้อยู่กึ่งกลางในแนวนอน */
    align-items: stretch; /* ทำให้ Card มีความสูงเท่ากันในแต่ละแถว */
}

/* Media Query สำหรับ Desktop (จอใหญ่) */
@media (min-width: 1200px) { /* สำหรับหน้าจอที่มีความกว้างตั้งแต่ 1200px ขึ้นไป */
    .features-grid {
        grid-template-columns: repeat(6, 1fr); /* 6 คอลัมน์เท่าๆ กัน */
    }
}

/* Media Query สำหรับ Tablet (จอขนาดกลาง) */
@media (min-width: 768px) and (max-width: 1199px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 คอลัมน์ */
    }
}

/* Media Query สำหรับ Mobile (จอเล็ก) */
@media (max-width: 767px) {
    .features-grid {
        grid-template-columns: 1fr; /* 1 คอลัมน์ (จะเรียงเป็นแถวเดียวลงมา) */
    }
}

/* สไตล์สำหรับแต่ละ Feature Card */
.feature-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* เพิ่มเงาให้ดูมีมิติ */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* เพิ่ม Transition เพื่อให้เกิด Animate ตอน Hover */
    height: 100%; /* สำคัญมากเพื่อให้ Card มีความสูงเท่ากัน */
    display: flex; /* ใช้ flex เพื่อจัดเรียง content ภายใน card */
    flex-direction: column; /* จัด content ภายใน card เป็นแนวตั้ง */
    justify-content: flex-start; /* จัด content ให้เริ่มจากด้านบน */
    align-items: center; /* จัด content ภายใน card ให้อยู่กึ่งกลางแนวนอน */
}

.feature-card:hover {
    transform: translateY(-5px); /* เลื่อนขึ้นเล็กน้อยเมื่อ Hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* เพิ่มเงาให้เข้มขึ้น */
}

.feature-card .feature-icon {
    font-size: 48px;
    color: #007bff; /* สีของไอคอน (สีน้ำเงิน Bootstrap) */
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 15px;
    color: #777;
    line-height: 1.6;
    flex-grow: 1; /* ทำให้ p ขยายเต็มพื้นที่ที่เหลือ เพื่อช่วยให้ h3 มีตำแหน่งที่สม่ำเสมอหากข้อความไม่เท่ากัน */
}



/* ******************* ส่วนของการแสดงราคาโชว์ตัวอย่าง ******************* */

/* ปรับโครงสร้างหลักใหม่ */
.price-display {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px; /* เพิ่มระยะห่างระหว่างราคาเดิมและราคาลด */
    margin: 12px 0;
    position: relative;
    padding-left: 12px;
    border-left: 3px solid #2e7d32;
    min-width: 120px; /* กำหนดความกว้างขั้นต่ำ */
}

/* ราคาเดิม (ถูกขีดฆ่า) */
.original-price {
    position: relative;
    color: #9e9e9e;
    font-size: 0.95em;
    line-height: 1.3;
}

.original-price .price-value {
    text-decoration: line-through;
    opacity: 0.8;
}

.original-price .price-unit {
    font-size: 0.85em;
    margin-left: 2px;
}

/* ปรับขนาดและระยะห่างของราคาสุดท้าย */
.final-price {
    display: flex;
    align-items: center; /* จัดแนวกลางแนวตั้ง */
    position: relative;
    color: #2e7d32;
    font-weight: 700;
    font-size: 1.5em;
    line-height: 1.3;
    padding: 8px 12px; /* เพิ่ม padding */
    background-color: rgba(46, 125, 50, 0.1);
    border-radius: 8px;
    animation: pulse 2s infinite;
    width: 100%; /* ให้เต็มความกว้าง */
    box-sizing: border-box;
}

/* ปรับตำแหน่งป้ายส่วนลดใหม่ */
.discount-badge {
    position: absolute;
    top: -15px;
    right: -25px;
    background-color: #ff5722;
    color: white;
    font-size: 0.6em;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: rotate(5deg);
    animation: bounce 1.5s infinite;
    z-index: 1; /* ให้อยู่เหนือเนื้อหาอื่น */
    white-space: nowrap; /* ป้องกันข้อความขึ้นบรรทัดใหม่ */
}

/* ปรับขนาดสัญลักษณ์เงินบาท */
.final-price .currency {
    color: #2e7d32;
    font-size: 20px;
    font-weight: bold;
    margin-right: 5px; /* เพิ่มระยะห่างจากตัวเลข */
    line-height: 1;
}

/* ปรับการแสดงผลบนมือถือ */
@media (max-width: 576px) {
    .price-display {
        gap: 4px;
        margin: 8px 0;
    }
    
    .final-price {
        padding: 6px 10px;
        font-size: 1.5em;
    }
    
    .discount-badge {
        font-size: 0.65em;
        padding: 2px 6px;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(5deg); }
    50% { transform: translateY(-3px) rotate(5deg); }
}
