html, body {
    overflow-x: hidden; /* ป้องกันการเกิดแถบเลื่อนแนวนอน */
    width: 100%;
    max-width: 100vw;
}

/* ================= CORE ================= */
:root { --rp-primary: #f04e23; --rp-primary-hover: #d83f17; --rp-green: #22a559; --rp-green-bg: #eafaf1; --rp-warning: #d97706; --rp-warning-bg: #fef3c7; --rp-dark: #1e293b; --rp-gray: #64748b; --rp-light-gray: #f8fafc; --rp-border: #e2e8f0; --rp-radius: 12px; --rp-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06); }
body { margin: 0; padding: 0; background-color: #ffffff; }
.rp-home-wrapper { font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--rp-dark); background-color: #ffffff; line-height: 1.6; margin: 0; padding: 0; box-sizing: border-box; }
.rp-home-wrapper *, .rp-home-wrapper *::before, .rp-home-wrapper *::after { box-sizing: inherit; }
.rp-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ================= NAVBAR ================= */
.rp-navbar { border-bottom: 1px solid #e2e8f0; background: #ffffff; position: sticky; top: 0; z-index: 100; }
.rp-nav-inner { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.rp-logo { font-size: 1.5rem; font-weight: 700; color: #0f172a; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.rp-logo span { color: #f04e23; }
.rp-nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.rp-nav-links a { text-decoration: none; color: #1e293b; font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.rp-nav-links a:hover { color: #f04e23; }

/* ================= HERO ZONE ================= */
.rp-hero { 
  background: radial-gradient(circle at 75% 50%, rgba(240, 78, 35, 0.04) 0%, rgba(248, 250, 252, 1) 60%); 
  padding: 56px 0 48px; 
  border-bottom: 1px solid #e2e8f0; 
  overflow: hidden; 
}
.rp-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.rp-hero-content { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: left; max-width: 600px; z-index: 2; }
.rp-hero-graphic { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; z-index: 1; }

@keyframes floatElement {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

.rp-hero-graphic img { 
  width: 100%; 
  max-width: 550px; 
  height: auto; 
  object-fit: contain; 
  display: block; 
  animation: floatElement 6s ease-in-out infinite; 
  filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.05));
  will-change: transform;
}

.rp-status-pill { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  background: #eafaf1; 
  border: 1px solid rgba(34, 165, 89, 0.2); 
  padding: 6px 16px; 
  border-radius: 999px; 
  font-size: 0.85rem; 
  color: #15803d; 
  margin-bottom: 20px; 
  align-self: flex-start; 
}
.rp-pulse-dot { width: 8px; height: 8px; background-color: #22a559; border-radius: 50%; box-shadow: 0 0 0 3px rgba(34, 165, 89, 0.2); }
.rp-hero h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); font-weight: 700; color: #0f172a; margin: 0 0 12px; letter-spacing: -0.02em; line-height: 1.3; }
.rp-hero p { font-size: 1.05rem; color: #64748b; margin: 0 0 28px; line-height: 1.6; }

/* ================= SEARCH BOX ================= */
.rp-search-form { 
  width: 100%; 
  margin: 0 0 18px 0; 
  display: flex; 
  gap: 10px; 
  background: rgba(255, 255, 255, 0.9); 
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 8px; 
  border-radius: 12px; 
  border: 1px solid rgba(203, 213, 225, 0.6); 
  box-shadow: 0 15px 30px -5px rgba(30, 41, 59, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.3); 
  transition: all 0.3s ease; 
}
.rp-search-form:focus-within { 
  border-color: #f04e23; 
  box-shadow: 0 15px 30px -5px rgba(240, 78, 35, 0.1), 0 0 0 1px #f04e23;
}
.rp-search-input { 
  flex: 1; 
  border: none; 
  background: transparent;
  padding: 12px 16px; 
  font-size: 1.05rem; 
  font-family: inherit; 
  outline: none; 
  color: #1e293b; 
}
.rp-search-btn { 
  background: linear-gradient(135deg, #f04e23 0%, #ea580c 100%); 
  box-shadow: 0 4px 12px rgba(240, 78, 35, 0.25);
  color: #ffffff; 
  border: none; 
  padding: 0 28px; 
  font-size: 1rem; 
  font-weight: 600; 
  font-family: inherit; 
  border-radius: 8px; 
  cursor: pointer; 
  transition: all 0.2s; 
  white-space: nowrap; 
}
.rp-search-btn:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(240, 78, 35, 0.35); 
}

/* Quick Tags */
.rp-quick-tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 0.85rem; color: #64748b; }
.rp-tag { background: #ffffff; border: 1px solid #e2e8f0; padding: 4px 12px; border-radius: 999px; text-decoration: none; color: #1e293b; font-weight: 500; transition: all 0.2s; }
.rp-tag:hover { border-color: #f04e23; color: #f04e23; background: #fff5f2; }

/* ================= SCROLL REVEAL & LAZY RENDER ================= */
.rp-lazy-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}
.rp-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.rp-reveal.rp-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= OTHER SECTIONS ================= */
.rp-section { padding: 56px 0; }
.rp-section-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.rp-section-title h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.rp-section-title p { margin: 0; color: #64748b; font-size: 0.95rem; }
.rp-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.rp-tab-btn { background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 18px; border-radius: 999px; font-family: inherit; font-size: 0.9rem; font-weight: 500; color: #64748b; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.rp-tab-btn.active, .rp-tab-btn:hover { background: #1e293b; color: #ffffff; border-color: #1e293b; }
.rp-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.rp-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; display: flex; flex-direction: column; position: relative; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06); }
.rp-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12); }
.rp-card-top-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rp-badge-status { background-color: #22a559; color: #ffffff; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.rp-code-pill { background: #f1f5f9; color: #475569; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.rp-card-img-wrap { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #f8fafc; margin-bottom: 14px; }
.rp-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.rp-card-title { font-size: 0.98rem; font-weight: 600; color: #1e293b; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.1em; }
.rp-price-box { background: #f8fafc; border-left: 3px solid #f04e23; padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; }
.rp-price-label { font-size: 0.75rem; color: #64748b; display: block; }
.rp-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.rp-price-current { font-size: 1.35rem; font-weight: 700; color: #f04e23; }
.rp-price-avg { font-size: 0.85rem; color: #94a3b8; text-decoration: line-through; }
.rp-save-tag { font-size: 0.75rem; color: #22a559; font-weight: 600; display: block; margin-top: 2px; }
.rp-meter-wrap { margin-bottom: 16px; }
.rp-meter-header { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 600; margin-bottom: 4px; }
.rp-meter-track { width: 100%; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.rp-meter-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 999px; }
.rp-card-btn { margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 6px; width: 100%; padding: 11px 16px; background: #ffffff; color: #f04e23; border: 1.5px solid #f04e23; border-radius: 8px; font-weight: 600; font-size: 0.92rem; text-decoration: none; transition: all 0.2s; }
.rp-card-btn:hover { background: #f04e23; color: #ffffff; }

.rp-wait-zone { background-color: #fffbeb; border-top: 1px solid #fde68a; border-bottom: 1px solid #fde68a; padding: 44px 0; }
.rp-wait-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.rp-wait-card { background: #ffffff; border: 1px solid #fcd34d; border-left: 5px solid #d97706; border-radius: 12px; padding: 18px; display: flex; gap: 16px; align-items: center; }
.rp-wait-img { width: 76px; height: 76px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #f8fafc; }
.rp-wait-info h4 { margin: 0 0 6px; font-size: 0.95rem; color: #1e293b; }
.rp-wait-badge { display: inline-block; background: #fef3c7; color: #b45309; font-size: 0.78rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; margin-bottom: 6px; }
.rp-wait-advice { margin: 0; font-size: 0.82rem; color: #64748b; }

.rp-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.rp-step-box { background: #f8fafc; border: 1px solid #e2e8f0; padding: 24px; border-radius: 12px; }
.rp-step-num { width: 36px; height: 36px; background: #f04e23; color: #ffffff; font-weight: 700; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.rp-step-box h3 { margin: 0 0 8px; font-size: 1.1rem; }
.rp-step-box p { margin: 0; font-size: 0.9rem; color: #64748b; }

/* ================= FOOTER ================= */
.rp-footer { background: #0f172a; color: #cbd5e1; padding: 48px 20px 32px; font-size: 0.88rem; width: 100%; box-sizing: border-box; }
.rp-disclosure-box { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); padding: 18px 22px; border-radius: 8px; margin-bottom: 32px; color: #94a3b8; }
.rp-disclosure-box strong { color: #ffffff; }
.rp-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 24px; }
.rp-footer-links { display: flex; gap: 20px; }
.rp-footer-links a { color: #cbd5e1; text-decoration: none; }
.rp-footer-links a:hover { color: #ffffff; }

/* ================= RESPONSIVE ================= */
.rp-mobile-menu-btn { display: none; background: none; border: none; font-size: 1.8rem; color: #1e293b; cursor: pointer; padding: 0 5px; transition: 0.3s; }

@media (max-width: 992px) {
  .rp-hero-inner { flex-direction: column; text-align: center; gap: 32px; }
  .rp-hero-content { align-items: center; text-align: center; max-width: 100%; }
  .rp-status-pill { align-self: center; }
  .rp-search-form { margin: 0 auto 18px auto; max-width: 680px; }
    /* บีบระยะห่างและลดขนาดฟอนต์เมนู */
  .rp-nav-links { gap: 12px; }
  .rp-nav-links a { font-size: 0.85rem; }
}

@media (max-width: 768px) {
  .rp-mobile-menu-btn { display: block; }
  .rp-nav-links { display: none; position: absolute; top: 72px; left: 0; width: 100%; background: #ffffff; flex-direction: column; gap: 0; padding: 0 20px 10px 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border-top: 1px solid #e2e8f0; }
  .rp-nav-links.active { display: flex; }
  .rp-nav-links li { border-bottom: 1px solid #e2e8f0; }
  .rp-nav-links li:last-child { border-bottom: none; }
  .rp-nav-links a { display: block; padding: 16px 0; font-size: 1.05rem; }
  .rp-search-form { flex-direction: column; }
  .rp-search-btn { padding: 14px; width: 100%; }
}
  
  /* ============ครอบขอบเขตเฉพาะบทความอื่นของเว็บ============ */
.rp-article-body {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Prompt', sans-serif;
    color: #334155;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* หัวข้อ H2 (เช่น ## ตรวจสอบโค้ดส่วนลด) */
.rp-article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f04e23; /* ขีดเส้นใต้สีส้มแบรนด์ */
}

/* หัวข้อ H3 */
.rp-article-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* ย่อหน้าข้อความ */
.rp-article-body p {
    margin-bottom: 1.25rem;
}

/* จัดการรูปภาพ (Screenshots และ AI Images) */
.rp-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* ใส่เงาให้รูปลอยขึ้นมาดูแพง */
    margin: 2rem auto;
    display: block;
}

/* จัดการลิสต์รายการ (Bullets / Numbers) */
.rp-article-body ul, .rp-article-body ol {
    margin-bottom: 1.25rem;
    margin-left: 1.5rem;
}
.rp-article-body ul { list-style-type: disc; }
.rp-article-body ol { list-style-type: decimal; }
.rp-article-body li { margin-bottom: 0.5rem; }

/* จุดเน้นข้อความ (Blockquote) ตัวอย่างเช่น > สิ่งที่ต้องกดดูเสมอ... */
.rp-article-body blockquote {
    background-color: #fff7ed; /* พื้นหลังส้มอ่อน */
    border-left: 4px solid #ea580c;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    color: #9a3412;
    border-radius: 0 8px 8px 0;
    font-weight: 500;
}

/* ตัวหนา (Bold) */
.rp-article-body strong {
    color: #0f172a;
    font-weight: 700;
}

/* เส้นกั้น (Horizontal Rule: ---) */
.rp-article-body hr {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 2.5rem 0;
}

/* ==============================================================
   สไตล์สำหรับกล่องเน้นข้อความ (CTA Box) ท้ายบทความ
   ============================================================== */
.rp-cta-box {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #fdba74;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.1);
    position: relative;
    overflow: hidden;
}

/* เพิ่มลวดลายตกแต่งพื้นหลังให้กล่อง */
.rp-cta-box::before {
    content: "💡";
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 8rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.rp-cta-box h4 {
    color: #c2410c;
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rp-cta-box p {
    color: #431407;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.rp-cta-box strong {
    color: #9a3412;
}

/* ตกแต่งปุ่ม (ลิงก์) ภายในกล่อง CTA */
.rp-cta-box a {
    display: inline-block;
    background-color: #ea580c;
    color: white !important;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(234, 88, 12, 0.2);
}

.rp-cta-box a:hover {
    background-color: #c2410c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(234, 88, 12, 0.3);
}

/* ================= SPRINT & UI POLISH (V3) ================= */
html, body {
  overflow-x: clip; /* แก้ปัญหา overflow-x: hidden ไปปิดการทำงานของ position: sticky บน Navbar */
}

.rp-nav-links {
  align-items: center;
  gap: 18px;
}

.rp-badge-status {
  white-space: nowrap; /* ป้องกันคำว่า "วัน" ตกบรรทัด */
}

.rp-card-top-meta {
  gap: 6px;
  flex-wrap: nowrap;
}

.rp-code-pill {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ปุ่มเมนูไฮไลต์ /daily-deals บนมือถือ */
@media (max-width: 768px) {
  .rp-nav-links li a.rp-nav-sprint {
    margin: 12px 0;
    padding: 12px 16px !important;
    text-align: center;
    border-radius: 10px;
  }
}

/* ================= TYPOGRAPHY MATCHING PROTOTYPE (V4) ================= */
body,
.rp-home-wrapper {
  font-family: 'Noto Sans Thai', 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #1e293b;
}

h1, h2, h3, h4,
.rp-logo,
.rp-price-current,
.dd-cta-direct,
.deal-cta-solid,
.rel-price-now,
.rel-cta-btn {
  font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
}