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

:root {
  --primary: #15803d;
  --primary-dark: #166534;
  --accent: #d97706;
  --dark: #102014;
  --muted: #64748b;
  --light: #f8fafc;
  --border: #dbe7de;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(16, 32, 20, 0.09);
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--dark);
  background: #f5f8f2;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.nav-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 22px;
}

.logo-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(21, 128, 61, 0.22));
}

.logo-text {
  font-weight: 900;
  font-size: 22px;
  color: var(--dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 700;
  color: #334155;
}

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

.mobile-menu-btn {
  display: none;
  border: 0;
  background: var(--dark);
  color: white;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 18px;
}

.hero {
  padding: 74px 0 54px;
  background:
    radial-gradient(circle at top left, rgba(21, 128, 61, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.14), transparent 30%),
    linear-gradient(180deg, #f5f8f2, #eef7ed);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 42px;
}

.badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: #dcfce7;
  color: var(--primary-dark);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -2.5px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 650px;
  margin-bottom: 26px;
}

.search-box {
  display: flex;
  gap: 10px;
  background: white;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 14px 16px;
  font-size: 16px;
}

.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 800;
  transition: 0.2s ease;
}

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

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

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

.btn-outline {
  background: white;
  border: 1px solid var(--border);
  color: var(--dark);
}

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

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

.btn-small {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
}

.hero-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-card-top {
  min-height: 300px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(21, 128, 61, 0.82), rgba(16, 32, 20, 0.88)),
    url("https://images.unsplash.com/photo-1500595046743-cd271d694d30?q=80&w=1400&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  display: flex;
  align-items: end;
  padding: 24px;
  color: white;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.stat {
  background: #f8fafc;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-size: 26px;
}

.section {
  padding: 54px 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -1px;
}

.section-header p {
  color: var(--muted);
  max-width: 620px;
}

.grid {
  display: grid;
  gap: 20px;
}

.category-grid {
  grid-template-columns: repeat(6, 1fr);
}

.category-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(16, 32, 20, 0.05);
  transition: 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.category-icon {
  font-size: 34px;
  margin-bottom: 10px;
}

.product-grid {
  grid-template-columns: repeat(4, 1fr);
}

.product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(16, 32, 20, 0.06);
  transition: 0.2s ease;
}

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

.product-image {
  height: 220px;
  background: #e2e8f0;
  object-fit: cover;
  width: 100%;
}

.product-body {
  padding: 18px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 9px;
}

.product-title {
  font-size: 18px;
  min-height: 54px;
  margin-bottom: 8px;
}

.price {
  color: var(--primary);
  font-weight: 900;
  font-size: 21px;
  margin-bottom: 10px;
}

.shop-line {
  color: #475569;
  font-size: 14px;
  margin-bottom: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}

.status.available {
  background: #dcfce7;
  color: #166534;
}

.status.out {
  background: #fee2e2;
  color: #991b1b;
}

.status.preorder,
.status.reserved {
  background: #fef3c7;
  color: #92400e;
}

.status.sold {
  background: #e5e7eb;
  color: #374151;
}

.livestock-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.fact {
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
}

.shop-grid {
  grid-template-columns: repeat(3, 1fr);
}

.shop-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(16, 32, 20, 0.06);
}

.shop-number {
  display: inline-flex;
  background: #dcfce7;
  color: var(--primary-dark);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  margin-bottom: 12px;
}

.shop-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.shop-card p {
  color: var(--muted);
  margin-bottom: 12px;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag {
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
}

.page-header {
  padding: 48px 0 28px;
  background: white;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -1.5px;
}

.page-header p {
  color: var(--muted);
  margin-top: 8px;
}

.content-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.filters {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 94px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
  font-size: 14px;
}

.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 15px;
  outline: none;
  background: white;
}

textarea.form-control {
  resize: vertical;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.1);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: start;
}

.gallery-main {
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: white;
}

.detail-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.detail-panel h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.05;
  margin: 10px 0;
}

.detail-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.info-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.info-box small {
  color: var(--muted);
  font-weight: 800;
}

.info-box strong {
  display: block;
  margin-top: 4px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.admin-card,
.login-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(16, 32, 20, 0.06);
}

.login-card {
  max-width: 520px;
  margin: 0 auto;
}

.admin-tabs {
  display: grid;
  gap: 10px;
}

.admin-tab {
  border: 1px solid var(--border);
  background: white;
  padding: 13px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-weight: 900;
}

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

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

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

.full {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 13px;
  font-size: 14px;
}

th {
  background: #f8fafc;
  font-weight: 900;
}

