/* ==========================================================================
   MARKET 2.0 - SPLIT SELL/BUY ORDERS & MODERN CLEAN TRADE CARDS
   ========================================================================== */

/* Top Orders Nav Header Bar: 3 Columns (Sell / Buy / Trade) */
.m2-orders-nav-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 16px;
    align-items: center;
    padding: 10px 16px;
    background: #0d0f14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 16px;
}

.m2-nav-col {
    display: flex;
    align-items: center;
    min-width: 0;
}

.m2-nav-col-last {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}


.m2-order-title-tab {
    font-size: 0.90rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.m2-order-title-tab:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    color: #ffffff !important;
    opacity: 1;
}

.m2-order-title-tab.sell,
.m2-order-title-tab.buy,
.m2-order-title-tab.trade,
.m2-order-title-tab span {
    color: #ffffff !important;
}

.m2-order-title-tab.sell:hover {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 10px rgba(245, 158, 11, 0.15);
}

.m2-order-title-tab.buy:hover {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.15);
}

.m2-order-title-tab.trade:hover {
    border-color: rgba(192, 132, 252, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 10px rgba(192, 132, 252, 0.15);
}

.m2-order-count {
    color: #ffffff !important;
    opacity: 0.75;
    font-weight: 500;
    font-size: 0.84rem;
}

.m2-trades-stat {
    color: #9ca3af;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Orders Columns */
.m2-col-header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin-bottom: 12px;
}

.m2-col-title-badge {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m2-col-title-badge.sell { color: #f59e0b; }
.m2-col-title-badge.buy { color: #38bdf8; }
.m2-col-title-badge.trade { color: #c084fc; }

/* Base Trade Card (MetaForge Style: Clean, Borderless Panels, Highly Legible) */
.m2-trade-card {
    background: #111317;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    margin-bottom: 10px;
    min-width: 0;
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 0 115px;
}

.m2-trade-card:hover {
    background: #151820;
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Promoted Card (การ์ดที่กดโปรโมท: พื้นหลังเกรเดี้ยนสีเขียวไล่จากมุมซ้ายบน) */
.m2-trade-card.is-promoted,
.m2-trade-card.m2-card-promoted {
    background: radial-gradient(circle at 0% 0%, rgba(16, 185, 129, 0.26) 0%, rgba(16, 185, 129, 0.08) 45%, #111317 80%);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.10), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.m2-trade-card.is-promoted:hover,
.m2-trade-card.m2-card-promoted:hover {
    background: radial-gradient(circle at 0% 0%, rgba(16, 185, 129, 0.36) 0%, rgba(16, 185, 129, 0.12) 50%, #151820 85%);
    border-color: rgba(16, 185, 129, 0.60);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.20), 0 6px 20px rgba(0, 0, 0, 0.5);
}


.m2-card-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* 1. TOP HEADER ROW */
.m2-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.m2-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.m2-avatar-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.m2-avatar-wrap:hover .m2-avatar {
    border-color: rgba(255, 255, 255, 0.45);
    filter: brightness(1.15);
}

.m2-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #181b22;
    transition: border-color 0.15s ease, filter 0.15s ease;
}

.m2-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #eab308;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m2-online-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4b5563;
    border: 1.5px solid #111317;
}

.m2-online-dot.online {
    background: #22c55e;
    box-shadow: none;
}

.m2-user-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.m2-username {
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
    transition: color 0.15s;
    letter-spacing: 0.2px;
}

.m2-username:hover {
    color: #ffffff;
}

/* Rating Badge (Yellow Star & Theme Color) */
.m2-rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.28);
    padding: 0 5px;
    border-radius: 4px;
    white-space: nowrap;
    height: 18px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.m2-rating-pill:hover {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
}

.m2-rating-pill i {
    font-size: 0.65rem;
    color: #ffc107;
}

.m2-rating-cnt {
    color: #9ca3af;
    font-weight: 500;
}

/* Time ago */
.m2-time-ago {
    font-size: 0.72rem;
    color: #71717a;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Header Right Actions */
.m2-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.m2-stock-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.m2-stock-badge i {
    font-size: 0.72rem;
    color: #6b7280;
}

.m2-stock-val {
    color: #ffffff;
    font-weight: 700;
}

.m2-btn-action {
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 5px;
    text-decoration: none;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.m2-btn-login,
.m2-btn-deal {
    background: rgba(255, 255, 255, 0.04);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.m2-btn-login:hover,
.m2-btn-deal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

/* 2. TRADE COLUMNS (Split Layout - Expanded Left Side for Better Text Visibility) */
.m2-trade-columns {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin-top: 4px;
    position: relative;
    z-index: 2;
}

.m2-col-left {
    flex: 1.45 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}

.m2-col-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    margin-top: auto;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
    flex-shrink: 0;
    width: 14px;
}

.m2-col-arrow i {
    display: inline-block;
}

.m2-col-right {
    flex: 0.85 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}

/* Trade Orders: 50/50 Equal Split between Left & Right items */
#m2-col-trade .m2-col-left,
#m2-col-trade .m2-col-right,
.m2-card-trade .m2-col-left,
.m2-card-trade .m2-col-right {
    flex: 1 1 0;
}

#m2-col-trade .m2-trade-offer-side.has-want-item,
.m2-card-trade .m2-trade-offer-side.has-want-item {
    padding: 2px 6px 2px 2px;
    gap: 6px;
}

.m2-badge-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    min-width: 0;
    padding-left: 4px;
    overflow: hidden;
}

.m2-badge-pill {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1.35;
    flex-shrink: 0;
}

.m2-pill-selling {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.m2-pill-buying {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.m2-pill-trading {
    background: rgba(192, 132, 252, 0.14);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.25);
}

.m2-pill-bundle {
    background: rgba(236, 72, 153, 0.16);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.35);
    font-size: 0.74rem;
    letter-spacing: 0.5px;
}

.m2-badge-want {
    background: rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.m2-trade-desc {
    font-size: 0.72rem;
    color: #a1a1aa;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 105px;
    flex: 1;
}

/* 3. ITEM SIDE (Single Line - Icon + Name with Capsule Gradient) */
.m2-trade-item-side {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 38px;
    padding: 2px 6px 2px 2px;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #13161d;
    border: none;
    transition: filter 0.2s ease, background 0.2s ease;
    overflow: hidden;
}

.m2-item-box {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 5px;
    background: #14171d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1px;
    transition: transform 0.15s ease, filter 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.m2-trade-card:hover .m2-item-box {
    transform: scale(1.05);
}

/* Blueprint items with classic blueprint grid in order cards */
.m2-item-box.bg-blueprint-grid,
.m2-want-box.bg-blueprint-grid {
    background-color: #0046b8 !important;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px) !important;
    background-size: 16px 16px !important;
    background-position: center !important;
    border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
}

.m2-item-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.m2-bundle-pill {
    position: absolute;
    top: 1px;
    left: 1px;
    background: #ec4899;
    color: #fff;
    font-size: 0.52rem;
    font-weight: 800;
    padding: 1px 3px;
    border-radius: 2px;
    z-index: 3;
    line-height: 1;
}

.m2-item-name {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    letter-spacing: -0.25px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    display: block;
    min-width: 0;
    flex: 1;
}

.m2-item-name:hover {
    text-decoration: underline;
}

.m2-item-name.is-blueprint,
.m2-want-title.is-blueprint,
.is-blueprint {
    color: #9ca3af !important;
}

.m2-item-name.is-blueprint:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.m2-bundle-extra {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* 4. OFFER SIDE (Snug Fit & Tighter Spacing) */
.m2-trade-offer-side {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    min-width: 0;
    height: 38px;
    padding: 2px 8px;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #13161d;
    border: none;
    transition: filter 0.2s ease, background 0.2s ease;
    overflow: hidden;
}

.m2-trade-offer-side.has-want-item {
    padding: 2px 8px 2px 2px;
}

.m2-price-box {
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.m2-price-box:hover {
    opacity: 0.85;
}

.m2-price-val {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    color: #9ca3af;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.m2-price-unit {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.84rem;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.m2-price-symbol {
    color: #9ca3af !important;
    font-weight: 500 !important;
    margin-right: 1px;
}

.m2-want-item-box {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

.m2-want-item-box:hover .m2-want-title {
    color: #ffffff;
    text-decoration: underline;
}

.m2-open-offers-box {
    cursor: pointer;
    text-decoration: none;
}

.m2-want-box {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 5px;
    background: #14171d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
    position: relative;
    overflow: hidden;
}

.m2-want-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.m2-want-title {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: -0.25px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.m2-open-offers-box {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.m2-open-offers {
    font-size: 0.78rem;
    color: #a1a1aa;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   GRADIENT CAPSULES (Item Rarity & Offer/Price Types - Borderless)
   ========================================================================== */

/* 1. Item Rarity Gradients (ไล่สีจากซ้ายไปขวา - ไม่มีเส้นกรอบ) */
.m2-rarity-bg-common {
    background: linear-gradient(90deg, rgba(156, 163, 175, 0.18) 0%, rgba(156, 163, 175, 0.02) 75%, transparent 100%), #13161d;
}

.m2-rarity-bg-uncommon {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.22) 0%, rgba(34, 197, 94, 0.03) 75%, transparent 100%), #13161d;
}

.m2-rarity-bg-rare {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.22) 0%, rgba(56, 189, 248, 0.03) 75%, transparent 100%), #13161d;
}

.m2-rarity-bg-epic {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.24) 0%, rgba(236, 72, 153, 0.03) 75%, transparent 100%), #13161d;
}

.m2-rarity-bg-legendary {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.24) 0%, rgba(245, 158, 11, 0.03) 75%, transparent 100%), #13161d;
}

/* Blueprint (ไล่สีน้ำเงินพร้อมลายกริดจางๆ สไตล์ Blueprint แท้) */
.m2-rarity-bg-blueprint {
    background-color: #13161d !important;
    background-image:
        linear-gradient(90deg, rgba(19, 22, 29, 0) 0%, rgba(19, 22, 29, 0.65) 60%, #13161d 95%),
        linear-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 116, 233, 0.35) 0%, rgba(14, 116, 233, 0.05) 75%, transparent 100%) !important;
    background-size: auto, 16px 16px, 16px 16px, auto !important;
    background-position: center !important;
}

/* 2. Offer / Price Gradients (ไล่สีจากซ้ายไปขวา - ไม่มีเส้นกรอบ) */
/* Sell: สีเขียวจางๆ */
.m2-offer-bg-sell {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.03) 75%, transparent 100%), #13161d;
}

/* Buy: สีฟ้าจางๆ */
.m2-offer-bg-buy {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.22) 0%, rgba(14, 165, 233, 0.03) 75%, transparent 100%), #13161d;
}

/* Open to offers / Neutral */
.m2-offer-bg-offers {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 75%, transparent 100%), #13161d;
}

