/* UmmahMarket - Shared Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Serif:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --emerald: #1B4332;
  --emerald-light: #2D6A4F;
  --emerald-bg: rgba(27, 67, 50, 0.06);
  --gold: #D4A017;
  --gold-soft: #F0D68A;
  --gold-bg: rgba(212, 160, 23, 0.1);
  --teal: #0F7173;
  --teal-bg: rgba(15, 113, 115, 0.06);
  --cream: #FAF8F5;
  --sand: #F3EDE4;
  --charcoal: #1A1A1A;
  --text-secondary: #5C5C5C;
  --border: rgba(27, 67, 50, 0.08);
  --white: #FFFFFF;
  --danger: #DC2626;
  --success: #16A34A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--emerald);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--emerald);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--emerald);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-cart {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--emerald);
  padding: 0.5rem;
}

.cart-count {
  position: absolute;
  top: 0;
  right: -2px;
  background: var(--gold);
  color: var(--emerald);
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--emerald);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--emerald-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--emerald);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--emerald);
}

.btn-gold {
  background: var(--gold);
  color: var(--emerald);
}

.btn-gold:hover {
  background: #C49515;
  transform: translateY(-1px);
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-content {
  padding-top: 5rem;
  min-height: 100vh;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(27, 67, 50, 0.1);
}

/* Halal Badge */
.halal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.halal-badge svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.halal-badge-lg {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
  gap: 0.5rem;
}

.halal-badge-lg svg {
  width: 18px;
  height: 18px;
}

/* Verified seller badge */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--teal-bg);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.product-card .card-image {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .card-image .placeholder-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.product-card .badge-row {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.product-card .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.product-card .card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal);
}

.product-card .card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.3;
}

.product-card .card-seller {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.product-card .card-price {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--emerald);
}

.product-card .card-price .compare-price {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

/* Category pills */
.category-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.category-pill:hover, .category-pill.active {
  background: var(--emerald);
  color: var(--white);
  border-color: var(--emerald);
}

.category-pill .cat-icon {
  font-size: 1rem;
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--emerald);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  background: transparent;
  color: var(--charcoal);
}

.search-bar input::placeholder {
  color: #B0B0B0;
}

.search-bar .search-icon {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Section headers */
.section-header {
  margin-bottom: 2rem;
}

.section-header h1, .section-header h2 {
  font-family: 'Noto Serif', Georgia, serif;
  font-weight: 700;
  color: var(--emerald);
  line-height: 1.2;
}

.section-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.section-header h2 { font-size: 1.8rem; }

.section-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* Form */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0.4rem;
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--emerald);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Footer */
.site-footer {
  background: var(--emerald);
  padding: 3rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand .footer-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  max-width: 300px;
}

.footer-links h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.footer-links a {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--emerald);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--sand) 25%, #EAE4DA 50%, var(--sand) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
  .nav { padding: 0.75rem 1rem; }
  .nav-links { display: none; }
  .container { padding: 0 1rem; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .product-card .card-body { padding: 0.75rem; }
  .product-card .card-name { font-size: 0.88rem; }
  .footer-inner { flex-direction: column; }
}

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

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
