@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  /* ── Banggood palette ── */
  --bg:          #f4f4f4;       /* light page bg (Banggood's off-white body) */
  --surface:     #ffffff;       /* card / panel white */
  --surface2:    #f8f8f8;       /* subtle inset / row striping */
  --surface3:    #efefef;       /* hovered row / deeper inset */
  --border:      rgba(0,0,0,.09);
  --border2:     rgba(0,0,0,.16);

  /* Primary — Banggood red */
  --accent:      #e1251b;
  --accent-h:    #c41e15;       /* darker hover */
  --accent-glow: rgba(225,37,27,.12);

  /* Semantic colours */
  --blue:        #1a73e8;
  --green:       #1a9e3f;
  --red:         #e1251b;
  --yellow:      #f5a623;
  --purple:      #7b2d8b;

  /* Text */
  --text:        #1a1a1a;       /* near-black heading / body */
  --text-2:      #555555;       /* secondary / label text */
  --text-3:      #999999;       /* muted / placeholder */

  /* Fonts (unchanged) */
  --font-head:   'Syne', sans-serif;
  --font-body:   'DM Sans', sans-serif;

  /* Shape / elevation */
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --shadow:      0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:   0 6px 24px rgba(0,0,0,.16);

  --nav-h:       56px;          /* Banggood has a compact top bar */
  --tr:          .18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; outline: none; }
ul { list-style: none; }

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.8rem,4vw,2.8rem); }
h2 { font-size: clamp(1.3rem,2.5vw,1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-2); }
.lead  { font-size: 1.1rem; }
.muted { color: var(--text-3); font-size: .875rem; }

/* ── Layout helpers ── */
.container    { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 860px;  margin: 0 auto; padding: 0 1.25rem; }
.page-wrap  { padding-top: var(--nav-h); }
.page-main  { min-height: calc(100vh - var(--nav-h) - 180px); padding: 2rem 0 3.5rem; }

.grid   { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-5 { grid-template-columns: repeat(5,1fr); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap     { display: flex; gap: 1rem; align-items: center; }
.flex-col     { flex-direction: column; }
.gap-sm { gap: .5rem; } .gap { gap: 1rem; } .gap-lg { gap: 1.5rem; }

/* ══════════════════════════════
   NAVBAR  — white top bar with red accents (Banggood style)
   ══════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  display: flex; align-items: center;
}
.navbar .container { display: flex; align-items: center; gap: 1.5rem; width: 100%; }

/* Logo: bold red */
.nav-brand {
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 800;
  color: var(--accent); letter-spacing: -.03em; white-space: nowrap;
}
.nav-brand span { color: var(--text); }

/* Search bar */
.nav-search { flex: 1; max-width: 540px; position: relative; display: flex; align-items: center; }
.nav-search input {
  width: 100%; padding: .5rem 1rem .5rem 1rem;
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text); font-size: .9rem; transition: var(--tr);
}
.nav-search input::placeholder { color: var(--text-3); }
.nav-search input:focus { box-shadow: 0 0 0 3px var(--accent-glow); }
.nav-search .search-icon { position: absolute; left: .75rem; color: var(--text-3); pointer-events: none; }
.nav-search .btn-search {
  background: var(--accent); color: #fff; border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .52rem 1rem; font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: var(--tr); white-space: nowrap;
}
.nav-search .btn-search:hover { background: var(--accent-h); }

/* Nav links */
.nav-links { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.nav-link {
  display: flex; align-items: center; gap: .35rem;
  padding: .45rem .7rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 500; color: var(--text-2);
  transition: var(--tr); white-space: nowrap;
}
.nav-link:hover { color: var(--accent); background: var(--surface2); }
.nav-link.active { color: var(--accent); }

/* Badge (cart count etc.) */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 700; min-width: 17px; height: 17px;
  border-radius: 999px; padding: 0 3px;
}

/* Avatar */
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--accent); cursor: pointer; overflow: hidden;
}

/* ══════════════════════════════
   SIDEBAR
   ══════════════════════════════ */
