.marketplace-product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 12px;
}

.marketplace-product-media {
  display: block;
  position: relative;
  height: 320px;
  overflow: hidden;
  background: #f5f6f7;
}

.marketplace-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.marketplace-genuine-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  width: 104px;
  padding: 0.55rem 0.45rem 1rem;
  background: #d71920;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.05;
  font-weight: 800;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  height: 104px;
  z-index: 1;
}

.marketplace-favorite {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #9a9a9a;
  font-size: 1.2rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.marketplace-color-label {
  position: absolute;
  bottom: 0.8rem;
  left: 0.9rem;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  background: #444;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.marketplace-product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.2rem 1.1rem 1.1rem;
}

.marketplace-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.marketplace-product-category {
  color: #777;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.marketplace-brand-pill {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #fff0f1;
  color: #d71920;
  font-size: 0.72rem;
  font-weight: 800;
}

.marketplace-product-title {
  margin-bottom: 0.35rem;
  color: var(--secondary);
  font-size: 1.22rem;
  line-height: 1.25;
}

.marketplace-product-title a { color: inherit; }
.marketplace-product-spec { margin-bottom: 0.75rem; color: var(--text-muted); font-size: 0.88rem; }

@media (max-width: 640px) {
  .marketplace-product-media { height: 280px; }
}

/* Buy page cards use the core route's legacy mp-card markup. */
.marketplace-buy-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

.marketplace-buy-card .mp-card-image {
  height: 300px;
  overflow: hidden;
  background: #f5f6f7;
}

.marketplace-buy-card .mp-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  transition: transform 0.4s ease;
}

.marketplace-buy-card .mp-buy-carousel { cursor: pointer; }

.marketplace-buy-card:hover .mp-card-image img { transform: scale(1.04); }

.marketplace-buy-ribbon {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto !important;
  left: 0 !important;
  width: 104px;
  height: 104px;
  padding: 0.65rem 0 0;
  background: var(--accent);
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  font-size: 0.62rem;
  line-height: 1.05;
  font-weight: 800;
  text-align: center;
  text-shadow: none;
  z-index: 2;
}

.marketplace-buy-ribbon .marketplace-buy-ribbon-text {
  position: absolute !important;
  top: 0.7rem;
  left: 0 !important;
  bottom: auto !important;
  width: 82px;
  color: #fff;
  text-align: center;
  text-shadow: none;
}

.marketplace-buy-color {
  left: 0.9rem !important;
  bottom: 0.8rem !important;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  background: #444;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-shadow: none !important;
}

.marketplace-buy-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background: #ffffff !important;
  border-radius: 16px !important;
}

.marketplace-buy-card .mp-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  padding: 1.15rem 1.15rem 1.25rem !important;
}

.marketplace-buy-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  margin-bottom: 0.65rem !important;
}

.marketplace-buy-category {
  color: #777;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.marketplace-buy-brand {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.marketplace-buy-card .mp-card-body h2 {
  font-size: 1.15rem !important;
  line-height: 1.35 !important;
  min-height: 4.05em !important;
  max-height: 4.05em !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  margin: 0 0 0.6rem 0 !important;
}

.marketplace-buy-card .mp-storage {
  font-size: 0.82rem !important;
  line-height: 1.3 !important;
  color: #64748b !important;
  min-height: 1.3em !important;
  max-height: 1.3em !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  margin-bottom: 0.75rem !important;
}

.marketplace-buy-card .mp-price-note {
  margin-top: auto !important;
  margin-bottom: 0.65rem !important;
  font-size: 0.84rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

.marketplace-buy-card .btn-block {
  margin-top: 0 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  padding: 0.55rem 1rem !important;
}

@media (max-width: 640px) {
  .marketplace-buy-card .mp-card-image { height: 280px; }
}

.marketplace-related-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1.35rem;
}

.marketplace-related-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

.marketplace-related-card .mp-card-image {
  height: 210px;
  overflow: hidden;
  background: #f5f6f7;
}

.marketplace-related-card .mp-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.45rem;
}

.marketplace-related-condition {
  left: 0.75rem !important;
  right: auto;
  bottom: 0.7rem !important;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  text-shadow: none !important;
}

