/* style.css - kulakan.id
   Desain modern, bersih, ringan, dan ramah mobile untuk pasar pertanian.
*/

:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-light: #e8f5e9;
  --primary-subtle: #f1f8f3;
  --background: #f7f9f7;
  --card-bg: #ffffff;
  --white: #ffffff;
  --text: #222222;
  --muted: #6b7280;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

button, input, select {
  font-family: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo .dot-id {
  color: var(--primary-dark);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.btn-mulai-jualan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-mulai-jualan:hover {
  background-color: var(--primary-dark);
}

.header-search-wrap {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.header-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--background);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.header-search-input:focus {
  border-color: var(--primary);
  background-color: var(--white);
}

.header-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.btn-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-cart:hover {
  background-color: #d7edd8;
}

.cart-badge {
  background-color: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Mobile search bar container */
.mobile-search-bar {
  display: none;
  padding: 10px 16px 12px;
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
}

.mobile-search-bar .header-search-wrap {
  max-width: 100%;
}

/* Hero Section */
.hero-section {
  padding: 40px 0 28px;
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-flow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.hero-flow-arrow {
  color: var(--primary);
  font-weight: 700;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

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

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.25);
}

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

/* Banner Carousel Section (Rasio 4:3) */
.banner-section {
  padding: 32px 0 20px;
}

.banner-container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.banner-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #e5e7eb;
  box-shadow: var(--shadow-md);
  user-select: none;
  touch-action: pan-y;
  cursor: pointer;
}

.banner-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.banner-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #e5e7eb;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.65);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  pointer-events: none;
  white-space: nowrap;
}

/* Banner Controls */
.banner-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background-color 0.15s ease, transform 0.1s ease;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.banner-btn:hover {
  background-color: var(--white);
  transform: translateY(-50%) scale(1.05);
}

.banner-btn-prev {
  left: -18px;
}

.banner-btn-next {
  right: -18px;
}

.banner-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.banner-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background-color: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, width 0.2s ease;
  padding: 0;
}

.banner-dot.active {
  background-color: var(--primary);
  width: 22px;
}

/* Products Section */
.products-section {
  padding: 32px 0 56px;
}

.products-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.filter-sort-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.sort-buttons {
  display: inline-flex;
  background-color: #edf2f7;
  padding: 3px;
  border-radius: var(--radius-sm);
}

.sort-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sort-btn.active {
  background-color: var(--white);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
}

/* Product Card */
.product-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.03);
}

.product-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.product-seller, .product-location {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-desc {
  font-size: 0.8rem;
  color: #555555;
  line-height: 1.4;
  margin-top: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty search result */
.empty-result {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background-color: var(--white);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.empty-result-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-result-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

/* About Section */
.about-section {
  padding: 48px 0;
  background-color: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.about-text {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* Footer */
.site-footer {
  background-color: #1a201c;
  color: #d1d5db;
  padding: 40px 0 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid #2d3748;
}

.footer-brand h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 0.9rem;
  color: #9ca3af;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.9rem;
  color: #d1d5db;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #4ade80;
}

.footer-bottom {
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Modal / Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--white);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  border-radius: var(--radius);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(16px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--text);
  transition: background-color 0.15s ease;
}

.modal-close-btn:hover {
  background-color: #f1f5f9;
}

.modal-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 11;
  background-color: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 20px;
}

.modal-product-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.modal-product-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 14px;
}

.modal-meta-box {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 0.85rem;
}

.modal-meta-item {
  display: flex;
  flex-direction: column;
}

.modal-meta-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.modal-meta-val {
  font-weight: 600;
  color: var(--text);
}

.modal-order-count {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--primary-dark);
  font-weight: 600;
  background-color: var(--primary-light);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.modal-control-group {
  margin-bottom: 16px;
}

.control-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

/* Quantity Control */
.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--white);
}

.qty-btn {
  width: 36px;
  height: 36px;
  background-color: #f8fafc;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.qty-btn:hover {
  background-color: #e2e8f0;
}

.qty-display {
  width: 48px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.modal-desc-box {
  margin-bottom: 18px;
}

.modal-desc-text {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.5;
}

.modal-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.modal-total-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-total-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-add-cart {
  width: 100%;
  padding: 12px;
  background-color: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-cart:hover {
  background-color: var(--primary-light);
}

.btn-pesan-sekarang {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(46, 125, 50, 0.2);
}

.btn-pesan-sekarang:hover {
  background-color: var(--primary-dark);
}

/* Cart Modal */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #fafafa;
}

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

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.cart-item-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

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

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.btn-remove-item:hover {
  background-color: #fee2e2;
}

.cart-empty-message {
  text-align: center;
  padding: 30px 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #1e293b;
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-nav .nav-link {
    display: none;
  }

  .header-search-wrap.desktop-search {
    display: none;
  }

  .mobile-search-bar {
    display: block;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .banner-btn {
    display: none;
  }

  .banner-container {
    max-width: 100%;
  }

  .modal-content {
    max-height: 94vh;
  }

  .footer-top {
    flex-direction: column;
  }
}