@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

:root {
  --ink: #10110f;
  --ink-2: #171916;
  --paper: #f5f4ef;
  --paper-2: #ebe9e1;
  --white: #fff;
  --muted: #77786f;
  --line: rgba(16, 17, 15, .12);
  --accent: #c9ff54;
  --accent-2: #a9dc37;
  --soft: #e5e4dc;
  --danger: #c94a4a;
  --success: #3f8b5f;
  --shadow: 0 24px 70px rgba(16, 17, 15, .12);
  --radius: 26px;
  --ease: cubic-bezier(.22, .75, .2, 1);
  --max: 1240px;
  --display: 'Manrope', 'Noto Sans Thai', sans-serif;
  --body: 'DM Sans', 'Noto Sans Thai', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.65;
  overflow-x: hidden
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle at 82% 8%, rgba(201, 255, 84, .16), transparent 28%), radial-gradient(circle at 8% 75%, rgba(0, 0, 0, .035), transparent 30%)
}

img {
  max-width: 100%;
  display: block
}

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

button,
input,
select,
textarea {
  font: inherit
}

button {
  cursor: pointer
}

ul {
  list-style: none
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px
}

.bg-ambient,
.bg-grid {
  display: none !important
}

/* ===== NEW GLOBAL NAV ===== */
.site-header {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 20px;
  transition: .35s var(--ease)
}

.header-inner {
  max-width: var(--max);
  margin: auto;
  min-height: 72px;
  padding: 10px 12px 10px 18px;
  background: rgba(245, 244, 239, .88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 17, 15, .1);
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 14px 50px rgba(16, 17, 15, .08)
}

.site-header.scrolled .header-inner {
  box-shadow: 0 18px 60px rgba(16, 17, 15, .14);
  background: rgba(245, 244, 239, .96)
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: max-content
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  overflow: hidden;
  background: var(--ink);
  display: grid;
  place-items: center
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.brand-text {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.03em
}

.brand-text strong {
  color: inherit;
  background: none
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1
}

.nav>a,
.dropdown-toggle {
  padding: 10px 13px;
  border-radius: 12px;
  color: #65665e;
  font-size: .9rem;
  font-weight: 600;
  transition: .25s
}

.nav>a:hover,
.dropdown-toggle:hover {
  color: var(--ink);
  background: var(--white)
}

.dropdown {
  position: relative
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  padding: 8px;
  background: var(--ink);
  color: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: .25s var(--ease)
}

.dropdown-menu a {
  display: block;
  padding: 11px 13px;
  border-radius: 11px;
  color: #d8d8d2;
  font-size: .88rem
}

.dropdown-menu a:hover {
  background: #242621;
  color: #fff
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: none
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 10px 15px;
  font-weight: 700;
  font-size: .86rem;
  transition: .25s var(--ease)
}

.btn--ghost {
  border-color: var(--line);
  background: transparent
}

.btn--ghost:hover {
  background: var(--white);
  transform: translateY(-2px)
}

.btn--solid {
  background: var(--ink);
  color: var(--white)
}

.btn--solid:hover {
  background: #2b2d28;
  transform: translateY(-2px)
}

.user-balance {
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--white);
  font-weight: 700;
  font-size: .82rem
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--ink);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px
}

.nav-toggle span {
  width: 17px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: .25s
}

.nav-toggle.open span:first-child {
  transform: translateY(7px) rotate(45deg)
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0
}

.nav-toggle.open span:last-child {
  transform: translateY(-7px) rotate(-45deg)
}

.nav-overlay {
  display: none
}

.mobile-menu-actions {
  display: none
}

/* ===== PAGE SYSTEM ===== */
main {
  padding-top: 120px
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 90px 0
}

.section-head {
  max-width: 760px;
  margin: 0 0 42px
}

.section-tag {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  color: #7c7d73;
  margin-bottom: 9px
}

.section-title,
.page-title {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1.03;
  font-size: clamp(2.3rem, 5vw, 4.8rem)
}