.marketplace-related-card .mp-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.marketplace-related-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.marketplace-related-meta strong {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  color: var(--accent);
  font-size: 0.68rem;
}

.marketplace-related-card .mp-card-title {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  line-height: 1.25;
}

.marketplace-related-storage {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.marketplace-related-card .mp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
}

.marketplace-related-card .mp-card-price {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .marketplace-related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .marketplace-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 480px) {
  .marketplace-related-grid { grid-template-columns: 1fr !important; }
}

.marketplace-buy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1.35rem;
}

@media (max-width: 1100px) {
  .marketplace-buy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .marketplace-buy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 480px) {
  .marketplace-buy-grid { grid-template-columns: 1fr !important; }
}
/* Marketplace — Gadget Box style */

.mp-page .mp-hero {
  position: relative;
  z-index: 0;
  padding: 4.5rem 0 4rem;
  overflow: hidden;
  background: #121e24;
  color: #ffffff;
  border-bottom: 0;
}

.mp-page .mp-hero::after {
  content: 'MARKET\A PLACE';
  white-space: pre;
  position: absolute;
  right: 4vw;
  top: 2.5rem;
  color: rgba(241, 206, 102, 0.22);
  font: 800 clamp(3.5rem, 8vw, 7.5rem)/.85 var(--font-display);
  letter-spacing: -.08em;
  text-align: right;
  pointer-events: none;
  z-index: 0;
}

.mp-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.mp-hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -.05em;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.mp-hero-content > p {
  color: #cbd8d3;
  font-size: 1.05rem;
  max-width: 32rem;
}

.mp-hero-eyebrow {
  color: #f1ce66;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.mp-hero-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.mp-perk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1px solid #49606a;
  border-radius: 4px;
  color: #f1ce66;
  box-shadow: none;
}

.mp-hero-card-preview {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.mp-preview-card {
  background: #ffffff;
  border: 0;
  border-radius: 4px;
  padding: 2.2rem 1.8rem;
  transform: rotate(-2deg);
  box-shadow: -16px 16px 0 #7d4047;
  text-align: center;
  max-width: 320px;
  width: 100%;
  color: #2e2e2e;
  transition: transform 0.3s ease;
}

.mp-preview-card:hover {
  transform: rotate(0deg) translateY(-8px);
}

.mp-preview-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #121e24;
  background: #f1ce66;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.mp-preview-icon {
  font-size: 3.25rem;
  margin-bottom: 0.75rem;
}

.mp-preview-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #2e2e2e;
  margin-bottom: 0.5rem;
}

.mp-preview-card p {
  font-size: 0.85rem;
  color: #5e5954;
  line-height: 1.5;
}

.mp-listing {
  padding: 2rem 0 4rem;
}

.mp-filters {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px !important;
  padding: 0.6rem 0.9rem !important;
  margin-bottom: 1.25rem !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

.mp-filters-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  gap: 0.6rem 0.85rem !important;
}

.mp-filter-group {
  flex: 1 1 140px !important;
  min-width: 125px !important;
  margin-bottom: 0 !important;
}

.mp-filter-search {
  flex: 2 1 200px !important;
  min-width: 170px !important;
}

.mp-filter-group label {
  display: block !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.15rem !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.mp-filter-group .form-control,
.mp-filter-group select,
.mp-filter-group input {
  height: 38px !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.86rem !important;
  border-radius: 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background-color: #ffffff !important;
}

.mp-filter-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  margin-bottom: 0 !important;
}

