/* Gamala Buyer UI - Mobile-First Ultra-Light (<6KB) */
:root {
  --b-primary: #10b981;
  --b-primary-dark: #059669;
  --b-bg: #f8fafc;
  --b-card: #ffffff;
  --b-text: #0f172a;
  --b-muted: #64748b;
  --b-border: #e2e8f0;
  --b-radius: 12px;
}

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

body.buyer-body {
  background-color: var(--b-bg);
  color: var(--b-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  padding-bottom: 40px;
}

/* Mobile-first Header */
.buyer-header {
  background: var(--b-card);
  border-bottom: 1px solid var(--b-border);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.buyer-store-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--b-text);
}

.buyer-store-sub {
  font-size: 0.75rem;
  color: var(--b-muted);
}

.buyer-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 12px 14px;
}

/* Category Filter Chips (Horizontal Scroll on Mobile) */
.buyer-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 12px;
  scrollbar-width: none;
}
.buyer-chips-scroll::-webkit-scrollbar {
  display: none;
}

.buyer-chip {
  white-space: nowrap;
  padding: 6px 14px;
  background: var(--b-card);
  border: 1px solid var(--b-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--b-muted);
  cursor: pointer;
}

.buyer-chip.active {
  background: var(--b-primary);
  color: #fff;
  border-color: var(--b-primary);
}

/* Product Cards Grid (Mobile 2 columns or 1 column card) */
.buyer-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .buyer-products-grid {
    gap: 14px;
  }
}

.buyer-prod-card {
  background: var(--b-card);
  border: 1px solid var(--b-border);
  border-radius: var(--b-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.buyer-prod-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f1f5f9;
}

.buyer-prod-empty-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
}

.buyer-prod-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.buyer-prod-cat {
  font-size: 0.68rem;
  color: var(--b-primary-dark);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.buyer-prod-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.buyer-prod-price {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--b-primary-dark);
  margin-top: auto;
  margin-bottom: 8px;
}

.buyer-btn-buy {
  width: 100%;
  padding: 8px;
  background: var(--b-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.buyer-btn-buy:active {
  background: var(--b-primary-dark);
}

/* Modal Bottom Sheet on Mobile */
.buyer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 1000;
}

@media (min-width: 540px) {
  .buyer-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
}

.buyer-modal-content {
  background: #fff;
  width: 100%;
  max-height: 90vh;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  overflow-y: auto;
  padding: 20px 16px;
}

@media (min-width: 540px) {
  .buyer-modal-content {
    border-radius: 14px;
    max-width: 480px;
  }
}

.buyer-form-group {
  margin-bottom: 14px;
}

.buyer-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.buyer-input, .buyer-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--b-border);
  border-radius: 8px;
  font-size: 0.92rem;
  background: #fff;
}

.buyer-input:focus, .buyer-textarea:focus {
  outline: none;
  border-color: var(--b-primary);
}

.buyer-summary {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
  font-size: 0.88rem;
}

.buyer-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.buyer-summary-row.total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--b-primary-dark);
  border-top: 1px dashed var(--b-border);
  padding-top: 8px;
  margin-top: 8px;
}

/* Product Card Links */
.buyer-prod-card-link {
  text-decoration: none;
  display: block;
}

.buyer-prod-name-link {
  text-decoration: none;
  color: inherit;
}

.buyer-prod-name-link:hover {
  color: var(--b-primary-dark);
}

/* Product Detail Page Styling */
.buyer-detail-card {
  background: var(--b-card);
  border: 1px solid var(--b-border);
  border-radius: var(--b-radius);
  overflow: hidden;
  margin-bottom: 70px;
}

.buyer-detail-gallery {
  position: relative;
  background: #f1f5f9;
}

.buyer-detail-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.buyer-detail-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--b-border);
  overflow-x: auto;
}

.buyer-detail-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  background: #f8fafc;
}

.buyer-detail-thumb.active {
  border-color: var(--b-primary);
}

.buyer-detail-body {
  padding: 16px;
}

.buyer-detail-cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--b-primary-dark);
  background: #ecfdf5;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.buyer-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--b-text);
  margin-bottom: 10px;
}

.buyer-detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--b-border);
}

.buyer-detail-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--b-primary-dark);
}

.buyer-detail-stock-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
}

.buyer-detail-stock-badge.in-stock {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.buyer-detail-stock-badge.out-of-stock {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.buyer-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--b-muted);
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.buyer-detail-section {
  margin-top: 16px;
}

.buyer-detail-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--b-text);
  margin-bottom: 8px;
}

.buyer-detail-desc {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Sticky Bottom Bar on Mobile for Immediate Purchase */
.buyer-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--b-border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  padding: 10px 16px;
  z-index: 100;
}

.buyer-bottom-bar-inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

