/* =============================================
   MIZOBAZAR - Main Stylesheet
   Used by ALL pages
   ============================================= */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ---- RESET & BASE ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --accent:        #f97316;
  --accent-dark:   #ea6c0a;
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --success:       #22c55e;
  --danger:        #ef4444;
  --radius:        12px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.13);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  outline: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  transition: border 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
}


/* ---- NAVBAR ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.nav-menu-btn {
  background: none;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

.nav-logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-login {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-login:hover { background: var(--primary-dark); }

.btn-logout {
  background: var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}


/* ---- SIDE DRAWER MENU ---- */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: 260px;
  background: var(--surface);
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-header img { height: 36px; }
.drawer-close {
  background: none;
  font-size: 22px;
  color: var(--text-muted);
}

.drawer-links {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}
.drawer-links li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 15px;
  color: var(--text);
  transition: background 0.15s;
}
.drawer-links li a:hover {
  background: var(--bg);
  color: var(--primary);
}
.drawer-links li a .icon { font-size: 18px; }


/* ---- FEATURED SELLERS (Instagram Stories style) ---- */
.featured-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.featured-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 16px 10px;
}

.featured-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 16px 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.featured-scroll::-webkit-scrollbar { display: none; }

.featured-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.featured-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #f97316, #2563eb, #7c3aed);
}

.featured-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--surface);
}

.featured-ring .featured-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  border: 2.5px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.featured-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  max-width: 68px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---- SEARCH BAR ---- */
.search-section {
  padding: 14px 16px;
  background: var(--bg);
}

.search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-wrap input {
  padding-left: 42px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.search-wrap input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}


/* ---- CATEGORY FILTER CHIPS ---- */
.category-section {
  padding: 8px 0 4px;
  background: var(--bg);
}

.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-chip:hover, .cat-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}


/* ---- PRODUCTS GRID ---- */
.products-section {
  padding: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 500px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg);
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-info {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

.product-seller {
  font-size: 10px;
  color: var(--text-muted);
}

.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 10px 10px;
  padding: 8px;
  background: #25d366;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-buy:hover { background: #1ebe5d; }
.btn-buy img { width: 14px; height: 14px; }


/* ---- LOADING SPINNER ---- */
.spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  width: 100%;
  grid-column: 1 / -1;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }


/* ---- BUTTONS (general) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-full { width: 100%; }


/* ---- FORMS ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}


/* ---- CARDS (general) ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
}


/* ---- TOAST NOTIFICATION ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }


/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  font-size: 20px;
  color: var(--text-muted);
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}


/* ---- PAGE HEADER (for inner pages) ---- */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 32px 20px 28px;
  text-align: center;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header p  { font-size: 13px; opacity: 0.85; margin-top: 6px; }


/* ---- SELLER PAGE ---- */
.seller-hero {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}
.seller-hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.6);
  flex-shrink: 0;
  background: #fff;
}
.seller-hero-info h2 { font-size: 20px; font-weight: 700; }
.seller-hero-info p  { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.seller-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: #25d366;
  color: #fff;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}


/* ---- DASHBOARD ---- */
.dashboard-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px;
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dashboard-title {
  font-size: 18px;
  font-weight: 700;
}

.product-list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.product-list-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.product-list-info { flex: 1; }
.product-list-name { font-size: 13px; font-weight: 600; }
.product-list-price { font-size: 12px; color: var(--primary); font-weight: 600; }
.product-list-actions { display: flex; gap: 6px; }
.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 6px;
}


/* ---- ADMIN ---- */
.admin-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 16px;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.admin-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
}
.admin-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.seller-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.seller-row-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.seller-row-info { flex: 1; }
.seller-row-name { font-size: 13px; font-weight: 600; }
.seller-row-meta { font-size: 11px; color: var(--text-muted); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.badge-active  { background: #dcfce7; color: #16a34a; }
.badge-paused  { background: #fee2e2; color: #dc2626; }
.badge-featured{ background: #fef9c3; color: #ca8a04; }


/* ---- FOOTER ---- */
.footer {
  background: var(--text);
  color: #fff;
  text-align: center;
  padding: 24px 16px;
  margin-top: 40px;
  font-size: 12px;
}
.footer a { color: #94a3b8; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}


/* ---- ABOUT / HELP / TERMS pages ---- */
.content-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.content-page h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--primary);
}
.content-page h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px;
}
.content-page p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.content-page ul {
  padding-left: 20px;
  margin-bottom: 10px;
}
.content-page ul li {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}