/* ============================================================
   cjworld - Main Stylesheet
   เว็บแทงหวยออนไลน์อันดับ 1 ครบทุกประเภทหวย
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #1e293b;
}
.section-title .highlight { color: #2563eb; }
.section-sub {
  text-align: center;
  color: #64748b;
  margin-bottom: 36px;
  font-size: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== HEADER (สีฟ้า) ===== */
header {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow: 0 2px 12px rgba(30,64,175,.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* --- Desktop Nav --- */
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  border-radius: 8px;
  transition: background .2s, color .2s;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.nav-links .nav-register {
  background: #fbbf24;
  color: #1e293b;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
}
.nav-links .nav-register:hover {
  background: #f59e0b;
  color: #1e293b;
}
.nav-links .lotto-link {
  background: rgba(255,255,255,.12);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  color: #fff;
}
.nav-links .lotto-link:hover {
  background: rgba(255,255,255,.2);
  color: #fbbf24;
}

/* --- Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background .2s;
}
.hamburger:hover { background: rgba(255,255,255,.1); }
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: all .3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: calc(100vh - 64px);
  background: rgba(15,23,42,.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  z-index: 999;
}
.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav a {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 14px 40px;
  border-radius: 10px;
  transition: background .2s;
  text-align: center;
  min-width: 200px;
}
.mobile-nav a:hover, .mobile-nav a:focus-visible { background: rgba(255,255,255,.1); }
.mobile-nav .mobile-register {
  background: #fbbf24;
  color: #1e293b;
}
.mobile-nav .mobile-register:hover { background: #f59e0b; }
.mobile-nav .mobile-lotto-check {
  background: rgba(37,99,235,.15);
  color: #93c5fd !important;
  border: 1px solid rgba(37,99,235,.3);
}
.mobile-nav .mobile-lotto-check:hover {
  background: rgba(37,99,235,.25) !important;
  color: #fff !important;
}
.mobile-divider {
  width: 60%;
  max-width: 200px;
  border: none;
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 4px 0;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.03) 0%, transparent 50%);
  pointer-events: none;
}
.hero * { position: relative; z-index: 1; }
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}
.hero h1 .gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.15rem;
  color: #bfdbfe;
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border-radius: 12px; font-weight: 700; border: none;
  cursor: pointer; transition: all .25s ease; line-height: 1.3;
}
.btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 3px; }
.btn-hero {
  padding: 16px 36px; font-size: 1.1rem; min-height: 52px;
  background: #fff; color: #2563eb; box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.btn-hero:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.btn-hero:active { transform: translateY(0); }
.btn-outline-light {
  padding: 16px 36px; font-size: 1.1rem; min-height: 52px;
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4);
}
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }
.btn-cta {
  padding: 20px 56px; font-size: 1.25rem; min-height: 60px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: 14px;
  display: inline-flex; align-items: center; gap: 10px; font-weight: 800;
  cursor: pointer; box-shadow: 0 8px 24px rgba(37,99,235,.35);
  transition: all .25s;
}
.btn-cta:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 36px rgba(37,99,235,.45); }
.btn-cta:active { transform: translateY(0) scale(1); }
.btn-cta:focus-visible { outline: 3px solid #fbbf24; outline-offset: 4px; }

/* ===== FEATURES ===== */
.features { padding: 60px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}
.feature-card {
  background: #fff; border-radius: 16px; padding: 32px 24px;
  text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,.04);
  border: 1px solid #e2e8f0; transition: transform .25s, box-shadow .25s;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(37,99,235,.1); }
.feature-icon {
  width: 60px; height: 60px; margin: 0 auto 16px;
  background: #eff6ff; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: #1e293b; }
.feature-card p { font-size: 0.92rem; color: #64748b; }

/* ===== LOTTERY TYPES ===== */
.lottery-types { padding: 60px 0; background: #f8fafc; }
.lotto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.lotto-card {
  background: #fff; border-radius: 16px; padding: 28px 24px;
  border: 1px solid #e2e8f0; text-align: center;
  transition: transform .25s, box-shadow .25s;
}
.lotto-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(37,99,235,.08); }
.lotto-card .lotto-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.4rem;
}
.lotto-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.lotto-card p { font-size: 0.88rem; color: #64748b; }

/* ===== PROMO SECTION ===== */
.promo-section { background: #fff; padding: 60px 0; }
.promo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.promo-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06); border: 1px solid #e2e8f0;
  transition: transform .25s, box-shadow .25s;
}
.promo-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(37,99,235,.12); }
.promo-card .promo-img-wrap {
  width: 100%;
  min-height: 180px;
  max-height: 220px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}
.promo-card .promo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .4s ease;
  background: #f1f5f9;
}
.promo-card:hover .promo-img-wrap img { transform: scale(1.06); }
.promo-card .promo-body { padding: 20px 20px 24px; }
.promo-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; color: #1e293b; }
.promo-card p { font-size: 0.9rem; color: #64748b; margin-bottom: 12px; }
.promo-card .promo-tag {
  display: inline-block; background: #eff6ff; color: #2563eb;
  padding: 4px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 700;
}
.promo-card:nth-child(1) .promo-tag { background: #ecfdf5; color: #059669; }  /* สะสมยอด - เขียว */
.promo-card:nth-child(2) .promo-tag { background: #fef3c7; color: #d97706; }  /* สมาชิกใหม่ - ทอง */
.promo-card:nth-child(3) .promo-tag { background: #ede9fe; color: #7c3aed; }  /* ระบบยศ - ม่วง */
.promo-card:nth-child(4) .promo-tag { background: #fce7f3; color: #db2777; }  /* iPhone - ชมพู */

/* ===== STEP GUIDE ===== */
.step-guide { padding: 60px 0; background: #fff; }
.step-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step-card { text-align: center; position: relative; }
.step-card::after {
  content: '→';
  position: absolute; top: 28px; right: -14px;
  font-size: 1.4rem; color: #2563eb; font-weight: 700;
}
.step-card:last-child::after { display: none; }
.step-num {
  width: 56px; height: 56px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.3rem; font-weight: 800;
}
.step-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.step-card p { font-size: 0.88rem; color: #64748b; }

/* ===== FAQ SECTION ===== */
.faq-section { padding: 60px 0; background: #f8fafc; }
.faq-list {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.faq-item {
  background: #fff; border-radius: 14px; padding: 20px 24px;
  border: 1px solid #e2e8f0;
}
.faq-item h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 6px;
  color: #1e293b; display: flex; align-items: center; gap: 8px;
}
.faq-item h3::before { content: '❓'; font-size: 1rem; }
.faq-item p { font-size: 0.92rem; color: #475569; padding-left: 28px; }

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff; padding: 64px 0; text-align: center;
}
.cta-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.cta-section p { font-size: 1.1rem; color: #94a3b8; max-width: 500px; margin: 0 auto 28px; }

/* ===== FOOTER ===== */
footer {
  background: #0f172a;
  padding: 48px 0 28px;
  margin-top: auto;
  text-align: center;
}
footer .footer-top {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
}
footer .footer-logo {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  object-fit: contain;
}
footer .footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
footer .footer-links a {
  color: #94a3b8;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
footer .footer-links a:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}
footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
footer .footer-copy {
  font-size: 0.78rem;
  color: #475569;
}
footer .footer-bottom-links {
  display: flex;
  gap: 12px;
}
footer .footer-bottom-links a {
  font-size: 0.75rem;
  color: #475569;
  transition: color .2s;
}
footer .footer-bottom-links a:hover {
  color: #94a3b8;
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 768px) {
  footer .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== MOBILE BOTTOM NAV BAR ===== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  z-index: 1001;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}
.mbb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  min-width: 72px;
  border-radius: 10px;
  transition: background .2s;
  color: #64748b;
  text-decoration: none;
}
.mbb-item:hover,
.mbb-item:focus-visible {
  background: #f1f5f9;
  color: #2563eb;
}
.mbb-icon {
  font-size: 1.3rem;
  line-height: 1;
}
.mbb-label {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}
.mbb-lotto {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff !important;
  border-radius: 12px;
  padding: 6px 18px;
  position: relative;
}
.mbb-lotto .mbb-icon {
  filter: brightness(0) invert(1);
}
.mbb-lotto .mbb-label {
  color: #fff !important;
}
.mbb-lotto:hover {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8) !important;
  color: #fff !important;
}
.mbb-register {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff !important;
  border-radius: 12px;
  padding: 6px 18px;
}
.mbb-register:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  color: #fff !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .promo-grid { grid-template-columns: repeat(2, 1fr); }
  .step-grid { grid-template-columns: repeat(2, 1fr); }
  .step-card::after { display: none; }
  .lotto-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { height: 56px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { top: 56px; height: calc(100vh - 56px); }

  /* แสดง mobile bottom bar */
  .mobile-bottom-bar { display: flex; }
  body { padding-bottom: 64px; }

  .hero { padding: 48px 0; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .btn-hero, .btn-outline-light { padding: 14px 24px; font-size: 1rem; min-height: 48px; }

  .features { padding: 40px 0; }
  .section-title { font-size: 1.4rem; }
  .promo-section { padding: 40px 0; }
  .lottery-types { padding: 40px 0; }
  .step-guide { padding: 40px 0; }
  .faq-section { padding: 40px 0; }

  .cta-section { padding: 48px 0; }
  .cta-section h2 { font-size: 1.5rem; }
  .btn-cta { padding: 16px 40px; font-size: 1.1rem; min-height: 54px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .promo-grid { grid-template-columns: 1fr; }
  .step-grid { grid-template-columns: 1fr; }
  .lotto-grid { grid-template-columns: 1fr; }
  .faq-item { padding: 16px 18px; }
}