/* Subtle glow on hover */
.m2-trade-card:hover .m2-trade-item-side,
.m2-trade-card:hover .m2-trade-offer-side {
    filter: brightness(1.12);
}

/* ==========================================================================
   RARITY STYLES (Clean & Subtle Borders)
   ========================================================================== */

/* Common */
.rarity-text-common { color: #9ca3af !important; }
.m2-item-box.rarity-common,
.m2-want-mini-box.rarity-common {
    border: 1.5px solid rgba(156, 163, 175, 0.35);
}

/* Uncommon */
.rarity-text-uncommon { color: #4ade80 !important; }
.m2-item-box.rarity-uncommon,
.m2-want-mini-box.rarity-uncommon {
    border: 1.5px solid #22c55e;
    box-shadow: inset 0 0 6px rgba(34, 197, 94, 0.15);
}

/* Rare */
.rarity-text-rare { color: #38bdf8 !important; }
.m2-item-box.rarity-rare,
.m2-want-mini-box.rarity-rare {
    border: 1.5px solid #38bdf8;
    box-shadow: inset 0 0 6px rgba(56, 189, 248, 0.15);
}

/* Epic */
.rarity-text-epic { color: #ec4899 !important; }
.m2-item-box.rarity-epic,
.m2-want-mini-box.rarity-epic {
    border: 1.5px solid #ec4899;
    box-shadow: inset 0 0 8px rgba(236, 72, 153, 0.2);
}

/* Legendary */
.rarity-text-legendary {
    color: #f59e0b !important;
}
.m2-item-box.rarity-legendary,
.m2-want-mini-box.rarity-legendary {
    border: 1.5px solid #f59e0b;
    box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.22);
}

/* Switcher Top Banner */
.m2-preview-banner {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(20, 24, 32, 0.9) 50%, rgba(245, 158, 11, 0.12) 100%);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.m2-preview-banner .banner-text {
    font-size: 0.86rem;
    color: #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.m2-preview-banner .banner-btn {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 5px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.2s;
}

.m2-preview-banner .banner-btn:hover {
    background: #ffc107;
    color: #000;
    border-color: #ffc107;
}

/* Empty State Box */
.m2-empty-state {
    text-align: center;
    padding: 30px 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #71717a;
    font-size: 0.84rem;
}

/* Stretched Link for Entire Card Clickability */
.m2-card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
}

.m2-card-header,
.m2-item-box,
.m2-want-capsule,
.m2-btn-action,
.m2-username {
    position: relative;
    z-index: 5;
}

/* ==========================================================================
   LOAD MORE & INFINITE SCROLL
   ========================================================================== */
.m2-load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    margin-bottom: 24px;
    width: 100%;
}

.m2-btn-load-more {
    width: 100%;
    background: rgba(14, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f59e0b;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 12px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.m2-btn-load-more:hover {
    background: #151822;
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.12);
}

.m2-btn-load-more:active {
    transform: translateY(0);
}

.m2-btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.m2-scroll-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #a1a1aa;
    font-size: 0.82rem;
    padding: 16px 0;
    font-weight: 600;
}

/* ==========================================================================
   MOBILE, TABLET & IPAD RESPONSIVE SYSTEM
   ========================================================================== */

/* 1. Global Container & Overflow Prevention */
body, #marketPageWrapper {
    overflow-x: hidden;
}

