<?php
/**
 * Template Name: หน้าแรก - NPX78 SongTuaThai
 */
get_header();
?>

<style>
/* ============================================
   ส่วนที่ 1: HERO - แบนเนอร์ NPX78
   ============================================ */
.hero-banner {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.hero-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-overlay-cta {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.hero-cta-btn {
    display: inline-block;
    padding: 20px 50px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5);
    transition: all 0.3s;
    border: 3px solid #fff;
}

.hero-cta-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.7);
}

/* ============================================
   ส่วนที่ 2: ฟอร์มขอเช็คจัดส่ง
   ============================================ */
.quote-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.quote-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.quote-container h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #1a3a8f;
    margin-bottom: 10px;
}

.quote-container .subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 40px;
}

.form-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #ff6b35;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #ff6b35;
    display: flex;
    align-items: center;
    gap: 10px;
}
https://npx78.com/wp-content/uploads/2026/10/ส่วนหัวแดง.png
.form-section-title:first-of-type {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group label .required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.file-upload {
    position: relative;
    border: 2px dashed #ff6b35;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff8f5;
}

.file-upload:hover {
    background: #fff0e8;
    border-color: #f7931e;
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
}

.file-upload .upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.file-upload p {
    margin: 5px 0;
    color: #ff6b35;
    font-weight: 600;
}

.file-upload small {
    color: #7f8c8d;
    font-size: 12px;
}

.submit-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.5);
}

/* ============================================
   ส่วนที่ 3: จุดเด่นบริการ
   ============================================ */
.features-section {
    padding: 60px 20px;
    background: #fff;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features-container h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #1a3a8f;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border-top: 4px solid #ff6b35;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #1a3a8f;
    margin-bottom: 10px;
    font-size: 20px;
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* ============================================
   ส่วนที่ 4: ประเภท vehicle
   ============================================ */
.vehicles-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #1a3a8f 0%, #2d5bc4 100%);
    color: #fff;
}

.vehicles-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.vehicles-container h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 40px;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.vehicle-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    border-radius: 15px;
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.vehicle-card:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-5px);
}

.vehicle-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.vehicle-card h3 {
    font-size: 20px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-cta-btn {
        font-size: 16px;
        padding: 15px 30px;
    }
    .form-grid { grid-template-columns: 1fr; }
    .quote-container { padding: 25px; }
    .quote-container h2 { font-size: 28px; }
    .features-container h2,
    .vehicles-container h2 { font-size: 28px; }
}
</style>

<!-- ============================================
     ส่วนที่ 1: HERO - แบนเนอร์ NPX78
     ============================================ -->
<section class="hero-banner">
    <!-- ⚠️ เปลี่ยน URL รูปแบนเนอร์ตรงนี้ -->
    <img src="https://npx78.com/wp-content/uploads/2026/10/npx78-banner.jpg" 
         alt="NPX78 ขนส่งทั่วประเทศไทย" 
         style="width:100%; height:auto;">
    
    <!-- ปุ่ม CTA ลอยอยู่เหนือแบนเนอร์ -->
    <div class="hero-overlay-cta">
        <a href="#quote-form" class="hero-cta-btn">
            📦 ขอเช็คจัดส่ง →
        </a>
    </div>
</section>

<!-- ============================================
     ส่วนที่ 2: ฟอร์มขอเช็คจัดส่ง
     ============================================ -->
