/* ===== V6 Dark Upgrade (override on top of app_full.css) ===== */

/* Theme tokens */
:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --card:#121b26;
  --border:rgba(255,255,255,.08);

  --text:#e8eef7;
  --muted:rgba(232,238,247,.68);
  --hint:rgba(232,238,247,.45);

  --primary:#4da3ff;
  --primary2:#2f7dff;
  --success:#41d1a8;
  --danger:#ff5d5d;

  --shadow:0 14px 34px rgba(0,0,0,.38);
  --r:16px;
  --r2:12px;
  --tap:48px;
  --max:1100px;
}

/* Global */
html,body{
  background: radial-gradient(1200px 700px at 30% -10%, rgba(77,163,255,.16), transparent 55%),
              radial-gradient(900px 600px at 90% 10%, rgba(65,209,168,.10), transparent 55%),
              var(--bg);
  color:var(--text);
}

*{ box-sizing:border-box; }
a{ color:inherit; text-decoration:none; }
a:active{ opacity:.9; }

.container{
  max-width:var(--max);
  margin:0 auto;
  padding:16px;
}

.has-bottom-nav{ padding-bottom:92px; }

.muted{ color:var(--muted) !important; }
.hint{ color:var(--hint); }

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(11,15,20,.72);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar .row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  font-weight:900;
  letter-spacing:.2px;
}

/* Dropdown (language) */
.dropdown{ position:relative; }
.dropdown .menu{
  position:absolute;
  right:0; top:calc(100% + 8px);
  min-width:160px;
  background:rgba(15,22,32,.96);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow);
  padding:8px;
  display:none;
}
.dropdown .menu a{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
}
.dropdown .menu a:hover{ background:rgba(255,255,255,.06); }
.dropdown .menu.show{ display:block; }

/* Card */
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  background-color:var(--card);
  border:1px solid var(--border);
  border-radius:var(--r);
  box-shadow:var(--shadow);
}
.card[style*="box-shadow:none"]{ box-shadow:none !important; }

/* Divider */
.hr{
  height:1px;
  background:var(--border) !important;
  margin:12px 0;
}

/* Buttons */
.btn, button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:var(--tap);
  padding:0 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary, .btn.btn-primary, button.primary{
  border:none !important;
  background:linear-gradient(135deg, var(--primary), var(--primary2)) !important;
  box-shadow:0 12px 26px rgba(47,125,255,.28);
}
.btn.block, .btn.btn-block, button.block{
  width:100%;
}
.btn:active, button:active{ transform:translateY(0.5px); }

/* Inputs */
.input, input, select, textarea{
  width:100%;
  min-height:var(--tap);
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}
.input::placeholder, input::placeholder, textarea::placeholder{
  color:rgba(232,238,247,.35);
}

/* Search row */
.searchrow{
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.searchrow .input{ flex:1; }

/* Product grid + cards */
.grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (min-width: 900px){
  .grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
}
.imgwrap{
  width:100%;
  aspect-ratio: 1/1;
  background:rgba(255,255,255,.03);
  border-bottom:1px solid var(--border);
  overflow:hidden;
  border-top-left-radius:var(--r);
  border-top-right-radius:var(--r);
}
.imgwrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.cardbody{ padding:12px; }
.title{
  font-weight:900;
  line-height:1.25;
}
.price{
  margin-top:6px;
  font-weight:900;
  color:var(--text);
  opacity:.95;
}

/* Key-value rows (profile, checkout) */
.kv{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
}
.kv .k{ color:var(--muted); font-weight:700; }
.kv .v{ font-weight:900; }

/* Badge */
.badge{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  vertical-align:middle;
}

/* Bottom nav (existing template uses bottomnav/wrap/navitem) */
.bottomnav{
  position:fixed;
  left:0; right:0; bottom:0; z-index:60;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(11,15,20,.82);
  backdrop-filter:blur(12px);
  border-top:1px solid var(--border);
}
.bottomnav .wrap{
  display:flex;
  justify-content:space-around;
  max-width:520px;
  margin:0 auto;
}
.navitem{
  width:25%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 0;
  border-radius:14px;
  color:var(--muted);
}
.navitem .icon{ width:22px; height:22px; }
.navitem.active{
  color:var(--text);
  background:rgba(77,163,255,.10);
  border:1px solid rgba(77,163,255,.20);
}

/* Tables (order detail / checkout) */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
th, td{
  padding:12px;
  background:rgba(255,255,255,.02);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}
tr > *:first-child{
  border-left:1px solid var(--border);
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
}
tr > *:last-child{
  border-right:1px solid var(--border);
  border-top-right-radius:14px;
  border-bottom-right-radius:14px;
}
