/* =========================
   BASIC & RESET
========================= */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden; /* ล็อคไม่ให้ไถลออกขอบขวา */
    position: relative;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Prompt", "Noto Sans Thai", sans-serif;
    color: #1e293b;
    background: #ffffff;
    line-height: 1.7;
    font-size: 17px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

/* =========================
   VARIABLES
========================= */

:root {
    --blue-main: #3852a4;
    --blue-dark: #1e3272;
    --blue-light: #eff3fa;
    --gray-text: #475569;
    --gray-border: #e2e8f0;
    --white: #ffffff;
}



/* =========================
   HEADER & LOGO
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 2px solid var(--blue-light);
    box-shadow: 0 2px 10px rgba(56, 82, 164, 0.05);
}

.nav-container {
    min-height: 85px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px;
    text-decoration: none;
}

.logo-symbol {
    height: 62px !important;
    width: auto !important;
    object-fit: contain;
    /* 📌 คำสั่งสำคัญ: กลืนสีขาวของรูปภาพให้อยู่เนียนกับพื้นหลัง ไม่เป็นกรอบลอย */
    mix-blend-mode: multiply; 
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-th {
    font-family: "Prompt", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #1e3272;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.logo-en {
    font-family: "Prompt", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #3852a4;
    letter-spacing: 1.2px;
    margin-top: 2px;
}

@media (max-width: 600px) {
    .logo-symbol {
        height: 48px !important;
    }
    .logo-th { font-size: 16px; }
    .logo-en { font-size: 10px; letter-spacing: 0.8px; }
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 17px;
    font-weight: 600;
}

.nav a {
    position: relative;
    color: #334155;
    transition: 0.3s;
}

.nav a:hover {
    color: var(--blue-main);
}

.menu-toggle {
    display: none;
    border: 0;
    background: none;
    font-size: 30px;
    color: var(--blue-main);
    cursor: pointer;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.lang-switch:hover {
    opacity: 0.8;
}

.flag-icon {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


/* =========================
   HERO & BG SLIDER
========================= */

.hero {
    position: relative;
    min-height: 650px;
    display: flex;
    align-items: center;
    padding: 90px 0;
    overflow: hidden;
    background: none !important;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
}

.hero-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    opacity: 0.50;
    animation: changeBg 12s infinite ease-in-out;
}

@keyframes changeBg {
    0%, 100% { background-image: url('Photo/P1.jpg'); }
    33% { background-image: url('Photo/P5.jpg'); }
    66% { background-image: url('Photo/P6.jpg'); }
}

.eyebrow {
    margin-bottom: 12px;
    color: #281eb0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero h1 {
    font-size: clamp(38px, 4.5vw, 58px);
    font-weight: 800;
    line-height: 1.2;
    color: #18108a;
    margin-bottom: 25px;
}

.hero h1 span {
    display: block;
    color: #305edc;
}

.hero-description {
    max-width: 650px;
    color: var(--gray-text);
    font-size: 19px;
    font-weight: 500;
    margin-bottom: 35px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.social-img-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero-social-links a:hover .social-img-icon {
    transform: translateY(-3px) scale(1.08);
    opacity: 0.9;
}

/* =========================
   BUTTONS
========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 32px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    transition: 0.3s;
}

.btn-primary {
    background: var(--blue-main);
    color: white;
    border: 2px solid var(--blue-main);
}

.btn-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 82, 164, 0.25);
}

.btn-outline {
    border: 2px solid var(--blue-main);
    color: var(--blue-main);
    background: transparent;
}

.btn-outline:hover {
    background: var(--blue-main);
    color: white;
}

/* =========================
   HERO CARD
========================= */

.hero-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--gray-border);
    box-shadow: 0 20px 40px rgba(56, 82, 164, 0.08);
}

.hero-image {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-light);
}

.hero-profile-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.hero-card-info {
    padding: 28px;
    text-align: center;
}