.section-desc {
  margin-top: 16px;
  color: var(--muted);
  max-width: 650px;
  font-size: 1rem
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease)
}

.reveal.is-visible {
  opacity: 1;
  transform: none
}

/* ===== HOME ===== */
.home-shell {
  width: min(var(--max), calc(100% - 40px));
  margin: auto
}

.home-hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  gap: 28px;
  align-items: stretch;
  padding: 34px 0 30px
}

.hero-copy {
  background: var(--ink);
  color: #fff;
  border-radius: 34px;
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative
}

.hero-copy:after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--accent);
  right: -120px;
  bottom: -140px;
  filter: blur(2px);
  opacity: .85
}

.eyebrow {
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a7a9a1;
  font-weight: 800
}

.hero-copy h1 {
  font-family: var(--display);
  font-size: clamp(3.2rem, 7vw, 7.4rem);
  line-height: .91;
  letter-spacing: -.075em;
  max-width: 700px;
  position: relative;
  z-index: 1
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--accent)
}

.hero-copy p {
  color: #bfc0b9;
  max-width: 500px;
  margin-top: 24px;
  position: relative;
  z-index: 1
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
  position: relative;
  z-index: 1
}

.hero-actions .primary {
  background: var(--accent);
  color: var(--ink)
}

.hero-actions .primary:hover {
  background: #d9ff87;
  transform: translateY(-2px)
}

.hero-actions .secondary {
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff
}

.hero-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: #9fa19a;
  font-size: .8rem;
  margin-top: 34px;
  position: relative;
  z-index: 1
}

.hero-visual {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  background: #d9d7cf;
  min-height: 500px
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.hero-visual:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .42))
}

.hero-caption {
  position: absolute;
  left: 28px;
  bottom: 25px;
  z-index: 2;
  color: #fff
}

.hero-caption small {
  display: block;
  color: #ddd;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase
}

.hero-caption strong {
  font-family: var(--display);
  font-size: 1.3rem
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line)
}

.stat-strip a,
.stat-strip>div {
  padding: 24px 20px;
  border-right: 1px solid var(--line)
}

.stat-strip>*:last-child {
  border-right: 0
}

.stat-kicker {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .13em
}

.stat-value {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 6px
}

.home-split {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 80px;
  align-items: start
}

.home-split .section-head {
  position: sticky;
  top: 130px
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px
}

.cat-card {
  position: relative;
  min-height: 290px;
  border-radius: 24px;
  overflow: hidden;
  background: #ddd;
  transition: .35s var(--ease)
}

.cat-card:nth-child(3n) {
  grid-column: span 2;
  min-height: 350px
}

.cat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow)
}

.cat-card a {
  display: block;
  height: 100%
}

.cat-image {
  width: 100%;
  height: 100%;
  min-height: 290px;
  object-fit: cover;
  transition: .6s var(--ease)
}

.cat-card:hover .cat-image {
  transform: scale(1.045)
}

.cat-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 28px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
  padding-top: 80px
}

.cat-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem
}

.cat-sub {
  font-size: .86rem;
  color: #e1e1dc
}

.cat-sheen {
  display: none
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px
}

.p-card {
  grid-column: span 4;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  transition: .35s var(--ease);
  position: relative
}

.p-card:nth-child(1) {
  grid-column: span 6
}

.p-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow)
}

.p-thumb {
  aspect-ratio: 1.18;
  background: var(--paper-2);
  overflow: hidden
}

.p-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .55s var(--ease)
}

.p-card:hover .p-image {
  transform: scale(1.04)
}

.p-body {
  padding: 20px
}

.p-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem
}

.p-price {
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: 8px
}

.p-price small {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 500
}

.p-buy {
  margin-top: 18px;
  background: var(--ink);
  color: #fff !important;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  transition: .25s
}

.p-buy:hover {
  background: #2c2e29;
  transform: translateY(-2px)
}

