/* ======================================
   MARKETPLACE PAGE
====================================== */

.marketplace-page {
  width: 100%;

  display: flex;

  flex-direction: column;

  gap: 15px;
}

/* ======================================
   COMMON MARKETPLACE WIDGET STYLE
====================================== */

.marketplace-page .widget {
  background: linear-gradient(145deg, #111827, #0f172a);

  border-radius: 14px;

  border: 1px solid rgba(255, 255, 255, 0.08);

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* ======================================
   MARKETPLACE HEADER
====================================== */

.marketplace-header-widget {
  padding: 25px;
}

.marketplace-header-widget h2 {
  margin: 0 0 10px 0;

  font-size: 30px;

  color: white;
}

.marketplace-header-widget p {
  margin: 0;

  color: #cbd5e1;

  font-size: 15px;

  line-height: 1.6;
}

/* ======================================
   MARKETPLACE STATS
====================================== */

.marketplace-stats-widget {
  padding: 20px;
}

.marketplace-stats-widget .stats-grid {
  display: grid;

  grid-template-columns: repeat(5, 1fr);

  gap: 15px;
}

.marketplace-stats-widget .stat-box {
  background: linear-gradient(145deg, #020617, #111827);

  border-radius: 12px;

  padding: 20px;

  text-align: center;

  border: 1px solid rgba(255, 255, 255, 0.06);

  transition: 0.2s;
}

.marketplace-stats-widget .stat-box:hover {
  transform: translateY(-3px);

  border-color: #38bdf8;
}

.marketplace-stats-widget .stat-title {
  display: block;

  color: #94a3b8;

  font-size: 14px;

  margin-bottom: 8px;
}

.marketplace-stats-widget .stat-value {
  display: block;

  color: white;

  font-size: 28px;

  font-weight: bold;
}

/* ======================================
   MARKETPLACE FILTERS
====================================== */

.marketplace-filters-widget {
  padding: 20px;
}

.marketplace-filter-grid {
  display: grid;

  grid-template-columns: 2fr 1fr 1fr auto;

  gap: 15px;

  align-items: end;
}

.marketplace-filter-form label {
  display: block;

  color: #cbd5e1;

  font-size: 14px;

  margin-bottom: 7px;
}

.marketplace-filter-form input,
.marketplace-filter-form select {
  width: 100%;

  padding: 12px;

  border-radius: 10px;

  border: 1px solid #334155;

  background: #020617;

  color: white;
}

.marketplace-filter-form input:focus,
.marketplace-filter-form select:focus {
  outline: none;

  border-color: #38bdf8;
}

/* ======================================
   FILTER BUTTON
====================================== */

.filter-action button {
  padding: 12px 25px;

  border: none;

  border-radius: 10px;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);

  color: white;

  font-weight: bold;

  cursor: pointer;

  transition: 0.2s;
}

.filter-action button:hover {
  transform: translateY(-2px);
}

/* ======================================
   MARKETPLACE LISTINGS
====================================== */

.marketplace-listing-widget {
  padding: 20px;
}

.marketplace-list-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 20px;
}

.marketplace-card {
  background: linear-gradient(145deg, #020617, #111827);

  border-radius: 15px;

  padding: 22px;

  border: 1px solid rgba(255, 255, 255, 0.08);

  transition: 0.2s;
}

.marketplace-card:hover {
  transform: translateY(-4px);

  border-color: #38bdf8;
}

.marketplace-item-type {
  display: inline-block;

  padding: 5px 12px;

  border-radius: 20px;

  background: #0f172a;

  color: #38bdf8;

  font-size: 13px;
}

.marketplace-card h3 {
  color: white;
}

.marketplace-card p {
  color: #cbd5e1;
}

.marketplace-price {
  font-size: 26px;

  font-weight: bold;

  color: #22c55e;
}

.marketplace-add-button {
  width: 100%;

  margin-top: 15px;

  padding: 13px;

  border: none;

  border-radius: 10px;

  background: linear-gradient(135deg, #16a34a, #15803d);

  color: white;

  font-weight: bold;

  cursor: pointer;
}

/* ======================================
   EMPTY MARKETPLACE
====================================== */

.empty-marketplace {
  text-align: center;

  padding: 50px;

  color: #94a3b8;
}

/* ======================================
   CART
====================================== */

.marketplace-cart-widget {
  padding: 20px;
}

.marketplace-cart-total {
  font-size: 24px;

  font-weight: bold;

  color: #22c55e;
}

/* ======================================
   RECEIPT DETAILS
====================================== */

.cattle-receipt-details {
  margin: 15px 0;

  padding: 15px;

  background: rgba(37, 99, 235, 0.1);

  border-radius: 10px;

  border-left: 4px solid #2563eb;
}

.cattle-receipt-details p {
  margin: 8px 0;
}

/* ======================================
   OWNERSHIP TRANSFER
====================================== */

.ownership-transfer-box {
  margin-top: 20px;

  padding: 20px;

  border-radius: 14px;

  background: rgba(34, 197, 94, 0.12);

  border: 1px solid rgba(34, 197, 94, 0.35);
}

/* ======================================
   MARKETPLACE GUIDE BUTTON
====================================== */

.marketplace-guide-button {
  padding: 12px 20px;

  border-radius: 10px;

  border: none;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);

  color: white;

  font-weight: bold;

  cursor: pointer;
}

/* ======================================
   MARKETPLACE MODAL
====================================== */

.marketplace-modal {
  display: none;

  position: fixed;

  top: 0;

  left: 280px;

  width: calc(100% - 280px);

  height: 100%;

  z-index: 99999;
}

.marketplace-modal.active {
  display: flex;

  justify-content: center;

  align-items: center;
}

/* DARK OVERLAY */

.marketplace-modal-overlay {
  position: absolute;

  inset: 0;

  background: rgba(0, 0, 0, 0.75);
}

/* ======================================
   MODAL BOX
====================================== */

.marketplace-modal-box {
  position: relative;

  z-index: 100000;

  width: 90%;

  max-width: 700px;

  max-height: 75vh;

  overflow-y: auto;

  padding: 35px 45px;

  margin-left: 40px;

  background: linear-gradient(145deg, #111827, #020617);

  color: white;

  border-radius: 18px;

  border: 1px solid rgba(255, 255, 255, 0.15);

  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);

  text-align: left;
}

.marketplace-modal-box h2 {
  margin-top: 0;

  margin-bottom: 25px;

  padding-right: 50px;

  text-align: center;

  color: white;
}

.marketplace-modal-box p {
  color: #cbd5e1;

  line-height: 1.7;

  font-size: 15px;
}

/* CLOSE BUTTON */

.marketplace-modal-close {
  position: absolute;

  right: 20px;

  top: 15px;

  width: 36px;

  height: 36px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: rgba(255, 255, 255, 0.08);

  border: 1px solid rgba(255, 255, 255, 0.15);

  border-radius: 50%;

  color: white;

  font-size: 20px;

  cursor: pointer;
}

.marketplace-modal-close:hover {
  background: #dc2626;
}

/* ======================================
   MODAL SECTIONS
====================================== */

.marketplace-modal-section {
  margin-top: 20px;

  padding: 20px;

  background: rgba(255, 255, 255, 0.05);

  border-radius: 12px;
}

.marketplace-modal-section h3 {
  margin-top: 0;

  margin-bottom: 12px;

  color: #38bdf8;
}

.marketplace-modal-section ul,
.marketplace-modal-section ol {
  padding-left: 28px;
}

.marketplace-modal-section li {
  margin: 10px 0;

  line-height: 1.5;

  color: #e2e8f0;
}

/* WARNING BOX */

.marketplace-modal-warning {
  margin-top: 20px;

  padding: 20px;

  border-radius: 12px;

  background: rgba(234, 179, 8, 0.15);

  border: 1px solid rgba(234, 179, 8, 0.35);
}

.marketplace-modal-warning h3 {
  margin-top: 0;
}

/* ======================================
   RESPONSIVE
====================================== */

@media (max-width: 1100px) {
  .marketplace-stats-widget .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .marketplace-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .marketplace-filter-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-modal {
    left: 0;

    width: 100%;
  }

  .marketplace-modal-box {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .marketplace-stats-widget .stats-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-list-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-modal-box {
    width: 95%;

    padding: 25px;
  }
}
