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

        html, body {
            overflow-x: hidden;
            max-width: 100%;
        }

        body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            margin: 0;         
            padding: 0;
            padding-top: 90px;
            background: linear-gradient(to top, #f8f6f6, #f8f6f6, #c4c4c4);
            box-sizing: border-box;
        }

        /* ใช้ box-sizing สำหรับทุกองค์ประกอบ */
        *, *::before, *::after {
            box-sizing: border-box;
        }

        .container {
            flex: 1;
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            width: 100%
        }

        /* Header - ลดความสูง */
        .header {
            background: #F7C873;
            padding: 8px 0px; /* ลดจาก 10px เป็น 8px */
            text-align: center;
            position: fixed;
            width: 100vw;
            max-width: 100%;
            top: 0;
            left: 0;
            z-index: 1500;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            height: 90px; /* กำหนดความสูงให้แน่นอน */
        }

        .header h1 {
            font-size: 4rem;
            color: #2A363B;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
            letter-spacing: 2px;
            font-family: 'Srisakdi', serif;
            z-index: 1600;
            position: absolute;
            white-space: nowrap;
            margin: 0;
        }

        .contact-footer {
            background: #F7C873;
            padding: 20px 0;
            text-align: center;
            font-size: 18px;
            color: #1e1d2b;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
            letter-spacing: 2px;
            position: relative;  
            width: 100%;        
            margin: 0;  
            margin-top: auto;    
        }

        .map-container {
            position: relative;
            display: inline-block;
            width: 100%;
            max-width: 100%;
        }

        .map-image {
            width: 100%;
            height: auto;
            display: block;
            max-width: 100%;
        }

        .map-point {
            position: absolute;
            width: 50px;
            height: 50px;
            background: #ffffff;
            color: rgb(0, 0, 0);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 20px;
            cursor: pointer;
            transform: translate(-50%, -50%);
            transition: all 0.3s ease;
            box-shadow: 0 5px 10px 5px rgba(255, 199, 78, 0.993);
        }

        .map-point:hover {
            transform: translate(-50%, -50%) scale(1.2);
        }

        .info-panel {
            padding: 30px;
            min-height: 300px;
            width: 100%;
            box-sizing: border-box;
        }

        .location-info {
            display: none;
            animation: fadeIn 0.5s ease;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        .location-info.active {
            display: block;
        }

        .location-info h2 {
            color: #8B4513;
            font-size: 30px;
            margin-bottom: 15px;
            border-bottom: 2px solid #CD853F;
            padding-bottom: 10px;
            word-wrap: break-word;
        }

        .location-info p {
            line-height: 1.6;
            color: #555;
            font-size: 20px;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        .default-info {
            text-align: center;
            color: #888;
            font-size: 25px;
            margin-top: 100px;
            word-wrap: break-word;
        }

        .location-info img {
            width: 100%;
            max-width: 500px;
            height: 300px;
            object-fit: cover;
            border-radius: 8px;
            margin: 15px auto;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            display: block;
        }

        .back-home-container {
            text-align: center;
            position: relative;
            left: 1110px;
            right: 30px;
            bottom: 40px;
            z-index: 10;
        }

        .back-home-btn {
            background: linear-gradient(45deg, #CF4647, #ee5a52);
            color: white;
            border: none;
            padding: 20px 40px;
            border-radius: 50px;
            font-size: 1.5rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 25px rgba(116, 0, 0, 0.6);
            position: relative;
            overflow: hidden;
        }

        .back-home-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(116, 0, 0, 0.6);
            background: linear-gradient(45deg, #CF4647, #ff6b6b);
        }

        .back-home-btn:active {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(116, 0, 0, 0.6);
        }

        .back-home-btn:active {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(116, 0, 0, 0.6);
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (max-width: 768px) {
            body {
                padding: 5px;
            }
    
            .container {
                margin: 5px;
                width: calc(100% - 10px);
                border-radius: 8px;
                max-width: calc(100vw - 10px);
            }
    
            .header {
                padding: 8px 5px;
                width: 100vw;
                left: 0;
                right: 0;
            }
    
            .header h1 {
                font-size: clamp(1.2rem, 5vw, 1.8rem);
                letter-spacing: 0.5px;
                word-break: break-word;
                hyphens: auto;
            }   
    
            .map-point {
                width: 35px;
                height: 35px;
                font-size: 16px;
            }
    
            .info-panel {
                padding: 15px 10px;
            }
    
            .location-info h2 {
                font-size: clamp(16px, 4vw, 20px);
            }
    
            .location-info p {
                font-size: clamp(13px, 3vw, 15px);
            }
    
            .location-info img {
                max-width: 100%;
                height: 200px;
                margin: 10px auto;
            }
    
            .location-info:has(img + img) img, #location6 img {
                width: 90%;
                max-width: none;
                height: 150px;
                margin: 8px auto;
                display: block;
            }
    
            .back-home-container {
                right: 0;
                padding: 0 10px;
            }
    
            .back-home-btn {
                padding: 12px 25px;
                font-size: clamp(13px, 3vw, 16px);
                max-width: 90%;
            }
    
            .contact-footer {
                padding: 12px 8px;
                font-size: clamp(10px, 3vw, 14px);
                word-break: break-word;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 2px;
            }
    
            .container {
                margin: 2px;
                width: calc(100% - 4px);
                max-width: calc(100vw - 4px);
            }
    
            .header {
                padding: 5px 2px;
            }
    
            .header h1 {
                font-size: clamp(1rem, 6vw, 1.5rem);
                letter-spacing: 1px;
            }
    
            .map-point {
                width: 30px;
                height: 30px;
                font-size: 14px;
            }
    
            .info-panel {
                padding: 10px 5px;
            }
    
            .location-info img {
                height: 150px;
            }
    
            .location-info:has(img + img) img, #location6 img {
                height: 120px;
            }
    
            .back-home-container {
                padding: 0 5px;
            }
    
            .back-home-btn {
                padding: 10px 20px;
                font-size: clamp(12px, 3.5vw, 14px);
            }
        }

        /* เพิ่มการป้องกันข้อความยาวเกินไป */
        .location-info p, .location-info h2, .default-info {
            word-break: break-word;
            overflow-wrap: break-word;
            hyphens: auto;
        }

        /* ป้องกัน element ที่อาจจะเกินขนาด */
        img, video, canvas, svg {
            max-width: 100%;
            height: auto;
        }