:root {
  --lemon: #CFFF04;
  --ink: #07101f;
  --cream: #f7f8f2;
  --white: #ffffff;
  --muted: #667085;
  --line: rgba(7, 16, 11, .10);
  --soft: #eef1e8;
  --shadow: 0 24px 60px rgba(7, 11, 11, .08);
}

/* =========================
   CORE RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s ease;
}

button {
  font-family: inherit;
}

/* =========================
   MARKETPLACE HEADER
========================= */
.market-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
}

.market-header-inner {
  height: 76px;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.market-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 900;
  letter-spacing: -1.5px;
  min-width: max-content;
}

.market-brand .z8 {
  font-size: 32px;
  color: var(--ink);
}

.market-brand .n-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--lemon);
  color: var(--ink);
  font-size: 22px;
}

.market-brand small {
  margin-left: 8px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}

/* Navigation */
.market-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 1;
}

.market-nav a {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ink);
}

.market-nav a:hover {
  color: #7a9400;
}

/* Action Buttons */
.market-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn, .account-btn, .market-join, .hamburger-btn {
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
}

.icon-btn {
  width: 42px;
  padding: 0;
  position: relative;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lemon);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-join {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.market-join:hover {
  background: var(--lemon);
  color: var(--ink);
  border-color: var(--lemon);
}

/* Account Dropdown */
.account-wrap {
  position: relative;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
}

.account-wrap:hover .account-menu {
  display: block;
}

.account-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.account-menu a:hover {
  background: var(--soft);
}

/* Search Bar */
.market-search-bar {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 12px 5%;
}

.market-search-bar.active {
  display: block;
}

.market-search-bar form {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  background: var(--soft);
  padding: 6px;
  border-radius: 14px;
}

.market-search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 10px 15px;
  font-weight: 600;
}

.market-search-bar button {
  border: 0;
  border-radius: 10px;
  background: var(--lemon);
  padding: 0 20px;
  font-weight: 900;
  cursor: pointer;
}

/* Category Strip */
.market-category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  white-space: nowrap;
  padding: 12px 5%;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.market-category-strip::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.market-category-strip a {
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
}

.market-category-strip a:hover {
  background: var(--lemon);
  color: var(--ink);
  border-color: var(--lemon);
}

/* =========================
   MOBILE DRAWER
========================= */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 31, 0.4);
  z-index: 1250;
  backdrop-filter: blur(4px);
}

.drawer-overlay.active {
  display: block;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100dvh;
  background: var(--white);
  z-index: 1300;
  padding: 24px;
  box-shadow: -10px 0 40px rgba(0,0,0,0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-drawer.active {
  transform: translateX(-320px);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  font-size: 20px;
  cursor: pointer;
}

.mobile-drawer a {
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
}

.drawer-sell {
  background: var(--lemon) !important;
  text-align: center;
  margin-top: 10px;
}

/* =========================
   PAGE CONTENT
========================= */
.market-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 5% 40px;
}

.market-badge {
  color: #4d6b00;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.market-hero h1 {
  font-size: clamp(38px, 8vw, 72px);
  line-height: 1;
  letter-spacing: -2.5px;
  margin-bottom: 20px;
  font-weight: 900;
}

.market-hero p {
  max-width: 600px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.market-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 5% 80px;
}

/* Vendor Grid */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.vendor-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow);
  transition: 0.3s ease;
}

.vendor-card:hover {
  transform: translateY(-6px);
  border-color: var(--lemon);
}

.verified {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(207, 255, 4, .15);
  color: #435d00;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.vendor-card h3 {
  margin: 18px 0 10px;
  font-size: 24px;
  letter-spacing: -0.5px;
}

.vendor-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
}

.cta-btn:hover {
  background: var(--lemon);
  color: var(--ink);
}

/* =========================
   RESPONSIVE DESIGN
========================= */
@media (max-width: 1024px) {
  .market-nav, .account-wrap {
    display: none;
  }
  
  .hamburger-btn {
    display: inline-flex;
  }

  .market-brand small {
    display: none;
  }
}

@media (max-width: 768px) {
  .market-hero {
    padding-top: 50px;
  }
  
  .market-hero h1 {
    font-size: 42px;
  }

  .market-header-inner {
    height: 68px;
  }
}

@media (max-width: 480px) {
  .market-join {
    display: none;
  }
  
  .vendor-grid {
    grid-template-columns: 1fr;
  }
}

/* FIX: tablet/desktop drawer + header behavior */

.hamburger-btn{
  display:none;
}

/* Desktop/tablet: never show drawer content */
@media (min-width:769px){
  .mobile-drawer,
  .drawer-overlay{
    display:none !important;
  }

  .market-nav{
    display:flex !important;
  }

  .account-wrap{
    display:block !important;
  }
}

/* Mobile only */
@media (max-width:768px){
  .market-nav,
  .account-wrap,
  .wishlist-btn{
    display:none !important;
  }

  .hamburger-btn{
    display:inline-flex !important;
  }

  .mobile-drawer{
    display:flex !important;
    position:fixed !important;
    top:0 !important;
    right:-340px !important;
    width:300px !important;
    height:100dvh !important;
    transition:right .3s ease !important;
  }

  .mobile-drawer.active{
    right:0 !important;
  }

  .drawer-overlay{
    display:none !important;
  }

  .drawer-overlay.active{
    display:block !important;
  }
}

/* Search must stay hidden until clicked */
.market-search-bar{
  display:none !important;
}

.market-search-bar.active{
  display:block !important;
}
