/* Theme overrides for MrR00TMRR site using Bootstrap 5 */
/* Typography */
:root {
  --bs-body-font-family: 'Sarabun', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --brand-accent: #00e5ff;
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-bg-hover: rgba(255, 255, 255, 0.12);
  --btn-border: rgba(255, 255, 255, 0.12);
  --brand-purple: 168, 85, 247;
  /* rgb tuple for glow */
  --footer-h: 64px;
  /* sticky footer height */
}

/* Mobile-first tuning for catalog product cards */
@media (max-width: 576px) {

  /* Ensure product cards don't require inner scrolling on small screens */
  .catalog-card {
    padding: .75rem;
  }

  .catalog-card .card-title {
    font-size: 1rem;
    margin-bottom: .35rem;
  }

  .catalog-card .catalog-desc {
    font-size: .9rem;
    line-height: 1.5;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
    /* standard property (limited support) */
  }

  /* Clamp title to two lines to avoid vertical overflow */
  .catalog-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
  }

  /* Shrink main product image height and hide small thumbs */
  .catalog-card .pg-img {
    height: 150px !important;
  }

  .catalog-card .pg-thumb {
    display: none !important;
  }

  /* Compact action buttons */
  .catalog-card .btn {
    padding: .35rem .6rem;
    font-size: .925rem;
  }

  .catalog-card .btn.btn-sm {
    padding: .3rem .5rem;
    font-size: .875rem;
  }

  /* Price text slightly smaller and tighter */
  .catalog-card .text-success {
    font-size: .95rem;
    margin-bottom: .5rem !important;
  }

  /* Reduce gaps under image container */
  .catalog-card .product-gallery+.d-flex,
  .catalog-card .product-gallery+div {
    margin-top: .5rem !important;
  }
}

html,
body {
  height: 100%;
}

body {
  background-color: #000;
  /* fallback */
  color: #e9ecef;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: var(--footer-h);
  /* space for fixed footer */
}

/* Global mobile safety: avoid accidental horizontal scroll and scale media */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
  height: auto;
}

/* Enforce Sarabun font across body text and form controls */
body,
button,
input,
select,
textarea {
  font-family: 'Sarabun', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

/* Starfield canvas underlay */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  /* ensure it never intercepts clicks and scrolls */
  pointer-events: none;
  /* hint the browser for smoother animation */
  will-change: transform, opacity;
}

/* Scoped container variant for starfield (used on homepage/login containers) */
.galaxy-wrap {
  position: relative;
  overflow: hidden;
  /* fill viewport minus fixed footer and keep content readable above it */
  min-height: calc(100vh - var(--footer-h));
  padding-bottom: var(--footer-h);
  /* ensure content doesn't collide with sticky navbar */
  padding-top: 2rem;
}

.galaxy-wrap>#starfield {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.galaxy-wrap>.container {
  position: relative;
  z-index: 1;
}

.galaxy-wrap .cosmic-particle {
  position: absolute;
}

/* Layout */
.layout {
  position: relative;
  z-index: 1;
  /* above starfield */
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  padding: 1rem;
  flex: 1 0 auto;
  /* allow footer to stick bottom */
}

@media (max-width: 992px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .layout {
    padding: 0.75rem;
    gap: 0.75rem;
  }
}

main.content {
  min-height: 60vh;
}

/* Generic grid helper for listings */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

/* Sidebar */
.sidebar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: .75rem;
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.layout>.sidebar {
  align-self: start;
}

.sidebar-title {
  font-weight: 600;
  font-size: 1rem;
  margin: .5rem 0 .25rem;
}

.sidebar .menu,
.sidebar .sidebar-toplinks {
  list-style: none;
  padding-left: 0;
  margin: .25rem 0 1rem;
}

.sidebar .menu li+li,
.sidebar .sidebar-toplinks li+li {
  margin-top: .25rem;
}

.sidebar a {
  color: #ced4da;
  text-decoration: none;
}

.sidebar a:hover {
  color: var(--brand-accent);
}

/* Navbar tweaks */
.navbar {
  /* charcoal dark gray header */
  background: #0f1115 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1200;
  /* keep navbar above content */
}