.p-sold,
.p-stock {
  font-size: .78rem !important;
  color: var(--muted) !important
}

.action-grid {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 14px;
  margin-top: 20px
}

.action-tile {
  min-height: 150px;
  padding: 28px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  align-items: end;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: .3s
}

.action-tile.topup {
  background: var(--ink);
  color: #fff
}

.action-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow)
}

.action-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem
}

.action-sub {
  font-size: .84rem;
  color: var(--muted);
  margin-top: 4px
}

.topup .action-sub {
  color: #aeb0a8
}

.action-click {
  font-size: .7rem;
  letter-spacing: .15em;
  font-weight: 800
}

.action-icon {
  position: absolute;
  right: 25px;
  top: 24px;
  opacity: .18
}

.action-icon svg {
  width: 55px;
  height: 55px
}

.action-glow {
  display: none
}

/* ===== FORMS / ACCOUNT / GENERAL ===== */
.container,
.container-login,
.container-register,
.buy-container,
.history-container,
.account-page,
.contact-grid,
.faq,
.main-content-login,
.main-content-register {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto
}

.container-login,
.container-register {
  max-width: 520px;
  padding: 145px 0 70px
}

.title-login,
.page-title {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.05em
}

.title-login {
  font-size: 3rem;
  margin-bottom: 26px
}

.input-group-login,
.form-group {
  margin-bottom: 17px;
  position: relative
}

.label-login,
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 7px;
  color: #606159
}

.input-login,
.form-input,
.form-select,
.form-textarea,
.modal-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 13px 15px;
  color: var(--ink);
  outline: none;
  transition: .2s
}

.input-login:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #8aa93e;
  box-shadow: 0 0 0 4px rgba(201, 255, 84, .22)
}

.btn-login,
.btn-register,
.btn-submit,
.btn-submit-order,
.btn-admin-submit {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  padding: 14px;
  font-weight: 800;
  transition: .25s
}

.btn-login:hover,
.btn-register:hover,
.btn-submit:hover,
.btn-submit-order:hover,
.btn-admin-submit:hover {
  transform: translateY(-2px);
  background: #2b2d28
}

.footer-link-login {
  margin-top: 18px;
  color: var(--muted);
  text-align: center
}

.link-login {
  font-weight: 800;
  text-decoration: underline
}

.toggle-password-login {
  position: absolute;
  right: 14px;
  bottom: 12px;
  cursor: pointer
}

.account-page {
  padding: 145px 0 80px
}

.account-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 35px
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px
}

.account-card,
.balance-card,
.contact-card,
.info-box,
.bank-info-card,
.order-card,
.item-data-box,
.preview-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px
}

.account-card h2,
.contact-title {
  font-family: var(--display);
  font-weight: 800
}

.balance-card {
  background: var(--ink);
  color: #fff
}

.balance-card .amount-text {
  font-size: 2.6rem;
  font-family: var(--display);
  font-weight: 800
}

.contact-grid {
  padding: 145px 0 80px;
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 30px
}

.contact-body {
  background: var(--ink);
  color: #fff;
  border-radius: 30px;
  padding: 40px
}

.contact-copy {
  color: #bdbfb7;
  margin-top: 10px
}

.contact-actions {
  display: grid;
  gap: 10px;
  margin-top: 25px
}

.contact-actions a {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 15px
}

.faq {
  padding: 145px 0 80px
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 10px;
  overflow: hidden
}

.faq-question {
  padding: 18px 20px;
  font-weight: 800;
    font-size: 1.3rem;
  cursor: pointer
}

.faq-answer {
  padding: 0 20px 18px;
  color: #000;
  font-size: 1rem;
}

.history {
  padding: 145px 0 80px
}

.history-container {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 25px;
  overflow: auto
}

.history table,
.order-table,
.product-table,
.category-table,
.help-table,
.stock-table,
.topup-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px
}

