/* ==========================================
   Tour Section & Table Styling (Modern Japanese Style)
   ========================================== */

/* 1. Layout & Containers */
.content-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    box-sizing: border-box;
}

/* ป้องกันปัญหา Padding รวมกับความกว้างจนล้นจอ */
.content-body *, .content-body *::before, .content-body *::after {
    box-sizing: border-box;
}

/* Breadcrumbs */
.breadcrumbs-bar {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    word-break: break-all;
}
.breadcrumbs-bar a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs-bar a:hover {
    text-decoration: underline;
}
.breadcrumbs-bar span {
    margin: 0 8px;
    color: #ccc;
}

/* Section Header */
.tour-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 40px 30px;
    margin-bottom: 40px;
}
.tour-section h2 {
    font-size: 28px;
    color: #333;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 10px;
    font-weight: 700;
}
.tour-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #ff9900;
    border-radius: 2px;
}
.tour-section p {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 40px;
}

/* 2. Responsive Table Base (Desktop) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #fff;
    min-width: 800px;
}

/* Table Headers */
table th {
    background-color: #f8f9fa;
    color: #444;
    font-weight: 600;
    padding: 16px 20px;
    font-size: 15px;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

/* Table Cells */
table td {
    padding: 20px;
    font-size: 15px;
    color: #444;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    line-height: 1.6;
}

table tbody tr:max-of-type {
    border-bottom: 2px solid #e0e0e0;
}
table tbody tr:hover {
    background-color: #fafafa;
}

/* 3. Specific Column Styles */
table td strong {
    color: #111;
    font-size: 16px;
    display: block;
}

/* Images Styling */
.tour-img {
    width: 140px;
    height: 95px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    transition: transform 0.3s ease;
}
.tour-img:hover {
    transform: scale(1.05);
}

/* Price Buttons */
.price-col {
    text-align: center;
    white-space: nowrap;
}
.price-col a {
    display: inline-block;
    background-color: #ff9900;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(255, 153, 0, 0.2);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.price-col a:hover {
    background-color: #e68a00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 153, 0, 0.4);
}
tr td.price-col:nth-child(4) a {
    background-color: #0073e6;
    box-shadow: 0 3px 10px rgba(0, 115, 230, 0.2);
}
tr td.price-col:nth-child(4) a:hover {
    background-color: #005bc1;
    box-shadow: 0 5px 15px rgba(0, 115, 230, 0.4);
}

/* ==========================================
   4. Mobile Responsive Transform (จอมือถือต่ำกว่า 768px)
   ========================================== */
@media screen and (max-width: 768px) {
    .tour-section {
        padding: 20px 10px;
    }
    .tour-section h2 {
        font-size: 22px;
    }
    
    .table-responsive {
        border: none;
        overflow-x: visible; /* ปิดการเลื่อนแนวนอนของ Container */
    }
    
    table, table thead, table tbody, table th, table td, table tr {
        display: block;
        width: 100% !important; /* บังคับให้ขยายเต็มความกว้างหน้าจอพอดี */
        min-width: 0 !important; /* ล้างค่า min-width ของเดสก์ท็อปออก */
    }
    
    /* ซ่อนหัวตารางแบบถาวร */
    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    /* แปลงแถวตารางให้กลายเป็นการ์ด */
    table tbody tr {
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        margin-bottom: 20px;
        padding: 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    }
    table tbody tr:hover {
        background-color: #fff;
    }
    
    table td {
        border: none;
        padding: 6px 0;
        font-size: 14px;
        text-align: left;
        word-wrap: break-word; /* บังคับตัดคำภาษาญี่ปุ่น/ไทยที่ยาวเกินไป */
        overflow-wrap: break-word;
    }
    
    /* คอลัมน์ที่ 1: ชื่อคอร์ส */
    table td:nth-child(1) {
        border-bottom: 1px dashed #eee;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
    table td strong {
        font-size: 16px;
        color: #0066cc;
        line-height: 1.4;
    }
    
    /* คอลัมน์ที่ 2: รูปภาพทัวร์ - ปรับให้แสดงตรงกลางและกว้างเต็มที่ หรือขนาดพอดีไม่ดันตัวหนังสือ */
    table td:nth-child(2) {
        text-align: center;
        padding: 5px 0 12px 0;
    }
    .tour-img {
        width: 100%; /* เปลี่ยนเป็นขยายเต็มพื้นที่การ์ดบนมือถือ */
        max-width: 100%; /* ป้องกันการล้นขอบ */
        height: auto; /* รักษาสัดส่วนรูปภาพ */
        aspect-ratio: 16 / 9; /* กำหนดสัดส่วนรูปภาพให้สวยงามสไตล์โมเดิร์น */
        margin: 0 auto;
    }
    
    /* คอลัมน์ที่ 3: รายละเอียดสถานที่แวะพัก */
    table td:nth-child(3) {
        color: #444;
        font-size: 13.5px;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    
    /* คอลัมน์ราคาจองแบบยืดหยุ่น (Flexbox) ป้องกันข้อความหรือปุ่มเบียดกันจนตกขอบ */
    table td.price-col {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8f9fa;
        padding: 10px 12px;
        margin-top: 6px;
        border-radius: 6px;
        white-space: normal; /* อนุญาตให้ปุ่มตัดบรรทัดได้หากเจอมือถือหน้าจอแคบมาก */
    }
    
    /* ใส่ข้อความระบุประเภทหน้าราคา */
    table td.price-col:nth-child(4)::before {
        content: "ガイド運転車";
        font-weight: bold;
        color: #333;
        font-size: 13px;
        padding-right: 5px;
    }
    table td.price-col:nth-child(5)::before {
        content: "運転手付車";
        font-weight: bold;
        color: #333;
        font-size: 13px;
        padding-right: 5px;
    }
    
    /* ปรับแต่งปุ่มกดสำหรับการ์ดมือถือ */
    .price-col a {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 95px; /* กำหนดขนาดปุ่มให้สมดุล */
        text-align: center;
        box-shadow: none;
    }
}
