/* ═══════════════════════════════════════════════════════════════════════════
   Moneta Marketplace — UI
   Gold: #F4AE01  Dark: #1a1a2e  Radius: 12px
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --mkt-gold:        #F4AE01;
  --mkt-gold-d:      #d49700;
  --mkt-dark:        #1a1a2e;
  --mkt-card-bg:     #fff;
  --mkt-border:      #eaebee;
  --mkt-bg:          #f7f8fc;
  --mkt-muted:       #6b7280;
  --mkt-radius:      12px;
  --mkt-shadow:      0 2px 16px rgba(26,26,46,.07);
  --mkt-shadow-h:    0 8px 32px rgba(26,26,46,.14);
}

/* ─── Page background ────────────────────────────────────────────────────── */
body.page-id-marketplace,
body.page-template-page-marketplace { background: var(--mkt-bg) !important; }

/* ─── Hero header ────────────────────────────────────────────────────────── */
.mkt-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 55%, #0f3460 100%);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Subtle radial glow behind title */
.mkt-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 300px;
  background: radial-gradient(ellipse, rgba(244,174,1,.18) 0%, transparent 70%);
  pointer-events: none;
}
.mkt-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--mkt-gold) 40%, var(--mkt-gold) 60%, transparent 100%);
}
.mkt-hero__inner { max-width: 680px; margin: 0 auto; position: relative; }
.mkt-hero__title {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 .6rem;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.mkt-hero__title span { color: var(--mkt-gold); }
.mkt-hero__sub {
  color: rgba(255,255,255,.55);
  font-size: .95rem;
  margin: 0;
  letter-spacing: .01em;
}

/* ─── Main container ─────────────────────────────────────────────────────── */
.mkt-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  min-height: 60vh;
}

/* ─── Toolbar ────────────────────────────────────────────────────────────── */
.mkt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 2rem;
}

.mkt-cats {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  background: #fff;
  border-radius: 999px;
  padding: .3rem;
  box-shadow: var(--mkt-shadow);
  border: 1px solid var(--mkt-border);
}

.mkt-pill {
  display: inline-block;
  padding: .38rem 1.1rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--mkt-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.mkt-pill:hover { color: var(--mkt-dark); background: #f3f4f6; text-decoration: none; }
.mkt-pill--active {
  background: var(--mkt-dark);
  color: #fff !important;
}
.mkt-pill--active:hover { background: #2d2d4e; }

.mkt-sort {
  border: 1.5px solid var(--mkt-border);
  border-radius: 8px;
  padding: .45rem 1rem;
  font-size: .82rem;
  color: var(--mkt-dark);
  background: #fff;
  cursor: pointer;
  outline: none;
  box-shadow: var(--mkt-shadow);
  transition: border-color .15s;
}
.mkt-sort:focus { border-color: var(--mkt-gold); }

/* ─── Section heading ────────────────────────────────────────────────────── */
.mkt-section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.mkt-section-head__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--mkt-border), transparent);
}
.mkt-section-head__line:first-child {
  background: linear-gradient(90deg, transparent, var(--mkt-border));
}
.mkt-section-head__label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--mkt-muted);
  white-space: nowrap;
  margin: 0;
}

/* ─── Product grid ───────────────────────────────────────────────────────── */
.mkt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  margin-bottom: 2rem;
}
@media (min-width: 560px)  { .mkt-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .mkt-grid { grid-template-columns: repeat(4, 1fr); gap: 1.35rem; } }
@media (min-width: 1100px) { .mkt-grid { grid-template-columns: repeat(5, 1fr); } }

/* ─── Card ───────────────────────────────────────────────────────────────── */
.mkt-card {
  background: var(--mkt-card-bg);
  border-radius: var(--mkt-radius);
  border: 1px solid var(--mkt-border);
  overflow: hidden;
  box-shadow: var(--mkt-shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.mkt-card:hover {
  box-shadow: var(--mkt-shadow-h);
  transform: translateY(-4px);
  border-color: rgba(244,174,1,.35);
}
.mkt-card--sold { opacity: .7; }

/* Image area */
.mkt-card__image-wrap {
  display: block;
  position: relative;
  text-decoration: none;
  aspect-ratio: 1;
  overflow: hidden;
  background: #1a1a2e;
}
.mkt-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .4s;
  opacity: .92;
}
.mkt-card:hover .mkt-card__img {
  transform: scale(1.07);
  opacity: 1;
}

.mkt-card__no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #22223a;
}