.history th,
.history td,
.order-table th,
.order-table td,
.product-table th,
.product-table td,
.category-table th,
.category-table td,
.help-table th,
.help-table td,
.stock-table th,
.stock-table td,
.topup-table th,
.topup-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left
}

.history th,
.order-table th,
.product-table th,
.category-table th,
.help-table th,
.stock-table th,
.topup-table th {
  font-size: .74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em
}

.search-filter-bar,
.filter-bar,
.order-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0
}

.search-box,
.form-control {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 14px
}

.empty-state {
  padding: 50px;
  text-align: center;
  color: var(--muted)
}

/* ===== PRODUCT DETAIL / BUY ===== */
.product-main {
  width: min(var(--max), calc(100% - 40px));
  margin: auto;
  padding: 145px 0 90px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 45px
}

.product-gallery {
  border-radius: 30px;
  overflow: hidden;
  background: var(--paper-2)
}

.product-main-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover
}

.product-details-side {
  padding: 20px 0
}

.product-name,
.prod-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.06em
}

.price-text,
.prod-price {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  margin: 20px 0
}

.quantity-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px
}

.btn-qty-control,
.qty-display-input {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  display: grid;
  place-items: center
}

.btn-shop,
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 13px;
  padding: 11px 15px;
  font-weight: 800;
  background: var(--ink);
  color: #fff
}

.btn-back {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  margin-bottom: 20px
}

.buy-container {
  padding: 145px 0 80px
}

.order-form-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 25px
}

.item-list-wrapper {
  display: grid;
  gap: 10px
}

.item-single-row {
  background: var(--paper);
  padding: 15px;
  border-radius: 14px
}

.total-price {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem
}

.status-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 800
}

.status-success,
.status-available {
  background: #e4f4e9;
  color: var(--success)
}

.status-sold,
.status-other {
  background: #f5dddd;
  color: var(--danger)
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 40px;
  background: var(--ink);
  color: #fff;
  border-radius: 34px 34px 0 0;
  padding: 65px 0 25px
}

.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px
}

.footer-tag {
  color: #aeb0a8;
  max-width: 430px;
  margin: 18px 0
}

.footer-list {
  display: grid;
  gap: 8px;
  color: #b7b8b1;
  font-size: .83rem
}

.footer-list svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent);
  margin-right: 7px;
  vertical-align: -2px
}

.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 20px
}

.footer-social a {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  display: grid;
  place-items: center
}

.footer-social svg {
  width: 18px;
  height: 18px
}

.footer-col-title {
  font-size: .75rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #777970;
  font-weight: 800;
  margin-bottom: 15px
}

.footer-links {
  display: grid;
  gap: 9px;
  color: #c5c6bf;
  font-size: .88rem
}

.footer-links a:hover {
  color: var(--accent)
}

.footer-bottom {
  width: min(var(--max), calc(100% - 40px));
  margin: 50px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .76rem;
  color: #777970
}

.float-contact {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  background: var(--accent);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  box-shadow: 0 15px 35px rgba(16, 17, 15, .18)
}

.float-contact .ring {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center
}

.float-contact svg {
  width: 20px;
  stroke: var(--ink) !important
}

.float-contact .label {
  font-size: .78rem
}

/* ===== ADMIN REDESIGN OVERRIDES ===== */
.admin-layout {
  background: var(--paper);
  min-height: 100vh
}

.sidebar {
  background: var(--ink) !important;
  color: #fff !important;
  border: 0 !important
}

.sidebar .logo {
  font-family: var(--display) !important;
  font-weight: 800 !important
}

.sidebar a {
  border-radius: 12px !important;
  color: #aeb0a8 !important
}

.sidebar a:hover,
.sidebar a.active {
  background: #242621 !important;
  color: #fff !important
}

.admin-content-wrapper,
.admin-container,
.main-content,
.admin-card,
.table-box,
.cards .card {
  font-family: var(--body)
}

