﻿:root {
    --c-orange: #ff4700;
    --c-orange-dark: #ee5d00;
    --c-brand: #f47d23;
    --c-green-light: #4CAF50;
    --c-green-dark: #1B5E20;
    --c-green-deep: #2e7d32;
    --c-green-mint: #e8f5e9;
    --c-text: #2a2a2a;
    --c-text-soft: #555;
    --c-line: #cfcfcf;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.1);
    --radius-pill: 50px;
}

/* ===== SHARED PATTERNS ===== */
/* การ์ดขาวกลม (ใช้ใน strengths_2, results, compare) */
.bg_light {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
}
/* intro paragraph กึ่งกลาง */
.results-actual-intro,
.faq-intro {
    color: var(--c-text-soft);
    font-size: 15px;
    line-height: 1.7;
    margin-left: auto;
    margin-right: auto;
}

.results-actual-intro {
    max-width: 760px;
}

.faq-intro {
    max-width: 820px;
}
/* description text 14px / 1.6 (card body) */
.basic-work-item p,
.result-card-text p {
    color: var(--c-text-soft);
    font-size: 14px;
    line-height: 1.6;
}
/* card title (h4) — สีเข้ม */
.basic-work-item h4,
.result-card-text h4 {
    color: var(--c-text);
}

.basic-work-item h4 {
    font-size: 17px;
}

.result-card-text h4 {
    font-size: 18px;
}
/* Override Bootstrap's .font-weight-bold (700) → 600 ทั่วหน้า */
.font-weight-bold {
    font-weight: 600 !important;
}

/* ===== HERO ===== */
.hero-pos {
    overflow: hidden;
}

    .hero-pos > img {
        display: block;
    }

    .hero-pos .hero-content {
        top: 0;
        left: 0;
        padding: 4% 6%;
    }

    .hero-pos h1 {
        line-height: 1.25;
        margin: 0 0 2.2% 0;
        font-size: clamp(24px, 3.4vw, 48px);
        max-width: 55%;
    }

    .hero-pos .sub_title {
        font-weight: 600;
        margin: 0 0 1.2% 0;
        font-size: clamp(16px, 1.8vw, 24px);
        max-width: 55%;
    }

    .hero-pos .sub_detail {
        margin: 0 0 2.5% 0;
        font-size: clamp(14px, 1.35vw, 18px);
        line-height: 1.6;
        max-width: 45%;
    }

    .hero-pos .hero_btn {
        gap: 12px;
    }

    /* ปุ่มเขียว gradient + ขอบขาว (ใช้ใน hero และ demo-cta) */
    .hero-pos .btn-success,
    .demo-cta .btn-success {
        background: linear-gradient(135deg, var(--c-green-light) 0%, var(--c-green-dark) 100%);
        border: 1px solid #fff;
        color: #fff;
    }

        .hero-pos .btn-success:hover,
        .hero-pos .btn-success:focus,
        .demo-cta .btn-success:hover,
        .demo-cta .btn-success:focus {
            background: linear-gradient(135deg, #43A047 0%, #145018 100%);
            border-color: #fff;
            color: #fff;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

    /* ปุ่มขวา: โปร่งใส border ขาว */
    .hero-pos .btn-default-transparent {
        color: #fff;
        border-color: #fff;
        background-color: transparent;
    }

        .hero-pos .btn-default-transparent:hover,
        .hero-pos .btn-default-transparent:focus {
            color: #1f9d55;
            background-color: #fff;
            border-color: #fff;
        }

/* ===== MARQUEE ===== */
.marquee {
    overflow: hidden;
    background: #f6f6f6;
}

.marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: marquee-scroll 45s linear infinite;
    will-change: transform;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee .mi {
    color: #050908;
    font-weight: 500;
    padding: 0 18px;
    white-space: nowrap;
    font-size: 15px;
}

.marquee .mi-sep {
    color: #c4c4c4;
    padding: 0 2px;
    font-size: 10px;
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Smooth scroll + offset ใต้ header + pos-nav */
html {
    scroll-behavior: smooth;
}

#strengths_2,
#basic_work,
#results-actual,
#compare,
#faq {
    scroll-margin-top: 140px;
}

/* ===== SECTION NAV ===== */
.pos-nav {
    position: sticky;
    top: 60px; /* ใต้เมนูหลักของ MasterPage */
    z-index: 100;
    background: transparent;
    padding: 16px 24px;
}

.pos-nav-inner {
    background: #fff;
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.pos-nav-item {
    color: var(--c-text);
    padding: 4px 18px;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

    .pos-nav-item:hover,
    .pos-nav-item:focus,
    .pos-nav-item.active {
        color: var(--c-brand);
        text-decoration: none;
    }

.pos-nav-sep {
    color: var(--c-line);
    font-weight: 300;
    user-select: none;
    font-size: 16px;
}

/* ===== BPLUS POS SECTIONS ===== */
.bplus_pos span {
    color: var(--c-orange);
}

/* ===== STRENGTHS_2 ===== */
#strengths_2 .bg_light {
    overflow: hidden;
}

.strengths-2-text h3 {
    font-weight: 600;
    color: var(--c-text);
    font-size: clamp(20px, 2.2vw, 30px);
    line-height: 1.35;
}

.strengths-2-text > p {
    color: var(--c-text-soft);
    font-size: 15px;
    line-height: 1.7;
}

.strengths-2-subtitle {
    font-weight: 600;
    color: var(--c-text);
    font-size: 18px;
}

.strengths-2-list li {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
    color: #444;
}

    .strengths-2-list li i {
        flex: 0 0 28px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: var(--c-green-mint);
        color: var(--c-green-deep);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        margin-right: 12px;
    }

.strengths-2-image {
    padding: 0;
    display: flex;
    align-items: center;
}

    .strengths-2-image img {
        width: 100%;
        height: auto;
        display: block;
    }

/* ===== BASIC_WORK ===== */
#basic_work .basic-work-images {
    display: grid;
    padding-left: 0;
    padding-right: 0;
}

#basic_work .basic-work-img {
    grid-column: 1;
    grid-row: 1;
    opacity: 0;
    z-index: 1;
    border-radius: 16px;
    /* รูปเก่าค้างก่อน แล้วค่อย fade ออก (delay 0.4s) — รูปใหม่ขึ้นมาทับก่อน */
    transition: opacity 0.6s ease 0.4s;
    pointer-events: none;
}

    #basic_work .basic-work-img.active {
        opacity: 1;
        z-index: 2;
        /* รูปใหม่ fade in ทันที ไม่มี delay */
        transition: opacity 0.6s ease 0s;
        pointer-events: auto;
    }