.navbar .brand,
.navbar .nav-link,
.navbar a {
  color: #f8f9fa;
  text-decoration: none;
}

.navbar a:hover {
  color: var(--brand-accent);
}

.navbar .nav-link {
  padding: .25rem .5rem;
  line-height: 1.2;
}

.navbar .nav-link .fa,
.navbar .nav-link .fas,
.navbar .nav-link .far,
.navbar .nav-link .fab {
  margin-right: .25rem;
  /* tighter icon spacing */
}

/* Dark gray dropdown styling */
.navbar .dropdown-menu {
  background-color: #111827;
  /* slate-900-ish */
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: .5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

.navbar .dropdown-item {
  color: #e5e7eb;
}

.navbar .dropdown-item i {
  opacity: .9;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: #1f2937;
  /* darker gray on hover */
  color: #ffffff;
}

.navbar .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Better behavior for collapsed navbar on mobile */
.navbar .navbar-collapse {
  flex-wrap: wrap;
}

@media (max-width: 991.98px) {
  .navbar .nav-link {
    display: block;
    width: 100%;
    padding: .6rem .75rem;
    font-size: .95rem;
  }

  .navbar .nav-link.text-nowrap {
    white-space: normal !important;
  }

  .navbar .user-info {
    gap: .3rem;
    flex-wrap: wrap;
  }

  /* Make brand text wrap and be readable on mobile */
  .navbar .navbar-brand {
    white-space: normal;
    font-size: 1rem;
    line-height: 1.2;
  }
}

/* Distinct colors for navbar icons */
.navbar .nav-link i.nav-home {
  color: #0dcaf0;
}

/* info */
.navbar .nav-link i.nav-store {
  color: #20c997;
}

/* teal */
.navbar .nav-link i.nav-blog {
  color: #f39c12;
}

/* amber */
.navbar .nav-link i.nav-code {
  color: #6f42c1;
}

/* purple */
.navbar .nav-link i.nav-rewards {
  color: #e83e8c;
}

/* pink */
.navbar .nav-link i.nav-topup {
  color: #22c55e;
}

/* green */
.navbar .nav-link i.nav-cart-icon {
  color: #adb5bd;
}

/* gray */

/* Keep icon color on hover (do not switch to accent) */
.navbar .nav-link:hover i.nav-home {
  color: #0dcaf0;
}

.navbar .nav-link:hover i.nav-store {
  color: #20c997;
}

.navbar .nav-link:hover i.nav-blog {
  color: #f39c12;
}

.navbar .nav-link:hover i.nav-code {
  color: #6f42c1;
}

.navbar .nav-link:hover i.nav-rewards {
  color: #e83e8c;
}

.navbar .nav-link:hover i.nav-topup {
  color: #22c55e;
}

.navbar .nav-link:hover i.nav-cart-icon {
  color: #adb5bd;
}

/* Logout button styling (เลือดหมู) */
.navbar .nav-link[href*="route=logout"],
.navbar .nav-link.logout {
  background-color: #8B0000;
  /* dark maroon */
  border: 1px solid #a3151c;
  color: #fff !important;
  border-radius: .5rem;
  padding: .25rem .5rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-left: .5rem;
}

.navbar .nav-link[href*="route=logout"]:hover,
.navbar .nav-link.logout:hover {
  background-color: #a3151c;
  /* slightly brighter on hover */
  border-color: #b11a22;
  color: #fff !important;
}

.navbar .nav-link[href*="route=logout"]:active,
.navbar .nav-link.logout:active {
  background-color: #790b12;
  border-color: #8a0f16;
}

/* Navbar user info offset (desktop only) */
.navbar .user-info.nav-user-shift {
  transform: translateX(-4%);
}

/* compact user-info line without changing font size */
.navbar .user-info {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: nowrap;
}

.navbar .user-info>span {
  white-space: nowrap;
}

/* keep level text and bar on the same line with compact bar */
.navbar .level-progress-wrap {
  display: inline-block;
  width: 90px;
  vertical-align: middle;
  margin-left: .25rem;
}

.navbar .level-progress {
  height: .35rem;
  margin: 0;
}

.navbar .level-progress .progress-bar {
  min-width: 0;
}

/* Scoped compact variant for user info pills (no side effects elsewhere) */
.navbar .user-info--compact {
  gap: .25rem;
}

.navbar .user-info--compact .user-pill {
  padding: .15rem .35rem;
  font-size: .85rem;
  border-radius: .45rem;
}

.navbar .user-info--compact .user-pill i {
  font-size: .8rem;
}

.navbar .user-info--compact .user-pill.level .level-progress-wrap {
  width: 64px;
  margin-left: .25rem;
}

.navbar .user-info--compact .level-progress {
  height: .3rem;
}

@media (max-width: 992px) {
  .navbar .user-info.nav-user-shift {
    transform: none;
    /* avoid layout issues on small screens */
  }

  /* Force a line break inside collapsed menu to push user block below links */
  .navbar .spacer {
    flex-basis: 100%;
    height: 0;
  }

  /* Ensure user info wraps nicely and uses full width */
  .navbar .user-info {
    display: flex;
    width: 100%;
    gap: .35rem;
    flex-wrap: wrap;
    margin: .25rem 0;
  }

  /* Slightly compact pills to fit smaller widths */
  .navbar .user-pill {
    padding: .2rem .4rem;
    font-size: .9rem;
  }

  /* Narrow progress bar on mobile to avoid overflow */
  .navbar .user-pill.level .level-progress-wrap {
    width: 68px;
  }

  /* Make logout button a compact pill instead of full-width bar on mobile */
  .navbar .nav-link[href*="route=logout"],
  .navbar .nav-link.logout {
    display: inline-flex;
    width: auto;
    align-self: flex-start;
    padding: .35rem .6rem;
    margin: .25rem 0 .5rem 0;
    border-radius: .5rem;
  }
}

/* Compact "pill" elements for user meta in navbar */
.navbar .user-pill {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: #f8f9fa;
  border-radius: .5rem;
  padding: .2rem .45rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}

.navbar .user-pill i {
  opacity: .9;
  font-size: .9rem;
}

.navbar .user-pill.level {
  padding-right: .4rem;
}

.navbar .user-pill.level .level-progress-wrap {
  width: 80px;
  margin-left: .35rem;
}

/* Colors for balance (green) and points (gold) */
.navbar .user-pill.balance .amount {
  color: #22c55e;
  font-weight: 600;
}

.navbar .user-pill.points .points-value {
  color: #FFD700;
  font-weight: 600;
}

/* Star icon in points pill = dark maroon (เลือดหมู) */
.navbar .user-pill.points .points-icon {
  color: #8B0000;
}

/* Wallet icon as solid blue */
.navbar .user-pill.balance .wallet-icon {
  color: #0d6efd;
}

/* Animated purple glow for brand */
.brand-glow {
  position: relative;
  color: #fff;
  font-weight: 700;
  /* soften direct glow on glyphs to avoid covering the text */
  -webkit-text-stroke: 0.6px rgba(0, 0, 0, 0.45);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 0 2px rgba(var(--brand-purple), 0.35),
    0 0 6px rgba(var(--brand-purple), 0.18);
}

.brand-glow:hover {
  text-decoration: none;
}

/* Place animated aura BEHIND the text so text stays crisp */
.brand-glow::before {
  content: "";
  position: absolute;
  inset: -8px -14px;
  /* extend slightly around text */
  z-index: -1;
  /* behind the text */
  pointer-events: none;
  background: radial-gradient(60% 50% at 50% 55%, rgba(var(--brand-purple), .45), rgba(var(--brand-purple), 0) 65%), radial-gradient(100% 80% at 50% -10%, rgba(var(--brand-purple), .25), rgba(var(--brand-purple), 0) 70%);
  filter: blur(6px) saturate(110%);
  opacity: .55;
  animation: brandAura 2.6s ease-in-out infinite;
}

@keyframes brandAura {

  0%,
  100% {
    transform: scale(1);
    opacity: .55;
    filter: blur(6px) saturate(110%);
  }

  50% {
    transform: scale(1.04);
    opacity: .75;
    filter: blur(8px) saturate(120%);
  }
}

/* Progress bar already uses Bootstrap classes; just tune height */
.level-progress {
  height: .5rem;
  background-color: rgba(255, 255, 255, 0.1);
}

.level-progress .progress-bar {
  background-image: linear-gradient(90deg, #0d6efd, #20c997);
}

/* Account dropdown (header) */
.account-wrap {
  position: relative;
}

.account-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: #f8f9fa;
  border-radius: .5rem;
  min-height: 34px;
  padding: .3rem .5rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
}

.account-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--btn-bg-hover);
}