.layout-sidebar { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.sidebar {
  position: sticky; top: calc(var(--nav-h) + 1rem);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.sidebar-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: .65rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 500; color: var(--text-2); transition: var(--tr); cursor: pointer;
}
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link.active { background: rgba(225,37,27,.08); color: var(--accent); border-left: 3px solid var(--accent); }

/* ══════════════════════════════
   CARDS
   ══════════════════════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card-hover { transition: var(--tr); }
.card-hover:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-2px); }

/* Product card */
.card-product {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: var(--tr);
  display: flex; flex-direction: column;
}
.card-product:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(225,37,27,.12);
  transform: translateY(-2px);
}
.card-product .prod-img { aspect-ratio: 3/2; overflow: hidden; background: var(--surface2); position: relative; min-height: 200px; }
.card-product .prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card-product:hover .prod-img img { transform: scale(1.05); }
.card-product .prod-badge {
  position: absolute; top: .5rem; left: .5rem;
  background: var(--accent); color: #fff;
  font-size: .62rem; font-weight: 700; padding: .18rem .45rem;
  border-radius: 2px; text-transform: uppercase;
}
.card-product .prod-body { padding: .9rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.card-product .prod-shop { font-size: .72rem; color: var(--accent); font-weight: 600; }
.card-product .prod-name {
  font-family: var(--font-head); font-size: .9rem; font-weight: 700;
  color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-product .prod-price { font-size: 1.15rem; font-weight: 800; color: var(--accent); margin-top: auto; font-family: var(--font-head); }
.card-product .prod-stars { display: flex; align-items: center; gap: .25rem; font-size: .78rem; color: #f5a623; }
.card-product .prod-actions { display: flex; gap: .4rem; padding: 0 .9rem .9rem; }

/* ══════════════════════════════
   BUTTONS
   ══════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.25rem; font-family: var(--font-body); font-size: .875rem;
  font-weight: 600; border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--tr); white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm  { padding: .38rem .8rem; font-size: .78rem; border-radius: var(--radius-sm); }
.btn-lg  { padding: .8rem 1.75rem; font-size: .95rem; }
.btn-xl  { padding: 1rem 2.25rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Red CTA — Banggood's main action colour */
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface3); border-color: var(--accent); }
.btn-outline  { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-glow); }
.btn-ghost    { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c41e15; }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover { background: #158034; }
.btn-info     { background: rgba(26,115,232,.1); color: var(--blue); border: 1px solid var(--blue); }

/* ══════════════════════════════
   FORMS
   ══════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .83rem; font-weight: 600; color: var(--text-2); }
.form-control {
  padding: .62rem .9rem; background: #fff; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); font-size: .875rem;
  transition: var(--tr); width: 100%;
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control.error { border-color: var(--red); }
select.form-control {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23999' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px; padding-right: 2.5rem;
}
textarea.form-control { min-height: 100px; resize: vertical; }
.form-hint  { font-size: .76rem; color: var(--text-3); }
.form-error { font-size: .76rem; color: var(--red); }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ══════════════════════════════
   TABLES
   ══════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead { background: #fff2f2; }        /* soft red tint for header — Banggood style */
th {
  padding: .8rem 1rem; text-align: left; font-weight: 600;
  color: var(--accent); white-space: nowrap; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em;
}
td { padding: .85rem 1rem; border-top: 1px solid var(--border); color: var(--text); }
tr:hover td { background: #fff8f8; }

/* ══════════════════════════════
   BADGES
   ══════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .18rem .6rem; border-radius: 2px;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.badge-primary { background: rgba(225,37,27,.1);   color: var(--accent); }
.badge-success { background: rgba(26,158,63,.1);   color: var(--green); }
.badge-danger  { background: rgba(225,37,27,.1);   color: var(--red); }
.badge-warning { background: rgba(245,166,35,.15); color: #b8760a; }
.badge-info    { background: rgba(26,115,232,.1);  color: var(--blue); }
.badge-purple  { background: rgba(123,45,139,.1);  color: var(--purple); }
.badge-muted   { background: var(--surface2);      color: var(--text-2); }

/* ══════════════════════════════
   ALERTS
   ══════════════════════════════ */
.alert { display: flex; align-items: flex-start; gap: .7rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); font-size: .875rem; border-left: 3px solid; }
.alert-success { background: rgba(26,158,63,.07);  border-color: var(--green);  color: #155a2d; }
.alert-danger  { background: rgba(225,37,27,.07);  border-color: var(--red);    color: #8b1515; }
.alert-warning { background: rgba(245,166,35,.1);  border-color: var(--yellow); color: #7c5204; }
.alert-info    { background: rgba(26,115,232,.07); border-color: var(--blue);   color: #0d4a99; }

/* ══════════════════════════════
   STAT CARDS
   ══════════════════════════════ */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .4rem;
  position: relative; overflow: hidden;
}
.stat-label { font-size: .75rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-icon {
  position: absolute; right: 1rem; top: 1rem; width: 40px; height: 40px;
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; background: rgba(225,37,27,.08); color: var(--icon-color, var(--accent));
}

/* ══════════════════════════════
   TABS
   ══════════════════════════════ */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); }
.tab {
  padding: .6rem 1.25rem; font-size: .875rem; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: var(--tr);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--text); }

/* ══════════════════════════════
   MODAL
   ══════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: var(--tr);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 1.75rem;
  width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
  transform: scale(.96); transition: var(--tr);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-title { font-family: var(--font-head); font-size: 1.2rem; color: var(--text); }
.modal-close {
  background: var(--surface2); border: none; color: var(--text-2);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}

/* ══════════════════════════════
   HERO — red accent on light bg (Banggood banner look)
   ══════════════════════════════ */
.hero {
  position: relative; background: #fff; overflow: hidden; padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(225,37,27,.06) 0%, transparent 60%);
}
.hero .container { position: relative; z-index: 1; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(225,37,27,.08); border: 1px solid rgba(225,37,27,.22);
  color: var(--accent); border-radius: 2px; padding: .25rem .75rem;
  font-size: .78rem; font-weight: 600; margin-bottom: 1.25rem;
}
.hero-title { color: var(--text); margin-bottom: 1rem; }
.hero-title span { color: var(--accent); }
.hero-sub { font-size: 1.05rem; color: var(--text-2); margin-bottom: 1.75rem; max-width: 500px; }
.hero-cta { display: flex; gap: .875rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.hero-stat .num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.hero-stat .lbl { font-size: .78rem; color: var(--text-3); }

/* ══════════════════════════════
   SECTION
   ══════════════════════════════ */
.section { padding: 3rem 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
/* Section title: left-border accent — classic Banggood category header */
.section-title {
  font-family: var(--font-head); font-size: 1.4rem; color: var(--text);
  border-left: 4px solid var(--accent); padding-left: .75rem;
}
.section-title span { color: var(--accent); }

/* ══════════════════════════════
   CATEGORY PILLS
   ══════════════════════════════ */
.cat-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.cat-pill {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 2px;
  font-size: .83rem; font-weight: 500; color: var(--text-2); cursor: pointer; transition: var(--tr);
}
.cat-pill:hover, .cat-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ══════════════════════════════
   PAGINATION
   ══════════════════════════════ */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; }
.page-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .83rem; cursor: pointer; transition: var(--tr);
}
.page-btn:hover, .page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ══════════════════════════════
   WALLET
   ══════════════════════════════ */
.wallet-card {
  background: linear-gradient(135deg, var(--accent) 0%, #c41e15 100%);
  border-radius: var(--radius-lg); padding: 1.75rem; position: relative; overflow: hidden;
}
.wallet-balance { font-family: var(--font-head); font-size: 2.5rem; font-weight: 800; color: #fff; }
.wallet-label { font-size: .75rem; color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .4rem; }

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */
.toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9999; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  display: flex; align-items: center; gap: .65rem;
  background: #fff; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: .8rem 1.1rem;
  font-size: .85rem; box-shadow: var(--shadow-lg);
  min-width: 270px; max-width: 380px; color: var(--text);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--yellow); }

/* ══════════════════════════════
   MISC COMPONENTS
   ══════════════════════════════ */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: mh-spin .7s linear infinite; }
.progress-bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.skeleton { background: linear-gradient(90deg,var(--surface2) 25%,var(--surface3) 50%,var(--surface2) 75%); background-size: 200% 100%; animation: mh-shimmer 1.5s infinite; border-radius: var(--radius-sm); }

/* Ticket / chat messages */
.msg-wrap { display: flex; gap: .85rem; margin-bottom: 1rem; }
.msg-wrap.mine { flex-direction: row-reverse; }
.msg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.msg-bubble { max-width: 70%; padding: .75rem 1rem; border-radius: var(--radius); font-size: .86rem; line-height: 1.5; }
.msg-wrap:not(.mine) .msg-bubble { background: var(--surface2); border-radius: 4px var(--radius) var(--radius) var(--radius); color: var(--text); }
.msg-wrap.mine .msg-bubble { background: rgba(225,37,27,.1); border-radius: var(--radius) 4px var(--radius) var(--radius); color: #7a1010; }

/* Qty control */
.qty-input { display: flex; align-items: center; background: #fff; border: 1px solid var(--border2); border-radius: var(--radius-sm); overflow: hidden; }
.qty-btn { width: 34px; height: 34px; background: none; border: none; color: var(--text); cursor: pointer; font-size: 1rem; font-weight: 600; transition: var(--tr); }
.qty-btn:hover { background: var(--accent); color: #fff; }
.qty-num { min-width: 38px; text-align: center; font-weight: 600; font-size: .875rem; color: var(--text); }

/* Avatar upload */
.avatar-upload { width: 96px; height: 96px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--border2); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; transition: var(--tr); }
.avatar-upload:hover { border-color: var(--accent); }
.avatar-overlay { position: absolute; inset: 0; background: rgba(225,37,27,.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--tr); font-size: .7rem; color: #fff; text-align: center; }
.avatar-upload:hover .avatar-overlay { opacity: 1; }

/* Checkout */
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.75rem; align-items: start; }
.order-summary { position: sticky; top: calc(var(--nav-h) + 1rem); }

/* Dashboard */
.dash-header { margin-bottom: 1.75rem; }
.dash-title  { font-family: var(--font-head); font-size: 1.6rem; margin-bottom: .2rem; color: var(--text); }
.dash-sub    { color: var(--text-2); font-size: .9rem; }

/* Sub nav (seller / admin) */
.snav,.anav {
  background: var(--surface); border-bottom: 2px solid var(--accent);
  padding: 0; position: sticky; top: var(--nav-h); z-index: 90;
}
.snav .container,.anav .container { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.snav .container::-webkit-scrollbar,.anav .container::-webkit-scrollbar { display: none; }
.snav a,.anav a {
  display: flex; align-items: center; gap: .3rem;
  padding: .65rem 1rem; font-size: .82rem; font-weight: 500;
  color: var(--text-2); white-space: nowrap; text-decoration: none; transition: .18s;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.snav a:hover,.anav a:hover { color: var(--accent); }
.snav a.on,.anav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Currency pills */
.cur-card {
  padding: .8rem 1rem; background: var(--surface);
  border: 1.5px solid var(--border2); border-radius: var(--radius-sm);
  cursor: pointer; text-align: center; transition: .18s; min-width: 85px; color: var(--text-2);
}
.cur-card:hover,.cur-card.on { border-color: var(--accent); background: rgba(225,37,27,.06); color: var(--accent); }

/* Address box */
.addr-box {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: .9rem;
  font-family: monospace; font-size: .85rem; word-break: break-all;
  position: relative; line-height: 1.6; color: var(--text);
}

/* Chat window */
.chat-win,.chat-window {
  position: fixed; bottom: 0; right: 2rem; width: 350px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-lg);
  z-index: 300; display: none; flex-direction: column; max-height: 480px;
}
.chat-hd,.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; background: var(--accent); color: #fff;
  border-radius: var(--radius) var(--radius) 0 0; flex-shrink: 0;
}
.chat-bd,.chat-body { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .5rem; min-height: 180px; }
.chat-ft,.chat-foot { padding: .7rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.cbubble,.chat-bubble { max-width: 80%; padding: .55rem .85rem; border-radius: var(--radius); font-size: .85rem; line-height: 1.5; word-break: break-word; }
.cmine,.chat-mine { align-self: flex-end; background: rgba(225,37,27,.1); color: #7a1010; border-radius: var(--radius) 4px var(--radius) var(--radius); }
.cother,.chat-other { align-self: flex-start; background: var(--surface2); color: var(--text); border-radius: 4px var(--radius) var(--radius) var(--radius); }

/* Online dot */
.online-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; flex-shrink: 0; }

/* Footer */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2.5rem 0 1.25rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3,1fr); gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-col h4 { font-size: .875rem; font-weight: 700; margin-bottom: .875rem; color: var(--text); }
.footer-col a { display: block; color: var(--text-2); font-size: .84rem; margin-bottom: .45rem; transition: var(--tr); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1.25rem; border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--text-3);
}

/* ── Utilities ── */
.mt-1{margin-top:.5rem} .mt-2{margin-top:1rem} .mt-3{margin-top:1.5rem} .mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem} .mb-2{margin-bottom:1rem} .mb-3{margin-bottom:1.5rem} .mb-4{margin-bottom:2rem}
.p-3{padding:1.5rem} .p-4{padding:2rem}
.text-accent{color:var(--accent)} .text-success{color:var(--green)} .text-danger{color:var(--red)} .text-muted{color:var(--text-2)}
.text-center{text-align:center} .text-right{text-align:right}
.fw-bold{font-weight:700} .fw-600{font-weight:600}
.hidden{display:none!important} .w-full{width:100%}
.relative{position:relative} .overflow-hidden{overflow:hidden}

/* ── Animations ── */
@keyframes mh-spin    { to { transform: rotate(360deg); } }
@keyframes mh-slide-in{ from { transform: translateX(100%); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes mh-shimmer { to { background-position: -200% 0; } }

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media(max-width:1200px){
  .grid-5{grid-template-columns:repeat(4,1fr)}
  .grid-4{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:1024px){
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .grid-5{grid-template-columns:repeat(3,1fr)}
  .layout-sidebar{grid-template-columns:1fr}
  .sidebar{position:static;display:flex;flex-wrap:wrap;gap:.4rem;padding:.65rem}
  .sidebar .sidebar-title{width:100%;margin-bottom:.2rem}
  .sidebar .sidebar-link{padding:.3rem .7rem;border-radius:var(--radius-sm);background:var(--surface2)}
  .checkout-grid{grid-template-columns:1fr}
}
@media(max-width:768px){
  :root{--nav-h:52px}
  .navbar .container{padding:0 .75rem}
  .nav-brand{font-size:1.1rem}
  .nav-search{display:none}
  .nav-links{gap:.35rem}
  .nav-avatar{width:30px;height:30px}
  .hero{padding:2rem 0}
  .hero h1{font-size:1.75rem}
  .grid-2{grid-template-columns:1fr}
  .grid-3,.grid-4,.grid-5{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr 1fr;gap:1.25rem}
  .section-header{flex-direction:column;align-items:flex-start;gap:.4rem}
  .flex-between{flex-wrap:wrap;gap:.4rem}
  .table-wrap table{min-width:580px}
  .stat-value{font-size:1.5rem}
  .card{padding:.9rem}
  .modal{padding:1.1rem}
  .wallet-balance{font-size:2rem}
  .grid-4.stat-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:600px){
  .grid-3,.grid-4,.grid-5{grid-template-columns:repeat(2,1fr)}
  .card-product .prod-name{font-size:.82rem}
  .card-product .prod-price{font-size:.92rem}
  .btn-lg{padding:.65rem 1.1rem;font-size:.875rem}
  .hero h1{font-size:1.5rem}
}
@media(max-width:480px){
  .grid-2,.grid-3,.grid-4,.grid-5{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr}
  .hero{padding:1.5rem 0}
  .hero h1{font-size:1.3rem}
  .hero p{font-size:.875rem}
  .container{padding:0 .75rem}
  .section-title{font-size:1.15rem}
  .page-main{padding-top:var(--nav-h)}
  .chat-win,.chat-window{right:0;width:100vw;border-radius:var(--radius) var(--radius) 0 0}
  .modal{padding:.9rem}
  .flex-gap{flex-wrap:wrap}
  .btn{min-height:40px}
  form .grid-2{grid-template-columns:1fr}
}
@media(max-width:360px){
  .grid-2,.grid-3,.grid-4,.grid-5{grid-template-columns:1fr}
  .nav-links .btn{display:none}
  .nav-links .btn:last-child{display:flex}
  .hero h1{font-size:1.15rem}
}
@media(hover:none){
  .btn:active{transform:scale(.97);opacity:.9}
  .card-product:active{transform:translateY(-1px)}
  .nav-link:active{opacity:.7}
}

/* Broken image fallback */
img.prod-img-el { background: var(--surface2); }
img[src=""], img:not([src]) { opacity: 0; }
.prod-img img { background: var(--surface2); min-height: 40px; }