.hero-card-info h3 {
    color: var(--blue-dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.hero-card-info p {
    color: var(--gray-text);
    font-size: 16px;
    margin-bottom: 14px;
}

/* =========================
   SECTIONS GENERAL
========================= */

.section {
    padding: 100px 0;
}

.section-heading {
    margin-bottom: 55px;
    max-width: 750px;
}

.section-heading.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-heading h2 {
    font-size: clamp(32px, 3.5vw, 44px);
    font-weight: 800;
    line-height: 1.25;
    color: var(--blue-dark);
    margin-bottom: 15px;
}

.section-heading p:not(.eyebrow) {
    color: var(--gray-text);
    font-size: 18px;
}

/* =========================
   ABOUT SECTION
========================= */

.about-profile-card {
    background: var(--blue-light);
    border: 1px solid var(--gray-border);
    border-left: 6px solid var(--blue-main);
    border-radius: 10px;
    padding: 30px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 45px;
}

.profile-main-info h3 {
    color: var(--blue-dark);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-position {
    color: var(--blue-main);
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 15px;
}

.profile-credentials {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-credentials li {
    color: var(--gray-text);
    font-size: 16px;
    font-weight: 500;
}

.profile-stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--gray-border);
    min-width: 130px;
    box-shadow: 0 4px 12px rgba(56, 82, 164, 0.05);
}

.stat-num {
    display: block;
    color: var(--blue-main);
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    color: var(--gray-text);
    font-size: 14px;
    font-weight: 600;
}

.about-details-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 40px;
}

.block-title {
    color: var(--blue-dark);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--blue-light);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 15px;
    border-left: 2px dashed var(--blue-main);
}

.timeline-item {
    position: relative;
    padding-left: 20px;
}

/* ✅ โค้ดที่ถูกต้อง (ปรับ width เป็น 10px) */
.timeline-item::before {
    content: "";
    position: absolute;
    left: -21px; /* ขยับตำแหน่งให้อยู่กึ่งกลางเส้นประพอดี */
    top: 6px;
    width: 10px; /* เปลี่ยนเป็น 10px เพื่อให้เป็นวงกลมเล็กๆ */
    height: 10px;
    border-radius: 50%;
    background: var(--blue-main);
}

.timeline-year {
    display: inline-block;
    background: var(--blue-main);
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.timeline-content h4 {
    color: var(--blue-dark);
    font-size: 17px;
    font-weight: 700;
}

.timeline-content p {
    color: var(--gray-text);
    font-size: 15px;
}

.trackrecord-desc {
    color: var(--gray-text);
    font-size: 16px;
    margin-bottom: 20px;
}

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

.case-box {
    background: var(--blue-light);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--gray-border);
}

.case-box h4 {
    color: var(--blue-dark);
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--blue-main);
}

.case-box ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-box li {
    font-size: 14px;
    color: var(--gray-text);
    font-weight: 500;
    position: relative;
    padding-left: 14px;
}

.case-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--blue-main);
    font-weight: bold;
}

/* =========================
   TRUSTED BY SLIDER
========================= */

.clients-slider-section {
    background: #f4f7fc;
    padding: 70px 0;
    overflow: hidden;
}

.logo-slider {
    position: relative;
    width: 100%;
    margin-top: 30px;
    overflow: hidden;
}

.logo-slider::before,
.logo-slider::after {
    background: linear-gradient(to right, #f4f7fc 0%, rgba(244, 247, 252, 0) 100%);
    content: "";
    height: 100%;
    position: absolute;
    width: 100px;
    z-index: 2;
}

.logo-slider::before { left: 0; top: 0; }
.logo-slider::after { right: 0; top: 0; transform: rotate(180deg); }

.logo-slide-track {
    display: flex;
    width: calc(220px * 38);
    animation: scrollLogos 35s linear infinite;
}

.logo-slide-track:hover {
    animation-play-state: paused;
}

.slide {
    width: 220px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.client-logo {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: filter 0.3s ease, transform 0.3s ease;
}

@keyframes scrollLogos {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-220px * 19)); }
}

/* =========================
   SERVICES
========================= */

.services {
    background: var(--blue-light);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.service-card {
    background: white;
    padding: 35px 25px;
    border-radius: 10px;
    border: 1px solid var(--gray-border);
    transition: 0.3s;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(56, 82, 164, 0.12);
    border-color: var(--blue-main);
}

.service-number {
    color: var(--blue-main);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
}

.service-card h3 {
    color: var(--blue-dark);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--gray-text);
    font-size: 15px;
    margin-bottom: 20px;
}

.service-card li {
    position: relative;
    padding-left: 18px;
    color: #334155;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
}

.service-card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--blue-main);
    font-size: 18px;
}

/* =========================
   SPEAKER
========================= */

.speaker { background: white; }

.speaker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.topic-box {
    padding: 40px;
    border-radius: 12px;
    border: 2px solid var(--blue-main);
    background: var(--blue-light);
}

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topics a.topic-chip {
    display: inline-block;
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--blue-main);
    border-radius: 30px;
    color: var(--blue-main);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.topics a.topic-chip:hover {
    background: var(--blue-main);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 82, 164, 0.25);
}

/* =========================
   PACKAGES
========================= */

.packages { background: var(--blue-light); }