.account-text {
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .3px;
  color: #f8f9fa;
}

@media (max-width: 420px) {
  .account-text {
    display: none;
  }
}

.navbar .account-btn {
  /* Ensure pill style in navbar, overriding any circular rules elsewhere */
  height: 34px;
  padding: .28rem .6rem;
  border-radius: .65rem;
}

.navbar .account-btn svg {
  width: 16px;
  height: 16px;
}

.navbar .account-btn i {
  font-size: 14px;
  line-height: 1;
}

/* Color variants for header account buttons */
.account-btn--register {
  background: rgba(25, 135, 84, 0.12);
  border-color: #198754;
  color: #eafaf0;
}

.account-btn--register:hover {
  background: #198754;
  border-color: #157347;
  color: #ffffff;
}

.account-btn--login {
  background: rgba(13, 110, 253, 0.12);
  border-color: #0d6efd;
  color: #e9f2ff;
}

.account-btn--login:hover {
  background: #0d6efd;
  border-color: #0a58ca;
  color: #ffffff;
}

.navbar .account-btn+.account-btn,
.navbar .account-btn+.account-wrap {
  margin-left: .5rem;
}

.account-dropdown {
  width: 280px;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: .75rem;
  padding: .75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
  z-index: 2000;
  /* ensure over cards/other content */
}

