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

:root {
  --primary: #1B5E20;
  --primary-light: #2E7D32;
  --gold: #F9A825;
  --gold-light: #FBC02D;
  --cream: #F5F5F0;
  --dark: #1e1e1e;
  --gray: #555;
  --light-gray: #e0e0e0;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--dark);
  line-height: 1.6;
  padding-bottom: 80px; /* space for bottom nav */
  overflow-x: hidden;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--white);
  padding: 12px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  letter-spacing: -0.5px;
}

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

.icon-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  position: relative;
  color: var(--dark);
  transition: color 0.2s;
}

.icon-btn:hover {
  color: var(--primary);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--gold);
  color: var(--dark);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px;
  border-top: 1px solid var(--light-gray);
  z-index: 200;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  color: var(--gray);
  gap: 2px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.2s;
  font-family: var(--font-body);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-item span {
  line-height: 1.2;
}

/* ===== VIEWS ===== */
.view {
  display: none;
  padding: 20px 0 16px;
  animation: fadeUp 0.3s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

.section-title {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.text-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.highlight {
  color: var(--gold);
}

/* ===== HERO ===== */
.hero {
  background: var(--primary);
  color: white;
  padding: 28px 24px 32px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.hero-title {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  min-height: 48px;
  min-width: 120px;
}

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

.btn-primary:hover {
  background: var(--gold-light);
  transform: scale(1.02);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
}

.btn-whatsapp:hover {
  background: #1da851;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

/* ===== BENEFITS ===== */
.benefits {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.benefit-item {
  background: var(--white);
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  box-shadow: var(--shadow);
}

.benefit-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.benefit-item h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--primary);
}

.benefit-item p {
  font-size: 0.8rem;
  color: var(--gray);
}

/* ===== MAP ===== */
.map-section {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.map-container {
  width: 100%;
  height: 260px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eaeaea;
}

.map-hint {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 8px;
  text-align: center;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

.product-seller {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 4px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border 0.2s;
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.form-group textarea {
  resize: vertical;
}

/* ===== PAYMENT OPTIONS ===== */
.payment-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 1;
  background: var(--white);
}

.payment-option input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

/* ===== CART ===== */
.cart-items {
  margin-bottom: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  background: var(--white);
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  align-items: center;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.cart-item-seller {
  font-size: 0.75rem;
  color: var(--gray);
}

.cart-item-price {
  font-weight: 700;
  color: var(--primary);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty button {
  background: var(--light-gray);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 16px 0;
  border-top: 2px solid var(--light-gray);
}

/* ===== PROFILE ===== */
.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.profile-menu-item {
  background: var(--white);
  border: none;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s;
  color: var(--dark);
}

.profile-menu-item:hover {
  background: var(--cream);
}

/* ===== DASHBOARD ===== */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: var(--white);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== BACK BUTTON ===== */
.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 12px;
  padding: 4px 0;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--gray);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--white);
  padding: 20px 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray);
  border-top: 1px solid var(--light-gray);
  margin-top: 20px;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 400px) {
  .hero-title { font-size: 1.5rem; }
  .benefits { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn { min-width: 100px; padding: 10px 16px; }
}

@media (min-width: 640px) {
  .container { max-width: 640px; }
  .bottom-nav { max-width: 640px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}