/* RESET & GLOBAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  background: radial-gradient(circle at top, #140026, #05000b);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* LOADING SCREEN */
.loading-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #140026, #05000b);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.loader {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top: 4px solid #c86bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* TOP NAV */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 5, 13, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.5px;
}
.logo span {
  color: #c86bff;
}
.stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stats span {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

/* BUTTONS */
button, .btn, .gradient-button, .chip-btn {
  cursor: pointer;
  outline: none;
}
.btn, .gradient-button {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #df71ff, #6f9dff);
  color: #05000b;
  box-shadow: 0 0 16px rgba(200,107,255,0.9);
  transition: 0.15s ease;
}
.btn:hover, .gradient-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.btn.secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
}

/* LAYOUT WRAPS */
.products-main {
  max-width: 1200px;
  margin: 18px auto;
  padding: 0 18px 80px;
}
.products-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .products-layout { grid-template-columns: 1fr; }
  .products-sidebar { position: relative; top: 0; }
}

/* SIDEBAR */
.products-sidebar {
  position: sticky;
  top: 86px;
  background: rgba(8,2,20,0.9);
  border: 1px solid rgba(200,107,255,0.25);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 0 20px rgba(0,0,0,0.85);
  height: fit-content;
}
.sidebar-header h3,
.products-sidebar h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 10px;
}

.categories-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-item .cat-btn {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.15s ease;
}
.category-item .cat-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
}
.category-item.active .cat-btn {
  border-color: #c86bff;
  background: rgba(200,107,255,0.12);
  box-shadow: 0 0 0 1px #c86bff inset, 0 6px 18px rgba(200,107,255,0.35);
}
.cat-ico { width: 18px; text-align: center; }

/* SEARCH */
.sidebar-footer label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  display: block;
  margin: 12px 0 6px;
}
#searchInput {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
  color: #fff;
  outline: none;
  transition: 0.15s ease;
}
#searchInput:focus {
  border-color: #c86bff;
  box-shadow: 0 0 0 2px rgba(200,107,255,0.25);
}

/* CONTENT HEADER */
.products-content { min-width: 0; }
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}
.products-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
}
.section-subtitle {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

/* TOP ACTIONS */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  transition: 0.12s ease;
  text-decoration: none;
}
.chip-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(200,107,255,0.6);
}

/* PRODUCTS GRID */
.product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
@media (max-width: 1050px) { .product-list { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .product-list { grid-template-columns: 1fr; } }

/* PRODUCT CARD */
.product-card {
  background: rgba(10,6,20,0.95);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  transition: 0.15s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.16);
}
.product-card-featured {
  border-color: rgba(255,216,87,0.9);
  box-shadow: 0 0 28px rgba(255,216,87,0.8);
}

.product-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Seller header */
.card-header {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
}
.seller-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 4px 8px;
  border-radius: 999px;
}
.seller-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
}
.seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.seller-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.seller-name {
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seller-rating {
  font-size: 0.72rem;
  opacity: 0.8;
}

.seller-badge-tick {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #37a1ff 55%, #0053c7 100%);
  box-shadow: 0 0 10px rgba(55, 161, 255, 0.9);
  position: relative;
}
.seller-badge-tick::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(40deg);
}

/* featured pill */
.featured-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 216, 87, 0.12);
  border: 1px solid rgba(255, 216, 87, 0.9);
  color: #ffe993;
  font-size: 0.77rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* product image */
.product-card img,
.product-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #000;
}

/* category chip */
.category-chip {
  position: absolute;
  left: 8px;
  top: 150px;
  transform: translateY(-50%);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.07);
}

/* body text */
.product-card h3 {
  margin: 10px 12px 4px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}
.product-card p {
  margin: 0 12px 10px;
  font-size: 0.9rem;
  color: #ddd;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.8em;
}