.account-form .field {
  margin-bottom: .5rem;
}

.account-form label {
  font-size: .9rem;
  color: #aab0b6;
  margin-bottom: .25rem;
  display: block;
}

.account-form input {
  width: 100%;
  background: #0b0f16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e9ecef;
  border-radius: .5rem;
  padding: .5rem .75rem;
}

.account-form .btn {
  width: 100%;
}

.account-form .subtext {
  margin-top: .5rem;
  display: block;
  text-align: right;
  font-size: .85rem;
  color: #aab0b6;
}

.account-form .subtext a {
  color: var(--brand-accent);
  text-decoration: none;
}

.account-form .subtext a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1250;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  /* charcoal dark gray footer to match header */
  background-color: #0f1115;
  color: #adb5bd;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cosmic floating particles added by starfield.js */
.cosmic-particle {
  position: fixed;
  z-index: 0;
  /* keep under layout but above body background */
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }

  20% {
    opacity: 0.6;
  }

  80% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}

/* Dark Mode Card Overrides */
body .card,
body .product-card {
  background-color: #111827 !important;
  /* Dark slate/gray */
  color: #e5e7eb !important;
  /* Light gray text */
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.card .card-body,
.product-card .card-body {
  background-color: transparent !important;
}

.card .card-title,
.product-card .card-title,
.product-card h6 {
  color: #f8f9fa !important;
  /* White title */
}

.product-card .product-price {
  color: var(--brand-accent) !important;
  /* Cyan accent for price */
}

.product-card .product-price-old {
  color: #9ca3af !important;
  /* Muted gray for old price */
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}



/* Utilities */
.spacer {
  flex: 1 1 auto;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .1rem .3rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  line-height: 1;
  width: max-content;
}

.user-icon {
  opacity: .9;
  width: 14px;
  height: 14px;
}

/* Cart nav count */
.nav-cart {
  position: relative;
}

#nav-cart-count {
  color: var(--brand-accent);
  font-weight: 600;
}

/* Bootstrap button theming */
.btn {
  border-radius: .5rem;
  border-width: 1px;
}

