/* =========================================
   0. Hero Section (กล่องสำหรับใส่รูปแบนเนอร์)
   ========================================= */
.hero-section {
    width: 100%;
    height: 60vh; 
    background-color: #ffffff; 
    background-image: url('../image/HDnew.png'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    padding-top: 150px; 
}

@media (max-width: 768px) {
    .hero-section { 
        background-image: url('../image/HDnewM.png'); 
        height: 65vw; 
        min-height: 250px; 
        background-size: cover; 
        background-position: center;
        margin-top: 100px; 
        padding-top: 0; 
        width: calc(100% - 30px);
        margin-left: auto;
        margin-right: auto;
        border-radius: 20px;
    }
}

/* =========================================
   1. Download Section
   ========================================= */
.download-section {
    background-color: #f8fbfd;
    padding: 100px 5%;
    text-align: center;
    position: relative;
    z-index: 10;
}
.section-title { color: #4a4a4a; font-size: 32px; font-weight: 600; margin-bottom: 50px; line-height: 1.4; }
.cards-container { display: flex; justify-content: center; align-items: center; gap: 30px; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; perspective: 1000px; }
.dl-card { background-color: #ffffff; border-radius: 15px; padding: 40px 30px; width: 280px; text-decoration: none; border: 1px solid rgba(0, 0, 0, 0.05); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); display: flex; flex-direction: column; align-items: center; position: relative; transition: box-shadow 0.3s ease, background-color 0.3s ease; transform-style: preserve-3d; }
.dl-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background-color: transparent; transition: background-color 0.3s ease; border-top-left-radius: 15px; border-top-right-radius: 15px; }
.dl-card:hover { box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15); z-index: 10; }
.card-blue:hover::before { background-color: #0056b3; } .card-blue:hover .get-started { color: #0056b3; } .card-blue:hover .icon-arrow { background-color: #0056b3; }
.card-red:hover::before { background-color: #ef443b; } .card-red:hover .get-started { color: #ef443b; } .card-red:hover .icon-arrow { background-color: #ef443b; }
.card-yellow:hover::before { background-color: #f5a623; } .card-yellow:hover .get-started { color: #f5a623; } .card-yellow:hover .icon-arrow { background-color: #f5a623; }
.dl-card img, .dl-card h3, .dl-card .get-started { pointer-events: none; }
.dl-card img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 25px; }
.dl-card h3 { font-size: 20px; font-weight: 600; color: #2c3e50; margin-bottom: 25px; }
.get-started { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: #a0aec0; letter-spacing: 1px; transition: color 0.3s; }
.icon-arrow { display: flex; justify-content: center; align-items: center; width: 24px; height: 24px; border-radius: 50%; background-color: #e2e8f0; color: #ffffff; font-size: 12px; transition: background-color 0.3s; }
.dl-card:hover .get-started { color: #f5a623; } .dl-card:hover .icon-arrow { background-color: #f5a623; }

/* =========================================
   🚀 2. Manual Slider Base (3D Card Stack)
   ========================================= */
.manual-slider-section {
    padding: 100px 5%;
    text-align: center;
    position: relative;
}

.theme-badge {
    display: inline-block; padding: 6px 18px; background-color: #f5a623; color: #fff;
    border-radius: 30px; font-size: 14px; font-weight: 700; letter-spacing: 2px;
    margin-bottom: 20px; box-shadow: 0 4px 10px rgba(245, 166, 35, 0.3);
}

.manual-title {
    font-size: 38px; font-weight: 700; margin-bottom: 50px; position: relative; display: inline-block;
}
.manual-title::after {
    content: ''; position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 4px; border-radius: 2px;
}

.slider-wrapper {
    position: relative;
    max-width: 1200px; 
    margin: 0 auto;
    border-radius: 16px;
    background: transparent; 
}

.slider-track-container {
    width: 100%;
    overflow: visible; 
}

.slider-track {
    position: relative;
    width: 100%;
    height: 800px; 
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px; 
}

/* 🖼️ ปรับแต่งแท็ก Picture สำหรับใช้งานใน Slider */
picture.slide-img {
    position: absolute;
    width: 95%; 
    max-width: 1000px; 
    height: 100%;
    max-height: 650px; 
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
    cursor: pointer;
    user-select: none;
    display: block;
}

picture.slide-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: -15px 10px 40px rgba(0,0,0,0.15);
    border: 1px solid #eaeaea;
    display: block;
}

.slide-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(17, 17, 17, 0.8); color: white; border: none;
    width: 55px; height: 55px; border-radius: 50%; font-size: 24px; cursor: pointer; z-index: 99;
    display: flex; justify-content: center; align-items: center; transition: all 0.3s;
    opacity: 0.3; /* ทำให้ลูกศรโปร่งแสงจางๆ */
}
.slide-btn.prev { left: 20px; } 
.slide-btn.next { right: 20px; }
.slide-btn:hover { background: #f5a623; transform: translateY(-50%) scale(1.1); opacity: 1; /* สว่างเต็มที่เมื่อเมาส์ชี้ */ }

/* 🖼️ Modal สำหรับดูรูปเต็มจอ (Lightbox) */
.image-modal {
    display: none; position: fixed; z-index: 99999; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(10px); justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.image-modal.show { opacity: 1; display: flex; }
.modal-content { max-width: 90%; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); object-fit: contain; }
.close-modal-btn {
    position: absolute; top: 20px; right: 40px; color: #ffffff; font-size: 50px;
    font-weight: 300; cursor: pointer; transition: color 0.3s;
}
.close-modal-btn:hover { color: #f5a623; }

/* =========================================
   🎨 3. THEME STYLES (รูปภาพพื้นหลัง + ฟิล์ม Overlay)
   ========================================= */

/* --- THEME 1: Cloud my --- */
.theme-cloudmy { 
    background-image: url('../image/BG2.jpg'); 
    background-size: cover;
    background-position: center;
    position: relative;
}
.theme-cloudmy::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.5); z-index: 0; 
}
.theme-cloudmy > * { position: relative; z-index: 1; }

.theme-cloudmy .manual-title { color: #111111; }
.theme-cloudmy .manual-title::after { background-color: #f5a623; }

/* --- THEME 2: Cloud PBX (โซนดาร์กโหมด) --- */
.theme-pbx {
    background-image: url('../image/BG4.jpg'); 
    background-size: cover;
    background-position: center;
    position: relative;
}
.theme-pbx::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.75); z-index: 0; 
}
.theme-pbx > * { position: relative; z-index: 1; }

.theme-pbx .badge-blue { background-color: #00a3e0; box-shadow: 0 4px 10px rgba(0, 163, 224, 0.3); }
.theme-pbx .manual-title { color: #ffffff; }
.theme-pbx .manual-title::after { background-color: #00a3e0; }
.theme-pbx .slide-btn { 
    background: #00a3e0; color: #ffffff; box-shadow: 0 4px 15px rgba(0, 163, 224, 0.4); 
    border: 2px solid #ffffff; backdrop-filter: none; opacity: 0.3; /* ทำให้ลูกศรโปร่งแสงจางๆ */
}
.theme-pbx .slide-btn:hover { 
    background: #f5a623; border-color: #f5a623; opacity: 1; /* สว่างเต็มที่เมื่อเมาส์ชี้ */
    box-shadow: 0 4px 20px rgba(245, 166, 35, 0.6); transform: translateY(-50%) scale(1.15); 
}

/* Accordion Hunt Group (ซ้อนใน Theme PBX) */
.theme-pbx .accordion-wrapper {
    max-width: 1200px; 
    margin: 50px auto 0; border-radius: 12px; overflow: hidden;
    background: #1f2937; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.theme-pbx .accordion-header {
    background: #1f2937; color: #ffffff; padding: 20px 30px; font-size: 22px; font-weight: 600;
    width: 100%; text-align: left; border: none; cursor: pointer; display: flex; 
    justify-content: space-between; align-items: center; transition: background 0.3s; 
    font-family: 'Prompt', sans-serif; outline: none;
}
.theme-pbx .accordion-header:hover, .theme-pbx .accordion-header.active { background-color: #00a3e0; }
.arrow-icon { font-size: 18px; transition: transform 0.3s ease; }
.accordion-header.active .arrow-icon { transform: rotate(180deg); }
.theme-pbx .accordion-content { max-height: 0; overflow: visible; transition: max-height 0.4s ease-out; background-color: #111827; }

/* --- THEME 3: FAX2Email --- */
.theme-fax { 
    background-image: url('../image/BG1.jpg'); 
    background-size: cover;
    background-position: center;
    position: relative;
}
.theme-fax::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(248, 251, 253, 0.7); z-index: 0; 
}
.theme-fax > * { position: relative; z-index: 1; }

.theme-fax .badge-dark { background-color: #2d3748; box-shadow: 0 4px 10px rgba(45, 55, 72, 0.3); }
.theme-fax .manual-title { color: #1a202c; }
.theme-fax .manual-title::after { background-color: #718096; }

/* =========================================
   4. Support & FAQ Section (ธีมโค้งเหลือง + การ์ดมินิมอลคลีนๆ)
   ========================================= */
.support-faq-section {
    position: relative; padding: 80px 5% 120px; text-align: center;
    background-color: #fafbfc; z-index: 1;
}
.support-faq-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 65%; 
    background-color: #f5a623; border-bottom-left-radius: 50% 60px; border-bottom-right-radius: 50% 60px; z-index: -1;
}
.support-faq-section .section-title { color: #ffffff; font-size: 36px; font-weight: 700; margin-bottom: 50px; }
.support-cards-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; max-width: 900px; margin: 0 auto; }

.support-card {
    background: #fffdf8; border-radius: 12px; padding: 40px 30px; width: 100%; max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); display: flex; flex-direction: column;
    align-items: center; position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.support-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12); }
.support-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
    border-top-left-radius: 12px; border-top-right-radius: 12px;
}
.card-blue-accent::before { background-color: #00a3e0; }
.card-orange-accent::before { background-color: #ff5722; }

.support-icon { margin-bottom: 20px; }
.support-icon img { width: 60px; height: 60px; object-fit: contain; }
.support-block { width: 100%; display: flex; flex-direction: column; align-items: center; }

.balance-text { font-size: 18px; color: #444; font-weight: 500; line-height: 1.6; margin-bottom: 20px; }
.support-btn-group { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.btn-support { border-radius: 8px; font-size: 18px; font-weight: 600; text-decoration: none; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; }
.btn-light-blue { background: #e0f2fe; color: #00a3e0; border: 1px solid #bae6fd; width: 100%; }
.btn-light-blue:hover { background: #bae6fd; }
.btn-solid-blue { background: #00a3e0; color: #ffffff; border: none; padding: 10px 35px; box-shadow: 0 4px 10px rgba(0, 163, 224, 0.3); }
.btn-solid-blue:hover { background: #008cc0; transform: translateY(-2px); }

.contact-title { font-size: 16px; color: #111; font-weight: 700; margin-bottom: 20px; line-height: 1.5; }
.contact-desc { color: #555; font-size: 18px; line-height: 1.8; margin-bottom: 20px; }
.call-center-box { background: #ffedd5; color: #ea580c; padding: 12px 25px; border-radius: 8px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }

/* =========================================
   5. NT Contact Center Section
   ========================================= */
.contact-center-section { background-color: #fafbfc; padding: 100px 5%; text-align: center; position: relative; border-top: 1px solid #f0f0f0; }
.cc-container { max-width: 900px; margin: 0 auto; position: relative; }
.cc-title { font-size: 42px; font-weight: 800; color: #1a202c; margin-bottom: 40px; }
.cc-phone-box {
    display: inline-flex; align-items: center; justify-content: center; background: #ffffff;
    padding: 15px 40px; border-radius: 4px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); margin-bottom: 50px; position: relative; border: 1px solid #f0f0f0;
}
.cc-phone-box::before { content: ''; position: absolute; left: -70px; top: 50%; transform: translateY(-50%); width: 50px; height: 2px; background-color: #1e3a8a; }
.phone-icon { width: 45px; margin-right: 15px; object-fit: contain; }
.phone-number { font-size: 46px; font-weight: 800; color: #f26522; letter-spacing: 1px; }

.cc-text-carousel { position: relative; min-height: 160px; margin-bottom: 50px; }
.cc-text-item { position: absolute; top: 0; left: 0; width: 100%; font-size: 18px; font-style: italic; color: #64748b; line-height: 1.8; }
.lang-th { animation: fadeTh 16s infinite; }
.lang-en { animation: fadeEn 16s infinite; opacity: 0; } 
@keyframes fadeTh { 0%, 45% { opacity: 1; visibility: visible; } 50%, 95% { opacity: 0; visibility: hidden; } 100% { opacity: 1; visibility: visible; } }
@keyframes fadeEn { 0%, 45% { opacity: 0; visibility: hidden; } 50%, 95% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }

.cc-footer { display: flex; align-items: center; justify-content: center; gap: 20px; }
.agent-img { width: 85px; height: 85px; border-radius: 50%; object-fit: cover; }
.cc-footer-info { text-align: left; }
.cc-email { display: block; font-size: 20px; font-weight: 800; color: #f26522; text-decoration: none; margin-bottom: 5px; transition: color 0.3s; }
.cc-email:hover { color: #1a202c; }
.cc-fax { font-size: 22px; font-weight: 800; color: #64748b; }

/* =========================================
   ระบบสลับสไลเดอร์ คอมพิวเตอร์ vs มือถือ
   ========================================= */

/* ซ่อนสไลเดอร์มือถือเมื่อเปิดบนจอคอม */
.mobile-only { 
    display: none !important; 
}

@media (max-width: 768px) {
    /* 📱 ให้มือถือแสดงสไลด์ชุดเดียวกับคอม (ครบทุกรูป) */
    .desktop-only { 
        display: block !important; 
    }
    
    /* ซ่อนสไลเดอร์ชุดมือถือที่มีรูปไม่ครบ */
    .mobile-only { 
        display: none !important; 
    }
}

/* =========================================
   📱 MOBILE OPTIMIZATION
   ========================================= */
@media (max-width: 768px) {
    /* 🚀 1. ปรับความสูงสไลเดอร์ให้พอดี ไม่ยาวเกินไป */
    .slider-track { height: 65vh; min-height: 400px; } 
    picture.slide-img { width: 85%; height: 60vh; min-height: 380px; } 
    picture.slide-img img { width: 100%; height: 100%; object-fit: contain; } 
    
    /* 2. ย่อขนาดปุ่มลูกศร และขยับให้ชิดขอบสุดๆ จะได้ไม่บังรูป */
    .slide-btn { width: 40px; height: 40px; font-size: 18px; }
    .slide-btn.prev { left: 2px; } 
    .slide-btn.next { right: 2px; } 
    .close-modal-btn { right: 15px; top: 10px; font-size: 40px;}
    
    /* ตัดขอบภาพสไลด์ที่ซ้อนล้นจอออกไป */
    .slider-wrapper { overflow: hidden !important; }
    .slider-track-container { overflow: hidden !important; width: 100%; }

    /* แก้ปัญหารูปทับข้อความ */
    .cc-container { display: flex; flex-direction: column; }
    .cc-text-carousel { min-height: 380px; margin-bottom: 30px; position: relative; z-index: 2; }
    .cc-footer { position: relative; display: flex; justify-content: center; margin-top: 10px; }
    .agent-img { width: 100px; height: 100px; }
}

@media (max-width: 480px) {
    /* สำหรับมือถือจอแคบมากๆ ปรับให้กระชับขึ้นอีก */
    .slider-track { height: 60vh; min-height: 400px; } 
    picture.slide-img { height: 55vh; min-height: 380px; width: 90%;}
    .cc-text-carousel { min-height: 450px; }
}
