/* การตั้งค่าพื้นฐาน */
:root {
    --gold-main: #f9ba32;
    --gold-light: #fffdf2;
    --red-main: #cc0000;
    --bg-body: #f4f4f4;
    --text-dark: #333;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body { 
    background-color: var(--bg-body); 
    font-family: 'Prompt', sans-serif; 
    margin: 0; 
}

/* Layout หลัก */
.container-layout {
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    gap: 25px;
    padding: 0 15px;
}

/* Sidebar */
.sidebar-gold {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-widget {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    background: var(--gold-main);
    padding: 12px 15px;
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid #f0f0f0;
    transition: 0.2s;
}

.sidebar-menu li a:hover {
    background: var(--gold-light);
    color: var(--red-main);
    padding-left: 20px;
}

/* Main Content */
.content-right {
    flex-grow: 1;
    min-width: 0; /* ป้องกันการล้นใน flex container */
}

/* Responsive สำหรับมือถือ */
@media (max-width: 991px) {
    .container-layout {
        flex-direction: column;
    }
    .sidebar-gold {
        width: 100%;
        order: 2; /* ย้าย sidebar ไปไว้ข้างล่างในมือถือ */
    }
    .content-right {
        order: 1; /* ให้เนื้อหาราคาทองขึ้นก่อน */
    }
}




/* 1. คอนเทนเนอร์หลัก */
.gold-container {
    max-width: 1000px;
    margin: 10px auto;
    font-family: 'Prompt', sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #eee;
}

/* 2. ส่วนหัวสีเหลือง */
.gold-header-banner {
    background: #FFD700;
    padding: clamp(15px, 4vw, 25px);
    text-align: center;
    font-size: clamp(1.1em, 5vw, 1.6em);
    font-weight: 800;
    color: #000;
    line-height: 1.3;
}

/* 3. แถบข้อมูลวันที่ */
.gold-meta-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-size: clamp(0.7em, 2.5vw, 0.85em);
    color: #666;
    flex-wrap: wrap;
}

/* 4. โครงสร้างหลัก (ใช้ Grid เพื่อล็อกสัดส่วนไม่ให้เบียดกัน) */
.gold-price-section {
    display: grid;
    grid-template-columns: 35% 65%;
    border-bottom: 1px solid #eee;
}

/* 5. ฝั่งซ้าย: ปรับรวมทั้งวัน */
.summary-box {
    background: #fffdf2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px 5px;
    border-right: 1px solid #eee;
    text-align: center;
}

.summary-label { 
    font-size: 0.6em; 
    font-weight: 700; 
    color: #666; 
}

.summary-value { 
    /* มือถือจะเล็กลงเยอะ คอมจะใหญ่เด่น */
    font-size: clamp(2.2em, 8vw, 4.2em); 
    font-weight: 900; 
    line-height: 1; 
    margin: 5px 0; 
}

.latest-badge {
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: clamp(0.65em, 2vw, 0.8em);
}

/* 6. ฝั่งขวา: รายละเอียดราคา */
.price-list {
    display: flex;
    flex-direction: column;
}

.price-row-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(10px, 3vw, 20px) clamp(10px, 4vw, 25px);
    border-bottom: 1px solid #eee;
    background-color: #FEFEA6;
}
.price-row-item:last-child { border-bottom: none; }

.type-info { flex-shrink: 0; }
.type-info strong { 
    font-size: clamp(1em, 3.5vw, 1.4em); 
    color: #222; 
    display: block; 
}
.type-info small { color: #999; font-size: 0.75em; }

/* การจัดการตัวเลขราคาไม่ให้ซ้อนทับชื่อ */
.price-display { 
    text-align: right; 
    min-width: 130px; /* กันพื้นที่ให้ราคา */
}

.price-unit { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
.price-unit .label { color: #888; font-size: 0.7em; white-space: nowrap; }

.price-unit .value { 
    font-size: clamp(1.6em, 5vw, 2.6em); 
    font-weight: 800; 
    color: #008000; 
}
.price-unit .value-sub { 
    font-size: clamp(1.2em, 4vw, 1.8em); 
    font-weight: 800; 
    color: #008000; 
    opacity: 0.8; 
}

/* 7. Footer: Spot/Rate */
.gold-footer-info {
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 20px);
    padding: 10px;
    font-size: clamp(0.75em, 2.5vw, 0.9em);
    font-weight: 600;
}

/* 8. Mobile Fix สำหรับจอเล็กพิเศษ */
@media (max-width: 420px) {
    .gold-price-section {
        grid-template-columns: 100%; /* สแต็กเป็นแถวเดียวถ้าจอแคบมากจริงๆ */
    }
    .summary-box { border-right: none; border-bottom: 1px solid #eee; }
    .price-display { min-width: auto; }
}


/* จัดการให้เมนูที่ดึงจากระบบ WordPress แสดงผลเป็นแนวนอนใน Desktop */
.nav-desktop div > ul { 
    list-style: none; 
    display: flex; 
    gap: 20px; 
    margin: 0; 
    padding: 0; 
}

/* ลบ Bullet point ที่อาจจะโผล่มาใน Mobile */
.mobile-menu-list { list-style: none; }