.btn:focus {
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.btn-primary {
  background-image: linear-gradient(180deg, #0d6efd, #0b5ed7);
  border-color: #0b5ed7;
}

.btn-primary:hover {
  background-image: linear-gradient(180deg, #0b5ed7, #0a58ca);
  border-color: #0a58ca;
}

.btn-primary:active {
  background-image: linear-gradient(180deg, #0a58ca, #094db4);
  border-color: #094db4;
}

.btn-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8f9fa;
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.btn-outline-light {
  border-color: var(--btn-border);
  color: #ffffff;
}

.btn-outline-light:hover {
  background: var(--btn-bg-hover);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Keep text readable when disabled on dark background */
.btn-outline-light.disabled,
.btn-outline-light:disabled {
  color: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  opacity: .75;
}

/* Card utilities and Sidebar fit adjustments */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: .75rem;
  padding: 1rem;
  backdrop-filter: blur(6px);
  text-align: center;
}

/* High-contrast auth card for login/register pages */
.auth-card {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #0f172a !important;
  /* slate-900 */
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: none !important;
  text-align: left;
}

.auth-card .form-label {
  color: #0f172a;
  font-weight: 600;
}

.auth-card .form-control {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.auth-card .form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
  background: #fff;
}

.auth-card .btn-primary {
  color: #fff;
}

.auth-card .text-muted {
  color: #4b5563 !important;
}

.auth-card a {
  color: #0d6efd;
  text-decoration: none;
}

.auth-card a:hover {
  text-decoration: underline;
}

/* Stack auth form fields vertically (override generic .card form flex) */
.auth-card form {
  display: block !important;
}

.auth-card .mb-3 {
  margin-bottom: 1rem !important;
}

.auth-card .form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.auth-card .d-grid {
  margin-top: .5rem;
}

/* Compact card padding on small devices to reduce vertical scroll */
@media (max-width: 576px) {
  .card {
    padding: .75rem;
  }
}

.card h3 {
  margin-top: .25rem;
  margin-bottom: .5rem;
}

.card p {
  margin-bottom: .75rem;
}

.card form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
}

.card .btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  justify-content: center;
}

.card .btn i {
  margin-right: .25rem;
}

/* Admin page readability overrides */
.admin-page .card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e5e7eb !important;
}

.admin-page h1,
.admin-page h2,
.admin-page h3,
.admin-page h4,
.admin-page h5,
.admin-page h6 {
  color: #ffffff !important;
}

/* But when headings are inside a white card, make them dark for contrast */
.admin-page .card h1,
.admin-page .card h2,
.admin-page .card h3,
.admin-page .card h4,
.admin-page .card h5,
.admin-page .card h6 {
  color: #0f172a !important;
}

.admin-page .card .text-muted {
  color: #374151 !important;
}

.admin-page .table {
  color: #111827;
}

.admin-page .table thead th {
  color: #0f172a;
}

.admin-page .card-header.bg-primary {
  background-color: #0d6efd !important;
}

/* Ensure admin headings never disappear due to animations/transitions or overlap */
.admin-page h1,
.admin-page h2,
.admin-page h3,
.admin-page h4,
.admin-page h5,
.admin-page h6 {
  opacity: 1 !important;
  /* prevent fade-outs */
  visibility: visible !important;
  /* prevent accidental hidden */
  transition: none !important;
  /* avoid unintended transitions */
  position: relative;
  /* create stacking context over background */
  z-index: 1;
  /* stay above starfield/background */
}

/* Compact buttons on admin pages (override global pill paddings) */
.admin-page .btn {
  border-radius: .375rem;
  /* standard radius */
}

.admin-page .btn.btn-sm {
  padding: .25rem .5rem !important;
  /* compact height/width */
  font-size: .875rem;
  /* slightly smaller text */
  line-height: 1.2;
  /* tighter line height */
}

/* Neutralize oversized pill paddings from site-wide style.css for outline primary in admin */
.admin-page .btn-outline-primary {
  padding: .375rem .75rem !important;
  /* Bootstrap default */
  border-radius: .375rem !important;
}

.admin-page .btn-outline-danger {
  padding: .375rem .75rem !important;
  border-radius: .375rem !important;
}

/* Ensure spacing between action buttons in tables */
.admin-page .btn+.btn {
  margin-left: .5rem;
}

/* Checkout page readability overrides */
.checkout-page .card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e5e7eb !important;
  backdrop-filter: none !important;
  text-align: left;
}

.checkout-page .card-header.bg-primary {
  background-color: #0d6efd !important;
}

