body {
  background: #F4F6F9;
  color: #333;
  font-family: 'Segoe UI', sans-serif;
  padding-top: 0;
}

.navbar-shopee {
  background-color: #EE4D2D;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 999;
  margin-top: 135px;
}

.btn-shopee {
  background-color: #EE4D2D;
  color: white;
  font-weight: 600;
  border: none;
}

.btn-shopee:hover {
  background-color: #E03E1A;
  color: white;
}

.market-container {
  max-width: 960px;
  margin: 25px auto 80px auto;
  padding: 0 15px;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
  padding: 15px 0;
}

.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  border: 1px solid #EAEAEA;
  display: flex;
  flex-direction: column;
  height: 345px;
  position: relative;
  transition: 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(238, 77, 45, 0.15);
  border-color: rgba(238, 77, 45, 0.3);
}

.img-wrapper {
  position: relative;
  width: 100%;
  height: 160px;
  background-color: #ECEFF1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-product {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-kondisi {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 3;
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 185px;
}

.product-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2C3E50;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.3rem;
}

.product-price {
  color: #EE4D2D;
  font-size: 1rem;
  font-weight: 700;
}

.meta-text {
  font-size: 0.68rem;
  color: #7F8C8D;
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.category-btn {
  background: white;
  color: #555;
  border: 1px solid #DDD;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
}

.category-btn.active {
  background: #EE4D2D;
  color: white;
  border-color: #EE4D2D;
}

.chat-box {
  max-height: 200px;
  overflow-y: auto;
  background: #F8F9FA;
  padding: 10px;
  border-radius: 8px;
}

.chat-item {
  background: white;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid #EE4D2D;
}

.hidden {
  display: none !important;
}

.loader {
  border: 3px solid #f3f3f3;
  border-radius: 50%;
  border-top: 3px solid #EE4D2D;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.input-group-custom {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
}

.input-group-text-custom {
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  color: #495057;
  font-weight: bold;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.input-field-custom {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.box-upload-area {
  border: 2px dashed #ced4da;
  padding: 15px;
  text-align: center;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.box-upload-area:hover {
  border-color: #EE4D2D;
  background: #fff5f3;
}

.preview-img-upload {
  max-width: 100%;
  max-height: 230px;
  object-fit: contain;
  border-radius: 6px;
  display: none;
}

.market-user-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mp-userbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.market-user-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.mp-user-greeting {
  color: #fff;
  font-weight: 800;
}

.mp-profile-btn,
.mp-logout-btn {
  border-radius: 8px;
  font-weight: 800;
}

.owner-panel {
  display: none;
}

.owner-panel.is-visible {
  display: block;
}

.modal-market-auth .nav-link {
  font-weight: 800;
  color: #555;
}

.modal-market-auth .nav-link.active {
  color: #EE4D2D;
}

.market-alert {
  font-size: 0.82rem;
}

.detail-description {
  white-space: pre-line;
}

.mp-avatar,
.mp-avatar-sm,
.mp-avatar-lg {
  border-radius: 50%;
  object-fit: cover;
  background: #f1f3f5;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.mp-avatar {
  width: 48px;
  height: 48px;
}

.mp-avatar-sm {
  width: 28px;
  height: 28px;
}

.mp-avatar-lg {
  width: 88px;
  height: 88px;
}

.mp-dashboard {
  border-radius: 14px;
  overflow: hidden;
}

.mp-dashboard-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  background: #fff8f6;
}

.mp-dashboard-tabs .nav-link,
.mp-dashboard-tab {
  font-weight: 900;
  color: #555;
}

.mp-dashboard-tabs .nav-link.active,
.mp-dashboard-tab.active {
  color: #EE4D2D;
}

.mp-dashboard-panel {
  min-height: 240px;
}

.mp-profile-form {
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.mp-profile-photo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f3;
}

.mp-my-posts-grid,
.seller-products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mp-my-post-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.mp-my-post-card img {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f3f5;
}

.mp-my-post-card h6 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 900;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mp-my-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.seller-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #5d6770;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.seller-mini:hover {
  color: #EE4D2D;
}

.seller-mini img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f3f5;
}

.seller-mini span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

@media screen and (max-width: 768px) {
  .navbar-shopee {
    margin-top: 58px;
  }

  .navbar-shopee .container-fluid {
    gap: 10px;
  }

  .market-user-status {
    width: 100%;
    justify-content: flex-start;
  }

  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card {
    height: 340px;
  }

  .img-wrapper {
    height: 140px;
  }

  .box-upload-area {
    min-height: 190px;
  }

  .mp-dashboard .modal-body {
    padding: 12px;
  }

  .mp-dashboard-header,
  .mp-profile-photo-upload,
  .seller-profile-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .mp-dashboard-header .ms-auto {
    margin-left: 0 !important;
    width: 100%;
  }

  .mp-dashboard-header .btn {
    width: 100%;
  }

  .mp-my-posts-grid,
  .seller-products-grid {
    grid-template-columns: 1fr;
  }

  .mp-my-post-actions .btn {
    flex: 1 1 100%;
  }
}

@media screen and (max-width: 390px) {
  .market-grid {
    grid-template-columns: 1fr;
  }
}
