/* Modern Responsive Stylesheet with Soft Purple Light Theme as Default */
:root {
  --bg-primary: #f6f3fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #faf7ff;
  --border-color: rgba(124, 58, 237, 0.14);
  --border-focus: #7c3aed;
  
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-glow: rgba(124, 58, 237, 0.22);
  --primary-gradient: linear-gradient(135deg, #7c3aed, #9333ea);
  
  --accent: #9333ea;
  --accent-glow: rgba(147, 51, 234, 0.18);
  
  --warning: #d97706;
  --danger: #dc2626;
  --success: #10b981;
  
  --text-main: #1e153b;
  --text-muted: #5e567a;
  --text-dim: #8b83a6;

  --card-shadow: 0 8px 30px rgba(124, 58, 237, 0.08);
  --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg-primary: #f8f6fd;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #faf8ff;
  --border-color: rgba(139, 92, 246, 0.16);
  --border-focus: #8b5cf6;
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.22);
  --primary-gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);
  
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.2);
  
  --warning: #d97706;
  --danger: #dc2626;
  --success: #10b981;
  
  --text-main: #1e153b;
  --text-muted: #5e567a;
  --text-dim: #8b83a6;
  --card-shadow: 0 8px 30px rgba(139, 92, 246, 0.08);

  --selected-card-bg: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
  --input-bg: #ffffff;
  --summary-bg: #fbfaff;
  --summary-border: rgba(139, 92, 246, 0.25);
  --thumb-bg: linear-gradient(135deg, #f5f0ff 0%, #ede5ff 100%);
}

