/* ═══════════════════════════════════════════════
   SEEKERSPARK MARKETPLACE — Compact Discovery Feed
   ═══════════════════════════════════════════════ */

:root {
    --mp-bg: #f0f2f5;
    --mp-card: #ffffff;
    --mp-gold: #F5A623;
    --mp-gold-light: rgba(245,166,35,.08);
    --mp-dark: #0f172a;
    --mp-muted: #64748b;
    --mp-blue: #3b82f6;
    --mp-green: #22c55e;
    --mp-radius: 14px;
    --mp-shadow-sm: 0 2px 8px rgba(0,0,0,.04);
    --mp-shadow-md: 0 8px 24px rgba(0,0,0,.08);
    --mp-shadow-lg: 0 20px 50px rgba(0,0,0,.12);
    --navbar-h: 70px;
}

.marketplace-wrapper {
    background: var(--mp-bg);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ═══ HERO BANNER ═══ */
.mp-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f3460 100%);
    padding: 22px 0 0;
    position: relative;
    overflow: hidden;
}
.mp-hero::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(245,166,35,0.15) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
}

.mp-hero-inner { position: relative; z-index: 2; padding-bottom: 12px; }

/* Hero Row: title left, search right */
.mp-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 12px;
}
.mp-hero-text { flex-shrink: 0; }

.mp-hero-title { color: #fff; font-size: 1.4rem; font-weight: 800; margin-bottom: 2px; letter-spacing: -.5px; }
.mp-hero-title span { color: var(--mp-gold); }
.mp-hero-sub { color: rgba(255,255,255,.5); font-size: .78rem; margin: 0; }

/* Hero Search — fills remaining space */
.mp-hero-search { position: relative; flex: 1; max-width: 520px; margin: 0; }
.mp-hero-search input {
    width: 100%; height: 46px;
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.18);
    border-radius: 12px;
    padding: 0 120px 0 42px;
    font-size: .9rem; color: #fff;
    outline: none; backdrop-filter: blur(10px);
    transition: all .3s;
}
.mp-hero-search input::placeholder { color: rgba(255,255,255,.45); }
.mp-hero-search input:focus { border-color: var(--mp-gold); background: rgba(255,255,255,.16); box-shadow: 0 0 0 3px rgba(245,166,35,.12); }
.mp-hero-search .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.45); font-size: .85rem; }
.mp-hero-search .search-btn {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    background: var(--mp-gold); color: #1a1a2e; border: none;
    padding: 7px 18px; border-radius: 9px;
    font-weight: 800; font-size: .82rem; cursor: pointer; transition: all .2s;
}
.mp-hero-search .search-btn:hover { background: #ffc107; transform: translateY(-50%) scale(1.03); }

/* Category pills */
.mp-cat-pills { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.3) transparent; padding-bottom: 6px; }
.mp-cat-pills::-webkit-scrollbar { height: 4px; }
.mp-cat-pills::-webkit-scrollbar-track { background: transparent; }
.mp-cat-pills::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.mp-cat-pills::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }
.mp-cat-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border-radius: 50px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.8);
    font-size: .75rem; font-weight: 600;
    white-space: nowrap; text-decoration: none;
    transition: all .25s; flex-shrink: 0;
    backdrop-filter: blur(4px);
}
.mp-cat-pill:hover, .mp-cat-pill.active {
    background: var(--mp-gold); border-color: var(--mp-gold);
    color: #1a1a2e; transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245,166,35,.3);
}
.mp-cat-pill i { font-size: .65rem; }
.mp-cat-pill .mp-pill-count {
    background: rgba(255,255,255,.12); padding: 1px 6px;
    border-radius: 50px; font-size: .65rem; font-weight: 700;
}
.mp-cat-pill.active .mp-pill-count { background: rgba(26,26,46,.15); }

/* Hero bottom — clean straight edge */
.mp-hero-wave { display: none; }

/* ═══ STICKY FILTER BAR ═══ */
.mp-filter-bar {
    position: sticky; top: var(--navbar-h); z-index: 1040;
    background: #fff; border-bottom: 1px solid rgba(0,0,0,.05);
    transition: box-shadow .3s; overflow: visible;
    height: auto; /* fixed content height, no scroll */
}
.mp-filter-bar, .mp-filter-bar * { scrollbar-width: none; }
.mp-filter-bar::-webkit-scrollbar, .mp-filter-bar *::-webkit-scrollbar { display: none !important; }
.mp-filter-bar.scrolled { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.mp-filter-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 8px 0; overflow: visible;
}
.mp-filter-left { display: flex; align-items: center; gap: 6px; overflow: visible; flex: 1; }
.mp-filter-right { flex-shrink: 0; position: relative; overflow: visible; }

