:root {
  --font-sans: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Red Theme - Light Mode */
  --bg-page: radial-gradient(ellipse at 18% 0%, rgba(220, 38, 38, 0.08) 0%, transparent 50%),
             radial-gradient(ellipse at 85% 100%, rgba(244, 63, 94, 0.07) 0%, transparent 50%),
             #fcfafa;
  --bg-solid: #fcfafa;
  --bg-section: #f7f2f2;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-glass-hover: rgba(255, 255, 255, 0.96);
  --bg-nav: rgba(252, 250, 250, 0.88);
  --bg-input: #ffffff;

  --red-core: #dc2626;
  --red-bright: #ef4444;
  --red-deep: #991b1b;
  --rose-pulse: #e11d48;
  --red-dim: rgba(220, 38, 38, 0.1);

  --gradient-flow: linear-gradient(135deg, #ef4444, #dc2626, #be123c);
  --gradient-text: linear-gradient(135deg, #dc2626 0%, #ef4444 48%, #be123c 100%);
  --gradient-glow-red: radial-gradient(ellipse at 30% 20%, rgba(239, 68, 68, 0.15) 0%, transparent 60%);
  --gradient-glow-rose: radial-gradient(ellipse at 75% 80%, rgba(225, 29, 72, 0.12) 0%, transparent 60%);

  --border-ghost: rgba(30, 10, 12, 0.08);
  --border-faint: rgba(30, 10, 12, 0.14);
  --border-glow-red: rgba(220, 38, 38, 0.42);

  --text-primary: #1f1215;
  --text-secondary: #473236;
  --text-muted: #70585d;

  --shadow-glass: 0 8px 32px rgba(28, 10, 14, 0.06);
  --shadow-elevated: 0 20px 56px rgba(153, 27, 27, 0.12);
  --shadow-glow-red: 0 0 24px rgba(220, 38, 38, 0.22);

  --grid-line: rgba(220, 38, 38, 0.045);
  --status-green: #16a34a;
}

[data-theme="dark"] {
  --bg-page: radial-gradient(ellipse at 20% 0%, rgba(239, 68, 68, 0.14) 0%, transparent 50%),
             radial-gradient(ellipse at 80% 100%, rgba(225, 29, 72, 0.12) 0%, transparent 50%),
             #0b0406;
  --bg-solid: #0b0406;
  --bg-section: #13070a;
  --bg-card: #180a0e;
  --bg-glass: rgba(28, 12, 16, 0.74);
  --bg-glass-hover: rgba(38, 16, 22, 0.92);
  --bg-nav: rgba(11, 4, 6, 0.85);
  --bg-input: rgba(255, 255, 255, 0.05);

  --red-core: #f87171;
  --red-bright: #ef4444;
  --red-deep: #b91c1c;
  --rose-pulse: #fb7185;
  --red-dim: rgba(248, 113, 113, 0.14);

  --gradient-flow: linear-gradient(135deg, #f87171, #ef4444, #e11d48);
  --gradient-text: linear-gradient(135deg, #fca5a5 0%, #f87171 48%, #fb7185 100%);
  --gradient-glow-red: radial-gradient(ellipse at 30% 20%, rgba(239, 68, 68, 0.24) 0%, transparent 60%);
  --gradient-glow-rose: radial-gradient(ellipse at 75% 80%, rgba(225, 29, 72, 0.2) 0%, transparent 60%);

  --border-ghost: rgba(255, 255, 255, 0.07);
  --border-faint: rgba(255, 255, 255, 0.13);
  --border-glow-red: rgba(248, 113, 113, 0.45);

  --text-primary: #fdf2f2;
  --text-secondary: rgba(253, 242, 242, 0.84);
  --text-muted: rgba(253, 242, 242, 0.62);

  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-glow-red: 0 0 24px rgba(239, 68, 68, 0.35);

  --grid-line: rgba(248, 113, 113, 0.055);
  --status-green: #4ade80;
}

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

[x-cloak] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  background-color: var(--bg-solid);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

img, svg {
  display: block;
}

.global_container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .global_container {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .global_container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.global_bg_grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
}

.global_mono {
  font-family: var(--font-mono);
}

.global_gradient_text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================= GLOBAL HEADER ================= */
.global_header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.global_header.is-scrolled {
  background-color: var(--bg-nav);
  border-bottom-color: var(--border-ghost);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass);
}

.global_nav_inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 70px;
}

.global_nav_left {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  min-width: 0;
}

.global_brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.global_brand_logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--shadow-glow-red);
}

.global_brand_name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.global_brand_name span {
  color: var(--red-core);
}

.global_desktop_nav {
  display: none;
  align-items: center;
  gap: 1.65rem;
}