/* 2. Top Filter Navigation Bar */
.market-filter-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    padding: 6px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.market-filter-nav::-webkit-scrollbar {
    display: none;
}

.market-pills-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.market-pills-row::-webkit-scrollbar {
    display: none;
}

.market-search-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.market-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Cinema Banner Defaults */
#marketBigBannerSlider {
    height: 212px;
}
.admin-banner-slot {
    height: 102px;
}

/* 3. Tablet & iPad Portrait ( < 992px ) */
@media (max-width: 991.98px) {
    /* Cinema Banner */
    #marketBigBannerSlider {
        height: 165px !important;
    }
    .admin-banner-slots {
        flex-direction: row !important;
    }
    .admin-banner-slot {
        height: 78px !important;
        flex: 1 1 0;
    }


    /* Interactive Segmented Tabs on Tablet/Mobile */
    .m2-orders-nav-bar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 5px !important;
        gap: 6px !important;
        background: #0d0f14 !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 10px !important;
        margin-bottom: 14px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .m2-orders-nav-bar::-webkit-scrollbar {
        display: none;
    }

    .m2-nav-col {
        flex: 1 1 0 !important;
        min-width: 80px;
        justify-content: center !important;
        padding: 8px 10px !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        text-align: center;
    }
    .m2-nav-col:hover {
        background: rgba(255, 255, 255, 0.05) !important;
    }

    .m2-nav-col.active.active-tab-sell {
        background: rgba(245, 158, 11, 0.15) !important;
        border-color: rgba(245, 158, 11, 0.5) !important;
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.2) !important;
    }
    .m2-nav-col.active.active-tab-sell .m2-order-title-tab.sell {
        color: #fbbf24 !important;
        font-weight: 800 !important;
    }

    .m2-nav-col.active.active-tab-buy {
        background: rgba(56, 189, 248, 0.15) !important;
        border-color: rgba(56, 189, 248, 0.5) !important;
        box-shadow: 0 0 12px rgba(56, 189, 248, 0.2) !important;
    }
    .m2-nav-col.active.active-tab-buy .m2-order-title-tab.buy {
        color: #38bdf8 !important;
        font-weight: 800 !important;
    }

    .m2-nav-col.active.active-tab-trade {
        background: rgba(192, 132, 252, 0.15) !important;
        border-color: rgba(192, 132, 252, 0.5) !important;
        box-shadow: 0 0 12px rgba(192, 132, 252, 0.2) !important;
    }
    .m2-nav-col.active.active-tab-trade .m2-order-title-tab.trade {
        color: #c084fc !important;
        font-weight: 800 !important;
    }

    .m2-nav-col.active.active-tab-all {
        background: rgba(34, 197, 94, 0.15) !important;
        border-color: rgba(34, 197, 94, 0.5) !important;
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.2) !important;
    }
    .m2-nav-col.active.active-tab-all .m2-order-title-tab.all {
        color: #4ade80 !important;
        font-weight: 800 !important;
    }

    .m2-order-title-tab {
        font-size: 0.85rem !important;
        gap: 5px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .m2-order-count {
        font-size: 0.78rem !important;
    }

    /* Column Switching Visibility on < 992px */
    .m2-tab-view-sell #m2-col-buy,
    .m2-tab-view-sell #m2-col-trade {
        display: none !important;
    }
    .m2-tab-view-buy #m2-col-sell,
    .m2-tab-view-buy #m2-col-trade {
        display: none !important;
    }
    .m2-tab-view-trade #m2-col-sell,
    .m2-tab-view-trade #m2-col-buy {
        display: none !important;
    }
    .m2-tab-view-all .m2-order-column {
        display: block !important;
    }

    /* Hide sub-headers inside columns since top tabs clearly show which column is active */
    .m2-col-header-wrap {
        display: none !important;
    }
}