.admin-title {
  font-family: var(--display) !important;
  color: var(--ink) !important
}

.card,
.table-box,
.admin-card {
  background: var(--white) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  border-radius: 24px !important
}

.card h2,
.card h4,
.table-box h2 {
  color: var(--ink) !important
}

.table-responsive {
  background: var(--white) !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important
}

.product-table th,
.stock-table th,
.order-table th,
.topup-table th {
  background: var(--paper-2) !important;
  color: var(--muted) !important
}

.product-table td,
.stock-table td,
.order-table td,
.topup-table td {
  color: var(--ink) !important;
  border-color: var(--line) !important
}

.modal-content {
  background: var(--white) !important;
  color: var(--ink) !important;
  border-radius: 24px !important
}

/* ===== MOBILE ===== */
@media(max-width:900px) {
  .nav {
    gap: 0
  }

  .home-hero {
    grid-template-columns: 1fr
  }

  .hero-visual {
    min-height: 420px
  }

  .home-split {
    grid-template-columns: 1fr;
    gap: 30px
  }

  .home-split .section-head {
    position: static
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr)
  }

  .stat-strip>* {
    border-bottom: 1px solid var(--line)
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .p-card,
  .p-card:nth-child(1) {
    grid-column: span 1
  }

  .action-grid {
    grid-template-columns: 1fr
  }

  .contact-grid,
  .product-main {
    grid-template-columns: 1fr
  }

  .account-grid {
    grid-template-columns: 1fr
  }

  .footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 30px
  }
}

@media(max-width:760px) {
  .site-header {
    top: 10px;
    padding: 0 10px
  }

  .header-inner {
    min-height: 62px;
    border-radius: 18px;
    padding: 8px 8px 8px 13px
  }

  .header-actions {
    margin-left: auto
  }

  .header-actions .user-balance,
  .header-actions .btn {
    display: none !important
  }

  .nav-toggle {
    display: flex !important
  }

  .nav {
    position: fixed;
    top: 82px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--ink);
    border-radius: 24px;
    padding: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: .3s var(--ease)
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
    transform: none
  }

  .nav>a,
  .dropdown-toggle {
    color: #d8d9d3 !important;
    padding: 14px;
    border-radius: 12px
  }

  .dropdown {
    width: 100%
  }

  .dropdown-toggle {
    justify-content: space-between
  }

  .dropdown-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    margin: 0;
    background: #242621;
    box-shadow: none
  }

  .dropdown.active .dropdown-menu {
    display: block
  }

  .mobile-menu-actions {
    display: block !important;
    padding: 10px 0 2px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 8px
  }

  .user-balance-mobile {
    padding: 10px;
    color: var(--accent);
    font-weight: 800
  }

  .btn-mobile {
    display: block !important;
    text-align: center;
    margin: 8px 0;
    padding: 12px;
    border-radius: 12px;
    background: #242621
  }

  .btn-mobile.btn-logout {
    background: #33362f
  }

  .container,
  .container-login,
  .container-register,
  .buy-container,
  .history-container,
  .account-page,
  .contact-grid,
  .faq,
  .main-content-login,
  .main-content-register {
    width: min(100% - 28px, 1100px)
  }

  main {
    padding-top: 90px
  }

  .section {
    width: min(100% - 28px, var(--max));
    padding: 65px 0
  }

  .home-shell {
    width: min(100% - 28px, var(--max))
  }

  .home-hero {
    padding-top: 20px;
    min-height: 0
  }

  .hero-copy {
    min-height: 520px;
    border-radius: 25px;
    padding: 30px
  }

  .hero-copy h1 {
    font-size: clamp(3.1rem, 17vw, 5rem)
  }

  .hero-visual {
    min-height: 310px;
    border-radius: 25px
  }

  .stat-strip {
    grid-template-columns: 1fr 1fr
  }

  .stat-strip a,
  .stat-strip>div {
    padding: 18px 12px
  }

  .category-grid {
    grid-template-columns: 1fr
  }

  .cat-card,
  .cat-card:nth-child(3n) {
    grid-column: auto;
    min-height: 250px
  }

  .cat-image {
    min-height: 250px
  }

  .product-grid {
    grid-template-columns: 1fr
  }

  .p-card,
  .p-card:nth-child(1) {
    grid-column: auto
  }

  .product-main {
    width: min(100% - 28px, var(--max));
    padding: 115px 0 60px
  }

  .product-name,
  .prod-title {
    font-size: 2.5rem
  }

  .contact-grid {
    padding: 115px 0 60px
  }

  .faq,
  .history,
  .account-page,
  .buy-container {
    padding-top: 115px
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 35px
  }

  .site-footer {
    border-radius: 25px 25px 0 0;
    padding-top: 45px
  }

  .float-contact {
    right: 12px;
    bottom: 12px
  }

  .float-contact .label {
    display: none
  }

  .float-contact .ring {
    width: 34px;
    height: 34px
  }

  .page-title {
    font-size: 2.8rem
  }
}