.basic-work-item {
    cursor: pointer;
    border-left: 4px solid transparent;
    border-radius: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    .basic-work-item h4 {
        font-weight: 600;
    }

    .basic-work-item.active {
        background: var(--c-orange-dark);
        border-left-color: var(--c-orange-dark);
    }

        .basic-work-item.active h4,
        .basic-work-item.active p {
            color: #fff;
        }

/* ===== RESULTS ACTUAL ===== */
.result-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-card-text {
    flex: 1 1 auto;
}

.result-card-img {
    display: block;
    height: auto;
    margin-top: auto;
}

/* ===== COMPARE TABLE ===== */
.compare-section {
    background: #fdf0e3;
}

.compare-table {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 0 3px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}

.compare-side,
.compare-main {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.compare-side,
.compare-rows {
    display: grid;
    grid-template-rows: repeat(8, 56px);
}

.compare-side {
    margin-top: 110px;
}

.compare-main {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.compare-logo {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

    .compare-logo img {
        max-width: 220px;
        max-height: 70px;
        height: auto;
        width: auto;
        border-radius: 12px;
    }

.compare-cell {
    padding: 0 24px;
    font-size: 15px;
    color: var(--c-text);
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.compare-side .compare-cell:first-child,
.compare-rows .compare-cell:first-child {
    border-top: none;
}

.compare-main .compare-cell {
    justify-content: center;
    text-align: center;
}

.compare-topics .compare-cell {
    font-weight: 600;
}

/* ===== FAQ ===== */
#faq h2 {
    font-weight: 600;
    color: #000;
    font-size: clamp(22px, 2.4vw, 32px);
}

    #faq h2 span {
        color: var(--c-orange);
    }

#faq .faq-summary span {
    color: #000;
}

.faq-item {
    background: #f2f2f2;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background 0.2s ease;
}

    .faq-item[open] {
        background: #ececec;
    }

.faq-summary {
    cursor: pointer;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    color: #000;
    font-size: 15px;
    text-align: left;
    list-style: none;
}

    .faq-summary::-webkit-details-marker {
        display: none;
    }

    .faq-summary::marker {
        display: none;
    }

.faq-toggle {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 16px;
    font-size: 0;
}

    .faq-toggle::before,
    .faq-toggle::after {
        content: "";
        position: absolute;
        background: var(--c-orange-dark);
    }

    .faq-toggle::before { /* แนวนอน (เป็นทั้ง + และ −) */
        top: 50%;
        left: 0;
        right: 0;
        height: 3px;
        margin-top: -1.5px;
    }

    .faq-toggle::after { /* แนวตั้ง (โผล่เฉพาะตอนปิด → เป็น +) */
        left: 50%;
        top: 0;
        bottom: 0;
        width: 3px;
        margin-left: -1.5px;
        transition: opacity 0.2s ease;
    }

.faq-item[open] .faq-toggle::after {
    opacity: 0;
}

.faq-answer {
    padding: 0 24px 18px;
    color: #000;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
    text-align: left;
}

/* ===== DEMO CTA — แบนเนอร์ส้ม ===== */
.demo-cta {
    background: linear-gradient(135deg, #ff7a2a 0%, #ee5d00 60%, #d44d00 100%);
}

    .demo-cta h3 {
        font-size: clamp(22px, 2.4vw, 32px);
        line-height: 1.3;
    }

    .demo-cta p {
        font-size: 15px;
        line-height: 1.6;
        opacity: 0.95;
    }

/* ===== MEDIA QUERIES (grouped by breakpoint) ===== */

/* Tablet + Mobile + xs (≤991) */
@media (max-width: 991.98px) {
    .hero-pos .hero-content {
        padding: 6% 6% 8% 6%;
        justify-content: flex-end !important;
    }

    .hero-pos h1,
    .hero-pos .sub_title,
    .hero-pos .sub_detail {
        max-width: 100%;
    }

    /* Tablet ลงไป — เมนูหลักไม่ fix → pos-nav ตรึงที่ขอบบน */
    .pos-nav {
        top: 0;
    }

    .pos-nav-item {
        font-size: 15px;
        padding: 4px 14px;
    }

    #strengths_2,
    #basic_work,
    #results-actual,
    #compare,
    #faq {
        scroll-margin-top: 70px;
    }

    /* Compare: ซ่อน topics ฝั่งซ้าย */
    .compare-table {
        grid-template-columns: 1.1fr 1fr;
    }

    .compare-topics {
        display: none;
    }
}

/* Tablet only (768-991) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-pos h1 {
        font-size: clamp(28px, 4vw, 38px);
    }

    .hero-pos .sub_title {
        font-size: clamp(17px, 2.4vw, 22px);
    }

    .hero-pos .sub_detail {
        font-size: clamp(15px, 1.9vw, 17px);
    }

    .hero-pos .btn-lg {
        padding: 0.55rem 1.3rem;
        font-size: 1rem;
    }
}

/* Mobile + xs (≤767) */
@media (max-width: 767.98px) {
    .marquee .mi {
        font-size: 13px;
        padding: 0 12px;
    }

    .pos-nav {
        display: none;
    }

    .strengths-2-list li {
        font-size: 13px;
    }

    /* Compare: ซ่อน Others เหลือเฉพาะ Bplus กลาง */
    .compare-table {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .compare-others {
        display: none;
    }

    .compare-cell {
        font-size: 14px;
        padding: 0 16px;
    }

    .compare-side,
    .compare-rows {
        grid-template-rows: repeat(8, 52px);
    }

    .compare-side {
        margin-top: 90px;
    }

    .compare-logo {
        height: 90px;
    }
}

/* Mobile only (481-767) */
@media (min-width: 481px) and (max-width: 767.98px) {
    .hero-pos h1 {
        font-size: clamp(22px, 5vw, 28px);
    }

    .hero-pos .sub_title {
        font-size: clamp(15px, 3.4vw, 18px);
    }

    .hero-pos .sub_detail {
        font-size: clamp(13px, 2.8vw, 15px);
    }

    .hero-pos .btn-lg {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* xs only (≤480) */
@media (max-width: 480px) {
    .hero-pos .hero-content {
        padding: 5% 5% 6% 5%;
    }

    .hero-pos h1 {
        font-size: clamp(18px, 5.2vw, 24px);
        margin-bottom: 8px;
    }

    .hero-pos .sub_title {
        font-size: clamp(13px, 3.4vw, 16px);
        margin-bottom: 6px;
    }

    .hero-pos .sub_detail {
        font-size: clamp(11px, 3vw, 13px);
        line-height: 1.5;
        margin-bottom: 12px;
    }

    .hero-pos .hero_btn {
        gap: 8px;
        width: 100%;
    }

    .hero-pos .btn-lg {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }

    .hero-pos .btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}
