/* ══════════════════════════════════════════════════════════════════════
   🔮 CRYSTALXSTORE MASTER MOBILE RESPONSIVE SYSTEM (MOBILE FIRST & FLUID)
   Comprehensive Mobile & Tablet Responsiveness for Frontend & Admin Backend
   ══════════════════════════════════════════════════════════════════════ */

/* ── 1. GLOBAL RESET, VIEWPORT & OVERFLOW CONTAINMENT ── */
:root {
  --cx-bottom-nav-height: 64px;
  --cx-safe-bottom: env(safe-area-inset-bottom, 0px);
  --cx-safe-top: env(safe-area-inset-top, 0px);
  --cx-admin-topbar-h: 60px;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

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

/* Fix iOS font auto-zoom on inputs */
@media (max-width: 768px) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ── 2. TOUCH TARGETS & ACCESSIBILITY ── */
button, a, input, select, textarea, .btn, .cx-nav-item, .cx-drawer-item, .cx-bnav-item {
  touch-action: manipulation;
}

@media (max-width: 768px) {
  button, .btn, a.btn, input[type="button"], input[type="submit"] {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-sm {
    min-height: 32px !important;
  }
}

/* ── 3. STOREFRONT MOBILE BOTTOM NAVIGATION BAR ── */
.cx-bottom-nav {
  display: none;
}

@media (max-width: 991px) {
  /* No bottom bar padding */
  body:not(.is-backend) {
    padding-bottom: 20px !important;
  }

  .cx-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    pointer-events: none !important;
  }
    left: 0 !important;
    right: 0 !important;
    height: calc(var(--cx-bottom-nav-height) + var(--cx-safe-bottom)) !important;
    padding-bottom: var(--cx-safe-bottom) !important;
    background: rgba(13, 11, 24, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(139, 92, 246, 0.25) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.85), 0 -2px 10px rgba(124, 58, 237, 0.2) !important;
    z-index: 1040 !important;
    justify-content: space-around !important;
    align-items: center !important;
  }

  .cx-bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
  }

  .cx-bnav-item i, .cx-bnav-item svg {
    font-size: 1.2rem;
    width: 20px;
    height: 20px;
    transition: all 0.2s ease;
  }

  .cx-bnav-item:hover, .cx-bnav-item:active {
    color: #c084fc;
  }

  .cx-bnav-item.active {
    color: #a855f7 !important;
    font-weight: 700;
  }

  .cx-bnav-item.active i, .cx-bnav-item.active svg {
    transform: translateY(-2px) scale(1.1);
    color: #a855f7 !important;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8));
  }

  .cx-bnav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #c084fc);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.9);
  }

  .cx-bnav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 9999px;
    line-height: 1.2;
    border: 1px solid #0d0b18;
  }
}

