:root {
  --sage: #4a5c3a;
  --sage-light: #7a8c6a;
  --cream: #f5f0e8;
  --blush: #e8e0d4;
  --warm: #8a7a6a;
  --dark: #1a1a1a;
  --card-bg: #ffffff;
  --gold: #c8a96e;
  --gold-light: #f5e6c8;
  --accent: #d4a373;
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "DM Sans", -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Top Nav */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--blush);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo { height: 32px; width: auto; }
.logo-link { text-decoration: none; }
.nav-links { display: flex; gap: 1.8rem; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--warm); font-size: 0.85rem;
  font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--sage); }
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 4px;
}
.menu-toggle span { width: 22px; height: 2px; background: var(--dark); border-radius: 1px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--sage) 0%, #3a4a2a 100%);
  color: var(--cream); text-align: center; padding: 4rem 1.5rem 3rem;
}
.hero h1 {
  font-family: var(--font-heading); font-size: 2.8rem; font-weight: 300;
  margin-bottom: 0.5rem; letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1rem; color: rgba(245,240,232,0.8); font-weight: 300;
  max-width: 500px; margin: 0 auto;
}

/* Filters Bar */
.filters-bar {
  background: var(--card-bg); border-bottom: 1px solid var(--blush);
  padding: 1rem 1.5rem;
}
.filters-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 160px; }
.filter-group label { font-size: 0.7rem; color: var(--warm); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.filter-group input, .filter-group select {
  padding: 0.6rem 0.8rem; border: 1px solid var(--blush); border-radius: 8px;
  font-family: var(--font-body); font-size: 0.85rem; background: var(--cream);
  color: var(--dark); outline: none; transition: border-color 0.2s;
}
.filter-group input:focus, .filter-group select:focus { border-color: var(--sage); }
.search-btn {
  background: var(--sage); color: var(--cream); border: none;
  padding: 0.6rem 1.5rem; border-radius: 8px; font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: background 0.2s;
}
.search-btn:hover { background: var(--sage-light); }

/* Main */
.main {
  max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem;
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; border-bottom: 1px solid var(--blush); padding-bottom: 0.8rem;
}
.section-header h2 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 400; color: var(--sage); }
.results-count { font-size: 0.8rem; color: var(--warm); }