<section class="quote-section" id="quote-form">
    <div class="quote-container">
        <h2>📦 ขอเช็คจัดส่ง</h2>
        <p class="subtitle">กรอกข้อมูลด้านล่าง เจ้าหน้าที่จะติดต่อกลับภายใน 30 นาที</p>
        
        <form action="<?php echo esc_url(home_url('/wp-content/themes/astra/quote-form-handler.php')); ?>" method="POST" enctype="multipart/form-data">
            <?php wp_nonce_field('submit_quote', 'quote_nonce'); ?>
            
            <input type="hidden" name="page_url" value="<?php echo esc_url(home_url('/')); ?>">
            <input type="hidden" name="page_title" value="NPX78 - ขอเช็คจัดส่ง">
            
            <!-- ข้อมูลต้นทาง -->
            <div class="form-section-title">📤 ข้อมูลต้นทาง</div>
            <div class="form-grid">
                <div class="form-group">
                    <label>ชื่อ-นามสกุล <span class="required">*</span></label>
                    <input type="text" name="origin_name" required placeholder="กรอกชื่อ-นามสกุล">
                </div>
                <div class="form-group">
                    <label>เบอร์โทรศัพท์ <span class="required">*</span></label>
                    <input type="tel" name="origin_phone" required placeholder="0812345678" pattern="[0-9]{10}">
                </div>
            </div>
            <div class="form-group full-width">
                <label>ที่อยู่ต้นทาง <span class="required">*</span></label>
                <input type="text" name="origin_address" id="origin_address" required placeholder="ค้นหาตำบล/อำเภอ/จังหวัด หรือ กรอกที่อยู่">
            </div>
            
            <!-- ข้อมูลปลายทาง -->
            <div class="form-section-title">📥 ข้อมูลปลายทาง</div>
            <div class="form-grid">
                <div class="form-group">
                    <label>ชื่อ-นามสกุล <span class="required">*</span></label>
                    <input type="text" name="dest_name" required placeholder="กรอกชื่อ-นามสกุล">
                </div>
                <div class="form-group">
                    <label>เบอร์โทรศัพท์ <span class="required">*</span></label>
                    <input type="tel" name="dest_phone" required placeholder="0812345678" pattern="[0-9]{10}">
                </div>
            </div>
            <div class="form-group full-width">
                <label>ที่อยู่ปลายทาง <span class="required">*</span></label>
                <input type="text" name="dest_address" id="dest_address" required placeholder="ค้นหาตำบล/อำเภอ/จังหวัด หรือ กรอกที่อยู่">
            </div>
            
            <!-- ข้อมูลสินค้า -->
            <div class="form-section-title">📦 ข้อมูลสินค้า</div>
            <div class="form-grid">
                <div class="form-group">
                    <label>ประเภทสินค้า <span class="required">*</span></label>
                    <select name="product_type" required>
                        <option value="">-- เลือกประเภทสินค้า --</option>
                        <option value="ตู้เย็น">ตู้เย็น</option>
                        <option value="เครื่องซักผ้า">เครื่องซักผ้า</option>
                        <option value="เฟอร์นิเจอร์">เฟอร์นิเจอร์</option>
                        <option value="เครื่องใช้ไฟฟ้า">เครื่องใช้ไฟฟ้า</option>
                        <option value="กล่อง/พัสดุ">กล่อง/พัสดุ</option>
                        <option value="มอเตอร์ไซค์">มอเตอร์ไซค์</option>
                        <option value="รถยนต์">รถยนต์</option>
                        <option value="อื่นๆ">อื่นๆ</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>จำนวน (ชิ้น) <span class="required">*</span></label>
                    <input type="number" name="quantity" min="1" value="1" required>
                </div>
            </div>
            
            <div class="form-grid">
                <div class="form-group">
                    <label>กว้าง (ซม.)</label>
                    <input type="number" name="width" min="0" placeholder="0">
                </div>
                <div class="form-group">
                    <label>ยาว (ซม.)</label>
                    <input type="number" name="length" min="0" placeholder="0">
                </div>
            </div>
            
            <div class="form-grid">
                <div class="form-group">
                    <label>สูง (ซม.)</label>
                    <input type="number" name="height" min="0" placeholder="0">
                </div>
                <div class="form-group">
                    <label>น้ำหนัก (กก.) <span class="required">*</span></label>
                    <input type="number" name="weight" min="0" step="0.1" placeholder="0" required>
                </div>
            </div>
            
            <!-- อัพโหลดรูปภาพ -->
            <div class="form-section-title">📷 รูปสินค้า (ถ้ามี)</div>
            <div class="form-group full-width">
                <div class="file-upload">
                    <input type="file" name="product_images[]" multiple accept="image/*">
                    <div class="upload-icon">📤</div>
                    <p>คลิกหรือลากรูปมาวางที่นี่</p>
                    <small>รองรับ JPG, PNG, WEBP (สูงสุด 5 รูป, รูปละไม่เกิน 5MB)</small>
                </div>
            </div>
            
            <!-- หมายเหตุ -->
            <div class="form-group full-width">
                <label>หมายเหตุ</label>
                <textarea name="notes" rows="3" placeholder="รายละเอียดเพิ่มเติม เช่น ต้องการส่งด่วน, สินค้าแตกหักง่าย, ฯลฯ"></textarea>
            </div>
            
            <button type="submit" class="submit-btn">🚀 ส่งขอเช็คจัดส่ง</button>
        </form>
    </div>
</section>

<!-- ============================================
     ส่วนที่ 3: ประเภท vehicle
     ============================================ -->
<section class="vehicles-section">
    <div class="vehicles-container">
        <h2> ยานพาหนะของเรา</h2>
        <div class="vehicles-grid">
            <div class="vehicle-card">
                <div class="vehicle-icon">🚛</div>
                <h3>6 ล้อ</h3>
            </div>
            <div class="vehicle-card">
                <div class="vehicle-icon">🛻</div>
                <h3>กระบะคอก</h3>
            </div>
            <div class="vehicle-card">
                <div class="vehicle-icon">🚚</div>
                <h3>กระบะตู้ทึบ</h3>
            </div>
            <div class="vehicle-card">
                <div class="vehicle-icon">🚗</div>
                <h3>รถเก๋ง</h3>
            </div>
        </div>
    </div>
</section>

<!-- ============================================
     ส่วนที่ 4: จุดเด่นบริการ
     ============================================ -->
<section class="features-section">
    <div class="features-container">
        <h2>ทำไมต้องเลือก NPX78?</h2>
        <div class="features-grid">
            <div class="feature-card">
                <div class="feature-icon">🚀</div>
                <h3>รวดเร็ว</h3>
                <p>จัดส่งภายใน 24-48 ชั่วโมง ครอบคลุมทุกพื้นที่ทั่วไทย</p>
            </div>
            <div class="feature-card">
                <div class="feature-icon">🛡️</div>
                <h3>ปลอดภัย</h3>
                <p>สินค้าได้รับการดูแลอย่างดี มีประกันความเสียหาย</p>
            </div>
            <div class="feature-card">
                <div class="feature-icon">💰</div>
                <h3>ราคาถูก</h3>
                <p>ราคายุติธรรม ไม่มีค่าใช้จ่ายแอบแฝง</p>
            </div>
            <div class="feature-card">
                <div class="feature-icon">🗺️</div>
                <h3>ครอบคลุม</h3>
                <p>ให้บริการ 77 จังหวัด 928 อำเภอ 7,452 ตำบล</p>
            </div>
            <div class="feature-card">
                <div class="feature-icon">📞</div>
                <h3>บริการ 24/7</h3>
                <p>ทีมงานพร้อมให้บริการตลอด 24 ชั่วโมง</p>
            </div>
            <div class="feature-card">
                <div class="feature-icon">⭐</div>
                <h3>มืออาชีพ</h3>
                <p>ทีมงานมีประสบการณ์ ดูแลสินค้าเหมือนของตัวเอง</p>
            </div>
        </div>
    </div>
</section>

<?php get_footer(); ?>