.package-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.package-card {
    position: relative;
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    border: 1px solid var(--gray-border);
}

.package-card.featured {
    border: 3px solid var(--blue-main);
    box-shadow: 0 15px 35px rgba(56, 82, 164, 0.15);
    transform: translateY(-8px);
}

.popular {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 20px;
    background: var(--blue-main);
    color: white;
    font-size: 14px;
    font-weight: 700;
    border-radius: 20px;
}

.package-label {
    color: var(--blue-main);
    font-size: 14px;
    font-weight: 700;
}

.package-card h3 {
    color: var(--blue-dark);
    font-size: 40px;
    font-weight: 800;
    margin-top: 8px;
}

.package-card li {
    position: relative;
    padding-left: 22px;
    color: var(--gray-text);
    font-size: 16px;
    margin-bottom: 12px;
}

.package-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--blue-main);
    font-weight: 800;
}

.package-btn {
    display: block;
    text-align: center;
    margin-top: 30px;
    padding: 14px;
    border: 2px solid var(--blue-main);
    border-radius: 6px;
    color: var(--blue-main);
    font-size: 16px;
    font-weight: 700;
    transition: 0.3s;
}

.package-card.featured .package-btn,
.package-btn:hover {
    background: var(--blue-main);
    color: white;
}

/* =========================
   WHY US
========================= */

.why-us {
    background: var(--blue-dark);
    color: white;
}

.why-us h2, .why-us p, .why-us .eyebrow { color: white !important; }