.checkout-page .card-header.bg-primary .text-white,
.checkout-page .card-header.bg-primary h5 {
  color: #ffffff !important;
}

.checkout-page .card-body p {
  color: #0f172a;
}

.checkout-page .text-muted {
  color: #374151 !important;
}

.checkout-page .table {
  color: #111827;
}

.checkout-page .table thead th {
  color: #0f172a;
  font-weight: 700;
}

.checkout-page .form-label,
.checkout-page .form-check-label {
  color: #0f172a;
  font-weight: 600;
}

.checkout-page .form-check-input {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.checkout-page .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Modal readability (used by Category Manage modal) */
.modal-content {
  background: #ffffff;
  color: #0f172a;
}

.modal .form-label {
  color: #0f172a;
  font-weight: 600;
}

.modal .table thead th {
  color: #0f172a;
  font-weight: 700;
}

.modal .btn {
  border-radius: .5rem;
}

.modal .form-control {
  background: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.modal .form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

/* Icon picker styles */
.icon-picker {
  display: none;
  max-height: 320px;
  overflow: auto;
  width: 100%;
  background: #111827;
  /* dark gray */
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: .5rem;
}

.icon-picker.show {
  display: block;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}

.icon-item {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
}

.icon-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.icon-item .icon-glyph i {
  font-size: 20px;
  color: #ffffff;
  display: block;
}

.icon-item .icon-name {
  margin-top: 4px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.icon-picker #iconSearch {
  margin-bottom: 8px;
}

.icon-picker #iconSearch {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.icon-picker #iconSearch::placeholder {
  color: #9ca3af;
}

/* Login-to-buy row with cart at the right side */
.buy-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.buy-center .btn-buy {
  order: 1;
}

.buy-center .add-to-cart {
  order: 2;
}

/* Shop page legibility */
.shop-page h2 {
  color: #0f172a;
}

.shop-filters {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
}

.shop-filters .card-body {
  background: #ffffff;
}

.shop-filters .card-title,
.shop-filters h6 {
  color: #0f172a;
}

.shop-filters .list-group-item {
  background: #ffffff;
  color: #0f172a;
  border-color: #e5e7eb;
}

.shop-filters .list-group-item i {
  color: #0b1324;
}

.shop-filters .list-group-item.active,
.shop-filters .list-group-item.active.bg-light {
  background: #e8f0fe !important;
  color: #0f172a !important;
  border-color: #e8f0fe !important;
  font-weight: 600;
}

/* Mobile offcanvas for shop sidebar */
@media (max-width: 767.98px) {
  .shop-offcanvas {
    width: min(92vw, 360px);
    background: #ffffff;
    color: #0f172a;
    border-right: 1px solid #e5e7eb;
  }

  .shop-offcanvas .offcanvas-header {
    border-bottom: 1px solid #e9ecef;
  }

  .shop-offcanvas .offcanvas-title {
    font-weight: 700;
    color: #0f172a;
  }

  .shop-offcanvas .shop-filters {
    background: #ffffff;
    border: none;
    box-shadow: none;
  }

  .shop-offcanvas .list-group-item {
    padding-top: .65rem;
    padding-bottom: .65rem;
  }

  .mobile-filter-btn {
    position: sticky;
    top: .5rem;
    z-index: 1010;
  }
}

@media (max-width: 420px) {
  .buy-center {
    flex-direction: column;
  }

  .buy-center .btn,
  .buy-center .btn-buy {
    width: 100%;
  }
}

/* Make login and add-to-cart buttons visually distinct */
/* Login to buy = blue (primary) */
.buy-center .btn-buy {
  background-image: linear-gradient(180deg, #0d6efd, #0b5ed7);
  border-color: #0b5ed7;
  color: #fff;
}

.buy-center .btn-buy:hover {
  background-image: linear-gradient(180deg, #0b5ed7, #0a58ca);
  border-color: #0a58ca;
  color: #fff;
}

.buy-center .btn-buy:active {
  background-image: linear-gradient(180deg, #0a58ca, #094db4);
  border-color: #094db4;
  color: #fff;
}

/* Add to cart = green outline that fills on hover */
.buy-center .add-to-cart {
  background: rgba(25, 135, 84, 0.08);
  border-color: #198754;
  color: #fff;
}

.buy-center .add-to-cart:hover {
  background: #198754;
  border-color: #157347;
  color: #fff;
}

.buy-center .add-to-cart:active {
  background: #157347;
  border-color: #146c43;
  color: #fff;
}

.sidebar {
  width: 100%;
  height: auto;
}

.sidebar .menu li a,
.sidebar .sidebar-toplinks li a {
  display: block;
  padding: .5rem .625rem;
  border-radius: .5rem;
  line-height: 1.3;
  /* Allow full text to be visible and wrap to the next line */
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}

.sidebar .menu li a .icon,
.sidebar .sidebar-toplinks li a .icon {
  margin-right: .5rem;
  width: 1.125rem;
  display: inline-block;
  text-align: center;
  opacity: .95;
}

.sidebar .menu li a:hover,
.sidebar .sidebar-toplinks li a:hover {
  background: var(--btn-bg-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.sidebar .menu li a:active,
.sidebar .sidebar-toplinks li a:active {
  transform: translateY(1px);
}

.sidebar .sidebar-title {
  margin-top: .75rem;
  margin-bottom: .25rem;
}

/* Hide specific sidebar link as requested */
body>div.layout>aside>ul:nth-child(5)>li:nth-child(6)>a {
  display: none !important;
}

/* Lightning text effect */
.lightning-text {
  position: relative;
  color: #ffffff;
  /* toned-down purple glow */
  -webkit-text-stroke: 0.4px rgba(0, 0, 0, 0.45);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 0 2px rgba(255, 255, 255, 0.75),
    0 0 6px rgba(var(--brand-purple), 0.28);
  /* subtle outer glow layer behind text */
  filter: saturate(105%);
  animation: lightningFlicker 3.2s ease-in-out infinite;
}

/* extra aura behind using pseudo element for depth */
.lightning-text::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(var(--brand-purple), 0.18), rgba(var(--brand-purple), 0) 70%),
    radial-gradient(80% 70% at 50% 40%, rgba(var(--brand-purple), 0.12), rgba(var(--brand-purple), 0) 75%);
  filter: blur(8px) saturate(110%);
  opacity: .7;
  transition: opacity .2s ease;
}

@keyframes lightningFlicker {

  /* calm */
  0%,
  6%,
  100% {
    text-shadow:
      0 1px 0 rgba(0, 0, 0, 0.5),
      0 0 2px rgba(255, 255, 255, 0.7),
      0 0 6px rgba(var(--brand-purple), 0.26);
    filter: saturate(105%);
  }

  /* micro flicker */
  7% {
    text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 2px rgba(255, 255, 255, .7), 0 0 6px rgba(var(--brand-purple), .26);
  }

  /* soft pulse instead of big strike */
  8%,
  8.6% {
    text-shadow:
      0 1px 0 rgba(0, 0, 0, .5),
      0 0 3px rgba(255, 255, 255, .85),
      0 0 9px rgba(var(--brand-purple), .36);
    filter: saturate(112%);
  }

  /* gentle fade */
  10% {
    text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 2px rgba(255, 255, 255, .75), 0 0 8px rgba(var(--brand-purple), .3);
  }

  /* tiny jitter */
  30% {
    text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 2px rgba(255, 255, 255, .7), 0 0 7px rgba(var(--brand-purple), .26);
  }

  /* soft glow cycle midpoint */
  50% {
    text-shadow:
      0 1px 0 rgba(0, 0, 0, 0.5),
      0 0 3px rgba(255, 255, 255, 0.8),
      0 0 9px rgba(var(--brand-purple), 0.34);
  }

  /* final jitter */
  72% {
    text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 3px rgba(255, 255, 255, .75), 0 0 8px rgba(var(--brand-purple), .28);
  }

  82%,
  83% {
    text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 4px rgba(255, 255, 255, .9), 0 0 11px rgba(var(--brand-purple), .38);
  }
}

/* ==========================
   Product page readability
   (scoped to <main class="product-page">)
   ========================== */
.product-page {
  color: #e9ecef;
  /* keep high contrast on dark bg */
  /* Ensure content stays above starfield/cosmic particles */
  position: relative;
  z-index: 1;
}

.product-page>.container {
  position: relative;
  z-index: 1;
}

.product-page h1 {
  color: #ffffff;
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: .2px;
}

.product-page h2.product-price {
  color: var(--brand-accent, #00e5ff);
  font-size: 2rem;
  font-weight: 800;
}

.product-page .product-price-old {
  color: #adb5bd !important;
  /* improve contrast vs background */
}

.product-page .breadcrumb {
  background: transparent;
}

.product-page .breadcrumb .breadcrumb-item a {
  color: #cfd3d8;
  text-decoration: none;
}

.product-page .breadcrumb .breadcrumb-item a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.product-page .breadcrumb .breadcrumb-item.active {
  color: #ffffff;
}

.product-page p,
.product-page .card-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #e5e7eb;
}

.product-page .text-muted {
  color: #cbd5e1 !important;
  /* override too-dim gray */
  opacity: 1 !important;
}

.product-page .list-unstyled li {
  color: #e2e8f0;
}

.product-page .list-unstyled i {
  color: #9db2ff;
  opacity: .95;
}

/* Buttons on dark bg already themed; ensure outline-secondary is readable */
.product-page .btn-outline-secondary {
  color: #e2e8f0;
  border-color: #94a3b8;
}

.product-page .btn-outline-secondary:hover {
  color: #0f172a;
  background-color: #e2e8f0;
  border-color: #e2e8f0;
}

/* Rating stars keep gold color but bump size slightly for clarity */
.product-page .rating-stars i {
  font-size: 1rem;
}

/* Tweak badges for readability on dark background */
.product-page .badge.bg-warning {
  color: #0f172a !important;
}

@media (max-width: 576px) {
  .product-page h1 {
    font-size: 1.6rem;
  }

  .product-page h2.product-price {
    font-size: 1.6rem;
  }

  .product-page p,
  .product-page .card-text {
    font-size: 1rem;
    line-height: 1.65;
  }
}

/* Forms and cards inside product page */
.product-page .card {
  text-align: left;
  color: #e9ecef;
}

.product-page .card-title {
  color: #ffffff;
  font-weight: 700;
}

.product-page h3 {
  color: #ffffff;
  font-weight: 700;
}

.product-page .form-label {
  color: #e5e7eb;
  font-weight: 600;
}

.product-page .form-check-label {
  color: #e5e7eb;
  font-weight: 600;
}

.product-page .form-check-input {
  background-color: #0b0f16;
  border-color: #6b7280;
}

.product-page .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.product-page .form-control::placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* ==========================
   Home/Listing product cards readability
   ========================== */
/* Use a solid dark translucent background to ensure text contrast */
.product-card {
  background: rgba(15, 17, 21, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(6px);
}

/* Headings and body text inside product cards */
.product-card .card-title {
  color: #ffffff;
  font-weight: 700;
}

.product-card .card-body {
  color: #e9ecef;
}

.product-card .card-text {
  color: #cfd3d8;
  opacity: 1;
}

.product-card .text-muted {
  color: #cfd3d8 !important;
  opacity: 1 !important;
}

/* Prices with better contrast on dark */
.product-card .product-price {
  color: #60a5fa;
  font-weight: 800;
}

.product-card .product-price-old {
  color: #adb5bd !important;
}

/* Rating stars (unfilled) slightly brighter than default muted */
.product-card .rating-stars i.text-muted {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* Ensure badges remain readable */
.product-card .badge.bg-primary {
  color: #ffffff;
}

/* Section headings over galaxy background */
.galaxy-wrap h1,
.galaxy-wrap h2,
.galaxy-wrap h3 {
  color: #ffffff;
}

/* ==========================
   Checkout Summary Visibility Fix
   ========================== */
.checkout-summary {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: .75rem;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
  color: #e9ecef;
}

.checkout-summary h5 {
  color: #ffffff !important;
  font-weight: 700;
}

.checkout-summary .d-flex span,
.checkout-summary .d-flex strong {
  color: #e9ecef !important;
}

.checkout-summary .text-primary {
  color: var(--brand-accent) !important;
}

.checkout-summary hr {
  border-color: rgba(255, 255, 255, 0.15);
}