/* bottom */
.card-bottom {
  margin-top: auto;
  padding: 10px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.price {
  font-weight: 900;
  font-size: 1rem;
}
.buy-button {
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(90deg, #c86bff, #7b88ff);
  box-shadow: 0 6px 18px rgba(200,107,255,0.35);
  transition: 0.12s ease;
}
.buy-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* EMPTY */
.empty-state {
  padding: 18px;
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
}

/* FOOTER */
.footer {
  margin-top: 18px;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

/* ================================
   PRODUCTS LAYOUT + CONTROL CENTER FIX
   (added by assistant, safe overrides)
================================ */

/* Ensure products page layout doesn't collapse */
body.products-body .products-main {
  max-width: 1200px;
  margin: 18px auto;
  padding: 0 18px 80px;
}

body.products-body .products-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  body.products-body .products-layout {
    grid-template-columns: 1fr;
  }
  body.products-body .products-sidebar {
    position: relative;
    top: 0;
  }
}

/* Products grid */
body.products-body .product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1050px){
  body.products-body .product-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  body.products-body .product-list { grid-template-columns: 1fr; }
}

/* Top action buttons (Yeni elanlar / Axtar / Elan ver) */
body.products-body .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.products-body .chip-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  transition: .12s ease;
}
body.products-body .chip-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(200,107,255,.6);
}

/* Control center panel (if present) */
.control-center {
  position: fixed;
  top: 72px;
  right: 18px;
  width: 300px;
  background: rgba(8,2,20,.98);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 0 30px rgba(0,0,0,.95);
  display: none;
  z-index: 9999;
}
.control-center.show { display: block; }
.cc-title { font-weight: 800; font-size: 1rem; margin-bottom: 8px; }
.cc-block { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.cc-label { font-size: .82rem; opacity: .85; margin-bottom: 6px; }
.cc-row { display: flex; gap: 6px; flex-wrap: wrap; }

.cc-btn{
  border: none;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: .85rem;
  border: 1px solid rgba(255,255,255,.08);
}
.cc-btn:hover{ box-shadow: 0 0 12px rgba(200,107,255,.7); }

/* Theme tiles (purple grid / blue grid) */
.theme-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.theme-tile{
  height: 58px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 6px;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(0,0,0,.8);
}
.theme-tile.purple{
  background:
    linear-gradient(180deg, rgba(200,107,255,.25), rgba(20,0,40,.95)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px);
}
.theme-tile.blue{
  background:
    linear-gradient(180deg, rgba(111,157,255,.25), rgba(5,0,20,.95)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px);
}
.theme-tile.dark{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.95));
}

