/*
 * Thucnhien MMO Design System
 * Shared storefront tokens and components
 */

:root {
  /* Marketplace palette: navy, neutral gray and restrained orange */
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #172b42;
  --muted: #64768a;
  --line: #d8e0e8;
  
  --primary: #15558a;
  --primary-dark: #0f3d65;
  --primary-light: #e8f1f8;
  --accent: #f5670a;
  
  --success: #087a55;
  --success-bg: #edf8f3;
  --danger: #c83f3f;
  --danger-bg: #fff1f1;
  --warning: #c87908;
  --warning-bg: #fff7e8;
  --info: #2e6da4;
  --info-bg: #edf4fa;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,39,64,.05);
  --shadow: 0 2px 6px rgba(15,39,64,.07);
  --shadow-md: 0 5px 14px rgba(15,39,64,.08);
  --shadow-lg: 0 9px 22px rgba(15,39,64,.1);
  --shadow-xl: 0 14px 32px rgba(15,39,64,.12);
  
  /* Radius */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 8px;
}

:root.dark-mode {
  color-scheme: dark;
  --bg: #101820;
  --surface: #17222d;
  --surface-2: #202f3d;
  --text: #e8eef4;
  --muted: #94a3b2;
  --line: #30404f;
  
  --primary: #68a4d3;
  --primary-dark: #8bb9dd;
  --primary-light: #193249;
  --accent: #ff812d;
  --success-bg: #183a2e;
  --danger-bg: #432525;
  --warning-bg: #41321b;
  --info-bg: #1d354b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--primary);
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Common Container */
.container {
  width: min(1200px, calc(100% - 32px));
  margin: auto;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
}

.nav-wrap {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}


.brand-logo {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  z-index: 1;
  overflow: hidden;
  -webkit-text-fill-color: #fff;
}

.brand-logo::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    #ff0000,
    #ff7f00,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #8b00ff,
    #ff0000
  );
  animation: rotate-rainbow 3s linear infinite;
  z-index: -2;
}

.brand-logo::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: #0f172a;
  border-radius: calc(var(--radius-sm) - 2px);
  z-index: -1;
}

@keyframes rotate-rainbow {
  100% {
    transform: rotate(360deg);
  }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a, .link-button {
  font-weight: 600;
  color: var(--muted);
  font-size: 15px;
}

.main-nav a:hover, .link-button:hover {
  color: var(--primary);
}

.main-nav b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  font-size: 24px;
  color: var(--text);
  padding: 8px;
}

.inline-form {
  display: inline;
}

/* Premium Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25);
}

.button:active {
  transform: translateY(0);
}

.button-secondary {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--primary-dark);
  box-shadow: var(--shadow);
}

.button-light {
  background: var(--surface);
  color: var(--text);
  border-color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.button-light:hover {
  background: var(--surface-2);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.button-small {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: none;
}

.button-small:hover {
  box-shadow: var(--shadow);
}

.button-block {
  width: 100%;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
  background: radial-gradient(circle at 85% 15%, rgba(79, 70, 229, 0.08), transparent 35%), 
              radial-gradient(circle at 15% 85%, rgba(6, 182, 212, 0.05), transparent 30%),
              var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 80px;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 24px;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin: 36px 0;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-row span::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
}

/* Hero Feature Card */
.hero-card {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #fff;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-card strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 32px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.metric-grid div {
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease;
}

.metric-grid div:hover {
  background: rgba(255, 255, 255, 0.1);
}

.metric-grid b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.metric-grid span:not(.metric-icon) {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.metric-icon svg {
  width: 18px;
  height: 18px;
  stroke: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.hero-orbit {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hero-orbit::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 30px;
  right: 30px;
  bottom: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-settings {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.settings-btn svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255, 255, 255, 0.6);
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-muted {
  background: var(--surface-2);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.section-heading > a {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}

.section-heading > a:hover {
  color: var(--primary-dark);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.category-card > span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.category-card strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.category-card small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* Product Grid & Cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.product-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.2);
}

.product-image {
  position: relative;
  display: grid;
  aspect-ratio: 16/10;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #e0e7ff, #ecfeff);
  border-bottom: 1px solid var(--line);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-image > span {
  font-size: 38px;
  font-weight: 800;
  color: var(--primary);
  opacity: 0.8;
}

.sale-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.product-body small {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-body h3 {
  margin: 10px 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.product-body h3 a {
  color: var(--text);
}

.product-body h3 a:hover {
  color: var(--primary);
}

.product-body p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 42px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.product-footer strong, .detail-price strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.product-footer del, .detail-price del {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.circle-link {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  transition: all 0.25s ease;
}

.product-card:hover .circle-link {
  background: var(--primary);
  color: #fff;
  transform: translateX(3px);
}

/* Call To Action (CTA) */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 60px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.cta h2 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  max-width: 600px;
}

/* Footer */
.site-footer {
  background: #0b0f19;
  color: #94a3b8;
  padding: 80px 0 0;
  border-top: 1px solid #1e293b;
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 60px;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo .brand-text {
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.footer-tagline {
  line-height: 1.6;
  margin: 0;
}

.footer-payments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.payment-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #1e293b;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.footer-links li {
  color: #94a3b8;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 30px 0;
  background: #070a13;
  font-size: 13px;
  color: #64748b;
}

.footer-bottom-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Internal Page Heros */
.page-hero {
  padding: 80px 0;
  background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05), transparent 45%),
              radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.04), transparent 45%),
              var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-hero .eyebrow {
  margin-bottom: 12px;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 600px;
  line-height: 1.6;
}

/* Contact Page Layout */
.contact-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 50px;
  align-items: start;
}

.contact-info-side {
  display: grid;
  gap: 24px;
}

.contact-card-premium {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.contact-card-premium:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.contact-icon-box {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  border-radius: 12px;
  flex-shrink: 0;
}

.contact-card-premium h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.contact-card-premium p {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}

.contact-card-premium p a {
  color: var(--text);
  text-decoration: none;
}

.contact-card-premium p a:hover {
  color: var(--primary);
}

.contact-card-premium small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.contact-form-side .form-card-premium {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.04);
}

.form-card-premium h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}

.form-card-premium p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 30px;
}

.form-row-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-card-premium form {
  display: grid;
  gap: 20px;
}

.form-card-premium label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.form-card-premium textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-card-premium .button {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  text-transform: uppercase;
  font-size: 14px;
  padding: 14px 20px;
}

.form-card-premium .button:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Legal Pages Layout */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 104px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.legal-sidebar h3 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 16px;
  padding-left: 12px;
}

.legal-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.legal-nav-list a {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border-radius: 8px;
}

.legal-nav-list a:hover {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.legal-nav-list a.active {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  font-weight: 700;
}

.legal-content {
  display: grid;
  gap: 30px;
}

.legal-section-card {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.legal-section-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.legal-section-card p, .legal-section-card ul {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 16px;
}

.legal-section-card ul {
  padding-left: 20px;
}

.legal-section-card li {
  margin-bottom: 8px;
}

.legal-section-card p:last-child, .legal-section-card ul:last-child {
  margin-bottom: 0;
}

/* Shop Layout */
.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

.filter-card, .summary-card, .payment-card, .form-card, .content-card, .cart-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.filter-card {
  height: max-content;
  position: sticky;
  top: 104px;
}

.filter-card form {
  display: grid;
  gap: 20px;
}

.filter-card label, .form-card label, .payment-card label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 15px;
}

/* Form Elements */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 14px 18px;
  outline: none;
  font-size: 15px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, select:focus, textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
}

.pagination a {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}

/* Product Detail */
.product-detail {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  align-items: start;
}

.detail-image {
  display: grid;
  aspect-ratio: 4/3;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
  border: none;
  box-shadow: 0 16px 40px -8px rgba(79, 70, 229, 0.28);
  position: relative;
}

.detail-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1), transparent 60%);
  border-radius: inherit;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-image > span {
  font-size: 60px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.04em;
  text-shadow: 0 4px 24px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.detail-content h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin: 10px 0 12px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.detail-price {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(124,58,237,0.04));
  border: 1px solid rgba(79,70,229,0.15);
  border-radius: 12px;
  width: max-content;
}

.detail-price strong {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.detail-price del {
  font-size: 14px;
  color: var(--muted);
  text-decoration: line-through;
}

.detail-price .sale-badge {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feature-list {
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: 14px;
  display: grid;
  gap: 10px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.feature-list li::before {
  content: '';
  display: flex;
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 0;
}

.buy-form {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.buy-form input {
  width: 64px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 8px;
}

.buy-form .button {
  flex: 1;
  padding: 11px 20px;
  font-size: 14px;
}

.rich-text {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

/* Auth Pages */
.auth-section {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
  padding: 60px 16px;
  background: radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.08), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.06), transparent 45%),
              #f1f5f9;
}

:root:not(.dark-mode) {
  color-scheme: light;
}

:root.dark-mode .auth-section {
  background:
    radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.14), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.09), transparent 45%),
    var(--bg);
}

.auth-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  width: min(1080px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.12), 
              0 0 0 1px rgba(15, 23, 42, 0.04);
  min-height: 620px;
}

.auth-brand-side {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  padding: 60px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-brand-side::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.15), transparent 70%);
  border-radius: 50%;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-content {
  margin: auto 0;
  padding: 40px 0;
}

.auth-brand-content h2 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand-content p {
  color: #94a3b8;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 32px;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #cbd5e1;
}

.auth-features li span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  background: rgba(79, 70, 229, 0.25);
  color: #818cf8;
  border-radius: 50%;
  font-weight: 800;
  font-size: 11px;
}

.auth-brand-footer {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.auth-form-side {
  display: grid;
  place-items: center;
  background: var(--surface);
  padding: 60px;
}

.auth-form-side .auth-card {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-card {
  width: min(460px, 100%);
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.15), 
              0 0 0 1px rgba(15, 23, 42, 0.04);
}

.auth-card > div:first-child {
  text-align: center;
}

.auth-card h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 12px 0 8px;
  color: var(--text);
}

.auth-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.auth-card form {
  display: grid;
  gap: 20px;
}

.auth-card label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.auth-card .button {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  text-transform: uppercase;
  font-size: 14px;
}

.auth-card .button:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.auth-links a {
  color: var(--primary);
  font-weight: 700;
}