@media(max-width:430px) {
  .hero-copy h1 {
    font-size: 3.2rem
  }

  .hero-meta {
    gap: 10px
  }

  .hero-actions>* {
    width: 100%
  }

  .stat-strip {
    grid-template-columns: 1fr
  }

  .stat-strip a,
  .stat-strip>div {
    border-right: 0
  }

  .section-title {
    font-size: 2.7rem
  }

  .action-tile {
    min-height: 135px
  }

  .footer-inner,
  .footer-bottom {
    width: calc(100% - 28px)
  }
}

/* ========================================
   DROPDOWN — FINAL FIX
======================================== */

.dropdown {
  position: relative;
}

/* ตัวปุ่ม Dropdown */
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

/* ========================================
   CHEVRON
======================================== */

.dropdown-toggle .chevron {
  width: 7px;
  height: 7px;

  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;

  transform: rotate(45deg);
  margin-top: -4px;

  opacity: .65;

  transition:
    transform .25s var(--ease),
    opacity .25s ease;
}

/* Hover */
.dropdown-toggle:hover .chevron {
  opacity: 1;
}

/* เปิด Dropdown */
.dropdown:hover .dropdown-toggle .chevron,
.dropdown.active .dropdown-toggle .chevron {
  transform: rotate(225deg);
  margin-top: 4px;
  opacity: 1;
}

/* ========================================
   DESKTOP DROPDOWN MENU
======================================== */

.dropdown-menu {
  position: absolute;

  top: calc(100% + 12px);
  left: 50%;

  min-width: 205px;

  padding: 8px;

  background: #ffffff !important;
  color: #10110f !important;

  border: 1px solid rgba(16, 17, 15, .10);
  border-radius: 16px;

  box-shadow:
    0 20px 50px rgba(16, 17, 15, .16),
    0 5px 15px rgba(16, 17, 15, .07);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate(-50%, -8px);

  transition:
    opacity .22s var(--ease),
    transform .22s var(--ease),
    visibility .22s ease;

  z-index: 9999;
}

/* กันพื้นที่ระหว่างปุ่มกับ Dropdown */
.dropdown-menu::before {
  content: "";
  position: absolute;

  left: 0;
  right: 0;
  top: -14px;

  height: 14px;
}

/* เปิด Dropdown */
.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translate(-50%, 0);
}

/* ========================================
   DROPDOWN ITEMS
======================================== */

.dropdown-menu a {
  display: flex;
  align-items: center;

  width: 100%;

  padding: 11px 13px;

  border-radius: 10px;

  background: transparent !important;
  color: #171916 !important;

  font-size: .88rem;
  font-weight: 600;

  text-decoration: none;

  transition:
    background .2s ease,
    color .2s ease,
    transform .2s ease;
}

/* Hover item */
.dropdown-menu a:hover {
  background: #f1f1eb !important;
  color: #10110f !important;

  transform: translateX(3px);
}