.mp-filter-actions .btn {
  height: 38px !important;
  padding: 0 1.1rem !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mp-count {
  margin-bottom: 1.25rem;
  color: var(--color-muted);
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.mp-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.mp-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.mp-card:hover {
  border-color: var(--color-red);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.mp-card-image {
  display: block;
  position: relative;
  aspect-ratio: 1;
  background: var(--color-bg-alt);
  overflow: hidden;
}

.mp-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-card-placeholder,
.mp-main-placeholder {
  display: grid;
  place-items: center;
  font-size: 3rem;
  background: var(--color-bg-alt);
  width: 100%;
  height: 100%;
  min-height: 200px;
}

.mp-badge {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.mp-badge-condition {
  top: 0.5rem;
  left: 0.5rem;
}

.mp-badge-delivery {
  bottom: 0.5rem;
  left: 0.5rem;
  background: var(--color-red);
  color: #fff;
}

.mp-card-body {
  padding: 1rem;
}

.mp-card-body h2,
.mp-card-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.mp-card-body h2 a,
.mp-card-body h3 a {
  color: var(--color-text);
}

.mp-card-body h2 a:hover,
.mp-card-body h3 a:hover {
  color: var(--color-red);
}

.mp-storage {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.mp-price-note {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.mp-price-note-lg {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.btn-block {
  width: 100%;
}

.mp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.mp-page-num {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.mp-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--color-bg-alt);
  border-radius: 12px;
}

/* Detail page */
.mp-detail-top {
  padding: 1rem 0 0;
}

.mp-back {
  font-weight: 600;
  font-size: 0.9rem;
}

.mp-detail {
  padding: 1.5rem 0 2rem;
}

.mp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.mp-main-image {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #fff;
  width: 100%;
  aspect-ratio: 1 / 0.82;
  display: grid;
  place-items: center;
}

.mp-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  display: block;
}

.mp-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mp-thumb {
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  width: 64px;
  height: 64px;
  cursor: pointer;
  background: #fff;
}

.mp-thumb.is-active {
  border-color: var(--accent);
}

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

.mp-detail-media {
  display: block;
  width: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  background: transparent;
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(125, 64, 71, 0.1);
  overflow: visible;
}

.mp-detail-media .mp-main-image {
  aspect-ratio: 4 / 3;
  max-height: 34rem;
  border-radius: 16px;
  background: #fff;
}

.mp-detail-media .mp-main-image img {
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
  padding: 1.25rem;
}

.mp-detail-media .mp-thumbs { margin-top: 0.9rem; }

.mp-detail-card-summary {
  margin-top: 1.75rem;
  padding: 1.25rem 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(125, 64, 71, 0.08);
}

.mp-detail-card-summary h2 {
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
}

.mp-detail-card-summary p {
  display: flex;
  gap: 0.45rem;
  margin: 0.35rem 0;
  color: var(--muted);
}

.mp-detail-card-summary strong { color: var(--ink); }

.mp-detail-media .mp-thumbs {
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (max-width: 700px) {
  .mp-main-image { aspect-ratio: 1 / 0.9; }
}

.mp-brand {
  color: var(--color-red);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.mp-summary h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.mp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mp-tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: var(--color-bg-alt);
  border-radius: 999px;
}

.mp-tag-delivery {
  background: var(--color-red-light);
  color: var(--color-red);
}

.mp-detail-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-red);
  margin-bottom: 1.25rem;
}

.mp-inquiry-hint {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.mp-sold-notice {
  color: var(--color-red);
  font-weight: 600;
}

.mp-detail-content {
  padding: 2rem 0 3rem;
  background: var(--color-bg-alt);
}

.mp-detail-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.mp-description h2,
.mp-key-info h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.mp-prose {
  color: var(--color-muted);
  line-height: 1.7;
}

.mp-info-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.mp-info-table th,
.mp-info-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.mp-info-table th {
  width: 35%;
  font-weight: 600;
  background: var(--color-bg-alt);
}

.mp-condition-guide {
  margin-top: 1.25rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
}

.mp-condition-guide summary {
  font-weight: 600;
  cursor: pointer;
}

.mp-condition-guide dl {
  margin-top: 1rem;
}

.mp-condition-guide dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

.mp-condition-guide dd {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-left: 0;
}

.mp-related {
  padding: 2rem 0 4rem;
}

.mp-related h2 {
  font-family: var(--font-display);
  margin-bottom: 1.25rem;
}

/* Modal */
.mp-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mp-modal[hidden] {
  display: none;
}

.mp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.mp-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.mp-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
}

.mp-modal-close:hover {
  color: var(--color-text);
}

.mp-modal-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  padding-right: 2rem;
  margin-bottom: 0.5rem;
}

.mp-modal-sub {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.mp-modal-shop {
  background: var(--color-bg-alt);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.mp-form-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 1rem 0;
}

@media (max-width: 900px) {
  .mp-page .mp-hero {
    min-height: clamp(320px, 65vw, 460px);
    padding: 2.5rem 0 2rem;
  }

  .mp-hero-video {
    object-position: center 35%;
  }

  .mp-detail-grid,
  .mp-detail-columns {
    grid-template-columns: 1fr;
  }

  .mp-filter-search {
    grid-column: span 1;
  }

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

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

  .mp-modal-dialog {
    margin: 0.75rem;
    max-height: calc(100vh - 1.5rem);
  }
}

/* Listing layout only — do not restyle .mp-hero */
.mp-listing {
  padding: 2.5rem 0 5rem;
  background: var(--color-sand-light);
}

.mp-filters {
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--color-sand);
  background: #fff;
  padding: 1.15rem 0 1.35rem;
  margin-bottom: 1.75rem;
}

.mp-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.mp-card {
  border-radius: 4px 4px 14px 14px;
  border: 0;
  box-shadow: 0 10px 28px rgba(46, 46, 46, 0.06);
}

@media (max-width: 900px) {
  .mp-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Refix Marketplace Detail Page Compact Single-Screen Styling
   ========================================================================== */
.mp-detail-page {
  background-color: var(--color-sand-light, #fbfaf8);
  min-height: 100vh;
}

/* Breadcrumbs Bar */
.mp-detail-breadcrumb {
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.35rem 0;
  margin-bottom: 0.75rem;
}

.mp-crumb-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mp-breadcrumbs-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--color-muted, #666);
}

.mp-crumb-link {
  color: var(--color-muted, #666);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mp-crumb-link:hover {
  color: var(--color-primary, #d71920);
}

.mp-crumb-sep {
  color: #ccc;
  font-size: 0.75rem;
}

.mp-crumb-current {
  color: var(--ink, #1a1a1a);
  font-weight: 600;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: #f0ede8;
  color: #222;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(0,0,0,0.06);
}

.mp-back-pill:hover {
  background: var(--color-primary, #d71920);
  color: #ffffff;
  transform: translateX(-2px);
}

/* Main Hero Grid */
.mp-detail-hero {
  padding-bottom: 1.25rem;
}

.mp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
}

/* Media Showcase */
.mp-detail-media-wrap {
  position: relative;
}

.mp-detail-media-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  padding: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.mp-detail-status-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 2;
}

.mp-detail-status-badge.status-in-stock {
  background: #e6f4ea;
  color: #137333;
}

.mp-detail-status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #137333;
  box-shadow: 0 0 0 2px rgba(19, 115, 51, 0.2);
}

.mp-detail-condition-ribbon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #1a1a1a;
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 2;
}

.mp-detail-media-card .mp-main-image {
  width: 100%;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
}

.mp-detail-media-card .mp-main-image img {
  max-height: 270px;
  width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.mp-detail-media-card:hover .mp-main-image img {
  transform: scale(1.02);
}

.mp-detail-media-wrap .mp-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.mp-detail-media-wrap .mp-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.mp-detail-media-wrap .mp-thumb.is-active,
.mp-detail-media-wrap .mp-thumb:hover {
  border-color: var(--color-primary, #d71920);
  transform: translateY(-1px);
}

/* Info Column */
.mp-detail-info-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mp-detail-header-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mp-brand-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--color-primary, #d71920);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mp-device-tag {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #eef2f6;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
}

.mp-delivery-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
}

.mp-detail-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  color: var(--ink, #0f172a);
  line-height: 1.25;
  margin: 0;
}

/* Price Banner */
.mp-price-banner {
  background: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
}

.mp-price-main {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-primary, #d71920);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.mp-price-currency {
  font-size: 1.35rem;
}

.mp-price-original {
  font-size: 1.05rem;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 500;
}

.mp-price-note {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--color-muted, #64748b);
  font-weight: 500;
}

/* Specs Grid */
.mp-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.mp-spec-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.05);
}

.mp-spec-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.mp-spec-label {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.mp-spec-value {
  display: block;
  font-size: 0.85rem;
  color: #0f172a;
  font-weight: 700;
}

/* CTAs */
.mp-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.mp-btn-hold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(215, 25, 32, 0.2);
  transition: all 0.2s ease;
}

.mp-btn-hold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(215, 25, 32, 0.3);
}

.mp-btn-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
}