.auth-links a:hover {
  color: var(--primary-dark);
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.field-error.block {
  display: block;
  margin: 6px 0 0;
}

/* Flash Messages & Alerts */
.flash-stack {
  padding-top: 20px;
}

.flash-stack:empty {
  display: none;
}

.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 15px;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border-left-color: var(--success);
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border-left-color: var(--danger);
}

.alert-info {
  background: var(--info-bg);
  color: #1e40af;
  border-left-color: var(--info);
  word-break: break-all;
}

:root.dark-mode .alert-success { color: #74e0b6; }
:root.dark-mode .alert-error { color: #ffaaa3; }
:root.dark-mode .alert-info { color: #9dcaee; }

/* Shopping Cart, Checkout, Orders Layout */
.cart-layout, .checkout-layout, .order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}

td {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

tr {
  transition: background-color 0.15s ease;
}

tr:hover td {
  background-color: var(--surface-2);
}

tr:last-child td {
  border-bottom: none;
}

td small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.qty-input {
  width: 70px;
  text-align: center;
  padding: 8px;
}

.text-danger {
  border: none;
  background: none;
  color: var(--danger);
  font-weight: 700;
  font-size: 14px;
  padding: 0;
}

.text-danger:hover {
  color: #b91c1c;
}

.summary-card {
  position: sticky;
  top: 104px;
}

.summary-card h2, .payment-card h2, .form-card h2, .content-card h2 {
  margin-top: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.summary-card > div:not(.summary-total):not(.coupon-active) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
  color: var(--muted);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 24px;
  padding: 20px 0 0;
  border-top: 2px solid var(--line);
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
}

.coupon-form {
  display: flex;
  margin-bottom: 20px;
}

.coupon-form input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.coupon-form button {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--text);
  color: #fff;
  padding: 0 20px;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.2s ease;
}

.coupon-form button:hover {
  background: var(--muted);
}

.coupon-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.coupon-active button {
  color: var(--danger);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.span-2 {
  grid-column: span 2;
}

.payment-method {
  margin: 16px 0 24px;
  padding: 20px;
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.payment-method p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--primary-dark);
  opacity: 0.8;
}

.payment-card dl, .form-card dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  font-size: 15px;
  margin: 0;
}

.payment-card dt, .form-card dt {
  color: var(--muted);
}

.payment-card dd, .form-card dd {
  margin: 0;
  font-weight: 700;
}

.payment-card form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.totals-list {
  margin-top: 24px;
  margin-left: auto;
  max-width: 360px;
}

.totals-list > div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 15px;
  color: var(--muted);
}

.totals-list > div:last-child {
  border-top: 2px solid var(--line);
  padding-top: 16px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
}

/* Modern Status Badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-active, .status-paid, .status-completed {
  background: var(--success-bg);
  color: var(--success);
}

.status-inactive, .status-blocked, .status-cancelled, .status-refunded {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pending_payment {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-payment_review {
  background: var(--info-bg);
  color: var(--info);
}

/* User Account Settings Dashboard */
/* Account Hero */
.account-hero {
  background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.04), transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.03), transparent 40%),
              var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 0;
}

.account-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.account-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
}

.account-hero-info .eyebrow {
  margin-bottom: 6px;
}

.account-hero-info h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  color: var(--text);
}

.account-hero-info p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.account-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.account-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.2s ease;
  text-decoration: none;
}

.account-nav a svg {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.account-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--line);
}

.account-nav a:hover svg {
  opacity: 1;
}

.account-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: none;
}

.account-nav a.active svg {
  opacity: 1;
}

/* Account Stat Cards */
.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.account-stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.account-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.account-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-stat-card span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.account-stat-card strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.06);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:nth-child(1)::before { background: #3b82f6; }
.stat-card:nth-child(2)::before { background: #10b981; }
.stat-card:nth-child(3)::before { background: #6366f1; }
.stat-card:nth-child(4)::before { background: #f59e0b; }
.stat-card:nth-child(5)::before { background: #ef4444; }

.stat-card span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.narrow {
  max-width: 800px;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.empty-state p {
  margin: 12px 0 24px;
  font-size: 16px;
}

.full-width {
  grid-column: 1 / -1;
}

/* ==========================================================================
   Admin Panel Layout
   ========================================================================== */
.admin-body {
  background: #f8fafc;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 20px;
  background: #090d16;
  color: #f8fafc;
  border-right: 1px solid #111827;
  display: flex;
  flex-direction: column;
}

.admin-brand {
  margin: 0 10px 36px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.admin-brand .brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}
.admin-sidebar nav::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.admin-sidebar nav a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  color: #64748b;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.admin-sidebar nav a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.admin-topbar div {
  text-align: right;
}

.admin-topbar strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
}

.admin-topbar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.admin-content {
  padding: 40px;
  flex: 1;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.admin-heading h1 {
  margin-bottom: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.admin-stats {
  grid-template-columns: repeat(5, 1fr);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* Admin Toolbar & Table Controls */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar input {
  max-width: 320px;
}

.toolbar select {
  max-width: 200px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions form {
  display: inline;
}

.actions button, .actions a {
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 700;
  padding: 0;
  font-size: 14px;
}

.actions button:hover, .actions a:hover {
  color: var(--primary-dark);
}

.check-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.check-label input {
  width: auto;
  cursor: pointer;
}

/* Statistics Mini Chart */
.mini-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  height: 240px;
  padding-top: 24px;
}

.mini-chart > div {
  display: flex;
  flex: 1;
  max-width: 40px;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.mini-chart span {
  display: block;
  width: 100%;
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #6366f1, var(--primary));
  transition: height 0.5s ease;
}

.mini-chart small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* Cart Item Styling */
.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  box-sizing: border-box;
}

.cart-item:not(:first-child) {
  border-top: 1px solid var(--line);
}

.cart-item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-details a {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-details small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.cart-item-price {
  color: var(--muted);
  font-size: 14px;
  min-width: 90px;
  text-align: right;
}

.cart-item-qty {
  width: 60px;
  text-align: center;
  padding: 8px 6px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.cart-item-subtotal {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  min-width: 90px;
  text-align: right;
}

.cart-item-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  color: var(--danger);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.cart-item-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .product-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .hero-grid, .product-detail, .cart-layout, .checkout-layout, .order-detail-grid, .shop-layout, .admin-grid-2, .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-brand-side {
    display: none;
  }

  .auth-form-side {
    padding: 40px 24px;
  }

  .hero {
    padding: 60px 0;
  }
  
  .hero-grid {
    gap: 48px;
  }
  
  .filter-card, .summary-card {
    position: static;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .main-nav {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }
  
  .main-nav.open {
    display: flex;
  }
  
  .product-grid, .product-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .admin-shell {
    display: block;
  }
  
  .admin-sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    bottom: 0;
    z-index: 200;
    width: 260px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .admin-sidebar.open {
    left: 0;
  }
  
  .admin-topbar {
    justify-content: space-between;
    padding: 0 24px;
  }
  
  .admin-topbar .nav-toggle {
    display: block;
  }
  
  .admin-content {
    padding: 24px;
  }
  
  .stats-grid, .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .contact-card-premium {
    padding: 18px;
    gap: 16px;
    border-radius: 12px;
  }

  .contact-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .contact-icon-box svg {
    width: 18px;
    height: 18px;
  }

  .contact-card-premium h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .contact-card-premium p {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .contact-card-premium small {
    font-size: 12px;
  }

  .contact-form-side .form-card-premium {
    padding: 30px 20px;
    border-radius: 16px;
  }

  .form-card-premium h2 {
    font-size: 20px;
  }

  .form-card-premium p {
    margin-bottom: 20px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .legal-sidebar {
    position: static;
  }
}
.admin-settings-form {
  padding: 32px;
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 36px;
  }
  
  .page-hero h1, .detail-content h1 {
    font-size: 30px;
  }
  
  .section {
    padding: 50px 0;
  }
  
  .product-grid, .product-grid-3, .category-grid, .stats-grid, .admin-stats, .form-grid {
    grid-template-columns: 1fr;
  }
  
  .span-2 {
    grid-column: auto;
  }

  .admin-settings-form {
    padding: 20px !important;
  }
  
  .hero-actions, .auth-links, .cta, .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  
  .cta {
    padding: 30px;
  }
  
  .buy-form {
    flex-direction: column;
  }
  
  .buy-form input {
    width: 100%;
  }
  
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  
  .admin-content {
    padding: 16px;
  }
  
  .payment-card dl, .form-card dl {
    grid-template-columns: 1fr;
  }
  
  .metric-grid {
    grid-template-columns: 1fr;
  }

  /* Product detail mobile */
  .detail-breadcrumb .bc-mid {
    display: none;
  }

  .detail-image {
    aspect-ratio: 4/3;
    border-radius: 16px;
  }

  .detail-price {
    width: 100%;
    box-sizing: border-box;
  }

  .detail-trust {
    display: none;
  }

  .account-stats-grid {
    grid-template-columns: 1fr;
  }

  .account-hero-inner {
    gap: 16px;
  }

  .account-avatar {
    width: 56px;
    height: 56px;
    font-size: 18px;
  }

  .account-hero-info h1 {
    font-size: 24px;
  }

  /* Cart page mobile */
  .cart-item {
    display: grid;
    grid-template-columns: 44px 1fr 32px;
    gap: 12px;
    padding: 16px;
  }

  .cart-item-thumb {
    grid-column: 1;
    grid-row: 1;
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .cart-item-details {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
  }

  .cart-item-remove {
    grid-column: 3;
    grid-row: 1;
    margin-left: auto;
  }

  .cart-item-price {
    display: none;
  }

  .cart-item-actions {
    grid-column: 1 / span 3;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--line);
    padding-top: 12px;
    width: 100%;
  }

  .cart-item-qty {
    width: 54px;
    padding: 6px;
  }

  .cart-item-subtotal {
    font-size: 14px;
    min-width: auto;
  }

  .status {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Responsive Admin Dashboard Table */
  .dashboard-orders-table, 
  .dashboard-orders-table thead, 
  .dashboard-orders-table tbody, 
  .dashboard-orders-table th, 
  .dashboard-orders-table td, 
  .dashboard-orders-table tr {
    display: block;
  }

  .dashboard-orders-table thead {
    display: none;
  }

  .dashboard-orders-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .dashboard-orders-table td {
    border: none;
    padding: 0 !important;
  }

  .dashboard-orders-table td:nth-child(1) {
    grid-column: 1;
    font-size: 13px;
  }

  .dashboard-orders-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px;
  }

  .dashboard-orders-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    text-align: right;
  }

  /* Responsive Admin Products Table */
  .admin-products-table,
  .admin-products-table thead,
  .admin-products-table tbody,
  .admin-products-table th,
  .admin-products-table td,
  .admin-products-table tr {
    display: block;
  }

  .admin-products-table thead {
    display: none;
  }

  .admin-products-table tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-products-table td {
    border: none;
    padding: 0 !important;
  }

  .admin-products-table td:nth-child(1) {
    font-size: 15px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 10px !important;
  }

  .admin-products-table td:nth-child(2),
  .admin-products-table td:nth-child(3),
  .admin-products-table td:nth-child(4),
  .admin-products-table td:nth-child(5) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 8px !important;
    border-bottom: 1px dashed var(--line);
  }

  .admin-products-table td:nth-child(2)::before {
    content: 'Danh mục:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-products-table td:nth-child(3)::before {
    content: 'Giá bán:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-products-table td:nth-child(4)::before {
    content: 'Kho hàng:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-products-table td:nth-child(5)::before {
    content: 'Trạng thái:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-products-table td:nth-child(6) {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px !important;
    border-bottom: none;
  }

  /* Responsive Admin Categories Table */
  .admin-categories-table,
  .admin-categories-table thead,
  .admin-categories-table tbody,
  .admin-categories-table th,
  .admin-categories-table td,
  .admin-categories-table tr {
    display: block;
  }

  .admin-categories-table thead {
    display: none;
  }

  .admin-categories-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-categories-table td {
    border: none;
    padding: 0 !important;
  }

  .admin-categories-table td:nth-child(1) {
    font-size: 15px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px !important;
  }

  .admin-categories-table td:nth-child(2),
  .admin-categories-table td:nth-child(3) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 6px !important;
    border-bottom: 1px dashed var(--line);
  }

  .admin-categories-table td:nth-child(2)::before {
    content: 'Số sản phẩm:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-categories-table td:nth-child(3)::before {
    content: 'Trạng thái:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-categories-table td:nth-child(4) {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px !important;
    border-bottom: none;
  }

  /* Responsive Admin Orders Listing Table */
  .admin-orders-table,
  .admin-orders-table thead,
  .admin-orders-table tbody,
  .admin-orders-table th,
  .admin-orders-table td,
  .admin-orders-table tr {
    display: block;
  }

  .admin-orders-table thead {
    display: none;
  }

  .admin-orders-table tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .admin-orders-table td {
    border: none;
    padding: 0 !important;
  }

  /* Order Code (Top Left) */
  .admin-orders-table td:nth-child(1) {
    grid-column: 1;
    font-size: 14px;
    align-self: center;
  }

  /* Status Badge (Top Right) */
  .admin-orders-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    text-align: right;
  }

  /* Customer Info (Row 2, full width) */
  .admin-orders-table td:nth-child(2) {
    grid-column: 1 / span 2;
    grid-row: 2;
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
    padding: 10px 0 !important;
    font-size: 13px;
  }

  /* Created Date (Row 3, Left) */
  .admin-orders-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    font-size: 12px;
    color: var(--muted);
    align-self: center;
  }

  /* Total (Row 3, Right) */
  .admin-orders-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 3;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    align-self: center;
  }

  /* Responsive Admin Users Table */
  .admin-users-table,
  .admin-users-table thead,
  .admin-users-table tbody,
  .admin-users-table th,
  .admin-users-table td,
  .admin-users-table tr {
    display: block;
  }

  .admin-users-table thead {
    display: none;
  }

  .admin-users-table tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-users-table td {
    border: none;
    padding: 0 !important;
  }

  .admin-users-table td:nth-child(1) {
    font-size: 15px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 10px !important;
  }

  .admin-users-table td:nth-child(2),
  .admin-users-table td:nth-child(3),
  .admin-users-table td:nth-child(4) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 8px !important;
    border-bottom: 1px dashed var(--line);
  }

  .admin-users-table td:nth-child(2)::before {
    content: 'Số đơn hàng:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-users-table td:nth-child(3)::before {
    content: 'Tổng chi tiêu:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-users-table td:nth-child(4)::before {
    content: 'Trạng thái:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-users-table td:nth-child(5) {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px !important;
    border-bottom: none;
  }

  /* Responsive Admin Coupons Table */
  .admin-coupons-table,
  .admin-coupons-table thead,
  .admin-coupons-table tbody,
  .admin-coupons-table th,
  .admin-coupons-table td,
  .admin-coupons-table tr {
    display: block;
  }

  .admin-coupons-table thead {
    display: none;
  }

  .admin-coupons-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-coupons-table td {
    border: none;
    padding: 0 !important;
  }

  .admin-coupons-table td:nth-child(1) {
    font-size: 15px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px !important;
  }

  .admin-coupons-table td:nth-child(2),
  .admin-coupons-table td:nth-child(3),
  .admin-coupons-table td:nth-child(4) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 6px !important;
    border-bottom: 1px dashed var(--line);
  }

  .admin-coupons-table td:nth-child(2)::before {
    content: 'Giá trị giảm:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-coupons-table td:nth-child(3)::before {
    content: 'Số lượt dùng:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-coupons-table td:nth-child(4)::before {
    content: 'Trạng thái:';
    color: var(--muted);
    font-weight: 600;
  }

  .admin-coupons-table td:nth-child(5) {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px !important;
    border-bottom: none;
  }

  /* Responsive Admin Logs Table */
  .admin-logs-table,
  .admin-logs-table thead,
  .admin-logs-table tbody,
  .admin-logs-table th,
  .admin-logs-table td,
  .admin-logs-table tr {
    display: block;
  }

  .admin-logs-table thead {
    display: none;
  }

  .admin-logs-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .admin-logs-table td {
    border: none;
    padding: 0 !important;
  }

  /* User Info (Row 1, Left) */
  .admin-logs-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    font-size: 14px;
  }

  /* Time (Row 1, Right) */
  .admin-logs-table td:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
    font-size: 11px;
    color: var(--muted);
    text-align: right;
    align-self: center;
  }

  /* Action (Row 2, full width) */
  .admin-logs-table td:nth-child(3) {
    grid-column: 1 / span 2;
    grid-row: 2;
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
    padding: 8px 0 !important;
    display: flex;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
  }

  /* Object (Row 3, Left) */
  .admin-logs-table td:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    font-size: 12px;
    align-self: center;
  }
  .admin-logs-table td:nth-child(4)::before {
    content: 'Đối tượng: ';
    color: var(--muted);
    font-weight: 600;
  }

  /* IP (Row 3, Right) */
  .admin-logs-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    font-size: 12px;
    color: var(--muted);
    font-family: monospace;
    text-align: right;
    align-self: center;
  }
}


