/* =====================================================
   PRAM YARD — SWAP SYSTEM UI (FINAL, STABLE)
   Safari + Chrome + MarketKing compatible
   ===================================================== */


/* =====================================================
   MARKETKING SCROLL SAFETY
   ===================================================== */

/* Let MarketKing manage scroll normally */
body.marketking-dashboard {
  overflow: visible;
}

/* Gentle top padding inside the scroll area */
body.marketking-dashboard .simplebar-content {
padding-top: 88px !important;
  box-sizing: border-box !important;  padding-left: 32px;
  padding-right: 32px;
  padding-bottom: 160px;
  box-sizing: border-box;
}

/* FINAL: SimpleBar clipping fix — margin on direct child */
body.marketking-dashboard .simplebar-content > .py-swap-dashboard {
  margin-top: 90px !important;  /* clears fixed header */
}


/* =====================================================
   SWAP PAGE WRAPPER
   ===================================================== */

.py-swap-dashboard {
  max-width: 860px;
  padding-top: 100px;   /* keep your working vertical fix */
  margin-left: 0;
  margin-right: 0;
}

body.marketking-dashboard .simplebar-content {
  padding-left: 32px;
  padding-right: 32px;
}


/* Page title */
.py-page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}


/* =====================================================
   SWAP CARDS
   ===================================================== */

.py-swap-card {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

.py-swap-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}


/* =====================================================
   STATUS PILLS
   ===================================================== */

.py-swap-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.py-swap-status.status-pending {
  background: #fff4e5;
  color: #8a5a00;
}

.py-swap-status.status-accepted {
  background: #e6f4ea;
  color: #1e7f43;
}

.py-swap-status.status-declined {
  background: #fdecea;
  color: #a42828;
}

.py-swap-status.status-withdrawn {
  background: #f0f0f0;
  color: #666;
}


/* =====================================================
   ITEM SUMMARY
   ===================================================== */

.py-swap-card p {
  margin: 6px 0;
  font-size: 14px;
}


/* =====================================================
   ACTION BUTTONS
   ===================================================== */

.py-swap-action {
  margin-right: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
}

.py-swap-action[data-action="accept"] {
  background: #1e7f43;
  color: #ffffff;
  border-color: #1e7f43;
}

.py-swap-action[data-action="decline"] {
  background: #ffffff;
  color: #a42828;
  border-color: #a42828;
}

.py-swap-action[data-action="withdraw"] {
  background: #ffffff;
  color: #444;
  border-color: #aaa;
}


/* =====================================================
   BLOCKED / CONFIRMED PANELS
   ===================================================== */

.py-swap-blocked,
.py-swap-confirmed {
  margin-top: 14px;
  padding: 14px;
  background: #fafafa;
  border-radius: 10px;
  font-size: 14px;
}


/* =====================================================
   COLLECTION CONFIRM FORM
   ===================================================== */

.py-collection-confirm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.py-collection-confirm label {
  font-size: 13px;
  font-weight: 500;
}

.py-collection-confirm input,
.py-collection-confirm select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.py-collection-confirm button {
  align-self: flex-start;
  background: #1e7f43;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}


/* =====================================================
   MESSAGING
   ===================================================== */

.py-swap-messages {
  margin-top: 16px;
}

.py-messages-thread {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.py-swap-message-input {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
  margin-bottom: 6px;
}

.py-send-message {
  background: #444444;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}


/* =====================================================
   PRODUCT PAGE — SWAP GRID (UNCHANGED, SAFE)
   ===================================================== */

.py-swap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.py-swap-item {
  border: 1px solid #ddd;
  background: #ffffff;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  text-align: center;
}

.py-swap-item img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 6px;
}

.py-swap-item.active {
  outline: 3px solid #000000;
}


/* =====================================================
   LOCKED STATE (PRODUCT PAGE)
   ===================================================== */

.py-swap-locked {
  max-width: 480px;
  margin: 40px auto;
  padding: 24px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fafafa;
  text-align: center;
}

.py-swap-locked .button {
  background: #000000;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.py-swap-locked .button:hover {
  background: #333333;
}

/* =====================================================
   PRODUCT PAGE — SWAP GRID (HORIZONTAL SLIDER)
   ===================================================== */

.swap-grid {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 2px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.swap-grid::-webkit-scrollbar {
  display: none;
}

.swap-grid .swap-item {
  flex: 0 0 140px;
  width: 140px;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ddd;
  background: #ffffff;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  scroll-snap-align: start;
}

.swap-grid .swap-item img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 6px;
}

.swap-grid .swap-item.selected {
  outline: 2px solid #b08968;
  background: #faf6f1;
}

/* Selected indicator */
.swap-grid .swap-item {
  position: relative;
}

.swap-grid .swap-item.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: #b08968;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
}

.swap-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #666;
}

#pramyard-send-swap {
  margin-top: 12px;
  border-radius: 999px;
  padding: 10px 16px;
}

#pramyard-send-swap:not(:disabled) {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

#pramyard-send-swap:not(:disabled) {
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.swap-grid .swap-item.is-locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.swap-grid .swap-item.is-locked::after {
  content: "In another swap";
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  font-size: 11px;
  background: rgba(255,255,255,0.9);
  padding: 2px 4px;
  border-radius: 4px;
  text-align: center;
}

/* Swap dashboard thumbnails */
.py-swap-thumbs {
  display: flex;
  gap: 14px;
  margin: 10px 0 6px;
}

.py-swap-thumb {
  text-align: center;
  font-size: 11px;
  color: #666;
}

.py-swap-thumb img {
  width: 72px;
  height: auto;
  display: block;
  border-radius: 8px;
  margin-bottom: 4px;
}


.py-swap-thumbs {
  position: relative;
}


.py-swap-thumbs::after {
  content: "↔";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: #999;
  opacity: 0.6;
}

