/* ============================================
   CANTYOU.COM — MARKETPLACE REDESIGN v1.2
   Fixes: Work Sans font, 4-col grid,
          buy button, duplicate Sell With Us
   ============================================ */

/* ── 1. HIDE DUPLICATE "SELL WITH US" that Astra injects into page content ── */
.cy-marketplace .ast-custom-button,
.entry-content .ast-custom-button {
  display: none !important;
}

/* ── RESET ── */
.cy-marketplace * { box-sizing: border-box; }

.cy-marketplace {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  font-family: 'Work Sans', sans-serif;
}

/* ── TOP BAR ── */
.cy-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.cy-topbar h1 {
  font-family: 'Work Sans', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  color: #111;
  text-transform: uppercase;
  margin: 0;
}

.cy-topbar h1 span { color: #111; }

.cy-topbar p {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

/* ── MY LIBRARY BUTTON ── */
.cy-lib-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FF6464;
  color: #fff !important;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 100px;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.15s, opacity 0.15s;
}
.cy-lib-btn:hover { transform: scale(1.04); opacity: 0.9; color: #fff !important; }

/* ── STATS ROW ── */
.cy-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.cy-stat {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}

.cy-stat-label {
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  color: #aaa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.cy-stat-val {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #111;
  line-height: 1.1;
}

.cy-stat-sub {
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  color: #3B6D11;
  margin-top: 2px;
}

/* ── PROMO BANNER ── */
.cy-promo {
  background: #FF6464;
  border-radius: 14px;
  padding: 1.3rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
  overflow: hidden;
  position: relative;
}

.cy-promo::after {
  content: 'SALE';
  position: absolute;
  right: -10px;
  top: -18px;
  font-family: 'Work Sans', sans-serif;
  font-size: 6rem;
  font-weight: 900;
  color: rgba(255,255,255,0.08);
  pointer-events: none;
  line-height: 1;
}

.cy-promo h3 {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.cy-promo p {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.cy-promo-cta {
  background: #fff;
  color: #FF6464 !important;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 100px;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none !important;
  transition: transform 0.15s;
}
.cy-promo-cta:hover { transform: scale(1.04); }

/* ── TOOLBAR ── */
.cy-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.cy-search-wrap { position: relative; flex: 1; min-width: 180px; }

.cy-search-wrap::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23aaa' stroke-width='2.5' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
}

.cy-search {
  width: 100%;
  padding: 0.6rem 0.9rem 0.6rem 36px;
  border-radius: 100px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.88rem;
  color: #111;
  outline: none;
  transition: border-color 0.2s;
}
.cy-search:focus { border-color: #FF6464; }
.cy-search::placeholder { color: #bbb; }

/* ── FILTER CHIPS ── */
.cy-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.cy-chip {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #555;
  padding: 0.42rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'Work Sans', sans-serif;
}
.cy-chip:hover { border-color: #FF6464; color: #FF6464; }
.cy-chip.active { background: #FF6464; border-color: #FF6464; color: #fff; font-weight: 600; }

.cy-sort {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #555;
  padding: 0.5rem 0.9rem;
  border-radius: 100px;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
}

/* ── RESULT META ── */
.cy-meta {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1.2rem;
}
.cy-meta strong { color: #111; font-weight: 600; }

/* ── PRODUCT GRID — 4 columns desktop ── */
.cy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
}

/* ── PRODUCT CARD — flex column so body grows and footer stays at bottom ── */
.cy-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
}
.cy-card:hover {
  transform: translateY(-4px);
  border-color: rgba(230,57,70,0.3);
  box-shadow: 0 8px 24px rgba(230,57,70,0.08);
}

.cy-card-img {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f3;
  position: relative;
  overflow: hidden;
}
.cy-card-img img { width: 100%; height: 100%; object-fit: cover; }

/* ── BADGES ── */
.cy-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: 'Work Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: uppercase;
  z-index: 2;
}
.cy-badge-sale { background: #FCEBEB; color: #A32D2D; }
.cy-badge-new  { background: #EAF3DE; color: #27500A; }
.cy-badge-hot  { background: #FAEEDA; color: #633806; }

/* Wishlist */
.cy-wish {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  z-index: 2;
  transition: all 0.15s;
  line-height: 1;
}
.cy-wish:hover, .cy-wish.active { background: #FCEBEB; border-color: #FF6464; color: #FF6464; }

/* ── CARD BODY — grows to fill card, pushes footer down ── */
.cy-card-body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cy-card-seller {
  font-family: 'Work Sans', sans-serif;
  font-size: 10px;
  color: #aaa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 3px;
}

.cy-card-name {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111 !important;
  margin-bottom: 6px;
  text-decoration: none !important;
  display: block;
  flex-grow: 1;
}
.cy-card-name:hover { color: #FF6464 !important; }

.cy-stars { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cy-stars .stars { color: #BA7517; font-size: 11px; letter-spacing: 1px; }
.cy-stars .count { font-family: 'Work Sans', sans-serif; font-size: 11px; color: #aaa; }

.cy-card-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  flex-wrap: nowrap;
}

.cy-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.cy-price {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
}

.cy-price-old {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.68rem;
  color: #ccc;
  text-decoration: line-through;
  white-space: nowrap;
}

/* ── BUY BUTTON — always stays on same line as price ── */
.cy-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #FF6464;
  color: #fff !important;
  border: none;
  border-radius: 100px;
  padding: 0.4rem 0.8rem;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: opacity 0.15s, transform 0.15s;
  line-height: 1.4;
}
.cy-buy-btn:hover { opacity: 0.88; transform: scale(1.03); color: #fff !important; }

/* ── TOAST ── */
.cy-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #111;
  color: #fff;
  padding: 0.75rem 1.4rem;
  border-radius: 100px;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 99999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.cy-toast.show { transform: translateY(0); opacity: 1; }

/* ── PAGINATION ── */
.cy-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.cy-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #555;
  font-size: 0.85rem;
  font-family: 'Work Sans', sans-serif;
  text-decoration: none;
  transition: all 0.15s;
}
.cy-pagination .page-numbers:hover { border-color: #FF6464; color: #FF6464; }
.cy-pagination .page-numbers.current {
  background: #FF6464;
  border-color: #FF6464;
  color: #fff;
  font-weight: 700;
}

/* ── HIDE OLD TABLE ── */
.wc-product-table-wrapper { display: none !important; }

/* ── RESPONSIVE: tablet → 3 cols ── */
@media (max-width: 1024px) {
  .cy-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── RESPONSIVE: mobile → 2 cols ── */
@media (max-width: 768px) {
  .cy-topbar h1 { font-size: 2rem; letter-spacing: -1px; }
  .cy-stats { grid-template-columns: repeat(2, 1fr); }
  .cy-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cy-toolbar { flex-direction: column; align-items: stretch; }
  .cy-search-wrap { min-width: 100%; }
}

/* ── RESPONSIVE: small mobile ── */
@media (max-width: 480px) {
  .cy-stats { grid-template-columns: 1fr; }
  .cy-promo { flex-direction: column; text-align: center; }
  .cy-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cy-card-img { height: 120px; }
  .cy-buy-btn { font-size: 0.68rem; padding: 0.38rem 0.65rem; }
}