/* ==========================================================================
   ACCOUNT LAYOUT (NEW)
   ========================================================================== */

.account-layout {
  display: flex;
  max-width: 1200px;
  margin: 40px auto;
  gap: 32px;
  padding: 0 24px;
  align-items: flex-start;
}

.account-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-sm);
}

.account-user-info {
  padding: 24px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}

.account-avatar {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 12px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.account-user-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.account-user-balance {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

.account-user-balance strong {
  color: var(--primary);
  font-weight: 700;
}

.account-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.account-nav a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--text-light);
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.account-nav a:hover, .account-nav a.active {
  background: var(--bg);
  color: var(--primary);
  border-left-color: var(--primary);
}

.account-content {
  flex: 1;
  min-width: 0;
}

.account-content .page-header {
  margin-bottom: 24px;
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.account-content .page-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.account-content .page-header p {
  color: var(--muted);
  font-size: 15px;
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.account-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.account-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-stat-card span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.account-stat-card strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

/* Account desktop — wider workspace, denser navigation and balanced cards. */
@media (min-width: 1025px) {
  .flash-stack {
    width: min(1280px, calc(100% - 32px));
    max-width: 1280px;
  }

  .account-layout {
    width: min(1280px, calc(100% - 32px));
    max-width: 1280px;
    margin: 28px auto 48px;
    padding: 0;
    gap: 24px;
  }

  .account-sidebar {
    width: 252px;
    top: 82px;
  }

  .account-user-info { padding: 20px 18px; }
  .account-avatar { width: 58px; height: 58px; margin-bottom: 10px; }
  .account-user-name { font-size: 16px; }
  .account-user-balance { font-size: 13px; }
  .account-nav { padding: 8px 0; }
  .account-nav a {
    min-height: 42px;
    padding: 10px 18px;
    font-size: 13px;
  }

  .account-content .page-header {
    margin-bottom: 18px;
    padding: 22px 24px;
  }
  .account-content .page-header h1 { margin: 0 0 6px; }
  .account-content .page-header p { margin: 0; }

  .account-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }
  .account-stat-card {
    min-width: 0;
    padding: 20px;
  }
  .account-stat-icon { width: 44px; height: 44px; }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  .account-layout {
    width: min(1120px, calc(100% - 28px));
    gap: 18px;
  }
  .account-sidebar { width: 230px; }
  .account-nav a { padding-left: 15px; padding-right: 15px; }
}

@media (max-width: 768px) {
  .account-layout {
    flex-direction: column;
    margin: 16px auto;
    gap: 16px;
    padding: 0 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .account-sidebar {
    width: 100%;
    max-width: 100%;
    position: static;
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
    box-sizing: border-box;
  }
  .account-user-info {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    box-sizing: border-box;
  }
  .account-avatar {
    width: 40px;
    height: 40px;
    margin: 0;
    font-size: 16px;
    flex-shrink: 0;
  }
  .account-user-name {
    font-size: 15px;
    margin-bottom: 2px;
    word-break: break-word;
  }
  .account-user-balance {
    font-size: 12px;
  }
  .account-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 14px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .account-nav::-webkit-scrollbar {
    display: none;
  }
  .account-nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .account-nav a:hover, .account-nav a.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
  }
  .account-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .account-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .account-stat-card {
    padding: 16px;
    border-radius: 12px;
    box-sizing: border-box;
  }
  .card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }
  .table-wrap table {
    width: 100%;
    min-width: 480px;
  }
}


/* ==========================================================================
   EXTRA ACCOUNT STYLES
   ========================================================================== */
.deposit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 768px) {
    .deposit-grid {
        grid-template-columns: 1fr;
    }
}
.content-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.button-block {
    display: block;
    width: 100%;
    text-align: center;
}