[data-theme="dark"] {
  --bg-primary: #19142d;
  --bg-secondary: #211a3b;
  --bg-card: #272045;
  --bg-card-hover: #322a56;
  --border-color: rgba(192, 132, 252, 0.24);
  --border-focus: #c084fc;
  
  --primary: #c084fc;
  --primary-hover: #a855f7;
  --primary-glow: rgba(192, 132, 252, 0.35);
  --primary-gradient: linear-gradient(135deg, #c084fc, #e879f9);
  
  --accent: #e879f9;
  --accent-glow: rgba(232, 121, 249, 0.28);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #34d399;
  
  --text-main: #ffffff;
  --text-muted: #e2d9f8;
  --text-dim: #b8abd8;
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

  --selected-card-bg: linear-gradient(180deg, #372c5e 0%, #2b224b 100%);
  --input-bg: #1f1838;
  --summary-bg: #1f1838;
  --summary-border: rgba(192, 132, 252, 0.35);
  --thumb-bg: #352a5a;
}

* {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
}

body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Background glow effects */
.bg-glow-top {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(ellipse at center, var(--primary-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-bottom {
  position: fixed;
  bottom: -200px;
  right: 10%;
  width: 500px;
  height: 400px;
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Main Container */
.app-container {
  position: relative;
  z-index: 1;
  width: 100% !important;
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

/* Header & Navbar */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

[data-theme="light"] .btn-theme-toggle {
  background: #f1f5f9;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(15deg);
}

.btn-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

[data-theme="light"] .btn-admin-link {
  background: #f1f5f9;
}

.btn-admin-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 24px 12px 34px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #7c3aed;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.06);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 30px;
  font-weight: 750;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.gradient-text {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.features-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.feature-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
  color: var(--primary);
}

/* Two-column Store Layout */
.store-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 40px;
  width: 100% !important;
}

/* Product Catalog Column */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

.category-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-filter::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cat-btn.active, .cat-btn:hover {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  border-color: var(--primary);
}

/* Product Cards */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100% !important;
}

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  width: 100% !important;
  box-sizing: border-box;
}

.product-card:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.product-card.selected {
  border: 2px solid var(--primary);
  background: var(--selected-card-bg);
  box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-radio-indicator {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
  flex-shrink: 0;
}

.radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: var(--bg-card);
}

.product-card.selected .radio-circle {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-circle::after {
  content: '✓';
  font-size: 13px;
  color: #fff;
  display: none;
  font-weight: bold;
}

.product-card.selected .radio-circle::after {
  display: block;
}

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--thumb-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
}

.product-body {
  flex: 1;
  min-width: 0;
}

.product-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.product-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(192, 132, 252, 0.12);
  color: var(--primary);
  border: 1px solid rgba(192, 132, 252, 0.25);
  white-space: nowrap;
}

.product-badge.hot {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}


.product-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.product-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}

.product-price-unit {
  font-size: 11.5px;
  color: var(--text-dim);
}

.stock-tag {
  font-size: 11.5px;
  color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.stock-tag.low { color: #d97706; background: rgba(217, 119, 6, 0.1); padding: 2px 8px; border-radius: 999px; }
.stock-tag.out { color: #dc2626; background: rgba(220, 38, 38, 0.1); padding: 2px 8px; border-radius: 999px; }

/* Checkout Box (Desktop Sticky) */
.checkout-panel {
  position: sticky;
  top: 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 40px -10px rgba(124, 58, 237, 0.12);
  width: 100% !important;
  box-sizing: border-box;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-badge-instant {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.selected-item-preview {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(147, 51, 234, 0.03) 100%);
  border: 1.5px solid rgba(124, 58, 237, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

[data-theme="light"] .selected-item-preview {
  background: #fcfaff;
}

.preview-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.4;
}

.preview-category {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quantity Control */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-qty {
  width: 48px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-qty:hover:not(:disabled) {
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary);
}

.btn-qty:active:not(:disabled) {
  transform: scale(0.92);
}

.btn-qty:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.input-qty {
  flex: 1;
  background: transparent;
  border: none;
  text-align: center;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  font-family: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}

.input-qty::-webkit-outer-spin-button,
.input-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}

.input-qty:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  color: var(--text-dim) !important;
}

/* Voucher / Coupon Section */
.voucher-box {
  margin-bottom: 16px;
}

.voucher-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.voucher-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.voucher-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.voucher-icon-prefix {
  font-size: 15px;
  margin-right: 6px;
  opacity: 0.8;
}

.input-voucher {
  flex: 1;
  height: 42px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  text-transform: uppercase;
}

.input-voucher::placeholder {
  color: var(--text-dim);
  text-transform: none;
  font-weight: 400;
  font-size: 12.5px;
}

.btn-apply-voucher {
  height: 42px;
  padding: 0 16px;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
  font-family: inherit;
}

.btn-apply-voucher:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-apply-voucher:active:not(:disabled) {
  transform: translateY(0);
}

.btn-apply-voucher:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Applied Voucher Chip */
.voucher-applied-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px dashed #10b981;
  border-radius: 12px;
  padding: 8px 12px;
  margin-top: 8px;
  animation: fadeIn 0.2s ease;
}

.voucher-chip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voucher-chip-icon {
  font-size: 16px;
}

.voucher-chip-text {
  display: flex;
  flex-direction: column;
}

.voucher-chip-code {
  font-size: 13px;
  font-weight: 700;
  color: #059669;
  letter-spacing: 0.5px;
}

.voucher-chip-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.btn-remove-voucher {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: transform 0.2s;
  font-weight: bold;
}

.btn-remove-voucher:hover {
  transform: scale(1.2);
}

.voucher-msg {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
  padding-left: 2px;
}

.voucher-msg.error {
  color: #dc2626;
}

.voucher-msg.success {
  color: #059669;
}

/* Order Summary */
.summary-box {
  background: var(--summary-bg);
  border: 1.5px dashed var(--summary-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.summary-label {
  font-weight: 500;
  color: var(--text-muted);
}

.summary-value {
  font-weight: 700;
  color: var(--text-main);
}

.summary-value.text-free {
  color: var(--success);
  font-weight: 700;
}

.summary-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}

.summary-row.total {
  margin-bottom: 0;
  padding-top: 4px;
}

.summary-total-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.summary-total-price {
  font-size: 21px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: normal;
}

/* Action Button */
.btn-primary-action {
  width: 100%;
  min-height: 50px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 22px -4px rgba(16, 185, 129, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.1px;
}

.btn-primary-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.55);
}

.btn-primary-action:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary-action:disabled {
  background: #cbd5e1 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none;
}

.btn-mobile-buy:disabled {
  background: #cbd5e1 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  pointer-events: none;
}

[data-theme="dark"] .btn-primary-action:disabled,
[data-theme="dark"] .btn-mobile-buy:disabled {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #8b80b6 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Modal Support Buttons with Rich Backgrounds */
.btn-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.22s ease;
  box-sizing: border-box;
}

.btn-support-zalo {
  background: linear-gradient(135deg, #0068ff 0%, #0050c8 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 104, 255, 0.4) !important;
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.35) !important;
}

.btn-support-zalo:hover {
  background: linear-gradient(135deg, #005ce6 0%, #0043a8 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 104, 255, 0.45) !important;
}

.btn-support-tele {
  background: linear-gradient(135deg, #229ED9 0%, #177cb0 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(34, 158, 217, 0.4) !important;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.35) !important;
}

.btn-support-tele:hover {
  background: linear-gradient(135deg, #1d8bc0 0%, #126691 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34, 158, 217, 0.45) !important;
}

.product-card.out-of-stock {
  opacity: 0.8;
  filter: grayscale(0.15);
}

.product-card.out-of-stock .product-name {
  color: var(--text-main) !important;
  opacity: 0.95;
}

.product-card.out-of-stock .product-desc {
  color: var(--text-muted);
  opacity: 0.85;
}

.product-card.out-of-stock .stock-tag {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12);
  font-weight: 700;
}

.checkout-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Product Guide Box */
.product-guide-box {
  margin-top: 16px;
  background: rgba(124, 58, 237, 0.05);
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
}

.guide-heading {
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
}

.guide-text {
  white-space: pre-line;
  font-size: 12.5px;
  color: var(--text-muted);
}


/* Mobile Floating Bottom Bar (Strictly hidden on desktop, only flex on < 640px) */
.mobile-bottom-bar {
  display: none !important;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 99;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.2);
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mobile-bar-info {
  flex: 1;
  min-width: 0;
}

.mobile-bar-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bar-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.btn-mobile-buy {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Payment Modal Overlay (Hidden completely by default) */
.modal-overlay {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 14, 36, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex !important;
  animation: fadeInModal 0.25s ease forwards;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  color: var(--text-main);
}

/* Modal Header Navigation (Flex row: Left Badge + Right Close) */
.modal-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  width: 100%;
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warning);
}

.pulse-dot-amber {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseGlow 1.5s infinite;
  flex-shrink: 0;
}

.countdown-digits {
  font-size: 16px;
  font-weight: 800;
  font-family: monospace;
  color: var(--warning);
}

.countdown-digits.urgent {
  color: var(--danger);
  animation: pulse 1s infinite;
}

.modal-close-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close-icon:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
  transform: scale(1.06);
}

.modal-title-box {
  text-align: center;
  margin-bottom: 12px;
}

.modal-main-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.modal-sub-title {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Modal Delivered & Error Header Badges */
.modal-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-success-title {
  font-size: 16px;
  font-weight: 700;
  color: #10b981;
}

.modal-delivered-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.modal-error-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* QR Code Section */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.qr-box {
  background: #ffffff;
  padding: 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.qr-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  max-width: 320px;
}

/* Payment Info Table */
.info-rows {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 16px;
}

[data-theme="light"] .info-rows {
  background: #f8fafc;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.info-item:last-child {
  border-bottom: none;
}

.info-key {
  color: var(--text-muted);
}

.info-val {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.btn-copy-chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  width: 100%;
  justify-content: center;
  margin-bottom: 14px;
}

.status-pill.pending {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent);
}

.status-pill.completed {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--primary);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Account Delivery Box */
.delivery-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.1));
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.delivery-header {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.account-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-family: monospace;
}

.acc-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12.5px;
}

.acc-label {
  color: var(--text-dim);
}

.acc-data {
  color: var(--text-main);
  font-weight: bold;
  user-select: all;
}

.btn-copy-all-acc {
  width: 100%;
  padding: 8px 12px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-copy-all-acc:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Delivered Guide Accordion (Collapsible to save viewport space) */
.delivered-guide-accordion {
  background: rgba(124, 58, 237, 0.04);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
}

.delivered-guide-summary {
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
}

.delivered-guide-summary::-webkit-details-marker {
  display: none;
}

.accordion-arrow {
  transition: transform 0.2s;
  font-size: 12px;
  color: var(--text-muted);
}

.delivered-guide-accordion[open] .accordion-arrow {
  transform: rotate(180deg);
}

.delivered-guide-accordion .guide-text {
  padding: 8px 12px;
  border-top: 1px dashed var(--border-color);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.btn-finish-modal {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-finish-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

/* Test Demo Trigger */
.demo-trigger-box {
  margin-top: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  text-align: center;
}

.btn-demo-pay {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-demo-pay:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   DEDICATED MOBILE PHONE OPTIMIZATION (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 10px 10px 90px 10px !important; /* Bottom padding for floating bar */
    margin: 0 !important;
  }

  /* Header on Phone */
  .header-bar {
    padding: 8px 12px !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 14px !important;
  }

  .brand-logo {
    width: 34px !important;
    height: 34px !important;
    font-size: 17px !important;
  }

  .brand-text h1 {
    font-size: 14px !important;
    max-width: 160px !important;
  }

  .brand-text p {
    font-size: 11px !important;
  }

  .header-actions {
    gap: 6px !important;
  }

  .btn-theme-toggle {
    width: 34px !important;
    height: 34px !important;
    font-size: 15px !important;
  }

  .btn-admin-link {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* Hero Section */
  .hero-section {
    padding: 10px 4px 18px !important;
  }

  .hero-title {
    font-size: 19px !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
  }

  .hero-subtitle {
    font-size: 12.5px !important;
    margin-bottom: 12px !important;
  }

  .features-row {
    gap: 6px !important;
  }

  .feature-pill {
    padding: 4px 10px !important;
    font-size: 11px !important;
  }

  /* Store Grid strictly 1 Column */
  .store-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
  }

  .section-title {
    font-size: 15px !important;
  }

  /* Product Card on Phone: 100% width, zero overflow */
  .product-card {
    padding: 12px !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .product-thumb {
    width: 44px !important;
    height: 44px !important;
    font-size: 22px !important;
  }

  .product-name {
    font-size: 13.5px !important;
  }

  .product-desc {
    font-size: 12px !important;
    -webkit-line-clamp: 2 !important;
  }

  .product-price {
    font-size: 16px !important;
  }

  /* Checkout Box on Phone */
  .checkout-panel {
    position: static !important;
    padding: 16px !important;
    border-radius: var(--radius-md) !important;
  }

  /* Show Sticky Bottom Bar on Phone */
  .mobile-bottom-bar {
    display: flex !important;
  }

  /* Modal on Phone: Centered Compact Card - STRICT ZERO SCROLL */
  .modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
  }

  .modal-card {
    border-radius: 18px !important;
    max-width: 385px !important;
    width: 100% !important;
    max-height: 96vh !important;
    padding: 12px 14px !important;
    overflow-y: auto !important;
  }

  .modal-header-nav {
    margin-bottom: 8px !important;
    gap: 8px !important;
  }

  .countdown-badge {
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    gap: 5px !important;
  }

  .countdown-digits {
    font-size: 14.5px !important;
  }

  .modal-close-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 18px !important;
  }

  .modal-title-box {
    margin-bottom: 6px !important;
  }

  .modal-main-title {
    font-size: 14.5px !important;
    margin-bottom: 2px !important;
  }

  .modal-sub-title {
    font-size: 11px !important;
  }

  .qr-container {
    margin-bottom: 6px !important;
  }

  .qr-box {
    width: 128px !important;
    height: 128px !important;
    padding: 5px !important;
    margin-bottom: 4px !important;
    border-radius: 10px !important;
  }

  .qr-hint {
    font-size: 11px !important;
    line-height: 1.3 !important;
    max-width: 270px !important;
  }

  .info-rows {
    padding: 6px 10px !important;
    margin-bottom: 6px !important;
    border-radius: 10px !important;
  }

  .info-item {
    padding: 3px 0 !important;
    font-size: 11.5px !important;
  }

  .btn-copy-chip {
    padding: 1px 6px !important;
    font-size: 10.5px !important;
  }

  .status-pill {
    padding: 5px 10px !important;
    font-size: 11.5px !important;
    margin-bottom: 6px !important;
  }

  .demo-trigger-box {
    margin-top: 4px !important;
    padding: 3px !important;
  }

  .btn-demo-pay {
    padding: 4px 8px !important;
    font-size: 10.5px !important;
  }

  /* Delivered State Mobile */
  .modal-success-badge {
    gap: 6px !important;
  }

  .modal-success-title {
    font-size: 14.5px !important;
  }

  .modal-delivered-hint {
    font-size: 11.5px !important;
    margin-bottom: 8px !important;
  }

  .delivery-box {
    padding: 10px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
  }

  .delivery-header {
    font-size: 13px !important;
    margin-bottom: 6px !important;
  }

  .account-card-item {
    padding: 7px 9px !important;
    margin-bottom: 6px !important;
  }

  .acc-field {
    padding: 2px 0 !important;
    font-size: 11.5px !important;
  }

  .btn-copy-all-acc {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
  }

  .delivered-guide-accordion {
    margin-bottom: 8px !important;
  }

  .delivered-guide-summary {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
  }

  .delivered-guide-accordion .guide-text {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  .btn-finish-modal {
    padding: 9px 12px !important;
    font-size: 13.5px !important;
  }
}