/* ========================================
   MOBILE DROPDOWN
======================================== */

@media (max-width: 760px) {

  /* ปุ่มหลัก */
  .dropdown-toggle {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px;

    color: #f4f4ef !important;
  }

  .dropdown-toggle:hover {
    background: rgba(255, 255, 255, .07) !important;
    color: #ffffff !important;
  }

  /* ลูกศร */
  .dropdown-toggle .chevron {
    width: 8px;
    height: 8px;

    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;

    flex-shrink: 0;
  }

  /* ====================================
       MOBILE MENU
    ==================================== */

  .dropdown-menu {
    position: static;

    width: 100%;
    min-width: 0;

    margin-top: 5px;

    padding: 5px;

    background: #242621 !important;
    color: #ffffff !important;

    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 13px;

    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .025),
      0 8px 20px rgba(0, 0, 0, .12);

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: none;

    display: none;

    max-height: none;
    overflow: hidden;
  }

  /* เปิด */
  .dropdown.active .dropdown-menu {
    display: block;

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: none;
  }

  /* ====================================
       MOBILE ITEMS
    ==================================== */

  .dropdown-menu a {
    display: flex;
    align-items: center;

    width: 100%;

    padding: 12px 13px;

    background: transparent !important;
    color: #e9eae5 !important;

    font-size: .88rem;
    font-weight: 600;

    border-radius: 9px;

    transform: none;
  }

  /* Hover / Touch */
  .dropdown-menu a:hover,
  .dropdown-menu a:focus,
  .dropdown-menu a:active {
    background: rgba(255, 255, 255, .09) !important;
    color: #ffffff !important;

    transform: none;
  }

  /* ลูกศรตอนเปิด */
  .dropdown.active .dropdown-toggle .chevron {
    transform: rotate(225deg);
    margin-top: 4px;
    opacity: 1;
  }
}

/* ========================================
   EXTRA CONTRAST FIX
======================================== */

/* เมนูมือถือทั้งหมด */
@media (max-width: 760px) {

  .nav {
    color: #ffffff;
  }

  .nav>a {
    color: #e9eae5 !important;
  }

  .nav>a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .07) !important;
  }

  .dropdown-toggle {
    color: #e9eae5 !important;
  }

  .dropdown-toggle span {
    color: inherit;
  }

  .mobile-menu-actions {
    color: #ffffff;
  }

  .user-balance-mobile {
    color: var(--accent) !important;
  }

  .btn-mobile {
    color: #ffffff !important;
  }
}

/* ========================================
   DESKTOP TEXT CONTRAST
======================================== */

@media (min-width: 761px) {

  .nav>a,
  .dropdown-toggle {
    color: #65665e;
  }

  .nav>a:hover,
  .dropdown-toggle:hover {
    color: #10110f;
  }

  .dropdown-menu,
  .dropdown-menu a {
    color: #10110f !important;
  }
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;

  border-radius: 12px;
  border: 1px solid #e5e7eb;

  background: #fff;
  color: #1f2937;

  text-decoration: none;
  font-size: 15px;
  font-weight: 600;

  transition: all .2s ease;
  cursor: pointer;
}

.menu-btn span:first-child {
  width: 24px;
  text-align: center;
  font-size: 18px;
}

.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  border-color: #d1d5db;
}

/* เติมเงิน */
.menu-btn.topup {
  background: #ffffff;
  color: #0c0c0c;
  padding: 12px 16px;
}

.menu-btn.topup:hover {
  color: #fff;
  background: #1f2937;
}

/* ประวัติ */
.menu-btn.history:hover {
  background: #f3f4f6;
}

/* เปลี่ยนรหัสผ่าน */
.menu-btn.password:hover {
  background: #f3f4f6;
}

/* ออกจากระบบ */
.menu-btn.logout {
  color: #dc2626;
}

.menu-btn.logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
}