:root{
  --bg:#f6f8fc;
  --card:#ffffff;
  --text:#101828;
  --muted:#667085;
  --line:#e6eaf0;
  --brand:#0e65c3;
  --brand2:#00beff;
  --success:#079455;
  --danger:#b42318;
  --shadow:0 14px 38px rgba(16,24,40,.08);
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:radial-gradient(circle at top left,#e9f6ff 0,#f7f9fd 34%,#eef3f9 100%);
  color:var(--text);
}

a{
  color:inherit;
  text-decoration:none;
}

img{
  display:block;
  max-width:100%;
}

/* Header */

.topbar{
  position:sticky;
  top:0;
  z-index:999;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px clamp(14px,4vw,42px);
  background:rgba(255,255,255,.86);
  backdrop-filter:blur(16px);
  border-bottom:1px solid rgba(230,234,240,.9);
}

.brand-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand-logo,
.market-icon,
.fallback-product{
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  box-shadow:0 10px 24px rgba(14,101,195,.22);
}

.brand-logo,
.market-icon{
  width:42px;
  height:42px;
  border-radius:15px;
}

.fallback-product{
  width:88px;
  height:88px;
  border-radius:26px;
  font-size:34px;
}

.brand strong{
  display:block;
  line-height:1;
}

.brand small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-weight:800;
}

.menu-toggle{
  display:none;
  width:44px;
  height:44px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--brand);
  font-size:22px;
  line-height:1;
  box-shadow:none;
  cursor:pointer;
}

.topbar nav{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.topbar nav a{
  color:#344054;
  font-weight:750;
}

/* Buttons */

button,
.btn,
.btn-mini{
  border:0;
  border-radius:14px;
  padding:12px 16px;
  color:#fff;
  font-weight:850;
  cursor:pointer;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  box-shadow:0 10px 22px rgba(14,101,195,.2);
  transition:.2s ease;
}

button:hover,
.btn:hover,
.btn-mini:hover{
  filter:brightness(.98);
  transform:translateY(-1px);
}

.btn.ghost{
  background:#eef6ff;
  color:var(--brand);
  box-shadow:none;
}

/* Layout */

.container{
  width:min(1160px,calc(100% - 28px));
  margin:0 auto;
  padding:26px 0 46px;
}

.hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) 240px;
  gap:20px;
  align-items:stretch;
  margin:16px 0 22px;
}

.hero>div:first-child,
.hero-card,
.auth-card,
.chart-card,
.product-card,
.price-card,
.profile-head,
.market-card,
.empty,
.empty-state{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(255,255,255,.95);
  border-radius:26px;
  box-shadow:var(--shadow);
}

.hero>div:first-child{
  padding:34px;
}

.eyebrow{
  display:inline-flex;
  padding:8px 12px;
  border-radius:999px;
  background:#e8f4ff;
  color:var(--brand);
  font-size:13px;
  font-weight:900;
}

.hero h1{
  margin:14px 0 12px;
  font-size:clamp(32px,5vw,58px);
  line-height:.98;
  letter-spacing:-.05em;
}

.hero p{
  max-width:760px;
  margin:0;
  color:var(--muted);
  font-size:17px;
  line-height:1.55;
}

.hero-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:22px;
}

.hero-card strong{
  font-size:52px;
  line-height:1;
  color:var(--brand);
}

.hero-card span{
  margin-top:6px;
  color:var(--muted);
  font-weight:850;
}

/* Forms */

.hero-search,
.filters{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(130px,.7fr) minmax(150px,.7fr) auto;
  gap:10px;
  margin:22px 0 0;
}

.hero-search input,
.hero-search select,
.filters input,
.filters select,
.stack input{
  width:100%;
  border:1px solid var(--line);
  border-radius:15px;
  background:#fff;
  padding:13px 15px;
  font-size:15px;
  outline:none;
}

.hero-search input:focus,
.hero-search select:focus,
.filters input:focus,
.filters select:focus,
.stack input:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(14,101,195,.1);
}

.stack{
  display:grid;
  gap:11px;
}

/* Quick categories */

.quick-categories{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin:16px 0 28px;
}

.quick-categories form button,
.empty-suggestions form button{
  width:auto;
  background:#fff;
  color:var(--brand);
  box-shadow:0 6px 18px rgba(16,24,40,.06);
  border:1px solid var(--line);
  padding:10px 13px;
}

/* Sections */

.section-title{
  margin:30px 0 14px;
  font-size:clamp(22px,3vw,30px);
  letter-spacing:-.03em;
}

/* Market cards */

.market-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:24px;
}

.market-card{
  padding:15px;
  display:flex;
  gap:13px;
  align-items:center;
  box-shadow:0 8px 24px rgba(16,24,40,.055);
}

.market-card strong{
  display:block;
  font-size:15px;
}

.market-card small,
.market-card span{
  display:block;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.35;
}

/* Product cards */

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

.product-card{
  overflow:hidden;
  display:flex;
  flex-direction:column;
  height:100%;
  transition:.2s ease;
}