/* Products Grid */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--card-bg); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--blush); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.product-image-wrap {
  position: relative; height: 220px; background: var(--cream);
  display: flex; align-items: center; justify-content: center;
}
.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.no-image {
  color: var(--warm); font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  height: 100%; width: 100%; background: linear-gradient(135deg, #f5f0e8 0%, #e8e0d4 100%);
}
.product-badges {
  position: absolute; top: 0.6rem; left: 0.6rem;
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.badge {
  font-size: 0.65rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 2rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-featured { background: var(--gold); color: #fff; }
.badge-new { background: var(--sage); color: #fff; }

.product-info { padding: 1rem 1.2rem 1.2rem; }
.product-meta {
  font-size: 0.7rem; color: var(--warm); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.4rem;
}
.product-name {
  font-family: var(--font-heading); font-size: 1.15rem; font-weight: 400;
  color: var(--dark); margin-bottom: 0.4rem; line-height: 1.2;
}
.product-desc {
  font-size: 0.8rem; color: var(--warm); line-height: 1.5;
  margin-bottom: 0.6rem;
}
.product-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.product-tag {
  font-size: 0.65rem; color: var(--sage); background: rgba(74,92,58,0.08);
  padding: 0.2rem 0.5rem; border-radius: 2rem;
}
.product-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--blush); padding-top: 0.6rem;
}
.product-price {
  font-size: 0.95rem; font-weight: 600; color: var(--sage);
}
.seller-name {
  font-size: 0.75rem; color: var(--warm);
}

/* Loading & Empty */
.loading { text-align: center; padding: 4rem; color: var(--warm); font-size: 0.9rem; grid-column: 1 / -1; }
.error { text-align: center; padding: 4rem; color: #c62828; font-size: 0.9rem; grid-column: 1 / -1; }
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--font-heading); font-size: 1.3rem; color: var(--sage); margin-bottom: 0.4rem; }
.empty-state p { color: var(--warm); font-size: 0.85rem; }

/* Modal */
.seller-modal { display: none; position: fixed; inset: 0; z-index: 200; }
.seller-modal.open { display: block; }
.modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--card-bg); border-radius: 16px; width: 90%; max-width: 720px;
  max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem; background: rgba(255,255,255,0.9);
  border: none; width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.3rem; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center;
}
.modal-body { display: flex; }
.modal-gallery {
  width: 45%; min-height: 400px; background: var(--cream);
  display: flex; flex-direction: column;
  border-radius: 16px 0 0 16px; overflow: hidden;
}
.modal-stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.modal-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.25s ease;
  pointer-events: none;
}
.modal-img.active { opacity: 1; pointer-events: auto; }
.modal-thumbs {
  display: flex; gap: 0.5rem; padding: 0.6rem;
  overflow-x: auto; flex-shrink: 0; background: rgba(0,0,0,0.03);
}
.modal-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  cursor: pointer; opacity: 0.6; flex-shrink: 0;
  border: 2px solid transparent; transition: opacity 0.2s ease, border-color 0.2s ease;
}
.modal-thumb:hover { opacity: 0.85; }
.modal-thumb.active { opacity: 1; border-color: var(--sage); }
.modal-details { width: 55%; padding: 2rem; }
.modal-meta { font-size: 0.75rem; color: var(--warm); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.modal-details h2 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 400; margin-bottom: 0.6rem; }
.modal-price { font-size: 1.2rem; font-weight: 600; color: var(--sage); margin-bottom: 0.3rem; }
.modal-stock { margin-bottom: 1rem; }
.stock-badge { font-size: 0.7rem; padding: 0.25rem 0.6rem; border-radius: 2rem; font-weight: 500; }
.in-stock { background: #e8f5e9; color: #2e7d32; }
.limited { background: #fff3e0; color: #e65100; }
.out-stock { background: #ffebee; color: #c62828; }
.modal-desc { font-size: 0.85rem; color: var(--warm); line-height: 1.6; margin-bottom: 1rem; }
.modal-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.modal-tag {
  font-size: 0.7rem; color: var(--sage); background: rgba(74,92,58,0.08);
  padding: 0.2rem 0.6rem; border-radius: 2rem;
}
.modal-seller h4 { font-size: 0.9rem; color: var(--dark); margin-bottom: 0.6rem; }
.contact-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.45rem 1rem; border-radius: 2rem; font-size: 0.75rem;
  font-weight: 500; text-decoration: none; transition: opacity 0.2s;
}
.contact-btn:hover { opacity: 0.85; }
.contact-wa { background: #e8f5e9; color: #2e7d32; }
.contact-phone { background: #e3f2fd; color: #1565c0; }
.contact-ig { background: #fce4ec; color: #c2185b; }

/* Sellers Grid */
.sellers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem; margin-bottom: 3rem;
}
.seller-card {
  background: var(--card-bg); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--blush); text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s; display: block;
}
.seller-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.seller-card .seller-image {
  position: relative; height: 160px; background: var(--cream);
  display: flex; align-items: center; justify-content: center;
}
.seller-card .seller-image img { width: 100%; height: 100%; object-fit: cover; }
.seller-card .seller-info { padding: 1rem 1.2rem 1.2rem; }
.seller-card .seller-info h3 {
  font-family: var(--font-heading); font-size: 1.1rem; font-weight: 400;
  color: var(--dark); margin-bottom: 0.3rem;
}
.seller-card .seller-info p {
  font-size: 0.75rem; color: var(--warm); line-height: 1.5; margin-bottom: 0.5rem;
}
.seller-card .seller-meta {
  font-size: 0.7rem; color: var(--sage); text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Footer */
.marketplace-footer {
  background: var(--card-bg); border-top: 1px solid var(--blush);
  padding: 2rem 1.5rem; text-align: center; margin-top: 3rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-inner p { color: var(--warm); font-size: 0.85rem; }
.footer-small { margin-top: 0.4rem; }
.footer-small a { color: var(--sage); text-decoration: none; }
.footer-small a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  body.menu-open .nav-links { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--card-bg); padding: 1rem; border-bottom: 1px solid var(--blush); }
  .hero h1 { font-size: 2rem; }
  .filters-inner { flex-direction: column; }
  .filter-group { width: 100%; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
  .modal-body { flex-direction: column; }
  .modal-gallery, .modal-details { width: 100%; }
  .modal-gallery { min-height: 200px; border-radius: 16px 16px 0 0; }
}