.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.why-grid > div {
    background: rgba(255, 255, 255, 0.08);
    padding: 30px 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.why-grid strong {
    color: #93c5fd;
    font-size: 36px;
    font-weight: 800;
}

.why-grid h3 { color: white; font-size: 20px; font-weight: 700; margin: 12px 0 8px; }

/* =========================
   ARTICLES
========================= */

.articles { background: white; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.article-card {
    background: white;
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.article-card:hover { transform: translateY(-5px); }

.article-card .article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.article-content { padding: 28px; }

.article-content h3 {
    color: var(--blue-dark);
    font-size: 20px;
    font-weight: 700;
    margin: 10px 0;
}

/* =========================
   FACEBOOK
========================= */

.facebook { background: var(--blue-light); }

.facebook-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.facebook-embed-wrapper {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* =========================
   CONTACT
========================= */

.contact {
    background: var(--blue-dark);
    color: white;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 70px;
    align-items: center;
}

.contact-card {
    background: white;
    color: var(--blue-dark);
    padding: 40px;
    border-radius: 12px;
}

.contact-button {
    display: block;
    text-align: center;
    padding: 14px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
}

.contact-button.line { background: #06c755; color: white; }
.contact-button.facebook-btn { background: #1877f2; color: white; }
.contact-button.phone { background: var(--blue-main); color: white; }

/* =========================
   FOOTER
========================= */

.footer {
    background: #0f172a;
    color: white;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 45px;
}

.footer-bottom {
    padding: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* =========================
   MESSENGER BUTTON
========================= */

.messenger-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 220px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #0084ff;
    color: white;
    border-radius: 999px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    transition: all 0.2s ease;
}

.messenger-btn:hover {
    background: #0077e6;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 132, 255, 0.35);
}

.messenger-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
}

.messenger-icon svg {
    width: 27px;
    height: 27px;
    fill: #0084ff;
}

/* =========================
   SEMINAR POPUP & MINI BUTTON
========================= */

.seminar-popup {
    position: fixed;
    right: 50%;
    top: 50%;
    transform: translate(50%, -50%) scale(1);
    width: min(70vw, 500px);
    background: #ffffff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    z-index: 10001;
    transition: transform 0.45s ease, opacity 0.35s ease;
}

.seminar-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.seminar-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #222;
    color: white;
    font-size: 27px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.seminar-popup.closing {
    opacity: 0;
    transform: translate(50%, 100vh) scale(0.15);
}

.seminar-mini {
    position: fixed;
    right: 24px;
    bottom: 94px;
    min-width: 210px;
    height: 48px;
    padding: 0 20px;
    border: 2px solid #d9a928;
    border-radius: 999px;
    cursor: pointer;
    color: #5c3b00;
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff5b0, #e8b93f, #fff8c7, #d89b18, #ffe98a);
    background-size: 250% 250%;
    box-shadow: 0 4px 15px rgba(180, 125, 0, 0.35);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-25px) scale(0.7);
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(.2,.8,.2,1);
}

.seminar-mini.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    animation: goldShine 2.8s linear infinite;
}

.sparkle {
    display: inline-block;
    margin: 0 4px;
    color: #fff;
    text-shadow: 0 0 4px #fff, 0 0 8px #ffd700, 0 0 14px #ffb300;
    animation: sparklePulse 1.2s ease-in-out infinite;
}

@keyframes goldShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes sparklePulse {
    0%, 100% { transform: scale(0.8); opacity: 0.6; }
    50% { transform: scale(1.25); opacity: 1; }
}

/* =========================
   RESPONSIVE DESIGN (MOBILE & TABLET)
========================= */

@media (max-width: 950px) {
    .service-grid, .why-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-content, .speaker-grid, .contact-grid { grid-template-columns: 1fr; }
    .package-grid, .article-grid { grid-template-columns: 1fr; }
    .about-profile-card { flex-direction: column; align-items: flex-start; }
    .about-details-grid { grid-template-columns: 1fr; }
    .package-card.featured { transform: none; }
}

/* จัดการเมนู 3 ขีดบนมือถือที่นี่ทีเดียว */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        padding: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        border-bottom: 2px solid var(--blue-main);
        z-index: 999;
    }

    .nav.open {
        display: flex !important;
    }

    .nav a {
        padding: 12px 0;
        border-bottom: 1px solid var(--gray-border);
        width: 100%;
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .cases-category-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .seminar-popup { width: 94vw; padding: 6px; }
    .seminar-mini { right: 16px; bottom: 82px; min-width: 170px; height: 44px; font-size: 15px; }
    .messenger-btn { right: 16px; bottom: 16px; width: 180px; height: 50px; font-size: 17px; gap: 10px; }
    .messenger-icon { width: 36px; height: 36px; }
    .messenger-icon svg { width: 23px; height: 23px; }
    .facebook-box { padding: 20px 10px; }
    .footer-grid { grid-template-columns: 1fr; }
}





/* =========================================
   MOBILE FIXES (แก้ไขปัญหาการแสดงผลมือถือ)
========================================= */

@media (max-width: 768px) {

    /* 1. แก้ไขจุดวงกลมบังปีในประวัติการทำงาน */
    .timeline {
        padding-left: 20px !important;
        border-left: 2px dashed var(--blue-main) !important;
    }

    .timeline-item::before {
        content: "" !important;
        position: absolute !important;
        left: -26px !important; /* จัดจุดวงกลมให้อยู่บนเส้นประพอดี */
        top: 6px !important;
        width: 10px !important;  /* ปรับความกว้างกลับเป็นวงกลมเล็ก */
        height: 10px !important;
        border-radius: 50% !important;
        background: var(--blue-main) !important;
    }

    .timeline-item {
        padding-left: 10px !important;
    }


    /* 2. แก้บริการของเรา ให้แสดงเรียงลงมาทีละกล่อง (ไม่แคบเป็นงู) */
    .service-grid {
        grid-template-columns: 1fr !important; /* เปลี่ยนเป็น 1 คอลัมน์เต็มจอ */
        gap: 20px !important;
    }


    /* 3. แก้เฟซบุ๊ก ให้เนื้อหาและกล่องเพจเรียงต่อกันเป็นแนวยาวลงมา */
    .facebook-box {
        flex-direction: column !important; /* จัดคอนเทนต์เรียงต่อกันลงด้านล่าง */
        align-items: center !important;
        text-align: center !important;
        padding: 30px 15px !important;
        gap: 30px !important;
    }

    .facebook-embed-container,
    .facebook-embed-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .facebook-embed-container iframe {
        width: 100% !important;
        max-width: 340px !important; /* คุมความกว้างไม่ให้ล้นจอมือถือ */
    }
}



/* =========================================
   TABLET & IPAD FIXES (สำหรับหน้าจอ iPad)
========================================= */

@media (max-width: 1024px) {

    /* 1. สั่งเปิดใช้ปุ่ม 3 ขีดบน iPad เพื่อไม่ให้ตัวหนังสือเมนูซ้อนเบียดกัน */
    .menu-toggle {
        display: block !important;
    }

    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #ffffff;
        padding: 15px 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-bottom: 3px solid var(--blue-main, #3852a4);
        z-index: 9999;
    }

    .nav.open {
        display: flex !important;
    }

    .nav a {
        padding: 12px 0;
        border-bottom: 1px solid var(--gray-border, #e2e8f0);
        width: 100%;
        color: #1e293b;
    }

    /* 2. ปรับหน้าแรกส่วน Hero ให้เรียงต่อกันเป็น 1 คอลัมน์อย่างสบายตา */
    .hero-content {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
        text-align: center;
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-card {
        max-width: 550px;
        margin: 0 auto;
        width: 100%;
    }
}