/* 5. Small Phones ( < 576px ) */
@media (max-width: 575.98px) {
    #marketBigBannerSlider {
        height: 135px !important;
    }
    .admin-banner-slot {
        height: 64px !important;
    }
    .m2-order-title-tab {
        font-size: 0.76rem !important;
    }
    .m2-order-count {
        font-size: 0.72rem !important;
    }
    .m2-nav-col {
        padding: 7px 6px !important;
        min-width: 70px;
    }

    .m2-trade-card {
        padding: 9px 10px;
        gap: 5px;
    }
    .m2-avatar-wrap {
        width: 30px;
        height: 30px;
    }
    .m2-username {
        font-size: 0.8rem;
        max-width: 90px;
    }
    .m2-badge-pill {
        font-size: 0.74rem;
        padding: 2px 7px;
    }
    .m2-trade-item-side,
    .m2-trade-offer-side {
        height: 36px;
        padding: 2px 7px 2px 2px;
    }
    .m2-item-box,
    .m2-want-box {
        width: 30px;
        height: 30px;
    }
    .m2-item-name {
        font-size: 0.82rem;
    }
    .m2-col-arrow {
        height: 36px;
        font-size: 0.95rem;
    }
    .m2-price-val,
    .m2-price-unit {
        font-size: 0.80rem;
    }
    .m2-want-title {
        font-size: 0.78rem;
        max-width: 90px;
    }
}

/* 6. Desktop & Large Tablets ( >= 992px ) - Always force 3 columns visible */
@media (min-width: 992px) {
    .m2-order-column {
        display: block !important;
    }

    /* เส้นประคั่นสีเทาแนวตั้งบางๆ ระหว่างคอลัมน์การ์ด */
    #m2-col-buy {
        border-left: 1px dashed rgba(255, 255, 255, 0.16);
        border-right: 1px dashed rgba(255, 255, 255, 0.16);
    }
}


