/* ==========================================================================
   PAGE-SPECIFIC STYLES: HOME PAGE (home.css)
   ========================================================================== */

/* 1. Hero Section (พื้นหลังสีขาว) */
.hero-wix {
    display: flex;
    min-height: calc(100vh - 70px);
    background-color: var(--bg-white);
}

.hero-wix-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 10%;
}

.hero-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-gold);
    text-transform: uppercase;
    margin-bottom: 15px;
    display: block;
}

.hero-wix-left h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.hero-wix-left p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-wix-right {
    flex: 1;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2. Intro Section (สลับเป็นพื้นหลังสีเทาอ่อน) */
.intro-wix {
    padding: 100px 10%;
    background-color: var(--bg-light-grey);
}

.intro-wix-container {
    display: flex;
    align-items: center;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-wix-left,
.intro-wix-right {
    flex: 1;
}

.intro-wix-right h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.intro-wix-right p {
    font-size: 1.05rem;
    margin-bottom: 35px;
    line-height: 1.8;
    color: var(--text-muted);
}

/* ==========================================================================
   3. Services Section - คอมพิวเตอร์ดูแบบ Tab / มือถือดูแบบ Card Grid
   ========================================================================== */
.services-tab-section {
    max-width: 1400px;
    margin: 80px auto;
    padding: 0 5%;
}

.services-header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.services-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.services-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ตั้งค่าเริ่มต้น: โชว์เวอร์ชัน Desktop และซ่อนเวอร์ชัน Mobile */
.desktop-only-view {
    display: block;
}

.mobile-only-view {
    display: none;
}

/* --- สไตล์ของฝั่ง Desktop (Tabs เหมือนเดิมเป๊ะ) --- */
.tabs-container {
    display: flex;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    height: 600px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.tabs-nav {
    width: 25%;
    background-color: var(--bg-light-grey);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.tab-link {
    padding: 25px 30px;
    text-align: left;
    background: none;
    border: none;
    border-left: 4px solid transparent;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.tab-link:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
}

.tab-link.active {
    background-color: var(--bg-white);
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
}

.tabs-content-area {
    width: 75%;
    padding: 50px 50px 40px 50px;
    background-color: var(--bg-white);
    height: 100%;
    display: flex;
    align-items: flex-start;
}

.tab-content {
    display: none;
    width: 100%;
    gap: 40px;
    align-items: flex-start;
    animation: fadeEffect 0.5s ease;
}

.tab-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-right: 20px;
}

.tab-text h3 {
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 15px;
    line-height: 1.3;
}

.tab-text p {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 18px;
}

.tab-text p:last-of-type {
    margin-bottom: 5px;
}

.tab-bullets {
    margin-top: 10px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

.tab-bullets li {
    position: relative;
    padding-left: 20px;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.tab-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-gold);
}

.tab-image {
    width: 35%;
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.tab-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes fadeEffect {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   4. RESPONSIVE SWITCHER (สลับหน้าตาตอนจอมือถือต่ำกว่า 900px)
   ========================================================================== */
@media (max-width: 900px) {

    /* สั่งซ่อนระบบ Tab ของคอมพิวเตอร์ และเปิดระบบ Card Grid ของมือถือ */
    .desktop-only-view {
        display: none !important;
    }

    .mobile-only-view {
        display: block !important;
    }

    /* สไตล์จัดหน้าตาแบบ Card Grid บนมือถือตามแบบ 62842.jpg */
    .services-mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        /* เรียงลงมาทีละการ์ดแนวตั้งเพื่อให้อ่านง่าย */
        gap: 25px;
        padding: 10px 0;
    }

    .service-mobile-card {
        display: flex;
        flex-direction: column;
        background: var(--bg-white);
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid var(--border-color);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
        transition: transform 0.3s ease;
    }

    .card-mobile-img {
        height: 200px;
        background-size: cover;
        background-position: center;
        width: 100%;
    }

    .card-mobile-content {
        padding: 25px 20px;
        text-align: center;
        /* จัดตัวหนังสือให้อยู่ตรงกลางตามแบบ Reference */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .card-mobile-content h3 {
        font-size: 1.3rem;
        color: var(--accent-gold);
        /* หัวข้อสีทองพรีเมียม */
        margin-bottom: 12px;
        font-weight: 600;
    }

    .card-mobile-content p {
        font-size: 0.9rem;
        color: var(--text-muted);
        line-height: 1.5;
        margin-bottom: 20px;
        max-width: 90%;
    }

    /* ปุ่มกรอบมนขอบทองตามดีไซน์หรูหรา */
    .btn-mobile-link {
        display: inline-block;
        padding: 10px 30px;
        font-size: 0.85rem;
        font-weight: 600;
        letter-spacing: 1px;
        color: var(--accent-gold);
        border: 1.5px solid var(--accent-gold);
        border-radius: 999px;
        /* ดีไซน์แคปซูล */
        text-transform: uppercase;
        background: transparent;
        transition: all 0.3s ease;
    }

    .btn-mobile-link:hover {
        background: var(--accent-gold);
        color: white;
    }
}

@media (max-width: 768px) {

    .hero-wix,
    .intro-wix-container {
        flex-direction: column;
        gap: 40px;
    }

    .hero-wix-left {
        padding: 60px 5%;
    }

    .hero-wix-left h1 {
        font-size: 2.5rem;
    }

    .intro-wix {
        padding: 60px 5%;
    }
}