/* Nav Pill */
.nav-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 10px;
    font-size: .8rem; font-weight: 600;
    color: var(--mp-muted); background: #fff;
    border: 1.5px solid #e2e8f0;
    text-decoration: none; white-space: nowrap;
    transition: all .25s; cursor: pointer; flex-shrink: 0;
}
.nav-pill i:first-child { font-size: .72rem; }
.nav-pill:hover { color: var(--mp-dark); border-color: #cbd5e1; box-shadow: var(--mp-shadow-sm); }
.nav-pill.has-filter { color: var(--mp-gold); border-color: var(--mp-gold); background: var(--mp-gold-light); }
.pill-trending { color: #ef4444; }
.pill-trending:hover { border-color: #ef4444; background: rgba(239,68,68,.05); color: #ef4444; }
.mp-chevron { font-size: .5rem; margin-left: 2px; transition: transform .25s; }

.mp-result-count {
    font-size: .78rem; color: var(--mp-muted); font-weight: 500; white-space: nowrap;
    padding: 5px 10px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0;
}
.mp-result-count span { color: var(--mp-dark); font-weight: 700; }

/* ═══ DROPDOWNS ═══ */
.mp-dd { position: relative; }
.mp-dd.open .mp-chevron { transform: rotate(180deg); }
.mp-dd.open .nav-pill { color: var(--mp-dark); border-color: var(--mp-dark); }
.mp-dd-panel {
    position: absolute; top: 100%; margin-top: 6px; left: 0;
    min-width: 260px; max-height: 380px; overflow-y: auto;
    background: #fff; border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.16);
    padding: 6px; z-index: 99999;
    opacity: 0; visibility: hidden; transform: translateY(-5px);
    transition: opacity .2s, transform .2s; pointer-events: none; display: block !important;
}
.mp-dd-panel.mp-dd-right { left: auto; right: 0; }
.mp-dd.open .mp-dd-panel { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; pointer-events: auto !important; }
.mp-dd-panel::-webkit-scrollbar { width: 3px; display: block !important; }
.mp-dd-panel::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.mp-dd-header { padding: 8px 12px 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.ap-cart-action-group .text-white-50 {
    color: var(--mp-dark) !important;
    opacity: 0.9;
}

.ap-cart-action-group .input-group input.form-control.quantity-input {
    background: transparent !important;
    color: #fff !important;
    border: 1px solid var(--mp-gold) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    height: 32px !important;
    padding: 0 4px !important;
    text-align: center !important;
}

.ap-cart-action-group .input-group button {
    background: var(--mp-gold-light) !important;
    color: var(--mp-dark) !important;
    border: none !important;
    border-radius: 6px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    line-height: 1;
}

.ap-cart-action-group .input-group button:hover {
    background: var(--mp-gold) !important;
    color: #fff !important;
}
.mp-dd-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; font-size: .82rem; font-weight: 500; color: var(--mp-dark); text-decoration: none; transition: background .15s; }
.mp-dd-item i { width: 16px; text-align: center; color: var(--mp-muted); font-size: .72rem; }
.mp-dd-item:hover { background: #f8fafc; }
.mp-dd-item.active { background: var(--mp-gold-light); color: var(--mp-gold); font-weight: 700; }
.mp-dd-item.active i { color: var(--mp-gold); }
.mp-dd-badge { margin-left: auto; font-size: .65rem; color: #94a3b8; font-weight: 600; background: #f1f5f9; padding: 2px 7px; border-radius: 20px; }
.mp-dd-hint { margin-left: auto; font-size: .65rem; color: #94a3b8; }

/* ═══ PRODUCT GRID — COMPACT 6-COLUMN ═══ */
.mp-feed { padding-top: 14px; }

.mp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

/* ── COMPACT PRODUCT CARD ── */
.tk-card {
    background: var(--mp-card);
    border-radius: var(--mp-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,.04);
    transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s;
    animation: mp-fadeUp .45s ease both;
}
.tk-card:hover { transform: translateY(-6px); box-shadow: var(--mp-shadow-lg); }

.tk-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex: 1; }

/* Image — short square ratio */
.tk-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f1f5f9;
}
.tk-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tk-card:hover .tk-img { transform: scale(1.07); }

/* Badges */
.tk-badge {
    position: absolute; z-index: 3;
    font-size: .55rem; font-weight: 800;
    padding: 3px 7px; border-radius: 5px;
    text-transform: uppercase; letter-spacing: .5px;
    line-height: 1;
}
.tk-badge--new { top: 7px; left: 7px; background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.tk-badge--verified {
    top: 7px; right: 7px;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 0; border: 1.5px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.tk-badge--verified i { color: #fff; font-size: .55rem; }
.vbadge--blue { background: var(--mp-blue); }
.vbadge--bronze { background: linear-gradient(135deg, #cd7f32, #b87333); }
.vbadge--silver { background: linear-gradient(135deg, #94a3b8, #64748b); }
.vbadge--gold { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Price + Rating overlay at bottom of image */
.tk-price-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 8px 6px;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
    z-index: 2;
}
.tk-price {
    color: #fff; font-weight: 800; font-size: .78rem;
    letter-spacing: -.02em;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.tk-star {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(4px);
    padding: 2px 6px; border-radius: 5px;
    font-size: .6rem; font-weight: 700;
    color: var(--mp-dark);
    display: flex; align-items: center; gap: 2px;
}
.tk-star i { color: #facc15; font-size: .55rem; }

/* Body — ultra-compact */
.tk-body { padding: 7px 9px 4px; }
.tk-name {
    font-size: .74rem; font-weight: 700; color: var(--mp-dark);
    line-height: 1.25; margin: 0 0 3px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.tk-meta { display: flex; align-items: center; gap: 4px; }
.tk-seller-name {
    font-size: .62rem; color: var(--mp-muted);
    display: flex; align-items: center; gap: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tk-seller-name i { font-size: .52rem; color: var(--mp-gold); }

/* Quick action buttons — compact row */
.tk-quick-actions {
    display: flex; gap: 3px; padding: 3px 7px 7px;
    margin-top: auto;
}
.tk-qbtn {
    flex: 1; height: 26px; border-radius: 7px; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; cursor: pointer;
    transition: all .2s; text-decoration: none; color: inherit;
    background: #f1f5f9;
}
.tk-qbtn--call { color: var(--mp-dark); }
.tk-qbtn--wa { background: rgba(37,211,102,.08); color: #25d366; }
.tk-qbtn--share { color: var(--mp-muted); }
.tk-qbtn:hover { transform: scale(1.08); }
.tk-qbtn--call:hover { background: var(--mp-dark); color: #fff; }
.tk-qbtn--wa:hover { background: #25d366; color: #fff; }
.tk-qbtn--share:hover { background: var(--mp-gold); color: #fff; }

/* ═══ RESPONSIVE CTA VISIBILITY ═══ */
.mp-cta-lg { display: flex !important; }
.mp-cta-sm { display: none !important; }

@media (max-width: 991px) {
    .mp-cta-lg { display: none !important; }
    .mp-cta-sm { display: flex !important; }
}

/* ═══ SECTION DIVIDERS ═══ */
.mp-section-divider {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0 2px;
}
.mp-section-divider h3 { font-size: .8rem; font-weight: 800; color: var(--mp-dark); white-space: nowrap; margin: 0; }
.mp-section-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, #e2e8f0, transparent); }
.mp-divider-icon { font-size: .7rem; color: var(--mp-gold); }

/* ═══ CTA CARD ═══ */
.mp-cta-wrapper {
    grid-column: span 1;
    display: flex;
    width: 100%;
}

@media (max-width: 991px) {
    .mp-cta-wrapper {
        grid-column: 1 / -1;
    }
}

.tk-cta {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--mp-radius); overflow: hidden;
    position: relative; display: flex;
    align-items: center; justify-content: center;
    text-align: center; min-height: auto;
    border: 1px solid rgba(255,255,255,.06);
    width: 100%;
}
.tk-cta-inner { position: relative; z-index: 2; padding: 18px 14px; }
.tk-cta-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.2rem; }
.tk-cta h3 { color: #fff; font-size: .95rem; font-weight: 800; margin-bottom: 4px; }
.tk-cta p { color: rgba(255,255,255,.55); font-size: .72rem; margin-bottom: 12px; line-height: 1.4; }
.tk-cta-link { display: inline-block; color: #fff; padding: 7px 18px; border-radius: 50px; font-weight: 700; font-size: .78rem; text-decoration: none; transition: all .3s; }
.tk-cta-link:hover { transform: translateY(-2px); filter: brightness(1.1); color: #fff; }
.tk-cta::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 30px solid rgba(255,255,255,.03); top: -50px; right: -50px; }

/* ═══ LOADER / EMPTY / BACK-TOP ═══ */
.mp-loader { padding: 30px 0; text-align: center; }
/* Updated spinner with animated dots */
.mp-spinner {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}
.mp-spinner::before,
.mp-spinner::after,
.mp-spinner div {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--mp-gold);
    border-radius: 50%;
    animation: mp-bounce 1s infinite ease-in-out;
}
.mp-spinner::before { animation-delay: -0.3s; }
.mp-spinner::after { animation-delay: 0.3s; }
@keyframes mp-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Quantity input visibility adjustments */
.quantity-input {
    width: 55px;
    text-align: center;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 600;
    color: #212529 !important;
    -moz-appearance: textfield; /* hide spinners in Firefox */
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input-group button {
    background: var(--mp-gold-light);
    border: none;
    color: var(--mp-dark);
    font-weight: 700;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-end-msg { text-align: center; padding: 20px 0; color: var(--mp-muted); font-size: .8rem; grid-column: 1 / -1; }

.mp-empty { text-align: center; padding: 60px 16px; grid-column: 1 / -1; }
.mp-empty-icon { width: 70px; height: 70px; background: #f1f5f9; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #cbd5e1; margin-bottom: 16px; }
.mp-empty h3 { font-weight: 700; color: var(--mp-dark); margin-bottom: 6px; font-size: 1rem; }
.mp-empty p { color: var(--mp-muted); max-width: 320px; margin: 0 auto; font-size: .82rem; }

.mp-back-top {
    position: fixed; bottom: 24px; right: 20px;
    width: 42px; height: 42px; border-radius: 11px;
    background: var(--mp-dark); border: 2px solid var(--mp-gold);
    color: var(--mp-gold); font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2000;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all .4s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.mp-back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.mp-back-top:hover { transform: translateY(-4px); }

/* ═══ ANIMATIONS ═══ */
@keyframes mp-fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tk-card:nth-child(1) { animation-delay: .02s; }
.tk-card:nth-child(2) { animation-delay: .04s; }
.tk-card:nth-child(3) { animation-delay: .06s; }
.tk-card:nth-child(4) { animation-delay: .08s; }
.tk-card:nth-child(5) { animation-delay: .1s; }
.tk-card:nth-child(6) { animation-delay: .12s; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1400px) { }
/* Grid is handled in the top section */

@media (max-width: 991px) {
    :root { --navbar-h: 80px; }
    .mp-hero { padding-top: 0.5rem; }
    .mp-hero-row { flex-direction: column; align-items: stretch; gap: 1rem; }
    .mp-hero-title { font-size: 1.15rem; }
    .mp-hero-search input { height: 40px; font-size: .82rem; }
    .mp-hero-search .search-btn { padding: 6px 14px; font-size: .78rem; }
    .tk-name { font-size: .7rem; }
    .tk-price { font-size: .72rem; }
    .nav-pill { padding: 6px 10px; font-size: .75rem; border-radius: 8px; }
    .mp-result-count { display: none; }
}

@media (max-width: 600px) {
    .mp-hero-title { font-size: 1rem; }
    .mp-hero-sub { display: none; }
    .mp-hero-search input { padding-right: 90px; }
    .mp-hero-search .search-btn { padding: 6px 12px; font-size: .75rem; }
    .mp-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .tk-name { -webkit-line-clamp: 1; font-size: .68rem; }
    .tk-seller-name { display: none; }
    .tk-quick-actions { padding: 2px 5px 5px; }
    .tk-qbtn { height: 24px; font-size: .62rem; border-radius: 6px; }
    .tk-price { font-size: .68rem; }
    .tk-badge { font-size: .5rem; padding: 2px 5px; }
    .nav-pill span, .mp-chevron { display: none !important; }
    .nav-pill { padding: 8px 11px; }
    .tk-cta { grid-column: span 2; min-height: 160px; }
    .tk-cta h3 { font-size: .85rem; }
}