.mp-sold-banner {
  padding: 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.85rem;
}

/* Trust Bar */
.mp-trust-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 0.8rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.mp-trust-item {
  font-size: 0.78rem;
  color: #334155;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mp-trust-check {
  color: #16a34a;
  font-weight: 900;
}

/* Overview & Guarantee Section */
.mp-overview-section {
  padding: 3rem 0;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mp-overview-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.mp-overview-card {
  background: var(--color-sand-light, #fbfaf8);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mp-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.mp-card-icon {
  font-size: 1.5rem;
}

.mp-card-head h2 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.mp-description-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #334155;
}

.mp-description-body p {
  margin-bottom: 1rem;
}

.mp-honest-footnote {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.88rem;
  color: #64748b;
}

/* Checklist */
.mp-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mp-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.mp-chk-icon {
  font-size: 1.35rem;
  line-height: 1;
  background: #ffffff;
  padding: 0.4rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.mp-checklist strong {
  display: block;
  font-size: 0.98rem;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.mp-checklist p {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.4;
}

/* Related Section */
.mp-related-section {
  padding: 4rem 0;
}

.mp-related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.mp-related-head h2 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.mp-link-all {
  color: var(--color-primary, #d71920);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
}

.mp-link-all:hover {
  text-decoration: underline;
}

.mp-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.mp-card-brand {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-primary, #d71920);
  letter-spacing: 0.05em;
}

.mp-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.25rem 0 0.75rem;
}

.mp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.mp-card-price {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

/* Responsiveness */
@media (max-width: 992px) {
  .mp-detail-grid,
  .mp-overview-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .mp-detail-media-wrap {
    position: static;
  }
}

/* Category Group Sections styling for /buy/ marketplace */
.mp-category-sections {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  margin-top: 1.5rem;
}

.mp-category-group {
  padding-bottom: 2rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

.mp-category-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mp-category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #0f172a;
}

.mp-category-group-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.mp-category-group-title h2 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.mp-category-group-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
}

.mp-category-see-more {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent, #d71920);
  text-decoration: none;
  transition: all 0.2s ease;
}

.mp-category-see-more:hover {
  color: #0f172a;
  transform: translateX(3px);
}

.mp-category-foot {
  text-align: center;
  margin-top: 1.75rem;
}

.mp-category-foot .btn {
  border-radius: 999px;
  font-weight: 700;
  padding: 0.6rem 1.6rem;
}

/* Back to Main Marketplace button styling */
.mp-filtered-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.mp-back-to-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.mp-back-to-buy-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Disable Chrome scroll-anchoring to allow AJAX scroll-to-top */
html,
body,
.mp-listing,
#mp-dynamic-area,
.mp-grid {
  overflow-anchor: none !important;
}

@media (max-width: 768px) {
  .mp-filters {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.75rem 0.85rem !important;
  }
  .mp-filters-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }
  .mp-filter-group,
  .mp-filter-search {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
  }
  .mp-filter-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-top: 0.25rem !important;
  }
  .mp-filter-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

@media (max-width: 640px) {
  .mp-category-group-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.4rem !important;
  }
  .mp-category-group-title {
    flex-wrap: wrap !important;
    gap: 0.35rem 0.6rem !important;
  }
  .mp-category-group-title h2 {
    font-size: 1.25rem !important;
  }
  .mp-category-see-more {
    font-size: 0.86rem !important;
    margin-top: 0.2rem !important;
  }
  .mp-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    text-align: center !important;
  }
  .mp-hero-content > p {
    margin-inline: auto !important;
  }
  .mp-hero-perks {
    justify-content: center !important;
  }
  .mp-preview-card {
    transform: none !important;
    margin: 0 auto !important;
    max-width: 290px !important;
  }
  .mp-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 0.85rem !important;
  }
}

@media (max-width: 480px) {
  .mp-grid,
  .marketplace-buy-grid {
    grid-template-columns: 1fr !important;
  }
  .mp-card-image,
  .marketplace-product-media,
  .marketplace-buy-card .mp-card-image {
    height: 240px !important;
  }
}