/* Background grids for themes */
body[data-theme="purple-grid"]{
  background:
    radial-gradient(circle at top, #1b0036, #05000b),
    repeating-linear-gradient(0deg, rgba(200,107,255,.10) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(200,107,255,.10) 0 1px, transparent 1px 40px),
    #05000b;
}

body[data-theme="blue-grid"]{
  background:
    radial-gradient(circle at top, #071b3f, #05000b),
    repeating-linear-gradient(0deg, rgba(111,157,255,.12) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(111,157,255,.12) 0 1px, transparent 1px 40px),
    #05000b;
}


/* ==========================
   ITEMSATSIS-STYLE PRODUCTS UI
   (only products page)
========================== */

body.products-body{
  background:
    radial-gradient(1200px 650px at 60% -10%, rgba(166,91,255,.12), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(60,140,255,.10), transparent 60%),
    #07050c;
}

/* Topbar layout */
.items-topbar{
  display:grid;
  grid-template-columns: 220px 1fr auto;
  gap:12px;
  align-items:center;
}
@media (max-width: 900px){
  .items-topbar{ grid-template-columns: 1fr; }
}

.search-bar{
  display:flex;
  align-items:center;
  gap:6px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:6px;
  max-width:680px;
  margin:0 auto;
}
.search-bar input{
  flex:1;
  background:transparent;
  border:0;
  outline:0;
  color:#fff;
  padding:8px 10px;
  font-size:.95rem;
}
.search-bar button{
  border:0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color:#fff;
  font-weight:800;
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
}

/* HERO */
.hero-wrap{
  max-width:1200px;
  margin:14px auto 8px;
  padding:0 16px;
}
.hero-card{
  background: rgba(12,8,22,.9);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:14px;
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:12px;
  box-shadow:0 12px 40px rgba(0,0,0,.6);
}
@media (max-width: 900px){
  .hero-card{ grid-template-columns: 1fr; }
}

.hero-title{
  font-size:1.6rem;
  font-weight:900;
}
.hero-sub{
  margin-top:6px;
  color:rgba(255,255,255,.8);
  font-size:.95rem;
}
.hero-actions{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.hero-btn{
  border:0;
  padding:10px 14px;
  font-weight:900;
  border-radius:999px;
  color:#fff;
  cursor:pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow:0 6px 18px var(--accent-glow);
}
.hero-btn.ghost{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:none;
}

.hero-banners{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:8px;
}
.banner{
  border-radius:14px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  min-height:110px;
  position:relative;
  overflow:hidden;
}
.banner.big{ grid-column:1 / span 3; min-height:160px; }
.banner.small{ min-height:120px; }
.banner.small.purple{
  background: radial-gradient(circle at 30% 30%, rgba(166,91,255,.4), transparent 60%), rgba(255,255,255,.05);
}
.banner.small.blue{
  background: radial-gradient(circle at 30% 30%, rgba(60,140,255,.4), transparent 60%), rgba(255,255,255,.05);
}
.banner-badge{
  position:absolute; top:10px; left:10px;
  font-size:.75rem; font-weight:900;
  padding:5px 8px;
  border-radius:999px;
  background: rgba(0,0,0,.6);
  border:1px solid rgba(255,255,255,.12);
}

/* Categories row */
.cats-wrap{
  max-width:1200px;
  margin:6px auto 8px;
  padding:0 16px;
}
.cats-title{
  font-weight:800;
  font-size:.95rem;
  margin:8px 0 8px;
  color:rgba(255,255,255,.85);
}
.cats-row{
  list-style:none;
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:4px;
  scrollbar-width:thin;
}
.cats-row::-webkit-scrollbar{ height:6px; }
.cats-row::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.15);
  border-radius:999px;
}

/* category pill button (re-using your cat-btn) */
.cats-row .category-item{ flex:0 0 auto; }
.cats-row .cat-btn{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  font-size:.9rem;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:#fff;
  white-space:nowrap;
}
.cats-row .category-item.active .cat-btn{
  border-color: var(--accent);
  background: rgba(166,91,255,.14);
  box-shadow:0 0 0 1px var(--accent) inset, 0 6px 18px var(--accent-glow);
}

/* Main head row */
.items-main{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px 80px;
}
.products-head-row{
  margin:8px 0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.products-head-row h2{
  font-size:1.15rem;
  font-weight:900;
}
.products-head-row p{
  margin-top:3px;
  color:rgba(255,255,255,.7);
  font-size:.9rem;
}

/* Grid (itemsatis style) */
.items-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
@media (max-width: 1100px){
  .items-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 820px){
  .items-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px){
  .items-grid{ grid-template-columns: 1fr; }
}

/* Card look */
.product-card{
  background: rgba(12,8,22,.95);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.55);
  transition:.15s;
}
.product-card:hover{
  transform:translateY(-2px);
  border-color: rgba(255,255,255,.16);
}

/* seller header */
.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.seller-chip{
  display:flex; align-items:center; gap:8px;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.10);
  padding:4px 8px;
  border-radius:999px;
  cursor:pointer;
  max-width:75%;
}
.seller-avatar{
  width:30px;height:30px;border-radius:50%;
  overflow:hidden;border:1px solid rgba(255,255,255,.25);
  flex:0 0 auto;
}
.seller-avatar img{ width:100%;height:100%;object-fit:cover; }
.seller-name{
  font-size:.84rem;font-weight:900;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:140px;
}

/* media */
.product-media{
  position:relative;
  height:165px;
  background:#000;
}
.product-media img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.category-chip{
  position:absolute; left:8px; bottom:8px;
  font-size:.75rem;font-weight:800;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.65);
  border:1px solid rgba(255,255,255,.12);
}

/* body */
.product-card h3{
  margin:10px 12px 4px;
  font-size:.98rem;font-weight:900;
  line-height:1.25;
}
.product-card p{
  margin:0 12px 10px;
  font-size:.88rem;color:#ddd;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
  min-height:3.6em;
}

/* bottom */
.card-bottom{
  padding:10px 12px 12px;
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin-top:auto;
}
.price{ font-weight:900; font-size:1rem; }
.buy-button{
  border:0; cursor:pointer;
  padding:8px 12px;border-radius:999px;
  font-weight:900;font-size:.9rem;color:#fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow:0 6px 18px var(--accent-glow);
}
.buy-button:hover{ transform:translateY(-1px); filter:brightness(1.05); }

/* footer */
.items-footer{
  margin-top:16px;
  color:rgba(255,255,255,.7);
  font-size:.85rem;
}
