/* ============================================================
   a_style_fix.css — Bug fixes จากการ review PDF
   โหลดหลังสุด ใน a_header.php ต่อจาก a_style_new.css
   ============================================================ */

/* ----------------------------------------------------------
   FIX 1: LOGO DUPLICATE — dark+light ซ้อนกัน
   แก้ให้ light version hidden เสมอ จนกว่า sticky-active
---------------------------------------------------------- */
.hd-logo-dark  { display: inline-flex !important; }
.hd-logo-light { display: none !important; }
.sticky-active .hd-logo-dark  { display: none !important; }
.sticky-active .hd-logo-light { display: inline-flex !important; }

/* ป้องกัน logo ซ้อนทับเมื่อ theme มี img อยู่แล้ว */
.header-logo .hd-logo-link { line-height: 0; }
.mobile-logo .hd-logo-link  { line-height: 0; }

/* ----------------------------------------------------------
   FIX 2: STATS BAR — กล่องดำทึบ ไม่มีตัวเลข
   เดิม margin-top ลบเข้าไปใต้ hero ทำให้ถูก hero บัง
---------------------------------------------------------- */
.hd-stats-section {
    position: relative;
    z-index: 10;
    padding: 0 0 60px !important;
    margin: 0 !important;
}
.hd-stats-inner {
    background: #fff !important;
    border-radius: 16px !important;
    border: 1px solid #f0f0f0 !important;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08) !important;
    margin: 30px 0 0 !important;
    padding: 36px 30px !important;
}
.hd-stat-number {
    font-family: 'Kanit', sans-serif !important;
    font-size: clamp(28px,3.5vw,44px) !important;
    font-weight: 700 !important;
    color: #111 !important;
    display: block;
    line-height: 1 !important;
}
.hd-stat-plus {
    font-family: 'Kanit', sans-serif !important;
    font-size: 26px !important;
    color: #FC3737 !important;
    font-weight: 700 !important;
    display: inline-block;
}
.hd-stat-label {
    font-family: 'Sarabun', sans-serif !important;
    font-size: 13px !important;
    color: #888 !important;
    margin-top: 6px !important;
}
.hd-stat-icon { color: #FC3737 !important; font-size: 22px !important; margin-bottom: 8px; }
.hd-stat-divider { width: 1px; height: 60px; background: #eee; flex-shrink: 0; }
@media (max-width: 768px) { .hd-stat-divider { display: none; } }

/* ----------------------------------------------------------
   FIX 3: SERVICE CARDS — icon วงกลมแดงทึบขนาดใหญ่
   theme ใช้ .service-grid_icon ทับ
---------------------------------------------------------- */
.service-grid .service-grid_icon {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    background: rgba(252,55,55,0.1) !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 16px !important;
    border: none !important;
}
.service-grid .service-grid_icon i {
    font-size: 26px !important;
    color: #FC3737 !important;
    line-height: 1 !important;
}
/* ยกเลิก ::before ::after ที่ theme อาจสร้าง circle */
.service-grid .service-grid_icon::before,
.service-grid .service-grid_icon::after { display: none !important; }

/* ----------------------------------------------------------
   FIX 4: ABOUT — รูปด้านซ้ายหาย / img-box4 ว่าง
---------------------------------------------------------- */
.img-box4 {
    position: relative;
    min-height: 380px;
    background: linear-gradient(135deg, #f5f5f5, #ebebeb);
    border-radius: 20px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hd-about-main-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 20px;
    display: block;
}
/* Placeholder สวยถ้าไม่มีรูป */
.img-box4:not(:has(img[src])) {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a0a0a 100%);
}
.img-box4::before {
    content: '\f233';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    font-size: 80px;
    color: rgba(252,55,55,0.15);
    pointer-events: none;
}

/* Float card ตำแหน่ง */
.hd-about-float-card {
    position: absolute !important;
    bottom: 20px !important;
    right: -16px !important;
    background: #fff !important;
    border-radius: 12px !important;
    padding: 12px 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    z-index: 5 !important;
    min-width: 170px;
}
@media (max-width: 991px) {
    .hd-about-float-card { right: 10px !important; }
}

/* ----------------------------------------------------------
   FIX 5: TECHSTACK — card พื้นดำทึบ ไม่มี icon สี
---------------------------------------------------------- */
.hd-tech-card {
    background: #fff !important;
    border: 1px solid #eee !important;
    border-radius: 12px !important;
    width: 100px !important;
    padding: 20px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.3s ease !important;
    cursor: default;
}
.hd-tech-card:hover {
    border-color: rgba(252,55,55,0.3) !important;
    box-shadow: 0 8px 24px rgba(252,55,55,0.1) !important;
    transform: translateY(-5px) !important;
}
.hd-tech-card span {
    font-size: 12px !important;
    color: #666 !important;
    font-family: 'Sarabun', sans-serif !important;
}
.hd-tech-icon { transition: transform 0.3s ease; }
.hd-tech-card:hover .hd-tech-icon { transform: scale(1.15); }
.hd-techstack-section { background: #f9f9f9 !important; }
.hd-tech-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 14px !important;
    margin-top: 40px !important;
}

/* ----------------------------------------------------------
   FIX 6: PRICING — ทุก card เป็น dark navy เหมือนกัน
   override theme price-card ให้ normal card = white
---------------------------------------------------------- */
.price-card {
    background: #fff !important;
    border: 1px solid #eee !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    position: relative;
}
.price-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.1) !important;
}
/* Featured card = dark */
.price-card.active {
    background: linear-gradient(135deg, #0f0f1a, #1a0a1a) !important;
    border-color: rgba(252,55,55,0.3) !important;
    box-shadow: 0 8px 32px rgba(252,55,55,0.2) !important;
}
.price-card.active .price-card_title,
.price-card.active .price-card_price,
.price-card.active .checklist ul li { color: #fff !important; }
.price-card.active .price-card_text { color: rgba(255,255,255,0.65) !important; }
.price-card.active .duration { color: rgba(255,255,255,0.5) !important; }
.price-card.active .checklist ul li i { color: #FC3737 !important; }
/* Normal card text */
.price-card:not(.active) .price-card_title { color: #111 !important; }
.price-card:not(.active) .price-card_text { color: #666 !important; }
.price-card:not(.active) .price-card_price { color: #111 !important; }

/* Badge แนะนำ */
.hd-price-badge {
    background: linear-gradient(90deg, #FC3737, #ff6b6b) !important;
    color: #fff !important;
    text-align: center !important;
    padding: 6px 10px !important;
    font-family: 'Kanit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}
.price-card_top { padding: 28px 24px 16px !important; }
.price-card_content { padding: 0 24px 24px !important; }

/* ----------------------------------------------------------
   FIX 7: PROCESS — step number ลอยออกนอก card
---------------------------------------------------------- */
.process-card {
    position: relative !important;
    overflow: visible !important;
    text-align: center !important;
    padding: 30px 20px 24px !important;
}
/* ซ่อน process-card_number ของ theme เดิม */
.process-card_number {
    display: none !important;
}
/* hd-process-step ที่เราสร้าง — ตรึงไว้บน card */
.hd-process-step {
    position: absolute !important;
    top: -14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    background: #FC3737 !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-family: 'Kanit', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    box-shadow: 0 4px 12px rgba(252,55,55,0.4) !important;
}
.hd-process-icon {
    font-size: 32px !important;
    color: #FC3737 !important;
    margin-bottom: 16px !important;
    position: relative !important;
    display: inline-flex !important;
}
.hd-process-icon-ring {
    position: absolute !important;
    inset: -8px !important;
    border: 2px dashed rgba(252,55,55,0.25) !important;
    border-radius: 50% !important;
    animation: hd-spin-slow 10s linear infinite !important;
}
.hd-process-tag {
    display: inline-block !important;
    background: rgba(252,55,55,0.08) !important;
    color: #FC3737 !important;
    border: 1px solid rgba(252,55,55,0.2) !important;
    padding: 3px 12px !important;
    border-radius: 50px !important;
    font-size: 12px !important;
    font-family: 'Sarabun', sans-serif !important;
    margin-top: 10px !important;
}
.hd-tag-success {
    background: rgba(34,197,94,0.08) !important;
    color: #16a34a !important;
    border-color: rgba(34,197,94,0.2) !important;
}
.process-card-wrap { margin-top: 20px; }

/* ----------------------------------------------------------
   FIX 8: TESTIMONIAL — avatar วงกลมแดงใหญ่
   .testi-grid_img ถูก theme กำหนด background แดง
---------------------------------------------------------- */
.testi-grid .testi-grid_img,
.hd-testi-avatar {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #f0f0f0 !important;
    border: none !important;
    position: relative;
    flex-shrink: 0 !important;
}
.testi-grid .testi-grid_img::before,
.testi-grid .testi-grid_img::after { display: none !important; }
.hd-testi-initials {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #FC3737, #ff6b6b) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    font-family: 'Kanit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    border-radius: 50% !important;
}
.hd-testi-profile {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    margin-top: 18px !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(0,0,0,0.06) !important;
}
.hd-star-row { color: #FBBF24 !important; font-size: 13px !important; display: flex; gap: 2px; margin-bottom: 12px; }
.hd-testi-card { border-radius: 16px !important; padding: 24px !important; }

/* ----------------------------------------------------------
   FIX 9: BLOG CARDS — รูป placeholder ไม่สวย
---------------------------------------------------------- */
.hd-blog-no-img {
    width: 100% !important;
    height: 100% !important;
    min-height: 200px !important;
    background: linear-gradient(135deg, #f0f0f0, #e5e5e5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 36px !important;
    color: #ccc !important;
}
.hd-blog-card-v2 { border-radius: 14px !important; }
.hd-blog-img-wrap { height: 200px !important; border-radius: 14px 14px 0 0 !important; overflow: hidden !important; display: block; }

/* ----------------------------------------------------------
   FIX 10: FAQ contact box สีดำเข้มเกิน
---------------------------------------------------------- */
.hd-faq-contact-box {
    background: linear-gradient(135deg, #111 0%, #1a0505 100%) !important;
    border: 1px solid rgba(252,55,55,0.2) !important;
    border-radius: 14px !important;
    padding: 22px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
}
.hd-faq-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    background: rgba(252,55,55,0.1) !important;
    color: #FC3737 !important;
    border-radius: 6px !important;
    font-family: 'Kanit', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-right: 10px !important;
    flex-shrink: 0 !important;
}
.accordion-button:not(.collapsed) .hd-faq-num {
    background: #FC3737 !important;
    color: #fff !important;
}

/* ----------------------------------------------------------
   FIX 11: CTA — ดูโล่ง ไม่มี background effect
---------------------------------------------------------- */
.hd-cta-wrap {
    border-radius: 20px !important;
    padding: 48px 40px !important;
    position: relative !important;
    overflow: hidden !important;
}
.hd-cta-badge {
    display: inline-flex !important;
    align-items: center !important;
    background: rgba(255,255,255,0.12) !important;
    color: rgba(255,255,255,0.9) !important;
    padding: 5px 14px !important;
    border-radius: 50px !important;
    font-size: 13px !important;
    margin-bottom: 16px !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
}
.hd-cta-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 14px !important;
    justify-content: flex-end !important;
}
.hd-chip {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.7) !important;
    padding: 4px 12px !important;
    border-radius: 50px !important;
    font-size: 12px !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    font-family: 'Sarabun', sans-serif !important;
}

/* ----------------------------------------------------------
   FIX 12: FOOTER LOGO — ยังเป็น text เดิม
   ถ้าไม่ได้ใช้ a_header_nav.php ใหม่ ให้ซ่อน text เดิม
   แล้ว inject SVG ผ่าน CSS + content trick
---------------------------------------------------------- */
.th-widget-about .about-logo h3 {
    font-family: 'Kanit', sans-serif !important;
    font-weight: 700 !important;
    color: #fff !important;
    font-size: 22px !important;
    margin: 0 !important;
}
/* ถ้า SVG logo ใน footer */
.th-widget-about .about-logo svg { display: block; }

/* ----------------------------------------------------------
   FIX 13: GENERAL — Floating buttons ซ้อนทับ scroll-top
---------------------------------------------------------- */
.hd-floating-contacts {
    bottom: 90px !important;
    right: 20px !important;
}
.scroll-top {
    z-index: 9990 !important;
}
.hd-floating-contacts {
    z-index: 9995 !important;
}

/* ----------------------------------------------------------
   ANIMATION KEYFRAMES (ถ้า a_animate.js โหลดไม่ครบ)
---------------------------------------------------------- */
@keyframes hd-spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes hd-float {
    0%   { transform: translateY(0px); }
    100% { transform: translateY(-14px); }
}
@keyframes hd-pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(252,55,55,0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(252,55,55,0); }
}
@keyframes hd-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