/* Gold bottom strip on image */
.mkt-card__image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mkt-gold), transparent);
  opacity: 0;
  transition: opacity .25s;
}
.mkt-card:hover .mkt-card__image-wrap::after { opacity: 1; }

/* Badges */
.mkt-card__badges {
  position: absolute;
  top: .55rem;
  left: .55rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.mkt-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 900;
  padding: .22rem .6rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  line-height: 1.4;
}
.mkt-badge--new  { background: var(--mkt-dark); color: var(--mkt-gold); }
.mkt-badge--sale { background: var(--mkt-gold); color: var(--mkt-dark); }
.mkt-badge--sold { background: rgba(185,28,28,.9); color: #fff; }

/* Card body */
.mkt-card__body {
  padding: .75rem .85rem .9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .5rem;
}

.mkt-card__title {
  font-size: .86rem;
  font-weight: 700;
  color: var(--mkt-dark);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  transition: color .15s;
}
.mkt-card__title:hover { color: var(--mkt-gold-d); text-decoration: none; }

.mkt-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: .4rem;
}

/* Price */
.mkt-card__price {
  font-weight: 800;
  font-size: .97rem;
  color: var(--mkt-dark);
  line-height: 1.2;
}
.mkt-card__price ins,
.mkt-card__price .woocommerce-Price-amount:not(del .woocommerce-Price-amount) {
  color: var(--mkt-gold-d);
  text-decoration: none;
}
.mkt-card__price del {
  font-size: .74rem;
  font-weight: 500;
  color: #9ca3af;
  display: block;
  text-decoration: line-through;
}
.mkt-card__price del .woocommerce-Price-amount { color: inherit; }
.mkt-card__price-bgn {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.3;
}
.mkt-card__price-bgn del {
  font-size: .72rem;
  color: #9ca3af;
}

.mkt-card__sold-txt {
  font-size: .75rem;
  color: #9ca3af;
}

/* Add to cart */
.mkt-atc {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--mkt-gold);
  color: var(--mkt-dark);
  border: none;
  border-radius: 7px;
  padding: .42rem .7rem;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.mkt-atc:hover { background: var(--mkt-gold-d); transform: scale(1.04); }
.mkt-atc:active { transform: scale(.97); }
.mkt-atc.loading { opacity: .6; pointer-events: none; }
.mkt-atc.success { background: #16a34a; color: #fff; }

.mkt-atc__label { display: none; }
@media (min-width: 480px) { .mkt-atc__label { display: inline; } }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.mkt-pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 2.5rem;
}
.mkt-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 .6rem;
  border-radius: 8px;
  border: 1.5px solid var(--mkt-border);
  background: #fff;
  color: var(--mkt-muted);
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.mkt-page:hover { border-color: var(--mkt-gold); color: var(--mkt-dark); text-decoration: none; }
.mkt-page--active { background: var(--mkt-dark); border-color: var(--mkt-dark); color: #fff !important; }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.mkt-empty {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--mkt-muted);
}
.mkt-empty h3 { font-size: 1.1rem; font-weight: 600; margin: .75rem 0 .25rem; }
.mkt-empty p  { color: #9ca3af; margin: 0; font-size: .9rem; }

/* ─── Float cart button ──────────────────────────────────────────────────── */
.moneta-cart-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 9999;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--mkt-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.28);
  text-decoration: none;
  transition: transform .2s, background .2s;
}
.moneta-cart-fab:hover { background: var(--mkt-gold); color: var(--mkt-dark); transform: scale(1.08); text-decoration: none; }

.moneta-cart-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: #dc2626;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.moneta-mkt-toast {
  position: fixed;
  bottom: 5.5rem;
  right: 1.75rem;
  z-index: 9998;
  background: #fff;
  border: 1px solid var(--mkt-border);
  border-left: 4px solid var(--mkt-gold);
  border-radius: var(--mkt-radius);
  box-shadow: var(--mkt-shadow-h);
  padding: .75rem 1rem;
  font-size: .875rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 200px;
  animation: mktSlideIn .25s ease;
}
@keyframes mktSlideIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.moneta-mkt-toast-link { color: var(--mkt-gold-d); font-weight: 600; text-decoration: none; }
.moneta-mkt-toast-link:hover { text-decoration: underline; }

/* ─── Courier office field ───────────────────────────────────────────────── */
.moneta-courier-office-wrap {
  display: none;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: .5rem;
  padding: .75rem;
  margin-bottom: 1rem !important;
}
.moneta-courier-office-wrap label { font-weight: 600 !important; color: #92400e; }

/* Keep old class names for JS backward compat */
.moneta-mkt-atc { /* mapped to .mkt-atc */ }