/* ==========================================================================
   FLOATING CHAT BUTTONS (NEW)
   ========================================================================== */
.floating-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.chat-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.chat-telegram {
  background: #0088cc;
}

.chat-zalo {
  background: #0068ff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.chat-btn svg {
  display: block;
}


/* ==========================================================================
   USER CUSTOM LIVE CHAT WIDGET
   ========================================================================== */
.custom-live-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.chat-trigger-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.chat-trigger-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.chat-popup {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  height: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chat-popup.open {
  display: flex;
}

.chat-popup-header {
  padding: 16px 20px;
  background: var(--primary);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-popup-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.chat-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 4px;
}

.chat-status-text {
  font-size: 11px;
  opacity: 0.9;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.chat-popup-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-system-message {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 8px 0;
}

.chat-popup-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  background: var(--surface);
}

.chat-popup-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}

.chat-popup-input-area input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-popup-input-area button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.chat-popup-guest {
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.chat-popup-guest p {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .chat-popup {
    width: calc(100vw - 32px);
    right: -8px;
    height: 420px;
  }
}


/* ==========================================================================
   FRONTEND CHAT BUBBLE STYLES (NEW)
   ========================================================================== */
.chat-popup-messages .chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-popup-messages .chat-bubble.admin {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-popup-messages .chat-bubble.user {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-popup-messages .chat-meta {
  font-size: 9px;
  margin-top: 4px;
  display: block;
  text-align: right;
  opacity: 0.8;
}

.chat-popup-messages .chat-bubble.user .chat-meta {
  color: var(--muted);
}


/* ==========================================================================
   CHAT LIGHTBOX MODAL STYLES (NEW)
   ========================================================================== */
.chat-lightbox {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: chat-zoom 0.25s ease-out;
  cursor: default;
}

@keyframes chat-zoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.chat-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.chat-lightbox-close:hover {
  color: var(--primary, #3b82f6);
}


/* ==========================================================================
   FRONTEND CHAT BUBBLE MEDIA STYLES (NEW)
   ========================================================================== */
.chat-popup-messages .chat-bubble.chat-bubble-media {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.chat-popup-messages .chat-bubble.chat-bubble-media .chat-meta {
  color: var(--text-light) !important;
  text-align: right;
  margin-top: 4px;
}


/* ==========================================================================
   FRONTEND CHAT RESPONSIVE MOBILE STYLES (NEW)
   ========================================================================== */
@media (max-width: 576px) {
  .custom-live-chat {
    bottom: 12px !important;
    right: 12px !important;
  }
  .chat-popup {
    position: fixed !important;
    bottom: 76px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    height: calc(100% - 100px) !important;
    max-height: none !important;
  }
}

/* ========================================================================== 
   LIGHTWEIGHT ICON MOTION UTILITIES
   Transform/opacity only: smooth on mobile, reusable without icon libraries.
   ========================================================================== */
.motion-icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
  transform-origin: center;
  will-change: transform, opacity;
}

.motion-icon-float { animation: icon-motion-float 2.8s ease-in-out infinite; }
.motion-icon-beat { animation: icon-motion-beat 1.9s ease-in-out infinite; }
.motion-icon-bounce { animation: icon-motion-bounce 2.6s ease-in-out infinite; }
.motion-icon-buzz { animation: icon-motion-buzz 3s ease-in-out infinite; }
.motion-icon-shine { animation: icon-motion-shine 2.2s ease-in-out infinite; }
.motion-icon-spin { animation: icon-motion-spin 2.4s linear infinite; }

.motion-icon-pop,
.site-header .main-nav a > svg {
  transition: transform .2s cubic-bezier(.2,.8,.2,1), filter .2s ease;
}
.motion-icon-pop:hover,
a:hover > .motion-icon-pop,
button:hover > .motion-icon-pop,
.site-header .main-nav a:hover > svg {
  transform: translateY(-2px) scale(1.14);
  filter: saturate(1.2);
}

@keyframes icon-motion-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes icon-motion-beat {
  0%,45%,100% { transform: scale(1); }
  12% { transform: scale(1.18); }
  24% { transform: scale(.98); }
  34% { transform: scale(1.1); }
}
@keyframes icon-motion-bounce {
  0%,18%,100% { transform: translateY(0) scale(1); }
  7% { transform: translateY(-4px) scale(1.03); }
  12% { transform: translateY(0) scale(1,.94); }
}
@keyframes icon-motion-buzz {
  0%,14%,100% { transform: rotate(0); }
  2% { transform: rotate(-9deg); }
  4% { transform: rotate(8deg); }
  6% { transform: rotate(-6deg); }
  8% { transform: rotate(5deg); }
  10% { transform: rotate(-3deg); }
  12% { transform: rotate(2deg); }
}
@keyframes icon-motion-shine {
  0%,100% { transform: scale(1) rotate(0); filter: brightness(1); }
  45% { transform: scale(1.12) rotate(-8deg); filter: brightness(1.35) drop-shadow(0 0 4px rgba(255,220,90,.8)); }
  60% { transform: scale(1.05) rotate(6deg); filter: brightness(1.15); }
}
@keyframes icon-motion-spin { to { transform: rotate(360deg); } }

.market-benefit:hover .market-benefit-icon { animation: icon-motion-beat .65s ease-in-out; }
.brand:hover img { transform: rotate(-5deg) scale(1.07); }
.brand img { transition: transform .22s cubic-bezier(.2,.8,.2,1); }

@media (prefers-reduced-motion: reduce) {
  .motion-icon,
  .motion-icon-float,
  .motion-icon-beat,
  .motion-icon-bounce,
  .motion-icon-buzz,
  .motion-icon-shine,
  .motion-icon-spin,
  .market-benefit:hover .market-benefit-icon {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

/* ========================================================================== 
   ACCOUNT MOBILE — compact profile, collapsible navigation and 2-col stats
   ========================================================================== */
.account-nav-toggle { display: none; }

@media (max-width: 768px) {
  .account-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px auto 24px !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
  }
  .account-sidebar {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 10px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }
  .account-user-info {
    min-height: 58px !important;
    padding: 8px 12px !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0,1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 10px !important;
    row-gap: 0 !important;
    text-align: left !important;
    background: var(--surface) !important;
  }
  .account-user-info .account-avatar {
    grid-row: 1 / 3 !important;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    align-self: center !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    font-size: 14px !important;
  }
  .account-user-name {
    align-self: end;
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
  }
  .account-user-balance {
    align-self: start;
    font-size: 11px;
    line-height: 1.3;
  }
  .account-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 0 5px 5px;
    background: var(--surface);
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  .account-sidebar .account-nav {
    display: none !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    gap: 1px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1px !important;
    overflow: visible !important;
    white-space: normal !important;
    border-top: 1px solid var(--line) !important;
    background: var(--line) !important;
  }
  .account-sidebar .account-nav.is-open { display: grid !important; }
  .account-sidebar .account-nav a {
    display: flex !important;
    flex: none !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    font-size: 11px;
    font-weight: 600 !important;
    line-height: 1.3;
    white-space: normal !important;
  }
  .account-sidebar .account-nav a:hover,
  .account-sidebar .account-nav a.active {
    background: var(--primary-light);
    color: var(--primary) !important;
  }
  .account-layout > .account-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .account-content .page-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 0 8px !important;
    padding: 8px 2px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .account-content .page-header h1 {
    margin: 0 !important;
    font-size: 19px !important;
    line-height: 1.25 !important;
  }
  .account-content .page-header p {
    flex-basis: 100% !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }
  .account-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 0 10px !important;
  }
  .account-stat-card {
    min-width: 0 !important;
    min-height: 64px !important;
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 7px !important;
    box-shadow: none !important;
  }
  .account-stat-card:nth-child(3) { grid-column: 1 / -1 !important; }
  .account-stat-card:hover { transform: none !important; box-shadow: none !important; }
  .account-stat-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 5px !important;
  }
  .account-stat-icon svg { width: 17px; height: 17px; }
  .account-stat-card span {
    margin-bottom: 2px;
    font-size: 9px;
    letter-spacing: .02em;
  }
  .account-stat-card strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    white-space: nowrap;
  }
  .account-content > .card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
  .account-content > .card .card-header {
    gap: 8px !important;
    padding: 11px 12px !important;
  }
  .account-content > .card .card-header h4 { font-size: 14px !important; }
  .account-content > .card .card-body { padding: 0 10px 10px !important; }
  .account-content .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .account-content .form-grid-2,
  .account-content .form-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .account-content input,
  .account-content select,
  .account-content textarea,
  .account-content button,
  .account-content .button {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .account-sidebar .account-nav { grid-template-columns: 1fr !important; }
  .account-stats-grid { grid-template-columns: 1fr !important; }
  .account-stat-card:nth-child(3) { grid-column: auto !important; }
}

@media (max-width: 600px) {
  .table-wrap:has(.account-recent-table) { overflow: visible; }
  .account-recent-table,
  .account-recent-table tbody,
  .account-recent-table tr,
  .account-recent-table td { display: block; width: 100%; }
  .account-recent-table { min-width: 0 !important; }
  .account-recent-table thead { display: none; }
  .account-recent-table tbody { display: grid; gap: 8px; }
  .account-recent-table tr {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
  }
  .account-recent-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0 !important;
    border: 0 !important;
    text-align: right;
    font-size: 11px;
  }
  .account-recent-table td + td { border-top: 1px dashed var(--line) !important; }
  .account-recent-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-align: left;
  }
}

/* ========================================================================== 
   SHARE FILE LIBRARY — practical download-directory layout
   ========================================================================== */
.share-library {
  max-width: 1200px;
  padding-top: 28px;
  padding-bottom: 56px;
}

.share-library .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.share-library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.share-library-kicker {
  margin-bottom: 7px;
  color: #e85d04;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.share-library-heading h1 {
  margin: 0 0 6px;
  color: #10243d;
  font-size: clamp(26px,3vw,34px);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.share-library-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.share-upload-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d95a0b;
  border-radius: 5px;
  background: #f5670a;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
}

.share-upload-button:hover { background: #dc5705; }

.share-search-bar {
  display: flex;
  width: 100%;
  margin: 18px 0 22px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.share-search-input {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  padding-left: 14px;
  color: #64748b;
}

.share-search-input input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.share-search-bar:focus-within { border-color: #315f91; }

.share-search-bar > button {
  min-width: 112px;
  margin: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: #123453;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.share-search-bar > button:hover { background: #0b2944; }

.share-library-layout {
  display: grid;
  grid-template-columns: 224px minmax(0,1fr);
  gap: 24px;
  align-items: start;
}

.share-category-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.share-category-title {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: #10243d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.share-category-list { padding: 6px 0; }

.share-category-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  border-left: 3px solid transparent;
  color: #425269;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.share-category-list a:hover {
  background: #f4f7fa;
  color: #123453;
}

.share-category-list a.active {
  border-left-color: #f5670a;
  background: #eef3f8;
  color: #102f4d;
  font-weight: 800;
}

.share-category-list b {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e5ebf1;
  color: #526274;
  font-size: 10px;
  text-align: center;
}

.share-community-note {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.share-community-note strong { color: #087a55; font-size: 12px; }
.share-community-note span { color: #334155; font-size: 11px; font-weight: 700; }
.share-community-note p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.share-results { min-width: 0; }

.share-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin-bottom: 12px;
}

.share-results-toolbar > div { color: var(--muted); font-size: 13px; }
.share-results-toolbar > div strong { color: var(--text); }
.share-results-toolbar > div span { margin-left: 4px; }
.share-results-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.share-results-toolbar select {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background-color: #fff;
  color: #26384d;
  font: inherit;
}

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

.share-file-card {
  min-width: 0;
  border: 1px solid #d6dee7;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.share-file-card:hover { border-color: #9baebe; }

.share-file-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  border-bottom: 1px solid #d6dee7;
  background: #e9eef3;
  overflow: hidden;
}

.share-file-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.share-file-card:hover .share-file-thumb img { transform: scale(1.025); }

.share-file-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #718096;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .12em;
}

.share-free-label {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  border-radius: 3px;
  background: #087a55;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.share-file-info { padding: 13px; }

.share-file-category {
  margin-bottom: 5px;
  color: #e85d04;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.share-file-info h2 {
  min-height: 40px;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
}

.share-file-info h2 a {
  display: -webkit-box;
  overflow: hidden;
  color: #13283f;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.share-file-info h2 a:hover { color: #d95a0b; }

.share-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-height: 17px;
  margin-bottom: 12px;
  color: #6b7d90;
  font-size: 10px;
}

.share-file-meta span + span::before { content: "•"; margin-right: 8px; color: #b2becb; }

.share-file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #edf0f3;
  color: #6b7d90;
  font-size: 10px;
}

.share-file-footer > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-file-footer > a {
  flex: 0 0 auto;
  color: #164f85;
  font-weight: 800;
}

.share-empty-state {
  padding: 48px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.share-empty-state > span { font-size: 34px; }
.share-empty-state h2 { margin: 8px 0 4px; font-size: 17px; }
.share-empty-state p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.share-empty-state a { color: #164f85; font-size: 13px; font-weight: 700; }

.share-pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 24px;
}

.share-pagination a {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

/* ========================================================================== 
   SHARE-FILE HERO SWITCHER & SEPARATE BOT FREE CARD
   ========================================================================== */
.share-main-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 6px;
}

.share-switcher-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
}

.share-switcher-btn:hover {
  transform: translateY(-2px);
  border-color: #8b5cf6;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}

.share-switcher-btn.active {
  border-color: #10243d;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.share-switcher-btn.active.bot-active {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.05));
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.18);
}

.share-switcher-btn .switcher-icon {
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--bg);
  flex-shrink: 0;
}

.share-switcher-btn.bot-active .switcher-icon {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.share-switcher-btn .switcher-text strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.share-switcher-btn .switcher-text small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.switcher-badge-hot {
  position: absolute;
  top: -8px;
  right: 14px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Sidebar Bot Free Card */
.share-bot-free-card {
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.04));
  overflow: hidden;
  transition: all 0.2s ease;
}

.share-bot-free-card:hover, .share-bot-free-card.active {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(99, 102, 241, 0.1));
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.share-bot-free-link {
  display: block;
  padding: 13px 14px;
  text-decoration: none;
}

.bot-card-badge {
  background: #8b5cf6;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.mobile-bot-pill {
  border-color: #8b5cf6 !important;
  color: #8b5cf6 !important;
  background: rgba(139, 92, 246, 0.08) !important;
}

.mobile-bot-pill.active {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
  color: #fff !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4) !important;
}

@media (max-width: 640px) {
  .share-main-switcher {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .share-switcher-btn {
    padding: 12px 14px;
    gap: 10px;
  }
  .share-switcher-btn .switcher-icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .share-switcher-btn .switcher-text strong {
    font-size: 13.5px;
  }
  .share-switcher-btn .switcher-text small {
    font-size: 11px;
  }
}

/* ========================================================================== 
   SHARE-FILE RESPONSIVE OVERHAULS FOR MOBILE & TABLET
   ========================================================================== */
@media (max-width: 920px) {
  .share-library-layout { display: block; }
  .share-category-panel { margin-bottom: 18px; border: 0; background: transparent; overflow: visible; }
  .share-category-title, .share-community-note { display: none; }
  .share-category-list {
    display: flex;
    gap: 8px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .share-category-list::-webkit-scrollbar { display: none; }
  .share-category-list a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 9999px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  }
  .share-category-list a:hover {
    border-color: #f5670a;
    color: #f5670a;
  }
  .share-category-list a.active {
    border-color: #f5670a;
    background: #f5670a;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(245, 103, 10, 0.35);
  }
  .share-category-list a.active b {
    background: rgba(255,255,255,0.25);
    color: #fff;
  }
}

@media (max-width: 768px) {
  .share-library-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding-bottom: 16px;
  }
  .share-library-heading h1 {
    font-size: clamp(22px, 6vw, 28px);
  }
  .share-upload-button {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
    border-radius: 8px;
  }
  .share-upload-button span {
    font-size: 16px;
  }
  .share-search-bar {
    margin: 14px 0 16px;
    border-radius: 10px;
  }
  .share-search-input input {
    height: 44px;
    font-size: 14px;
  }
  .share-search-bar > button {
    min-width: 86px;
    font-size: 13px;
    border-radius: 6px;
  }
  .share-results-toolbar {
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .share-file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .share-file-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .share-file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  }
  .share-file-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    min-height: unset;
    border-bottom: 1px solid var(--line);
  }
  .share-free-label {
    top: 6px;
    right: 6px;
    padding: 3px 6px;
    font-size: 9px;
    border-radius: 4px;
    font-weight: 800;
  }
  .share-file-info {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .share-file-category {
    margin-bottom: 4px;
    font-size: 9px;
    font-weight: 800;
    color: #e85d04;
  }
  .share-file-info h2 {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    min-height: 36px;
    margin: 0 0 6px;
  }
  .share-file-info h2 a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
  }
  .share-file-meta {
    font-size: 10px;
    gap: 4px 8px;
    margin-bottom: 10px;
    color: var(--muted);
  }
  .share-file-footer {
    margin-top: auto;
    font-size: 11px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .share-file-footer > span {
    display: none;
  }
  .share-file-footer > a {
    width: 100%;
    text-align: center;
    padding: 6px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s;
  }
  .share-file-footer > a:hover {
    background: #10b981;
    color: #fff;
  }
}

@media (max-width: 480px) {
  .share-library {
    padding: 16px 12px 40px !important;
  }
  .share-library-heading h1 {
    font-size: 22px;
  }
  .share-library-heading p {
    font-size: 13px;
  }
  .share-file-grid {
    gap: 10px;
  }
  .share-file-info {
    padding: 8px 8px 10px;
  }
  .share-file-info h2 {
    font-size: 12.5px;
    min-height: 34px;
  }
}

@media (max-width: 360px) {
  .share-file-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .share-file-footer > span {
    display: block;
  }
  .share-file-footer > a {
    width: auto;
  }
}

/* ========================================================================== 
   SHARE-FILE DETAIL & CREATE RESPONSIVE
   ========================================================================== */
.share-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.share-detail-download-card {
  background: var(--surface);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  border-radius: 18px;
  padding: 24px;
  position: sticky;
  top: 90px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.share-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.share-create-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

@media (max-width: 900px) {
  .share-detail-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .share-detail-download-card {
    position: static;
    padding: 20px;
    border-radius: 16px;
  }
  .share-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .share-create-box {
    padding: 20px 16px;
    border-radius: 14px;
  }
}

@media (max-width: 560px) {
  .share-detail-header-stats {
    gap: 10px !important;
    font-size: 12px !important;
  }
  .share-detail-desc-box {
    padding: 18px 14px !important;
    border-radius: 12px !important;
  }
  .share-related-grid {
    grid-template-columns: 1fr;
  }
}

.share-mobile-bar {
  display: none;
}

@media (max-width: 768px) {
  .share-mobile-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px env(safe-area-inset-bottom, 10px);
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  }
}

/* ========================================================================== 
   STOREFRONT CART — compact marketplace cart and checkout summary
   ========================================================================== */
.store-cart-page {
  max-width: 1200px;
  padding-top: 24px;
  padding-bottom: 56px;
}

.store-cart-breadcrumb {
  display: flex;
  gap: 7px;
  margin-bottom: 17px;
  color: #7a899a;
  font-size: 11px;
}

.store-cart-breadcrumb a { color: #315f91; }

.store-cart-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid #d8e0e8;
}

.store-cart-heading h1 {
  margin: 0 0 4px;
  color: #10243d;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.store-cart-heading p { margin: 0; color: #6b7d90; font-size: 12px; }
.store-cart-heading > a { color: #315f91; font-size: 12px; font-weight: 700; }

.store-cart-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 330px;
  gap: 20px;
  align-items: start;
}

.store-cart-products,
.store-cart-summary {
  border: 1px solid #d4dde6;
  border-radius: 6px;
  background: #fff;
}

.store-cart-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid #dce3ea;
  color: #10243d;
  font-size: 13px;
}

.store-cart-panel-title span { color: #8290a0; font-size: 10px; }

.store-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(160px,1fr) 92px 66px 100px 28px;
  gap: 13px;
  align-items: center;
  padding: 15px 14px;
}

.store-cart-item + .store-cart-item { border-top: 1px solid #e3e8ee; }

.store-cart-thumb {
  display: grid;
  width: 68px;
  height: 58px;
  place-items: center;
  border: 1px solid #d7dfe7;
  border-radius: 4px;
  background: #eaf0f5;
  color: #315f91;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
}

.store-cart-thumb img,
.store-cart-thumb span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  object-fit: cover;
}

.store-cart-details { min-width: 0; }
.store-cart-details small {
  display: block;
  margin-bottom: 3px;
  color: #e85d04;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.store-cart-details h2 { margin: 0; font-size: 13px; line-height: 1.35; }
.store-cart-details h2 a {
  display: -webkit-box;
  overflow: hidden;
  color: #172b42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.store-cart-details h2 a:hover { color: #d95a0b; }

.store-cart-variant {
  display: inline-block;
  max-width: 100%;
  margin-top: 5px;
  padding: 2px 6px;
  border: 1px solid #d7e3ef;
  border-radius: 3px;
  background: #f4f7fa;
  color: #51677e;
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-cart-unit-price,
.store-cart-subtotal,
.store-cart-quantity {
  display: grid;
  gap: 4px;
}

.store-cart-unit-price span,
.store-cart-subtotal span,
.store-cart-quantity span {
  color: #8a97a5;
  font-size: 9px;
}

.store-cart-unit-price strong { color: #536579; font-size: 12px; }
.store-cart-subtotal strong { color: #102f4d; font-size: 13px; }

.store-cart-quantity input {
  width: 58px;
  height: 34px;
  padding: 0 5px;
  border: 1px solid #cdd7e1;
  border-radius: 4px;
  background: #fff;
  color: #23384f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.store-cart-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a25c5c;
  cursor: pointer;
}
.store-cart-remove:hover { background: #fff0f0; color: #c53030; }

.store-cart-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid #dce3ea;
  background: #f8fafc;
}

.store-cart-list-footer > span { color: #7a899a; font-size: 10px; }
.store-cart-list-footer > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #bdc9d5;
  border-radius: 4px;
  background: #fff;
  color: #334a62;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.store-cart-summary {
  position: sticky;
  top: 92px;
  padding: 17px;
}

.store-cart-summary h2 {
  margin: 0 0 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dce3ea;
  color: #10243d;
  font-size: 15px;
}

.store-cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  color: #65778a;
  font-size: 12px;
}
.store-cart-summary-row strong { color: #34485e; }
.store-cart-summary-row strong.discount { color: #087a55; }

.store-cart-coupon-form {
  display: flex;
  margin: 12px 0;
}
.store-cart-coupon-form input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cdd7e1;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  color: #26384d;
  font: inherit;
  font-size: 11px;
}
.store-cart-coupon-form button {
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid #315f91;
  border-radius: 0 4px 4px 0;
  background: #eef3f8;
  color: #234f79;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.store-cart-coupon-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 11px 0;
  padding: 8px 9px;
  border: 1px dashed #79b99f;
  border-radius: 4px;
  background: #effaf5;
  color: #176b50;
  font-size: 11px;
}
.store-cart-coupon-active form { margin: 0; }
.store-cart-coupon-active button { padding: 0; border: 0; background: transparent; color: #a33b3b; font: inherit; font-size: 10px; cursor: pointer; }

.store-cart-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 13px;
  border-top: 1px solid #dce3ea;
  color: #33485e;
  font-size: 12px;
  font-weight: 700;
}
.store-cart-total strong { color: #d95a0b; font-size: 20px; }

.store-cart-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  margin-top: 14px;
  border: 1px solid #d95a0b;
  border-radius: 4px;
  background: #f5670a;
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
}
.store-cart-checkout:hover { background: #dc5705; }

.store-cart-assurance {
  display: grid;
  gap: 6px;
  margin: 13px 0 0;
  padding: 0;
  color: #718195;
  font-size: 9px;
  list-style: none;
}
.store-cart-assurance li::before { content: "✓"; margin-right: 6px; color: #087a55; font-weight: 900; }

.store-cart-empty {
  display: grid;
  grid-template-columns: 62px minmax(0,1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 138px;
  padding: 24px 28px;
  border: 1px solid #d4dde6;
  border-radius: 6px;
  background: #fff;
}

.store-cart-empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #eef3f8;
  color: #315f91;
}
.store-cart-empty h2 { margin: 0 0 5px; color: #10243d; font-size: 18px; }
.store-cart-empty p { margin: 0; color: #6f8091; font-size: 12px; }
.store-cart-empty > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #d95a0b;
  border-radius: 4px;
  background: #f5670a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.store-cart-help {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  margin-top: 14px;
  border: 1px solid #dbe2e9;
  border-radius: 6px;
  background: #f8fafc;
}
.store-cart-help > span { display: grid; gap: 3px; padding: 13px 16px; }
.store-cart-help > span + span { border-left: 1px solid #dbe2e9; }
.store-cart-help b { color: #334a62; font-size: 11px; }
.store-cart-help small { color: #7b8998; font-size: 9px; }

@media (max-width: 940px) {
  .store-cart-layout { grid-template-columns: 1fr; }
  .store-cart-summary { position: static; }
}

@media (max-width: 700px) {
  .store-cart-item { grid-template-columns: 58px minmax(0,1fr) 26px; gap: 10px; padding: 12px; }
  .store-cart-thumb { grid-column: 1; grid-row: 1; width: 58px; height: 52px; }
  .store-cart-details { grid-column: 2; grid-row: 1; }
  .store-cart-remove { grid-column: 3; grid-row: 1; }
  .store-cart-unit-price,
  .store-cart-quantity,
  .store-cart-subtotal { grid-row: 2; padding-top: 9px; border-top: 1px dashed #dce3ea; }
  .store-cart-unit-price { grid-column: 1; }
  .store-cart-quantity { grid-column: 2; }
  .store-cart-subtotal { grid-column: 3; align-items: end; text-align: right; }
  .store-cart-subtotal strong { white-space: nowrap; }
}

@media (max-width: 560px) {
  .store-cart-page { padding: 14px 10px 34px !important; }
  .store-cart-breadcrumb { margin-bottom: 10px; font-size: 9px; }
  .store-cart-heading { align-items: center; margin-bottom: 12px; padding-bottom: 12px; }
  .store-cart-heading h1 { font-size: 21px; }
  .store-cart-heading p { font-size: 10px; }
  .store-cart-heading > a { max-width: 105px; font-size: 9px; text-align: right; }
  .store-cart-panel-title { min-height: 40px; padding: 0 11px; }
  .store-cart-panel-title span { display: none; }
  .store-cart-item { grid-template-columns: 52px minmax(0,1fr) 24px; gap: 8px; padding: 10px; }
  .store-cart-thumb { width: 52px; height: 48px; }
  .store-cart-details h2 { font-size: 12px; }
  .store-cart-unit-price strong { font-size: 10px; }
  .store-cart-quantity input { width: 50px; height: 31px; font-size: 11px; }
  .store-cart-subtotal strong { font-size: 11px; }
  .store-cart-list-footer { padding: 9px 10px; }
  .store-cart-list-footer > span { display: none; }
  .store-cart-list-footer > button { margin-left: auto; }
  .store-cart-summary { padding: 14px; }
  .store-cart-empty { grid-template-columns: 48px minmax(0,1fr); gap: 12px; min-height: 0; padding: 18px 14px; }
  .store-cart-empty-icon { width: 46px; height: 46px; }
  .store-cart-empty-icon svg { width: 27px; height: 27px; }
  .store-cart-empty h2 { font-size: 15px; }
  .store-cart-empty p { font-size: 10px; line-height: 1.45; }
  .store-cart-empty > a { grid-column: 1 / -1; min-height: 38px; }
  .store-cart-help { grid-template-columns: 1fr; }
  .store-cart-help > span + span { border-top: 1px solid #dbe2e9; border-left: 0; }
}

/* ========================================================================== 
   RENTED BOT SERVICE — straightforward MMO service page
   ========================================================================== */
.bot-service-page {
  padding: 30px 0 60px;
  background: #f5f7fa;
  color: #172b42;
}

.bot-service-intro,
.bot-service-features,
.bot-pricing-section,
.bot-owned-section,
.bot-command-section,
.bot-service-notes {
  width: min(1180px,calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
}

.bot-service-intro {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr);
  gap: 32px;
  align-items: center;
  padding: 14px 0 28px;
}

.bot-service-breadcrumb {
  display: flex;
  gap: 7px;
  margin-bottom: 25px;
  color: #8290a0;
  font-size: 10px;
}
.bot-service-breadcrumb a { color: #315f91; }

.bot-service-label {
  margin-bottom: 8px;
  color: #e85d04;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.bot-service-copy h1 {
  max-width: 700px;
  margin: 0 0 13px;
  color: #10243d;
  font-size: clamp(30px,4vw,43px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.bot-service-copy > p {
  max-width: 700px;
  margin: 0;
  color: #5f7184;
  font-size: 14px;
  line-height: 1.7;
}

.bot-service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}

.bot-service-actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #bdc9d5;
  border-radius: 4px;
  background: #fff;
  color: #31506f;
  font-size: 11px;
  font-weight: 800;
}
.bot-service-actions a.primary { border-color: #d95a0b; background: #f5670a; color: #fff; }
.bot-service-actions a.primary:hover { background: #dc5705; }

.bot-service-overview {
  border: 1px solid #cfd9e3;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.bot-service-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid #dbe2e9;
  background: #123453;
  color: #fff;
  font-size: 12px;
}
.bot-service-overview-head span { padding: 3px 6px; border-radius: 3px; background: #dff7ed; color: #087a55; font-size: 8px; font-weight: 900; }

.bot-service-overview dl { margin: 0; padding: 8px 15px; }
.bot-service-overview dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #edf0f3; font-size: 11px; }
.bot-service-overview dt { color: #758598; }
.bot-service-overview dd { margin: 0; color: #263b52; font-weight: 700; text-align: right; }
.bot-service-overview > p { margin: 0; padding: 11px 15px; background: #f8fafc; color: #66788a; font-size: 10px; line-height: 1.5; }

.bot-service-features {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  margin-bottom: 42px;
  border: 1px solid #d4dde6;
  border-radius: 6px;
  background: #fff;
}
.bot-service-features article { display: grid; gap: 4px; padding: 15px 17px; }
.bot-service-features article + article { border-left: 1px solid #dce3ea; }
.bot-service-features b { color: #263d55; font-size: 11px; }
.bot-service-features span { color: #758598; font-size: 9px; line-height: 1.45; }

.bot-pricing-section,
.bot-owned-section,
.bot-command-section { margin-bottom: 48px; }

.bot-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 17px;
  padding-bottom: 13px;
  border-bottom: 1px solid #d3dce5;
}
.bot-section-heading > div > span { display: block; margin-bottom: 4px; color: #e85d04; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.bot-section-heading h2 { margin: 0; color: #10243d; font-size: 22px; line-height: 1.2; }
.bot-section-heading > p { max-width: 520px; margin: 0; color: #6f8091; font-size: 11px; line-height: 1.5; text-align: right; }
.bot-section-heading.compact { align-items: center; }

.bot-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(230px,1fr));
  gap: 12px;
}

.bot-plan-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 17px;
  border: 1px solid #d3dce5;
  border-radius: 6px;
  background: #fff;
}
.bot-plan-card.recommended { border-top: 3px solid #f5670a; padding-top: 15px; }
.bot-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.bot-plan-head h3 { margin: 0 0 5px; color: #182e46; font-size: 14px; }
.bot-plan-head p { min-height: 34px; margin: 0; color: #718195; font-size: 10px; line-height: 1.45; }
.bot-plan-head > span { flex: 0 0 auto; padding: 3px 5px; border-radius: 3px; background: #fff0e6; color: #c24d05; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.bot-plan-price { display: flex; align-items: baseline; gap: 5px; margin: 14px 0 4px; }
.bot-plan-price strong { color: #123453; font-size: 23px; letter-spacing: -.02em; }
.bot-plan-price span { color: #7a899a; font-size: 9px; }
.bot-plan-count { margin: 4px 0 0; color: #087a55; font-size: 9px; font-weight: 800; }
.bot-plan-card ul { display: grid; flex: 1; gap: 7px; margin: 15px 0 18px; padding: 13px 0 0; border-top: 1px solid #e1e6ec; color: #506276; font-size: 10px; list-style: none; }
.bot-plan-card li { display: flex; gap: 6px; line-height: 1.4; }
.bot-plan-card li::before { content: "✓"; color: #087a55; font-weight: 900; }
.bot-plan-card form { margin: 0; }
.bot-plan-card button {
  width: 100%;
  min-height: 38px;
  border: 1px solid #234f79;
  border-radius: 4px;
  background: #123453;
  color: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.bot-plan-card button:hover { background: #0b2944; }

.bot-wallet { display: flex; align-items: center; gap: 7px; color: #6d7f91; font-size: 11px; }
.bot-wallet strong { color: #087a55; }
.bot-wallet a { padding: 4px 7px; border: 1px solid #b9c7d5; border-radius: 3px; background: #fff; color: #315f91; font-size: 9px; font-weight: 800; }

.bot-owned-empty {
  display: flex;
  align-items: center;
  gap: 9px 18px;
  padding: 20px;
  border: 1px solid #d3dce5;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
}
.bot-owned-empty span { flex: 1; color: #758598; }
.bot-owned-empty a { color: #315f91; font-weight: 800; }

.bot-owned-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 12px; }
.bot-owned-card { padding: 15px; border: 1px solid #d3dce5; border-radius: 6px; background: #fff; }
.bot-owned-card > header { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid #e0e6ec; }
.bot-owned-card h3 { margin: 0 0 3px; color: #172d45; font-size: 13px; }
.bot-owned-card code { color: #62758a; font-size: 9px; }
.bot-owned-card header > span { align-self: flex-start; padding: 3px 6px; border-radius: 3px; font-size: 8px; font-weight: 900; }
.bot-owned-card header > span.active { background: #e4f6ed; color: #087a55; }
.bot-owned-card header > span.expired { background: #fff0f0; color: #ae3838; }
.bot-owned-card dl { margin: 9px 0; }
.bot-owned-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: #65778a; font-size: 10px; }
.bot-owned-card dd { margin: 0; color: #2d4359; font-weight: 700; text-align: right; }
.bot-manage-link,
.bot-owned-card form button { display: flex; width: 100%; min-height: 35px; align-items: center; justify-content: center; border-radius: 4px; font-size: 9px; font-weight: 800; }
.bot-manage-link { margin-top: 10px; border: 1px solid #234f79; background: #123453; color: #fff; }
.bot-owned-card form { margin: 6px 0 0; }
.bot-owned-card form button { border: 1px solid #b8c6d4; background: #fff; color: #315f91; font: inherit; cursor: pointer; }

.bot-command-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 12px; }
.bot-command-list { display: grid; align-content: start; border: 1px solid #d2dce5; border-radius: 6px; background: #fff; overflow: hidden; }
.bot-command-list button {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #e2e7ed;
  background: #fff;
  color: #19466f;
  font: 700 11px ui-monospace,SFMono-Regular,Consolas,monospace;
  text-align: left;
  cursor: pointer;
}
.bot-command-list button:last-child { border-bottom: 0; }
.bot-command-list button span { color: #7a899a; font: 400 9px system-ui,sans-serif; }
.bot-command-list button:hover,
.bot-command-list button.active { background: #edf3f8; }
.bot-command-list button.active { box-shadow: inset 3px 0 #f5670a; }

.bot-command-console { min-width: 0; border: 1px solid #263b50; border-radius: 6px; background: #132234; color: #dce7f2; overflow: hidden; }
.bot-command-console > header { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid #32475b; background: #1d3044; font-size: 10px; }
.bot-command-console > header b { color: #54d6a4; font-size: 8px; letter-spacing: .07em; }
#bot-command-output { min-height: 190px; padding: 17px; font: 11px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace; }
#bot-command-output p { margin: 0 0 10px; }
#bot-command-output p.system { color: #8296aa; }
#bot-command-output .reply { padding: 10px 12px; border-left: 3px solid #f5670a; background: #1b3045; color: #dbe8f3; }

.bot-service-notes { margin-bottom: 0; }
.bot-service-notes > div { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid #d4dde6; border-radius: 6px; background: #fff; }
.bot-service-notes article { padding: 16px 18px; }
.bot-service-notes article + article { border-left: 1px solid #dce3ea; }
.bot-service-notes b { color: #263d55; font-size: 11px; }
.bot-service-notes p { margin: 5px 0 0; color: #718195; font-size: 9px; line-height: 1.5; }

/* Thuê Bot: đồng bộ toàn bộ nội dung với theme tối. */
:root.dark-mode .bot-service-page { background: var(--bg); color: var(--text); }
:root.dark-mode .bot-service-copy h1,
:root.dark-mode .bot-section-heading h2,
:root.dark-mode .bot-plan-head h3,
:root.dark-mode .bot-owned-card h3,
:root.dark-mode .bot-service-features b,
:root.dark-mode .bot-service-notes b { color: var(--text); }
:root.dark-mode .bot-service-copy > p,
:root.dark-mode .bot-section-heading > p,
:root.dark-mode .bot-plan-head p,
:root.dark-mode .bot-plan-card ul,
:root.dark-mode .bot-owned-empty span,
:root.dark-mode .bot-owned-card dl > div,
:root.dark-mode .bot-service-features span,
:root.dark-mode .bot-service-notes p { color: var(--muted); }
:root.dark-mode .bot-service-actions a,
:root.dark-mode .bot-service-overview,
:root.dark-mode .bot-service-features,
:root.dark-mode .bot-plan-card,
:root.dark-mode .bot-wallet a,
:root.dark-mode .bot-owned-empty,
:root.dark-mode .bot-owned-card,
:root.dark-mode .bot-command-list,
:root.dark-mode .bot-command-list button,
:root.dark-mode .bot-service-notes > div { background: var(--surface); border-color: var(--line); }
:root.dark-mode .bot-service-actions a { color: var(--text); }
:root.dark-mode .bot-service-actions a.primary { color: #fff; }
:root.dark-mode .bot-service-overview dl > div,
:root.dark-mode .bot-service-features article + article,
:root.dark-mode .bot-section-heading,
:root.dark-mode .bot-plan-card ul,
:root.dark-mode .bot-owned-card > header,
:root.dark-mode .bot-command-list button,
:root.dark-mode .bot-service-notes article + article { border-color: var(--line); }
:root.dark-mode .bot-service-overview dt,
:root.dark-mode .bot-service-overview > p,
:root.dark-mode .bot-plan-price span,
:root.dark-mode .bot-command-list button span { color: var(--muted); }
:root.dark-mode .bot-service-overview dd,
:root.dark-mode .bot-owned-card dd,
:root.dark-mode .bot-plan-price strong { color: var(--text); }
:root.dark-mode .bot-service-overview > p { background: var(--surface-2); }
:root.dark-mode .bot-plan-head > span { background: #452b1b; color: #ffad72; }
:root.dark-mode .bot-owned-card code { color: #a9b8c7; }
:root.dark-mode .bot-owned-card form button { background: var(--surface-2); border-color: var(--line); color: var(--primary); }
:root.dark-mode .bot-command-list button:hover,
:root.dark-mode .bot-command-list button.active { background: var(--surface-2); }

@media (max-width: 860px) {
  .bot-service-intro { grid-template-columns: 1fr; gap: 18px; }
  .bot-service-overview { max-width: none; }
  .bot-service-features { grid-template-columns: repeat(2,1fr); }
  .bot-service-features article:nth-child(3) { border-left: 0; border-top: 1px solid #dce3ea; }
  .bot-service-features article:nth-child(4) { border-top: 1px solid #dce3ea; }
  .bot-command-layout { grid-template-columns: 220px minmax(0,1fr); }
}

@media (max-width: 600px) {
  .bot-service-page { padding: 15px 0 34px; }
  .bot-service-intro,
  .bot-service-features,
  .bot-pricing-section,
  .bot-owned-section,
  .bot-command-section,
  .bot-service-notes { width: calc(100% - 20px); }
  .bot-service-breadcrumb { margin-bottom: 15px; }
  .bot-service-copy h1 { font-size: 26px; }
  .bot-service-copy > p { font-size: 12px; line-height: 1.6; }
  .bot-service-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .bot-service-actions a { justify-content: center; min-height: 38px; padding: 0 8px; font-size: 9px; }
  .bot-service-actions a.primary { grid-column: 1 / -1; }
  .bot-service-overview dl > div { font-size: 10px; }
  .bot-service-features { margin-bottom: 30px; }
  .bot-service-features article { padding: 12px; }
  .bot-pricing-section,
  .bot-owned-section,
  .bot-command-section { margin-bottom: 34px; }
  .bot-section-heading { align-items: flex-start; gap: 8px; margin-bottom: 12px; }
  .bot-section-heading h2 { font-size: 18px; }
  .bot-section-heading > p { max-width: 145px; font-size: 8px; }
  .bot-plan-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .bot-plan-card { padding: 12px; }
  .bot-plan-card.recommended { padding-top: 10px; }
  .bot-plan-head { display: block; }
  .bot-plan-head > span { display: inline-block; margin-top: 5px; }
  .bot-plan-head p { min-height: 42px; font-size: 8px; }
  .bot-plan-price { display: block; margin-top: 10px; }
  .bot-plan-price strong { display: block; font-size: 18px; }
  .bot-plan-card ul { gap: 5px; margin: 10px 0 12px; padding-top: 10px; font-size: 8px; }
  .bot-plan-card button { min-height: 34px; font-size: 9px; }
  .bot-wallet { display: grid; justify-items: end; font-size: 9px; }
  .bot-owned-empty { display: grid; gap: 5px; padding: 14px; }
  .bot-owned-empty a { margin-top: 4px; }
  .bot-owned-grid { grid-template-columns: 1fr; }
  .bot-command-layout { grid-template-columns: 1fr; gap: 7px; }
  .bot-command-list { display: flex; overflow-x: auto; scrollbar-width: none; }
  .bot-command-list::-webkit-scrollbar { display: none; }
  .bot-command-list button { flex: 0 0 auto; min-width: 118px; border-right: 1px solid #e2e7ed; border-bottom: 0; }
  #bot-command-output { min-height: 150px; padding: 13px; font-size: 9px; }
  .bot-service-notes > div { grid-template-columns: 1fr; }
  .bot-service-notes article + article { border-top: 1px solid #dce3ea; border-left: 0; }
}

@media (max-width: 420px) {
  .bot-plan-grid { grid-template-columns: 1fr; }
  .bot-plan-head p { min-height: 0; }
}

/* ========================================================================== 
   GLOBAL DARK-MODE COMPATIBILITY — legacy and marketplace templates
   ========================================================================== */
:root.dark-mode main { background-color: var(--bg); color: var(--text); }

/* Share File */
:root.dark-mode .share-library-heading h1,
:root.dark-mode .share-category-title,
:root.dark-mode .share-file-info h2 a { color: var(--text); }
:root.dark-mode .share-search-bar,
:root.dark-mode .share-category-panel,
:root.dark-mode .share-file-card,
:root.dark-mode .share-empty-state,
:root.dark-mode .share-pagination a,
:root.dark-mode .share-results-toolbar select { background: var(--surface); border-color: var(--line); color: var(--text); }
:root.dark-mode .share-category-list a { color: var(--muted); }
:root.dark-mode .share-category-list a:hover,
:root.dark-mode .share-category-list a.active { background: var(--surface-2); color: var(--text); }
:root.dark-mode .share-category-list b,
:root.dark-mode .share-community-note,
:root.dark-mode .share-file-thumb { background: var(--surface-2); color: var(--muted); }
:root.dark-mode .share-community-note span { color: var(--text); }
:root.dark-mode .share-file-thumb,
:root.dark-mode .share-file-footer { border-color: var(--line); }

/* Cart and checkout */
:root.dark-mode .store-cart-heading h1,
:root.dark-mode .store-cart-panel-title,
:root.dark-mode .store-cart-details h2 a,
:root.dark-mode .store-cart-summary h2,
:root.dark-mode .store-cart-empty h2,
:root.dark-mode .store-cart-help b { color: var(--text); }
:root.dark-mode .store-cart-products,
:root.dark-mode .store-cart-summary,
:root.dark-mode .store-cart-empty,
:root.dark-mode .store-cart-list-footer > button,
:root.dark-mode .store-cart-quantity input,
:root.dark-mode .store-cart-coupon-form input { background: var(--surface); border-color: var(--line); color: var(--text); }
:root.dark-mode .store-cart-list-footer,
:root.dark-mode .store-cart-help,
:root.dark-mode .store-cart-thumb,
:root.dark-mode .store-cart-variant,
:root.dark-mode .store-cart-coupon-form button,
:root.dark-mode .store-cart-empty-icon { background: var(--surface-2); border-color: var(--line); }
:root.dark-mode .store-cart-heading,
:root.dark-mode .store-cart-panel-title,
:root.dark-mode .store-cart-item,
:root.dark-mode .store-cart-list-footer,
:root.dark-mode .store-cart-summary h2,
:root.dark-mode .store-cart-total,
:root.dark-mode .store-cart-help > span { border-color: var(--line); }
:root.dark-mode .store-cart-summary-row,
:root.dark-mode .store-cart-summary-row strong,
:root.dark-mode .store-cart-total,
:root.dark-mode .store-cart-unit-price strong { color: var(--muted); }

/* Inline styles from older user-facing templates. */
:root.dark-mode main [style*="background: #fff"],
:root.dark-mode main [style*="background:#fff"],
:root.dark-mode main [style*="background: white"],
:root.dark-mode main [style*="background:white"] { background: var(--surface) !important; }
:root.dark-mode main [style*="background: #f8fafc"],
:root.dark-mode main [style*="background:#f8fafc"],
:root.dark-mode main [style*="background: #f4f7fa"],
:root.dark-mode main [style*="background:#f4f7fa"],
:root.dark-mode main [style*="background: #f1f5f9"],
:root.dark-mode main [style*="background:#f1f5f9"],
:root.dark-mode main [style*="background: #eef2f7"],
:root.dark-mode main [style*="background:#eef2f7"] { background: var(--surface-2) !important; }
:root.dark-mode main [style*="background: #fffbeb"],
:root.dark-mode main [style*="background:#fffbeb"],
:root.dark-mode main [style*="background: #fff3cd"],
:root.dark-mode main [style*="background:#fff3cd"] { background: var(--warning-bg) !important; border-color: #765b2b !important; }
:root.dark-mode main [style*="background: #fef2f2"],
:root.dark-mode main [style*="background:#fef2f2"] { background: var(--danger-bg) !important; border-color: #754040 !important; }
:root.dark-mode main [style*="background: #eff6ff"],
:root.dark-mode main [style*="background:#eff6ff"] { background: var(--info-bg) !important; border-color: #315b7d !important; }
:root.dark-mode main [style*="color: #172033"],
:root.dark-mode main [style*="color:#172033"],
:root.dark-mode main [style*="color: #172b42"],
:root.dark-mode main [style*="color:#172b42"],
:root.dark-mode main [style*="color: #10243d"],
:root.dark-mode main [style*="color:#10243d"],
:root.dark-mode main [style*="color: #0f172a"],
:root.dark-mode main [style*="color:#0f172a"],
:root.dark-mode main [style*="color: #1e293b"],
:root.dark-mode main [style*="color:#1e293b"],
:root.dark-mode main [style*="color: #334155"],
:root.dark-mode main [style*="color:#334155"] { color: var(--text) !important; }
:root.dark-mode main [style*="color: #92400e"],
:root.dark-mode main [style*="color:#92400e"],
:root.dark-mode main [style*="color: #b45309"],
:root.dark-mode main [style*="color:#b45309"],
:root.dark-mode main [style*="color: #a16207"],
:root.dark-mode main [style*="color:#a16207"] { color: #f3cf91 !important; }
:root.dark-mode main [style*="color: #1e40af"],
:root.dark-mode main [style*="color:#1e40af"],
:root.dark-mode main [style*="color: #1d4ed8"],
:root.dark-mode main [style*="color:#1d4ed8"] { color: #b9daf2 !important; }
:root.dark-mode main [style*="border: 1px solid #e2e8f0"],
:root.dark-mode main [style*="border:1px solid #e2e8f0"],
:root.dark-mode main [style*="border: 1px solid #d"],
:root.dark-mode main [style*="border:1px solid #d"] { border-color: var(--line) !important; }

/* High-specificity overrides for templates that ship their own page-level CSS. */
html:root.dark-mode body main .shop-page {
  --shop-line: var(--line) !important;
  --shop-bg: var(--bg) !important;
  --shop-text: var(--text) !important;
  --shop-muted: var(--muted) !important;
}
html:root.dark-mode body main .shop-page .shop-head,
html:root.dark-mode body main .shop-page .shop-filter,
html:root.dark-mode body main .shop-page .product-card,
html:root.dark-mode body main .shop-page .shop-field input,
html:root.dark-mode body main .shop-page .shop-field select,
html:root.dark-mode body main .shop-page .shop-empty,
html:root.dark-mode body main .shop-page .circle-link { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
html:root.dark-mode body main .shop-page .product-image { background: var(--surface-2) !important; }
html:root.dark-mode body main .shop-page .product-footer { border-color: var(--line) !important; }

html:root.dark-mode body main .rewards-page {
  --rw-line: var(--line) !important;
  --rw-bg: var(--bg) !important;
  --rw-text: var(--text) !important;
  --rw-muted: var(--muted) !important;
}
html:root.dark-mode body main .rewards-page .rewards-head,
html:root.dark-mode body main .rewards-page .reward-card,
html:root.dark-mode body main .rewards-page .reward-referral,
html:root.dark-mode body main .rewards-page .reward-winners { background: var(--surface) !important; border-color: var(--line) !important; }
html:root.dark-mode body main .rewards-page .reward-note,
html:root.dark-mode body main .rewards-page .checkin-day,
html:root.dark-mode body main .rewards-page .reward-winners > div > div { background: var(--surface-2) !important; }

html:root.dark-mode body main .feed-page,
html:root.dark-mode body main .feed-shell {
  --surface: #17222d !important;
  --surface2: #202f3d !important;
  --bg: #101820 !important;
  --line: #30404f !important;
  --text: #e8eef4 !important;
  --muted: #a7b4c2 !important;
}
html:root.dark-mode body main .feed-composer-input,
html:root.dark-mode body main .feed-actions { background: var(--surface) !important; }

html:root.dark-mode body main .legal-sidebar,
html:root.dark-mode body main .policy-rule-card { background: var(--surface) !important; border-color: var(--line) !important; color: var(--text) !important; }

/* QR codes need a white quiet zone for reliable scanning in both themes. */
:root.dark-mode main #qrImageWrapper,
:root.dark-mode main #qr-img,
:root.dark-mode main #step-2 div:has(> #qr-img) { background: #fff !important; }