/* ── 4. RESPONSIVE STOREFRONT HEADER & NAVBAR ── */
@media (max-width: 991px) {
  .cx-storefront-navbar-wrap {
    padding: 6px 10px !important;
  }
  .cx-navbar-pill {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    padding: 6px 12px !important;
    border-radius: 16px !important;
  }
  .cx-brand-name {
    font-size: 14px !important;
    max-width: 140px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .cx-brand-logo {
    height: 28px !important;
    width: auto !important;
  }
  .cx-balance-pill {
    padding: 4px 10px !important;
  }
  .cx-balance-text {
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .cx-brand-name {
    font-size: 12px !important;
    max-width: 105px !important;
  }
  .cx-brand-logo {
    height: 24px !important;
  }
  .cx-balance-pill {
    padding: 3px 8px !important;
  }
  .cx-balance-text {
    font-size: 10.5px !important;
  }
}

/* ── 5. RESPONSIVE HERO SECTION ── */
@media (max-width: 991px) {
  .p0-hero-section {
    padding-top: 8px !important;
    padding-bottom: 0 !important;
  }
  .p0-hero-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding-top: 6px !important;
    padding-bottom: 12px !important;
  }
  .p0-hero-left {
    max-width: 100% !important;
    width: 100% !important;
  }
  .p0-hero-title {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
    word-break: break-word !important;
  }
  .p0-hero-desc {
    font-size: 13px !important;
    line-height: 1.55 !important;
    margin-bottom: 16px !important;
    max-width: 100% !important;
  }
  .p0-hero-actions {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }
  .p0-btn-primary, .p0-btn-secondary {
    flex: 1 !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
  .p0-hero-right {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 4px !important;
  }
  .p0-feat-item {
    width: 100% !important;
    background: rgba(124, 58, 237, 0.08) !important;
    border: 1px solid rgba(139, 92, 246, 0.18) !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
  }
  .p0-feat-item span {
    font-size: 12.5px !important;
  }
  .p0-feat-icon {
    width: 32px !important;
    height: 32px !important;
  }
}

@media (max-width: 480px) {
  .p0-hero-title {
    font-size: 20px !important;
  }
  .p0-hero-desc {
    font-size: 12px !important;
  }
}

/* ── 6. RESPONSIVE BANNER & 4 STAT CARDS ── */
@media (max-width: 991px) {
  .p0-banner-grid {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .p0-carousel {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    flex: none !important;
    overflow: hidden !important;
  }
  .p0-carousel img {
    width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    border-radius: 14px !important;
    display: block !important;
  }
  .p0-stats-col {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    flex-direction: unset !important;
  }
  .p0-stat-card {
    min-height: 58px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }
  .p0-stat-icon-wrap {
    width: 32px !important;
    height: 32px !important;
  }
  .p0-stat-icon-wrap svg {
    width: 15px !important;
    height: 15px !important;
  }
  .p0-stat-label {
    font-size: 10.5px !important;
  }
  .p0-stat-num {
    font-size: 15px !important;
  }
  .p0-stat-unit {
    font-size: 10.5px !important;
  }
  .p0-stat-watermark {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .p0-carousel img {
    height: auto !important;
    max-height: none !important;
  }
  .p0-stats-col {
    gap: 8px !important;
  }
  .p0-stat-card {
    min-height: 52px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .p0-stat-num {
    font-size: 14px !important;
  }
}

/* ── 7. RESPONSIVE PRODUCT GRID & SHELF TRACK ── */
@media (max-width: 768px) {
  /* Home shelf: wrap 2 columns (no horizontal peek/cut) */
  .cx-home-shelf-wrapper {
    overflow: visible !important;
  }
  .cx-home-prod-track {
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 10px !important;
    padding: 4px 0 12px 0 !important;
    scroll-snap-type: none !important;
  }
  .cx-home-prod-track .product-card-link {
    flex: 0 0 calc((100% - 10px) / 2) !important;
    width: calc((100% - 10px) / 2) !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  
  /* Shop page 2-column grid */
  .product-grid, .shop-grid, .v2-prod-grid, .prod-grid, .prod-grid-layout {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .product-card-inner {
    padding: 10px !important;
    border-radius: 14px !important;
  }
  .product-image-container {
    border-radius: 10px !important;
  }
  .product-name {
    font-size: 13px !important;
    margin-bottom: 3px !important;
    height: auto !important;
    max-height: 38px !important;
    line-height: 1.3 !important;
  }
  .product-price {
    font-size: 14.5px !important;
    margin-bottom: 4px !important;
  }
  .stock-badge span {
    font-size: 10px !important;
  }
  .buy-button {
    font-size: 12px !important;
    padding: 7px 10px !important;
    border-radius: 8px !important;
  }
  .sold-tag {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
    top: 6px !important;
    right: 6px !important;
  }
}

@media (max-width: 360px) {
  .product-grid, .shop-grid, .v2-prod-grid, .prod-grid, .prod-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ── 8. CATEGORY PILLS BAR (HORIZONTAL SCROLL ON MOBILE) ── */
@media (max-width: 991px) {
  .category-scroll-wrapper, .shop-cat-pills-bar, .cx-cat-pills-row {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 4px 2px 10px 2px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .category-scroll-wrapper::-webkit-scrollbar, .shop-cat-pills-bar::-webkit-scrollbar, .cx-cat-pills-row::-webkit-scrollbar {
    display: none !important;
  }
  .category-pill, .shop-cat-pill {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 7px 15px !important;
    font-size: 12.5px !important;
    border-radius: 9999px !important;
  }
}

/* ── 9. RESPONSIVE PRODUCT DETAIL PAGE ── */
@media (max-width: 991px) {
  .pfx-container {
    padding: 12px 12px 60px 12px !important;
  }
  .pfx-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .pfx-art-wrap {
    max-width: 420px !important;
    margin: 0 auto !important;
  }
  .pfx-title {
    font-size: 1.5rem !important;
  }
  .pfx-price-hero {
    font-size: 2rem !important;
  }
  .pfx-section-box {
    padding: 16px 14px !important;
    border-radius: 16px !important;
  }
  .pfx-variant-card {
    padding: 12px 14px !important;
  }
  .pfx-vc-name {
    font-size: 0.9rem !important;
  }
  .pfx-vc-price {
    font-size: 1.05rem !important;
  }
  .pfx-qty-row {
    flex-direction: row !important;
    gap: 12px !important;
  }
  .pfx-qty-capsule {
    height: 44px !important;
    width: 140px !important;
  }
  .pfx-btn-buy-hero {
    min-height: 48px !important;
    font-size: 1rem !important;
  }
}

/* ── 10. RESPONSIVE TOPUP PAGE ── */
@media (max-width: 820px) {
  .cx-topup-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .cx-channel-sidebar {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .cx-channel-card {
    padding: 12px !important;
    border-radius: 14px !important;
  }
  .cx-topup-panel {
    padding: 18px 16px !important;
    border-radius: 18px !important;
  }
  .cx-topup-balance {
    font-size: 28px !important;
  }
  .qr-code-box, .cx-qr-image-wrap img {
    max-width: 220px !important;
    margin: 0 auto !important;
  }
}
@media (max-width: 480px) {
  .cx-channel-sidebar {
    grid-template-columns: 1fr !important;
  }
}

/* ── 11. RESPONSIVE HISTORY & ORDERS HUB ── */
@media (max-width: 768px) {
  .cx-his-tab-wrap {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cx-his-tab-wrap::-webkit-scrollbar {
    display: none;
  }
  .cx-his-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 7px 14px !important;
    font-size: 0.82rem !important;
  }
  
  /* Discrete Key Cards in Receipt Modal */
  .cx-key-card {
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }
  .cx-key-card code {
    font-size: 0.8rem !important;
    word-break: break-all !important;
  }
}

/* ── 12. RESPONSIVE TABLES & MOBILE CARDS ── */
.table-responsive {
  border-radius: 12px;
  -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 768px) {
  .table-responsive {
    border: none !important;
    overflow-x: auto !important;
  }
  .table {
    font-size: 12.5px !important;
  }
  .table th, .table td {
    padding: 8px 10px !important;
    white-space: nowrap;
  }
}

/* ── 13. RESPONSIVE PROFILE & LUCKY WHEEL ── */
@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .wheel-container {
    max-width: 100vw !important;
    padding: 10px !important;
  }
  #wheelCanvas {
    max-width: 90vw !important;
    height: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   14. RESPONSIVE BACKEND ADMIN PANEL (CRYSTALX MOBILE FIRST)
   ══════════════════════════════════════════════════════════════ */

/* Backend Navbar on Mobile */
@media (max-width: 1199.98px) {
  .cx-backend-navbar, .cx-admin-header {
    height: auto !important;
    min-height: 54px !important;
    padding: 6px 0 !important;
  }
  .cx-backend-navbar .container-fluid, .cx-admin-header-inner {
    height: auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }
  .cx-admin-brand-title {
    font-size: 0.95rem !important;
  }
  .cx-admin-brand-sub {
    font-size: 0.62rem !important;
  }
  .cx-admin-brand-logo {
    width: 26px !important;
    height: 26px !important;
  }
}

/* Quick Scrollable Admin Tabs for Mobile */
.cx-admin-quick-bar {
  display: none;
  background: #090714;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  padding: 8px 12px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  z-index: 1030;
}
.cx-admin-quick-bar::-webkit-scrollbar {
  display: none;
}
@media (max-width: 1199.98px) {
  .cx-admin-quick-bar {
    display: flex !important;
    align-items: center;
  }
}
.cx-admin-qtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.cx-admin-qtab:hover,
.cx-admin-qtab.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: #a855f7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}
.cx-admin-qtab i {
  font-size: 11px;
}

/* Admin Mobile Slide Drawer */
.cx-admin-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cx-admin-drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.cx-admin-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #080612;
  border-right: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85);
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.cx-admin-mobile-drawer.show {
  transform: translateX(0) !important;
  display: flex !important;
}

/* Dashboard Responsive Layout & Cards */
@media (max-width: 991.98px) {
  .dash-container {
    padding: 12px 10px 80px 10px !important;
  }
  .dash-header-title {
    font-size: 1.45rem !important;
  }
  .dash-card {
    padding: 0.9rem 1rem !important;
    border-radius: 14px !important;
  }
  .dash-val-main {
    font-size: 1.35rem !important;
  }
  .dash-lbl-main {
    font-size: 0.8rem !important;
  }
  .dash-sub-text {
    font-size: 0.7rem !important;
  }
  .dash-icon-box {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
  }
  .dash-pill-tag {
    top: 0.75rem !important;
    right: 0.75rem !important;
    font-size: 0.65rem !important;
    padding: 1px 7px !important;
  }
  .chart-box {
    padding: 16px 12px !important;
    border-radius: 14px !important;
  }
  .chart-box > div[style*="height: 480px"],
  .chart-box > div[style*="height:480px"] {
    height: 260px !important;
  }
}

/* 2-Col Grid on Mobile for Admin Stats */
@media (max-width: 575.98px) {
  .dash-container .row.g-3 > div[class*="col-"] {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
  .chart-box > div[style*="height: 480px"],
  .chart-box > div[style*="height:480px"] {
    height: 220px !important;
  }
}
@media (max-width: 380px) {
  .dash-container .row.g-3 > div[class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* ── 15. ADMIN MODALS & FORMS ON MOBILE ── */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px auto !important;
    max-width: calc(100vw - 16px) !important;
  }
  .modal-content {
    border-radius: 16px !important;
  }
  .modal-body {
    max-height: calc(85vh - 110px) !important;
    overflow-y: auto !important;
    padding: 14px !important;
  }
  .modal-footer {
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .modal-footer .btn {
    flex: 1 1 auto !important;
    min-height: 42px !important;
  }
  
  /* Manage Variants Split Browser on Mobile */
  .mv-split-browser {
    flex-direction: column !important;
    height: auto !important;
  }
  .mv-split-browser > div {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
}

/* ── 16. FLOATING DISCORD & CHAT WIDGET RESPONSIVE POSITION ── */
@media (max-width: 768px) {
  .cx-floating-discord,
  .cx-floating-chat,
  .floating-discord-btn,
  .cx-scroll-top,
  .floating-contact-btn {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 1.2rem !important;
    z-index: 1060 !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6) !important;
  }
}

@media (max-width: 480px) {
  .cx-floating-discord,
  .cx-floating-chat,
  .floating-discord-btn {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 1.1rem !important;
  }
}

@media (max-width: 768px) {
  .p0-why-grid, .why-grid, .cx-why-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .p0-why-card, .why-card {
    width: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding: 16px 18px !important;
  }
}


/* ══════════════════════════════════════════════════════════════════════
   📱 IPAD & MOBILE RESPONSIVE HIGH-CLARITY SURFACE ENHANCEMENTS
   Ensures child stores and master store render with beautiful contrast,
   distinct elevated cards, legible typography, and seamless touch UI
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1199.98px) {
  /* Rich dark backdrop with depth instead of flat pitch black */
  html, body, body.theme-dark, body.cx-starry-bg, #main-app-content, .page-wrapper {
    background-color: #0b0c10 !important;
    background: radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb, 124, 58, 237), 0.12) 0%, #0b0c10 70%) !important;
    min-height: 100vh !important;
  }

  /* Elevated Card Surfaces with clear distinction & subtle borders */
  .card, .xez-card, .product-card, .product-card-inner, .pfx-card, .pfx-panel,
  .admin-card, .dashboard-stat-card, .cx-prod-card, .cx-home-card, .p0-stat-card,
  .p0-why-card, .p0-product-card, .p0-card, .p0-review-card, .cx-channel-card,
  .shop-product-card, .category-card, .p0-feat-card, .dash-card, .cx-topup-card {
    background: rgba(18, 17, 28, 0.92) !important;
    background-color: #12111c !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  }

  /* Clear legible text on all mobile cards */
  .card-title, .p0-card-title, .product-name, .cx-prod-title, .p0-feat-title,
  .card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
    color: #ffffff !important;
  }
  .card-text, .text-muted, .p0-card-desc, .cx-prod-desc, .p0-feat-desc, .card p {
    color: #cbd5e1 !important;
  }

  /* Input Fields on Mobile */
  input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea, .form-control {
    background-color: #141320 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
  }

  /* Modal Dialogs */
  .modal-content {
    background: #12111c !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
  }

  /* ═══ CYBERPUNK SCI-FI HUD FLOATING MOBILE MENU MODAL ═══ */
  #mobileMenu {
    display: none !important;
  }
  .offcanvas#mobileMenu.show, #mobileMenu.offcanvas.show {
    display: flex !important;
    visibility: visible !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: min(370px, 94vw) !important;
    max-height: min(92dvh, 720px) !important;
    height: auto !important;
    border-radius: 20px !important;
    background: linear-gradient(180deg, #0e091d 0%, #080512 100%) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border: 1.5px solid #a855f7 !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5), 0 24px 60px rgba(0, 0, 0, 0.95), inset 0 0 15px rgba(168, 85, 247, 0.15) !important;
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    flex-direction: column !important;
    z-index: 99999 !important;
    padding: 16px 14px 14px 14px !important;
    animation: cxModalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  #mobileMenu::-webkit-scrollbar {
    width: 4px !important;
  }
  #mobileMenu::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.35) !important;
    border-radius: 4px !important;
  }

  .cx-hud-corner-tl {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    pointer-events: none;
    z-index: 10;
  }
  .cx-hud-corner-tl::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 20px solid #a855f7;
    border-right: 20px solid transparent;
    opacity: 0.35;
  }
  .cx-hud-slashes {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    gap: 2.5px;
    transform: rotate(-45deg);
  }
  .cx-hud-slashes span {
    display: block;
    width: 2px;
    height: 8px;
    background: #e879f9;
    border-radius: 1px;
    box-shadow: 0 0 4px #e879f9;
  }

  .cx-hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    position: relative;
    z-index: 5;
  }
  .cx-neon-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #e879f9;
    box-shadow: 0 0 10px #e879f9, 0 0 18px #c026d3;
    flex-shrink: 0;
  }
  .cx-hud-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  }
  .cx-hud-subtitle {
    font-size: 0.74rem;
    color: #a78bfa;
    font-weight: 500;
    margin-top: 2px;
    line-height: 1.2;
  }
  .cx-hud-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    outline: none;
  }
  .cx-hud-close-btn:hover, .cx-hud-close-btn:active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  }

  .cx-hud-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }
  .cx-hud-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(20, 14, 38, 0.72);
    border: 1.5px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 58px;
  }
  .cx-hud-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-bottom: 9px solid rgba(168, 85, 247, 0.22);
    border-left: 9px solid transparent;
    pointer-events: none;
  }
  .cx-hud-card:hover {
    background: rgba(30, 20, 56, 0.88);
    border-color: rgba(192, 132, 252, 0.65);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
  }
  .cx-hud-card.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(147, 51, 234, 0.15) 100%) !important;
    border: 2px solid #e879f9 !important;
    box-shadow: 0 0 18px rgba(217, 70, 239, 0.65), inset 0 0 12px rgba(217, 70, 239, 0.25) !important;
  }
  .cx-hud-card.active::before {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 3px;
    width: 14px;
    height: 2px;
    background: #e879f9;
    transform: rotate(-45deg);
    box-shadow: 0 0 6px #e879f9;
  }
  .cx-hud-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .cx-hud-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #c084fc;
    font-size: 1.05rem;
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6));
    position: relative;
  }
  .cx-hud-badge::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1px dashed rgba(192, 132, 252, 0.25);
  }
  .cx-hud-card.active .cx-hud-badge {
    background: rgba(232, 121, 249, 0.25);
    border-color: #e879f9;
    color: #ffffff;
    filter: drop-shadow(0 0 8px #e879f9);
  }
  .cx-hud-card-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }
  .cx-hud-card-title {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cx-hud-card-sub {
    color: #a78bfa !important;
    font-size: 0.64rem;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cx-hud-chevron {
    color: #cbd5e1;
    font-size: 0.72rem;
    margin-left: 4px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s ease;
  }
  .cx-hud-card:hover .cx-hud-chevron {
    transform: translateX(2px);
    opacity: 1;
    color: #ffffff;
  }

  .cx-hud-profile-box {
    background: rgba(18, 12, 34, 0.85);
    border: 1.5px solid rgba(168, 85, 247, 0.38);
    border-radius: 14px;
    padding: 10px 12px;
    position: relative;
    overflow: hidden;
  }
  .cx-hud-profile-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 14px solid rgba(168, 85, 247, 0.35);
    border-right: 14px solid transparent;
  }
  .cx-hud-crown-icon {
    font-size: 1.6rem;
    color: #c084fc;
    filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
  }
  .cx-hud-profile-name {
    font-weight: 800;
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1.2;
  }
  .cx-hud-profile-role {
    color: #a78bfa;
    font-size: 0.74rem;
    line-height: 1.2;
    margin-top: 1px;
  }
  .cx-hud-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(168, 85, 247, 0.2);
    border: 1.5px solid rgba(217, 70, 239, 0.55);
    border-radius: 50px;
    padding: 4px 12px;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
  }
  .cx-hud-balance-pill i {
    color: #e879f9;
    font-size: 0.75rem;
  }
  .cx-hud-quick-logout {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
  }
  .cx-hud-quick-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  }

  .cx-hud-admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #7e22ce 0%, #9333ea 50%, #a855f7 100%);
    border: 1.5px solid #d946ef;
    border-radius: 14px;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
  }
  .cx-hud-admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(217, 70, 239, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #ffffff !important;
  }
  .cx-hud-admin-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .cx-hud-admin-btn-inner i {
    font-size: 1.05rem;
  }
  .cx-hud-btn-stripes {
    position: absolute;
    bottom: 4px;
    right: 6px;
    display: flex;
    gap: 3px;
    transform: skewX(-25deg);
    opacity: 0.55;
  }
  .cx-hud-btn-stripes span {
    width: 3px;
    height: 8px;
    background: #ffffff;
    border-radius: 1px;
  }

  .cx-hud-account-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 16px;
    background: rgba(18, 12, 34, 0.85);
    border: 1.5px solid rgba(168, 85, 247, 0.38);
    border-radius: 14px;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }
  .cx-hud-account-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 10px solid rgba(168, 85, 247, 0.35);
    border-right: 10px solid transparent;
  }
  .cx-hud-account-btn:hover {
    background: rgba(28, 18, 52, 0.95);
    border-color: rgba(192, 132, 252, 0.65);
    box-shadow: 0 4px 18px rgba(168, 85, 247, 0.35);
    color: #ffffff !important;
    transform: translateY(-2px);
  }
  .cx-hud-door-icon {
    font-size: 1.15rem;
    color: #cbd5e1;
  }
  .cx-hud-account-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
  }

  /* Mobile Bottom Navigation Bar Completely Removed */
  .cx-mobile-bottom-nav, #cxMobileBottomNav, .cx-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    pointer-events: none !important;
  }
}
/* Modal Master Stacking Context Fix */
.modal {
    z-index: 1060 !important;
}
.modal.show {
    z-index: 1060 !important;
}
.modal-backdrop {
    z-index: 1050 !important;
}
.modal-backdrop.show {
    z-index: 1050 !important;
}
.modal-dialog {
    z-index: 1065 !important;
}
.modal-content {
    z-index: 1070 !important;
}