@media (min-width: 1024px) {
  .global_desktop_nav {
    display: flex;
  }
}

.global_nav_link {
  position: relative;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.global_nav_link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--gradient-flow);
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.global_nav_link:hover,
.global_nav_link.is-active {
  color: var(--red-core);
}

.global_nav_link:hover::after,
.global_nav_link.is-active::after {
  transform: scaleX(1);
}

.global_nav_actions_desktop {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .global_nav_actions_desktop {
    display: flex;
  }
}

.global_nav_actions_mobile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  .global_nav_actions_mobile {
    display: none;
  }
}

.global_icon_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-faint);
  background: var(--bg-glass);
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.global_icon_btn:hover {
  border-color: var(--border-glow-red);
  color: var(--red-core);
  box-shadow: var(--shadow-glow-red);
}

.global_theme_sun { display: none; }
.global_theme_moon { display: block; }
[data-theme="dark"] .global_theme_sun { display: block; }
[data-theme="dark"] .global_theme_moon { display: none; }

/* Buttons */
.global_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.global_btn_sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.global_btn_lg {
  padding: 0.875rem 1.65rem;
  font-size: 1rem;
  border-radius: 14px;
}

.global_btn_full {
  width: 100%;
}

.global_btn_primary {
  background: var(--gradient-flow);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.28);
}

.global_btn_primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.42);
}

.global_btn_glass {
  background: var(--bg-glass);
  border-color: var(--border-faint);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.global_btn_glass:hover {
  border-color: var(--border-glow-red);
  color: var(--red-core);
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
}

/* Mobile Drawer */
.global_drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.global_drawer_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 3, 5, 0.6);
  backdrop-filter: blur(6px);
}

.global_drawer_panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 340px);
  background: var(--bg-card);
  border-left: 1px solid var(--border-faint);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
}

.global_drawer_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-ghost);
}

.global_drawer_links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.global_drawer_links a {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.global_drawer_links a:hover {
  background: var(--red-dim);
  color: var(--red-core);
}

.global_drawer_foot {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-ghost);
}

/* ================= GLOBAL FOOTER ================= */
.global_footer {
  border-top: 1px solid var(--border-ghost);
  background: var(--bg-solid);
  padding: 4rem 0 2rem;
}

.global_footer_grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .global_footer_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .global_footer_grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
  }
}

.global_footer_desc {
  margin: 0.9rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 38ch;
}

.global_social_row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.global_social_pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-faint);
  background: var(--bg-card);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.global_social_pill:hover {
  border-color: var(--border-glow-red);
  color: var(--red-core);
}

.global_footer_title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.global_footer_links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.global_footer_links a {
  font-size: 0.94rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.global_footer_links a:hover {
  color: var(--red-core);
}

.global_footer_bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-ghost);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .global_footer_bottom {
    flex-direction: row;
    align-items: center;
  }
}

.global_footer_status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--status-green);
}

.global_status_dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--status-green);
}

/* ================= GLOBAL MODAL ================= */
.global_modal_overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 3, 5, 0.68);
  backdrop-filter: blur(8px);
}

.global_modal_box {
  width: 100%;
  max-width: 490px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow-red);
  border-radius: 22px;
  padding: 1.65rem;
  box-shadow: var(--shadow-elevated);
  max-height: 92vh;
  overflow-y: auto;
}

.global_modal_head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.global_modal_title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.global_modal_summary {
  padding: 1rem;
  border-radius: 14px;
  background: var(--red-dim);
  border: 1px solid var(--border-glow-red);
  margin-bottom: 1.15rem;
}

.global_modal_summary_title {
  font-weight: 700;
  font-size: 1rem;
}

.global_modal_summary_price {
  color: var(--red-core);
  font-weight: 800;
  font-size: 1.15rem;
  margin-top: 0.2rem;
}

.global_modal_summary_old_price {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration-line: line-through;
  text-decoration-color: var(--red-core);
  text-decoration-thickness: 2px;
  text-decoration-skip-ink: none;
  margin-right: 0.35rem;
}

.global_modal_summary_meme {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.global_modal_field {
  margin-bottom: 0.9rem;
}

.global_modal_field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.global_modal_field input,
.global_modal_field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-faint);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.global_modal_field input:focus,
.global_modal_field select:focus {
  outline: 2px solid var(--red-core);
  outline-offset: 1px;
}

.global_alert_success {
  margin-top: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(22, 163, 74, 0.14);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: var(--status-green);
  font-weight: 600;
  font-size: 0.9rem;
}

.global_alert_error {
  margin-top: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--red-dim);
  border: 1px solid var(--border-glow-red);
  color: var(--red-core);
  font-weight: 600;
  font-size: 0.9rem;
}
