/* ============================================================
   NS Traffic - style.css
   ปรับปรุงจากเวอร์ชันเดิม: สี + font ใหม่, ลบโค้ดซ้ำ
   FrontPage safe: ไฟล์ .css FrontPage จะไม่แตะ
   หมายเหตุ: HTML ทุกไฟล์ต้องมี:
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   เพื่อป้องกัน FrontPage แปลง Thai เป็น entities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;600;700&display=swap');

/* --- BASE --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Sarabun', 'Angsana New', 'Cordia New', Arial, sans-serif;
    background-color: #E4E8ED;
    color: #1A2332;
}

img { max-width: 100%; height: auto; }
a  { text-decoration: none; }
a:hover { color: #D97706 !important; }

/* --- PAGE CONTAINER --- */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 16px rgba(0,0,0,0.12);
}

/* --- BANNER --- */
.banner { width: 100%; display: block; }

/* --- TAGLINE BAR (was .blue-bar) --- */
.blue-bar {
    background-color: #1E3A5F;
    color: #fff;
    text-align: center;
    padding: 9px 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* --- TOP NAVIGATION --- */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    background-color: #152B46;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.top-nav a {
    flex: 1;
    min-width: 80px;
    color: #F9D71C;
    text-align: center;
    padding: 11px 6px;
    font-size: 15px;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.top-nav a:hover  { background-color: #F59E0B; color: #1E3A5F !important; }
.top-nav a.active { background-color: #F59E0B; color: #1E3A5F !important; font-weight: 700; }

/* --- CONTENT WRAPPER (sidebar + main) --- */
.content-wrapper {
    display: flex;
    flex-direction: row;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 210px;
    flex-shrink: 0;
    padding: 8px 0;
    background-color: #fff;
    border-right: 1px solid #E2E8F0;
}

.pc-sidebar-logo {
    text-align: center;
    padding: 10px 12px 12px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 4px;
}

/* Sidebar category title */
.sidebar-section-title {
    background-color: #1E3A5F;
    color: #fff;
    text-align: center;
    font-weight: 700;
    padding: 7px 8px;
    font-size: 13px;
    margin-top: 4px;
}

/* Yellow highlight variant (for bestseller) */
.sidebar-section-title.yellow {
    background-color: #F59E0B;
    color: #1E3A5F;
}

/* Sidebar product links - ::before replaces dot.gif */
.sidebar-item {
    padding: 7px 8px 7px 10px;
    border-bottom: 1px solid #EEF2F7;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-item:hover { background-color: #F0F4F8; }

.sidebar-item::before {
    content: "›";
    color: #F59E0B;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-item a {
    color: #1D4ED8;
    font-weight: 600;
    flex: 1;
}

.sidebar-item a:hover { color: #D97706 !important; }

/* HOT badge - replaces hot.gif */
.badge-hot {
    background-color: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

/* --- PC CONTACT BOX (inside main, hidden on mobile) --- */
.pc-contact-box {
    text-align: center;
    background-color: #F0F6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.contact-header {
    font-size: 16px;
    font-weight: 700;
    color: #1E3A5F;
    padding: 5px;
    margin-bottom: 5px;
}

.contact-info-text {
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.contact-info-text a   { color: #1D4ED8; font-weight: 700; }
.contact-info-text img { width: 22px; height: auto; display: inline; vertical-align: middle; }

.contact-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin: 9px 0 4px;
}

.contact-icons a {
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1D4ED8 !important;
    font-weight: 600;
}

.contact-icons a img { width: 26px; height: auto; display: inline; }
.contact-icons a:hover { color: #D97706 !important; }

.contact-divider {
    border: none;
    border-top: 3px solid #1E3A5F;
    margin: 12px 0 0;
}

/* --- PAGE HEADINGS --- */
h1.main-title {
    text-align: center;
    color: #1E3A5F;
    font-size: 22px;
    font-weight: 700;
    margin: 16px 0 8px;
    line-height: 1.45;
}

h2.sub-title {
    text-align: center;
    color: #2563A8;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.65;
}

/* Section h2 with left accent bar */
h2.section-title {
    color: #1E3A5F;
    font-size: 16px;
    font-weight: 700;
    margin: 22px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2.section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #F59E0B;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Centered section h2 (for comparison table heading) */
h2.section-title-center {
    text-align: center;
    color: #1E3A5F;
    font-size: 17px;
    font-weight: 700;
    margin: 26px 0 10px;
}

/* --- BODY TEXT --- */
.paragraph-text {
    font-size: 15px;
    line-height: 1.85;
    color: #1A2332;
}
.paragraph-text p { margin-bottom: 10px; }

/* --- PRODUCT COMPARISON TABLE (index page) --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 12px;
}

table.spec-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

table.spec-table th {
    background-color: #EF4444;
    color: #fff;
    padding: 9px 10px;
    border: 1px solid #CBD5E0;
    font-size: 14px;
    font-weight: 700;
}

table.spec-table td {
    background-color: #FEFCE8;
    padding: 7px 10px;
    border: 1px solid #CBD5E0;
    text-align: center;
    font-size: 14px;
}

table.spec-table td:first-child { font-weight: 700; color: #1E3A5F; }
table.spec-table td a { color: #1D4ED8; font-weight: 700; }
table.spec-table td a:hover { color: #D97706 !important; }

/* --- PRODUCT DETAIL TABLE (product pages) --- */
.table-detail-wrap { width: 100%; overflow-x: auto; margin: 14px 0; }

table.detail-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
    font-size: 14px;
}

table.detail-table th {
    background-color: #1E3A5F;
    color: #fff;
    padding: 8px 10px;
    border: 1px solid #CBD5E0;
    text-align: center;
    font-weight: 700;
}

table.detail-table td {
    padding: 7px 10px;
    border: 1px solid #CBD5E0;
    text-align: center;
}

.row-blue   { background-color: #DBEAFE; }
.row-gray   { background-color: #F1F5F9; }
.row-green  { background-color: #D1FAE5; }
.row-teal   { background-color: #CCFBF1; }
.row-yellow { background-color: #FEF9C3; }
.row-purple { background-color: #EDE9FE; }
.row-head   { background-color: #0E7490; color: #fff; font-weight: 700; }

/* --- PRODUCT LAYOUT (image + spec table side by side) --- */
.spec-container {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin: 14px 0;
    align-items: flex-start;
}

.spec-image { flex: 0 0 230px; }
.spec-image img {
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    width: 100%;
    margin-bottom: 8px;
}

.spec-details { flex: 1; min-width: 230px; }

/* --- CTA BUTTON --- */
.cta-button {
    display: inline-block;
    background-color: #F59E0B;
    color: #1E3A5F !important;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    border: none;
}
.cta-button:hover { background-color: #D97706; }

/* --- VIDEO --- */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-top: 18px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* --- FAQ PAGE --- */
.faq-item {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 13px 15px;
    margin-bottom: 10px;
}
.faq-question { font-weight: 700; color: #1E3A5F; font-size: 14px; display: block; margin-bottom: 4px; }
.faq-answer   { font-size: 14px; color: #374151; line-height: 1.8; display: block; }

/* --- DOWNLOAD PAGE --- */
.download-section { margin-bottom: 22px; }
.download-section h2 { font-size: 16px; font-weight: 700; color: #1E3A5F; border-bottom: 2px solid #1E3A5F; padding-bottom: 4px; margin-bottom: 10px; }
.download-section h3 { font-size: 14px; color: #6B7280; margin: 8px 0 4px; }
.download-list { padding-left: 20px; }
.download-list li { margin-bottom: 5px; font-size: 14px; }
.download-list a { color: #1D4ED8; font-weight: 600; }
.download-list a:hover { color: #D97706 !important; text-decoration: underline; }

/* --- CONTACT PAGE --- */
.contact-info-block {
    background: #F0F6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 18px 20px;
    font-size: 15px;
    line-height: 2.1;
    margin-bottom: 16px;
}
.contact-info-block strong { color: #1E3A5F; }

.holiday-box {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin: 18px 0;
}
.holiday-box .month { font-size: 16px; font-weight: 700; color: #92400E; margin-bottom: 5px; }
.holiday-box .dates { font-size: 15px; color: #1D4ED8; font-weight: 600; line-height: 1.9; }
.holiday-box .note  { font-size: 13px; color: #EF4444; margin-top: 6px; }

.contact-map-wrap iframe { width: 100%; height: 380px; border: 0; border-radius: 8px; margin-top: 10px; }

/* --- ABOUT PAGE --- */
.about-text { font-size: 15px; line-height: 1.9; }
.about-text p { margin-bottom: 12px; }

.main-site-box {
    background: #1E3A5F;
    color: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}
.main-site-box p { margin-bottom: 10px; font-size: 15px; }
.main-site-box a {
    display: inline-block;
    background: #F59E0B;
    color: #1E3A5F !important;
    padding: 9px 22px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
}

/* --- MOBILE-ONLY BLOCKS (hidden on PC) --- */
.mobile-logo-box    { display: none; }
.mobile-contact-box { display: none; }

/* ==========================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ========================================================== */
@media (max-width: 768px) {

    /* Stack layout */
    .content-wrapper { flex-direction: column; }

    /* Sidebar: full width, drop right border */
    .sidebar { width: 100%; border-right: none; border-bottom: 2px solid #E2E8F0; }

    /* Hide sidebar logo + PC contact box on mobile */
    .pc-sidebar-logo  { display: none; }
    .pc-contact-box   { display: none; }

    /* Show mobile logo */
    .mobile-logo-box {
        display: block;
        text-align: center;
        padding: 12px 0 5px;
        background-color: #fff;
    }
    .mobile-logo-box img { max-width: 160px; }

    /* Mobile sticky contact box */
    .mobile-contact-box {
        display: block;
        position: sticky;
        top: 0;
        background-color: #fff;
        z-index: 999;
        padding: 8px 0;
        border-bottom: 2px solid #1E3A5F;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .mobile-contact-box .contact-header {
        font-size: 13px !important;
        padding: 0 8px 5px;
    }
    .mobile-contact-box .contact-info-text {
        font-size: clamp(11px, 3.5vw, 13px) !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        gap: 3px;
    }
    .mobile-contact-box .contact-icons {
        flex-wrap: nowrap !important;
        gap: 10px !important;
        margin: 4px 0 0;
    }
    .mobile-contact-box .contact-icons a {
        font-size: 12px !important;
        white-space: nowrap !important;
    }
    .mobile-contact-box .contact-icons a img { width: 22px !important; }

    /* Nav: 3 per row */
    .top-nav a { flex: 1 1 33%; font-size: 13px; padding: 9px 4px; }

    /* Tagline smaller */
    .blue-bar { font-size: 12px; padding: 7px 8px; }

    /* Typography scale down */
    h1.main-title { font-size: 17px !important; margin: 10px 5px 6px !important; line-height: 1.4 !important; }
    h2.sub-title  { font-size: 13px !important; line-height: 1.5 !important; margin-bottom: 12px !important; padding: 0 5px !important; }
    h2.section-title { font-size: 14px; }

    .main-content { padding: 14px 12px; }
    .paragraph-text { font-size: 14px; }

    table.spec-table th,
    table.spec-table td,
    table.detail-table th,
    table.detail-table td { font-size: 12px; padding: 5px 6px; }

    /* Product layout: stack */
    .spec-container { flex-direction: column; }
    .spec-image { flex: none; width: 100%; max-width: 260px; margin: 0 auto; }

    .contact-map-wrap iframe { height: 270px; }
}

@media (max-width: 480px) {
    .top-nav a { flex: 1 1 50%; }
    h1.main-title { font-size: 15px !important; }
}