.empty-state {
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: 24px;
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.alert {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.security-note {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.footer {
  background: var(--dark);
  color: white;
  padding: 34px 0;
  margin-top: 40px;
}

.footer p {
  color: #cbd5e1;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .hero-grid,
  .content-layout,
  .detail-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 82px;
    padding: 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links.show {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding-top: 42px;
  }

  .search-box,
  .toolbar,
  .section-header,
  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .category-grid,
  .product-grid,
  .shop-grid,
  .stat-row,
  .form-grid,
  .detail-info {
    grid-template-columns: 1fr;
  }

  .gallery-main {
    height: 320px;
  }
}

.media-count {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  margin: -6px 0 12px;
}

.media-gallery {
  display: grid;
  gap: 14px;
}

.media-gallery video.gallery-main {
  background: #0f172a;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.media-strip img,
.media-strip video {
  width: 100%;
  height: 105px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #e2e8f0;
}

.form-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}


.language-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-weight: 900;
  padding: 7px 10px;
  border-radius: 999px;
  transition: 0.2s ease;
}

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

.lang-btn:hover {
  background: #dbeafe;
  color: var(--primary-dark);
}

.lang-btn.active:hover {
  background: var(--primary-dark);
  color: white;
}

@media (max-width: 720px) {
  .language-switcher {
    justify-content: center;
    margin-top: 8px;
  }
}

.community-value {
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  background: linear-gradient(135deg, #f0fdf4, #fff7ed);
}

.community-value.compact {
  padding: 10px 12px;
  margin: 8px 0 12px;
}

.community-label {
  display: block;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.community-value strong {
  display: block;
  color: var(--dark);
  font-size: 20px;
}

.community-value.compact strong {
  font-size: 16px;
}

.community-value small {
  color: var(--muted);
  font-weight: 700;
}

.price-suggestion-box {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #f8fafc;
}

.price-suggestion-box h3 {
  margin-bottom: 6px;
}

.price-suggestion-box p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.price-suggestion-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.success-text {
  color: var(--success);
  font-weight: 800;
}

.error-text {
  color: var(--danger);
  font-weight: 800;
}

.value-section {
  padding-top: 20px;
}

.value-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid #bbf7d0;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff, #f0fdf4);
  box-shadow: var(--shadow);
}

.value-hero-card h2 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.08;
  margin-bottom: 10px;
}

.value-hero-card p {
  color: var(--muted);
  max-width: 720px;
}

@media (max-width: 720px) {
  .price-suggestion-form,
  .value-hero-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}

.footer {
  background: #07130b;
  color: #ffffff;
  padding: 48px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 32px;
  align-items: flex-start;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 14px;
}

.footer-logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(74, 222, 128, 0.25));
}

.footer-brand p,
.footer-column p {
  color: #cbd5d1;
  line-height: 1.7;
  max-width: 420px;
}

.footer-column h4 {
  font-size: 17px;
  margin-bottom: 14px;
  color: #ffffff;
}

.footer-column a {
  display: block;
  color: #cbd5d1;
  margin-bottom: 9px;
  font-weight: 600;
  transition: 0.2s ease;
}

.footer-column a:hover {
  color: #4ade80;
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 34px;
  padding-top: 18px;
  text-align: center;
}

.footer-bottom p {
  color: #a7b5ad;
  margin: 0;
  font-size: 14px;
}

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

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

  .footer {
    padding-top: 36px;
  }
}

.footer-contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.footer-contact-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(74, 222, 128, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(74, 222, 128, 0.28);
  font-weight: 800;
  transition: 0.2s ease;
}

.footer-contact-btn:hover {
  background: #4ade80;
  color: #07130b !important;
  transform: translateX(3px);
}

/* Improved public price suggestion and seller rating UI */
.price-block {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(22, 163, 74, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.price-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.price-block strong {
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.detail-price strong {
  font-size: 30px;
}

.seller-rating {
  display: grid;
  gap: 4px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 12px 0;
}

.seller-rating.compact {
  padding: 9px 11px;
  margin: 10px 0;
}

.rating-stars {
  color: #f59e0b;
  letter-spacing: 1px;
  font-size: 18px;
  line-height: 1;
}

.seller-rating strong {
  color: #7c2d12;
  font-size: 18px;
}

.seller-rating small {
  color: #9a3412;
  font-weight: 700;
}

.card-actions {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.card-actions .btn {
  width: 100%;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
}

.modal-overlay.hidden {
  display: none;
}

.user-modal {
  position: relative;
  width: min(440px, 100%);
  background: white;
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.user-modal h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.user-modal p {
  color: var(--muted);
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  color: var(--dark);
  background: #f1f5f9;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-form label {
  font-weight: 900;
}

.star-picker {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
}

.star-picker button {
  width: 42px;
  height: 42px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  cursor: pointer;
  color: #cbd5e1;
  background: #fff7ed;
  font-size: 24px;
  transition: 0.18s ease;
}

.star-picker button.active {
  color: #f59e0b;
  background: #ffedd5;
  transform: translateY(-1px);
}

.success-text {
  color: #15803d;
  font-weight: 900;
}

.error-text {
  color: #b91c1c;
  font-weight: 900;
}

@media (max-width: 560px) {
  .user-modal {
    padding: 22px;
  }

  .star-picker button {
    width: 38px;
    height: 38px;
  }
}