.product-card:hover{
  transform:translateY(-2px);
  box-shadow:0 20px 44px rgba(16,24,40,.1);
}

.product-img{
  height:190px;
  padding:22px;
  background:transparent;
  display:grid;
  place-items:center;
}

.product-img img{
  max-width:100%;
  max-height:145px;
  object-fit:contain;
  mix-blend-mode:multiply;
  filter:drop-shadow(0 12px 18px rgba(16,24,40,.08));
}

.product-body{
  padding:17px;
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1;
}

.product-body h2{
  margin:0;
  min-height:46px;
  font-size:18px;
  line-height:1.25;
  letter-spacing:-.02em;
}

.product-body p{
  margin:0;
  color:var(--muted);
  line-height:1.35;
}

.product-body small{
  color:var(--muted);
  line-height:1.35;
}

.product-body .btn,
.product-body a.btn{
  margin-top:auto;
  width:100%;
  text-align:center;
}

.chip{
  display:inline-flex;
  align-self:flex-start;
  border-radius:999px;
  padding:6px 10px;
  background:#eef7ff;
  color:var(--brand);
  font-size:12px;
  font-weight:900;
}

.price{
  color:var(--success);
  font-size:25px;
  letter-spacing:-.03em;
}

/* Price list */

.price-list{
  display:grid;
  gap:10px;
}

.price-card{
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  gap:13px;
  align-items:center;
  padding:14px;
  border-radius:20px;
  box-shadow:0 7px 24px rgba(16,24,40,.055);
}

.price-card small{
  color:var(--muted);
}

.right{
  text-align:right;
}

/* Chart */

.chart-card{
  padding:16px;
  height:360px;
  min-height:360px;
  position:relative;
}

.chart-card canvas{
  width:100% !important;
  height:100% !important;
}

/* Auth/Profile */

.auth-card{
  width:min(460px,100%);
  margin:30px auto;
  padding:26px;
}

.auth-card.wide{
  width:min(740px,100%);
}

.profile-head{
  padding:24px;
  margin-bottom:20px;
}

/* Alerts */

.alert{
  padding:13px 15px;
  border-radius:15px;
  margin-bottom:14px;
  font-weight:800;
}

.alert-success{
  background:#eafaf4;
  color:#087a55;
}

.alert-error{
  background:#fff1f1;
  color:var(--danger);
}

/* Empty states */

.empty{
  padding:24px;
  color:var(--muted);
  font-weight:800;
  border-style:dashed;
}

.empty-state{
  padding:34px;
  text-align:center;
}

.empty-state h2{
  margin:10px 0 8px;
  font-size:28px;
  letter-spacing:-.03em;
}

.empty-state p{
  max-width:620px;
  margin:0 auto 18px;
  color:var(--muted);
  line-height:1.55;
}

.empty-icon{
  width:70px;
  height:70px;
  margin:0 auto;
  display:grid;
  place-items:center;
  border-radius:24px;
  background:#eef7ff;
  font-size:34px;
}

.empty-suggestions{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}

/* Footer */

.footer{
  text-align:center;
  color:var(--muted);
  padding:28px 16px;
}

/* Responsive */

@media(max-width:1040px){
  .market-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .hero-search,
  .filters{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:920px){
  .hero{
    grid-template-columns:1fr;
  }

  .grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:720px){
  .topbar{
    flex-direction:column;
    align-items:stretch;
    gap:14px;
    padding:14px 16px;
  }

  .brand-wrap{
    width:100%;
  }

  .brand{
    min-width:0;
  }

  .menu-toggle{
    display:grid;
    place-items:center;
  }

  .topbar nav{
    display:none;
    width:100%;
  }

  .topbar.is-open nav{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    margin-top:12px;
  }

  .topbar nav a{
    width:100%;
    text-align:center;
    padding:12px;
    border-radius:14px;
    background:#fff;
    border:1px solid var(--line);
    font-size:14px;
    font-weight:800;
  }

  .topbar nav .btn-mini{
    background:linear-gradient(135deg,var(--brand),var(--brand2));
    color:#fff;
    border:0;
  }
}

@media(max-width:560px){
  .container{
    width:min(100% - 22px,1160px);
    padding-top:18px;
  }

  .grid,
  .market-grid,
  .hero-search,
  .filters{
    grid-template-columns:1fr;
  }

  .hero>div:first-child{
    padding:22px;
  }

  .hero-card{
    padding:18px;
  }

  .hero-card strong{
    font-size:44px;
  }

  .product-img{
    height:165px;
  }

  .price-card{
    grid-template-columns:46px 1fr;
  }

  .right{
    text-align:left;
    grid-column:2;
  }

  .btn,
  .btn-mini,
  button{
    width:100%;
    text-align:center;
  }

  .quick-categories form,
  .quick-categories form button,
  .empty-suggestions form,
  .empty-suggestions form button{
    width:100%;
  }

  .chart-card{
    height:300px;
    min-height:300px;
  }
}
