/* ============================================================================
   Marketplace Module CSS — v1.2 Design System
   Matching mockup: marketplace-browse.html
   Colors: --green:#1c6b45, --orange:#f59e0b, --gold:#d4a017
============================================================================ */

:root {
    --mkt-green: #1c6b45;
    --mkt-green-dark: #145235;
    --mkt-green-light: #e8f5ee;
    --mkt-orange: #f59e0b;
    --mkt-gold: #d4a017;
    --mkt-text: #1a1a2e;
    --mkt-muted: #6b7280;
    --mkt-border: #e5e7eb;
    --mkt-bg: #f8fafc;
}

/* Prevent horizontal scrollbar on marketplace pages */
html:has(.marketplace-layout),
body:has(.marketplace-layout) {
    overflow-x: hidden;
}

/* === Layout: Sidebar + Content + Right Panel === */
.marketplace-layout {
    display: flex;
    gap: 0;
    margin: 0 -15px;
    width: calc(100% + 30px);
}

/* === Left Sidebar (Marketplace only) === */
.marketplace-sidebar {
    width: 200px;
    min-width: 200px;
    background: #fff;
    border-right: 1px solid var(--mkt-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--mkt-text);
    border-bottom: 1px solid var(--mkt-border);
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.sidebar-section-label {
    padding: 12px 18px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mkt-muted);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background: var(--mkt-green-light);
    color: var(--mkt-green);
}

.sidebar-nav-item.active {
    background: var(--mkt-green-light);
    color: var(--mkt-green);
    font-weight: 600;
    border-left-color: var(--mkt-green);
}

.sidebar-nav-item i { width: 18px; text-align: center; font-size: 13px; }

.sidebar-help {
    padding: 14px 18px;
    font-size: 12px;
    color: var(--mkt-muted);
    border-top: 1px solid var(--mkt-border);
}
.sidebar-help a { color: var(--mkt-green); text-decoration: none; font-weight: 500; display: flex; align-items: center; }
.sidebar-help a:hover { text-decoration: underline; }

.sidebar-impact-card {
    margin: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #1c6b45, #145235);
    border-radius: 12px;
    color: #fff;
}
.sidebar-impact-card .impact-card-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}
.sidebar-impact-card .impact-card-title i { margin-right: 4px; }
.sidebar-impact-card .impact-card-stats { display: flex; flex-direction: column; gap: 8px; }
.sidebar-impact-card .impact-stat { font-size: 11px; opacity: 0.9; }
.sidebar-impact-card .impact-stat strong { font-size: 20px; font-weight: 700; display: block; line-height: 1.1; margin-bottom: 2px; }

/* === Main Content Area === */
.marketplace-content {
    flex: 1;
    padding: 20px 24px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* === Right Sidebar === */
.marketplace-right-sidebar {
    width: 290px;
    min-width: 290px;
    padding: 20px 14px;
}

/* === Loyalty Banner === */
.loyalty-banner {
    background: linear-gradient(135deg, #1a3c34, #1c5a45);
    border-radius: 16px;
    padding: 14px 24px;
    margin-bottom: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.loyalty-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.loyalty-medal {
    width: 42px; height: 42px;
    background: radial-gradient(circle, #d4a017 60%, #b8860b 100%);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    flex-shrink: 0;
}

.loyalty-medal::after {
    content: '';
    position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
    border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 7px solid #b8860b;
}

.loyalty-text .l-small { font-size: 11px; opacity: 0.8; }
.loyalty-text .l-level { font-size: 18px; font-weight: 800; color: #d4a017; }
.loyalty-text .l-xp { font-size: 12px; font-weight: 600; }

.loyalty-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.3); margin: 0 20px; }

.loyalty-center { flex-shrink: 0; white-space: nowrap; }
.loyalty-center .lc-label { font-size: 11px; opacity: 0.75; }
.loyalty-center .lc-value { font-size: 18px; font-weight: 800; margin: 2px 0; }
.loyalty-center .lc-sub { font-size: 11px; opacity: 0.75; }

.loyalty-right { flex: 1; min-width: 0; }
.loyalty-right .lr-label { font-size: 12px; opacity: 0.9; margin-bottom: 6px; }
.loyalty-right .lr-label strong { font-weight: 800; }
.loyalty-right .lr-bar { background: rgba(255,255,255,0.2); border-radius: 10px; height: 8px; overflow: hidden; margin-bottom: 4px; }
.loyalty-right .lr-bar-fill { background: linear-gradient(90deg, #22c55e, #16a34a); height: 100%; border-radius: 10px; }
.loyalty-right .lr-info { font-size: 11px; opacity: 0.7; text-align: right; }

/* === Inner Row: Filters + Products === */
.marketplace-inner-row {
    display: flex;
    gap: 20px;
    flex: 1;
}

/* === Left Filters Panel === */
.filters { width: 180px; flex-shrink: 0; }
.filter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.filter-reset { color: var(--mkt-green); font-size: 12px; text-decoration: none; font-weight: 400; }
.filter-section { margin-bottom: 18px; }
.filter-section h4 { font-size: 12px; font-weight: 600; color: var(--mkt-text); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; color: var(--mkt-muted); cursor: pointer; }
.filter-option input[type=radio], .filter-option input[type=checkbox] { accent-color: var(--mkt-green); }
.filter-option.active { color: var(--mkt-text); font-weight: 500; }
.price-range { padding: 4px 0; }
.price-range input[type=range] { width: 100%; accent-color: var(--mkt-green); }
.range-green { accent-color: var(--mkt-green); }

/* Dual range slider (min/max on one bar) */
.dual-range {
    position: relative;
    height: 20px;
}
.dual-range-track {
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
}
.dual-range-fill {
    position: absolute;
    top: 9px;
    height: 4px;
    background: var(--mkt-green);
    border-radius: 2px;
    left: 0;
    width: 100%;
}
.dual-range input[type=range] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
.dual-range input[type=range]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border-radius: 2px;
}
.dual-range input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 16px;
    height: 16px;
    background: var(--mkt-green);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
    margin-top: -6px;
}
.dual-range input[type=range]::-moz-range-track {
    height: 4px;
    background: transparent;
    border-radius: 2px;
}
.dual-range input[type=range]::-moz-range-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    background: var(--mkt-green);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
}
.price-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--mkt-muted); margin-top: 4px; }
.stars-row { display: flex; gap: 2px; font-size: 14px; color: var(--mkt-orange); }
.stars-row span { font-size: 12px; color: var(--mkt-muted); margin-left: 4px; }
.region-select { width: 100%; padding: 7px 10px; border: 1px solid var(--mkt-border); border-radius: 8px; font-size: 13px; color: var(--mkt-muted); outline: none; background: #fff; }

/* === Products Area === */
.products-area { flex: 1; min-width: 0; }
.products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.products-count { font-size: 13px; color: var(--mkt-muted); }
.products-count span { font-weight: 600; color: var(--mkt-text); }
.sort-row { display: flex; align-items: center; gap: 10px; }
.sort-label { font-size: 13px; color: var(--mkt-muted); }
.sort-select { padding: 6px 10px; border: 1px solid var(--mkt-border); border-radius: 8px; font-size: 13px; outline: none; }
.view-btns { display: flex; gap: 4px; }
.view-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--mkt-border); border-radius: 6px; cursor: pointer; color: var(--mkt-muted); font-size: 13px; transition: .15s; }
.view-btn:hover { border-color: var(--mkt-green); color: var(--mkt-green); }
.view-btn.active { background: var(--mkt-green); color: #fff; border-color: var(--mkt-green); }

.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}
.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    min-height: 110px;
}
.products-grid.list-view .product-card-image {
    width: 200px;
    min-width: 200px;
    height: auto;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
}
.products-grid.list-view .product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 100%;
}
.products-grid.list-view .product-card-body {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    overflow: hidden;
    max-width: 400px;
}
.products-grid.list-view .product-card-body .product-title {
    font-size: 13px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.products-grid.list-view .product-card-body .card-seller {
    font-size: 11px;
    margin-bottom: 1px;
}
.products-grid.list-view .product-card-body .impact-score {
    font-size: 11px;
    margin: 1px 0;
}
.products-grid.list-view .product-card-body .product-price-row {
    margin: 2px 0;
}
.products-grid.list-view .product-card-body .product-savings,
.products-grid.list-view .product-card-body .product-xp,
.products-grid.list-view .product-card-body .product-rating {
    font-size: 11px;
    margin: 0;
}
.products-grid.list-view .product-card-footer {
    border-top: none;
    border-left: 1px solid #f1f5f9;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    min-width: 170px;
}

/* Domain tags in product card - hidden in grid, shown in list */
.product-domains-list {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.products-grid.list-view .product-domains-list {
    display: flex;
}
.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    font-size: 11px;
    color: #166534;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.domain-tag:hover {
    background: #dcfce7;
    border-color: #1c6b45;
    color: #14532d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(28, 107, 69, 0.15);
}
.domain-tag i {
    font-size: 10px;
    color: #1c6b45;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    gap: 14px;
}

/* === Product Card === */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-card-image { position: relative; height: 150px; overflow: hidden; background: var(--mkt-bg); }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }

.product-card-image .type-badge {
    position: absolute; top: 10px; left: 10px;
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 4px; letter-spacing: 0.3px;
}

.type-badge-product { background: #4ade80; color: #166534; }
.type-badge-service { background: #60a5fa; color: #1e3a8a; }
.type-badge-experience { background: #a78bfa; color: #4c1d95; }

.product-card-image .favorite-btn {
    position: absolute; top: 10px; right: 10px;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.9); border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--mkt-muted); transition: 0.2s;
}

.product-card-image .favorite-btn:hover { color: #ef4444; }
.product-card-image .favorite-btn.favorited { color: #ef4444; }
.product-card-image .favorite-btn.favorited i { color: #ef4444; }

.product-card-body { padding: 10px 12px; flex: 1; }
.product-card-body .product-title { font-size: 13px; font-weight: 700; margin: 0 0 2px; line-height: 1.3; }
.product-card-body .product-title a { color: var(--mkt-text); text-decoration: none; }
.product-card-body .product-title a:hover { color: var(--mkt-green); }
.product-card-body .card-seller { font-size: 11px; color: var(--mkt-muted); margin-bottom: 8px; }
.product-card-body .impact-score { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--mkt-green); margin-bottom: 8px; font-weight: 500; }

.product-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.price-original { font-size: 12px; color: var(--mkt-muted); text-decoration: line-through; }
.price-final { font-size: 17px; font-weight: 800; color: var(--mkt-text); }
.discount-badge { background: #dcfce7; color: #166534; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }

.product-savings { margin-bottom: 6px; }
.product-savings .savings-text { font-size: 11px; color: var(--mkt-green); font-weight: 500; }
.product-savings .cap-warning { font-size: 11px; color: var(--mkt-orange); font-weight: 500; }

.product-xp { font-size: 11px; color: var(--mkt-orange); font-weight: 600; margin-bottom: 8px; }
.product-xp i { margin-right: 3px; }

.product-rating { font-size: 12px; color: var(--mkt-orange); }
.product-rating span { color: var(--mkt-muted); margin-left: 4px; }

/* === Card Footer: Level Bar === */
.product-card-footer { padding: 0 14px 12px; }

.level-bar {
    background: var(--mkt-bg); border-radius: 8px; padding: 6px 10px;
    display: flex; align-items: center; gap: 6px; font-size: 11px;
    margin-bottom: 6px;
}

.level-bar .level-icon {
    width: 18px; height: 18px; background: var(--mkt-orange); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: #fff; font-weight: 700;
}

.level-bar .level-xp { font-weight: 600; color: var(--mkt-text); }
.level-bar .level-next { margin-left: auto; font-size: 10px; color: var(--mkt-muted); }

.whatsapp-cta-link {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    color: #25D366; font-size: 12px; font-weight: 600; text-decoration: none;
    padding: 4px 0;
}

.whatsapp-cta-link:hover { color: #1da851; }

/* === Right Sidebar Cards === */
.fidelity-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 16px; }
.fidelity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.fidelity-header h3 { font-size: 13px; font-weight: 700; margin: 0; }
.fidelity-header .see-all { font-size: 11px; color: var(--mkt-green); text-decoration: none; }

.fidelity-xp-display { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fidelity-xp-display .xp-value strong { font-size: 28px; font-weight: 800; color: var(--mkt-text); display: block; }
.fidelity-xp-display .xp-label { font-size: 11px; color: var(--mkt-muted); }

.fidelity-discount-box {
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
    padding: 14px; text-align: center; margin: 12px 0;
}
.fidelity-discount-box .discount-label { display: block; font-size: 11px; color: var(--mkt-muted); margin-bottom: 4px; }
.fidelity-discount-box .discount-value { display: block; font-size: 32px; font-weight: 800; color: var(--mkt-green); }
.fidelity-discount-box .discount-sub { display: block; font-size: 11px; color: var(--mkt-muted); }

.fidelity-progression { margin-bottom: 12px; }
.fidelity-progression h4 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; color: var(--mkt-muted); }
.fidelity-progression .progression-remaining strong { font-size: 13px; color: var(--mkt-text); }
.fidelity-progression .progression-target { font-size: 12px; color: var(--mkt-muted); margin-bottom: 8px; }

.progression-bar { background: var(--mkt-border); border-radius: 10px; height: 7px; overflow: hidden; margin-bottom: 4px; }
.progression-bar-fill { background: var(--mkt-green); height: 100%; border-radius: 10px; }
.progression-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--mkt-muted); }

.fidelity-advantages h4 { font-size: 13px; font-weight: 700; margin: 0 0 12px; }
.fidelity-advantages ul { list-style: none; padding: 0; margin: 0; }
.fidelity-advantages li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; color: #4b5563; }
.fidelity-advantages .adv-circle { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.fidelity-help { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--mkt-border); text-align: center; }

/* Missions section */
.fidelity-missions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--mkt-border); }
.fidelity-missions .missions-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.fidelity-missions .missions-header h4 { font-size: 13px; font-weight: 700; margin: 0; }
.fidelity-missions .missions-header a { font-size: 11px; color: var(--mkt-green); text-decoration: none; font-weight: 600; }
.mission-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.mission-item:last-child { border-bottom: none; }
.mission-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: #6b7280; font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.mission-content { flex: 1; min-width: 0; }
.mission-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mission-name { font-size: 12px; font-weight: 500; color: var(--mkt-text); }
.mission-xp { font-size: 11px; font-weight: 700; color: var(--mkt-text); white-space: nowrap; }
.mission-progress-bar { height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; }
.mission-progress-fill { height: 100%; background: var(--mkt-green); border-radius: 2px; }
.mission-count { font-size: 10px; color: #9ca3af; text-align: right; margin-top: 2px; }
.fidelity-help p { font-size: 12px; color: var(--mkt-muted); margin-bottom: 8px; }

.whatsapp-help-btn {
    width: 100%; background: #25D366; color: #fff; border: none;
    padding: 10px; border-radius: 8px; font-size: 13px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.whatsapp-help-btn:hover { background: #1ebe5a; color: #fff; text-decoration: none; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--mkt-muted);
    grid-column: 1 / -1;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid var(--mkt-border);
}
.empty-state i { margin-bottom: 16px; color: #d1d5db; font-size: 48px; display: block; }
.empty-state p { font-size: 14px; margin: 0 0 16px; }
.empty-state .btn { border-radius: 8px; }

/* === Pagination === */
.pagination-wrap { display: flex; justify-content: center; margin-top: 24px; }

/* === Page Header Row === */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mkt-border);
}
.page-header-row h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--mkt-text);
}
.page-header-row .btn {
    background: var(--mkt-green);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.page-header-row .btn:hover { background: #145235; color: #fff; }

/* === Marketplace Sub-Page Content (my-items, my-orders, etc.) === */
.marketplace-content h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--mkt-text);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mkt-border);
}

/* Marketplace tables */
.marketplace-content .table-responsive {
    border-radius: 10px;
    border: 1px solid var(--mkt-border);
    overflow: hidden;
}
.marketplace-content .table {
    margin: 0;
    font-size: 13px;
    width: 100%;
    border-collapse: collapse;
}
.marketplace-content .table thead {
    background: #f8fafc;
}
.marketplace-content .table thead th {
    padding: 12px 14px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 1px solid var(--mkt-border);
    white-space: nowrap;
}
.marketplace-content .table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: var(--mkt-text);
}
.marketplace-content .table tbody tr:last-child td { border-bottom: none; }
.marketplace-content .table tbody tr:hover { background: #fafbfc; }

/* Badges in tables */
.marketplace-content .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
}
.marketplace-content .badge-warning { background: #fef3c7; color: #92400e; }
.marketplace-content .badge-success { background: #d1fae5; color: #065f46; }
.marketplace-content .badge-danger { background: #fee2e2; color: #991b1b; }
.marketplace-content .badge-info { background: #dbeafe; color: #1e40af; }
.marketplace-content .badge-secondary { background: #f3f4f6; color: #4b5563; }

/* Action buttons in tables */
.marketplace-content .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}
.marketplace-content .btn-outline-primary {
    color: var(--mkt-green);
    border-color: var(--mkt-green);
    background: transparent;
}
.marketplace-content .btn-outline-primary:hover {
    background: var(--mkt-green);
    color: #fff;
}
.marketplace-content .btn-outline-danger {
    color: #ef4444;
    border-color: #ef4444;
    background: transparent;
}
.marketplace-content .btn-outline-danger:hover {
    background: #ef4444;
    color: #fff;
}

/* Flash messages */
.marketplace-content .alert {
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    margin-bottom: 16px;
    border: none;
}
.marketplace-content .alert-success { background: #d1fae5; color: #065f46; }
.marketplace-content .alert-danger { background: #fee2e2; color: #991b1b; }

/* === Sell Form === */
.sell-section {
    background: #fff;
    border: 1px solid var(--mkt-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}
.sell-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--mkt-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sell-section-title i { color: var(--mkt-green); font-size: 14px; }

.sell-field { margin-bottom: 16px; }
.sell-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.sell-field label .required { color: #ef4444; }
.sell-field input[type="text"],
.sell-field input[type="number"],
.sell-field textarea,
.sell-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: var(--mkt-text);
    transition: border-color .2s;
    background: #fff;
}
.sell-field input:focus,
.sell-field textarea:focus,
.sell-field select:focus {
    outline: none;
    border-color: var(--mkt-green);
    box-shadow: 0 0 0 3px rgba(28,107,69,.1);
}
.sell-field input[type="range"] { width: 100%; cursor: pointer; }
.sell-range-value {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--mkt-green);
    margin-top: 4px;
}
.sell-hint { display: block; font-size: 11px; color: #9ca3af; margin-top: 4px; }

.sell-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sell-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.sell-input-prefix {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}
.sell-input-group input {
    border-radius: 0 8px 8px 0 !important;
    flex: 1;
}
.sell-input-status {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 16px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.sell-input-status.valid { color: #22c55e; }
.sell-input-status.invalid { color: #ef4444; }
.sell-input-status.pending { color: #9ca3af; }
.sell-input-group { display: flex; align-items: stretch; position: relative; }

.sell-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: .2s;
    background: #fafbfc;
}
.sell-upload-area:hover { border-color: var(--mkt-green); background: var(--mkt-green-light); }
.sell-upload-area i { font-size: 32px; color: #9ca3af; margin-bottom: 8px; display: block; }
.sell-upload-area p { font-size: 14px; font-weight: 600; color: #374151; margin: 0 0 4px; }
.sell-upload-area span { font-size: 12px; color: #9ca3af; }

.sell-image-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sell-preview-img { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 2px solid #e5e7eb; }
.sell-preview-img:first-child { border-color: var(--mkt-green); }
.sell-preview-img img { width: 100%; height: 100%; object-fit: cover; }
.sell-preview-img span {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--mkt-green); color: #fff; font-size: 9px; text-align: center; padding: 1px 0; font-weight: 700;
}

.sell-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}
.sell-submit-note {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sell-submit-note i { color: #9ca3af; }
.sell-submit-btn {
    background: var(--mkt-green);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: .2s;
}
.sell-submit-btn:hover { background: var(--mkt-green-dark); }

@media (max-width: 768px) {
    .sell-row-2, .sell-row-3 { grid-template-columns: 1fr; }
    .sell-submit-row { flex-direction: column; align-items: stretch; }
}

/* === Status Tabs === */
.status-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.status-tab { padding: 0.5rem 1rem; border-radius: 20px; font-size: 13px; text-decoration: none; color: var(--mkt-muted); background: #f3f4f6; }
.status-tab.active { background: var(--mkt-green); color: #fff; }

/* === Detail Page === */
.breadcrumb-nav { font-size: 12px; margin-bottom: 16px; color: var(--mkt-muted); }
.breadcrumb-nav a { color: var(--mkt-green); text-decoration: none; }

/* Page body: 2-column grid (detail page) */
.page-body { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; padding: 16px 0 40px; align-items: flex-start; }

/* LEFT COLUMN */
.left-col { min-width: 0; position: relative; }
.product-title { font-size: 22px; font-weight: 800; color: var(--mkt-text); margin-bottom: 8px; line-height: 1.25; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--mkt-muted); }
.meta-item i { font-size: 12px; }
.meta-verified { color: var(--mkt-green); font-weight: 600; }
.meta-stars { display: flex; align-items: center; gap: 3px; font-size: 13px; color: var(--mkt-orange); }
.meta-stars span { color: var(--mkt-muted); font-size: 12px; margin-left: 3px; }

/* Gallery row: image 65% + impact side 35% */
.gallery-row { display: flex; gap: 20px; margin-bottom: 0; align-items: flex-start; }
.gallery-wrap { flex: 0 0 65%; min-width: 0; overflow: hidden; }
.gallery-main-img { position: relative; border-radius: 12px; overflow: hidden; height: 380px; background: #f3f4f6; }
.gallery-main-img img { width: 100%; height: 100%; object-fit: contain; }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; background: rgba(255,255,255,0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; color: var(--mkt-text); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; margin-bottom: 16px; overflow: hidden; width: 100%; }
.gallery-thumb { flex: 1; min-width: 0; height: 68px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.gallery-thumb.active { border-color: var(--mkt-green); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Impact side card + description (35%) */
.impact-side { flex: 0 0 35%; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.impact-card { background: var(--mkt-green-light); border-radius: 12px; padding: 14px; }
.impact-card-title { font-size: 12px; font-weight: 700; color: var(--mkt-text); margin-bottom: 10px; }
.impact-item { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 9px; }
.impact-item:last-child { margin-bottom: 0; }
.impact-icon { width: 30px; height: 30px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.impact-txt strong { display: block; font-size: 12px; font-weight: 600; color: var(--mkt-text); line-height: 1.2; }
.impact-txt span { font-size: 10px; color: var(--mkt-muted); }

/* Description area */
.desc-text { font-size: 13px; color: var(--mkt-muted); line-height: 1.7; }
.view-more { color: var(--mkt-green); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.delivery-col { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.delivery-badge { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--mkt-muted); white-space: nowrap; }
.delivery-badge i { color: var(--mkt-green); font-size: 12px; }

/* Bottom section: Tabs + Rating (70/30) */
.detail-bottom-row { display: flex; gap: 20px; align-items: flex-start; margin-top: 20px; }
.detail-tabs-section { flex: 0 0 70%; min-width: 0; }
.detail-rating-section { flex: 0 0 28%; min-width: 0; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--mkt-border); margin-bottom: 14px; }
.tab { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--mkt-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: 0.15s; }
.tab:hover { color: var(--mkt-green); }
.tab.active { color: var(--mkt-green); border-bottom-color: var(--mkt-green); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Checklist */
.check-list { margin-bottom: 14px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mkt-muted); padding: 3px 0; }
.check-item i { color: var(--mkt-green); font-size: 10px; width: 12px; }

/* Rating block */
.rating-block { background: #fff; border: 1px solid var(--mkt-border); border-radius: 12px; padding: 18px; }
.rating-block .rating-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.rating-block .rating-big { font-size: 28px; font-weight: 800; color: var(--mkt-green); }
.rating-block .rating-slash { font-size: 16px; color: var(--mkt-muted); font-weight: 600; }
.rating-stars { color: var(--mkt-orange); display: inline-flex; gap: 2px; font-size: 16px; }
.rating-count-text { font-size: 12px; color: var(--mkt-muted); margin-bottom: 14px; }
.rating-bars { margin-bottom: 12px; }
.rbar { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; color: var(--mkt-muted); line-height: 1; }
.rbar-track { flex: 1; background: #e5e7eb; border-radius: 10px; height: 7px; overflow: hidden; }
.rbar-fill { background: var(--mkt-green); height: 100%; border-radius: 10px; }
.view-all-btn { width: 100%; padding: 9px; border: 1px solid var(--mkt-border); border-radius: 8px; background: #fff; font-size: 12px; color: var(--mkt-text); cursor: pointer; font-weight: 500; text-align: center; }
.view-all-btn:hover { background: var(--mkt-bg); }

/* Others row */
.others-row { margin-top: 20px; }
.others-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.others-header span { font-size: 14px; font-weight: 700; }
.others-header a { font-size: 12px; color: var(--mkt-green); text-decoration: none; }

/* RIGHT COLUMN */
.right-col { position: sticky; top: 80px; }

/* Loyalty status bar */
.loyalty-bar { background: linear-gradient(135deg, #1a3c34, #1c5a45); border-radius: 16px; padding: 14px 20px; color: #fff; margin-bottom: 16px; display: flex; align-items: center; gap: 0; }
.lb-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.lb-medal { width: 42px; height: 42px; background: radial-gradient(circle, #d4a017 60%, #b8860b 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); position: relative; }
.lb-medal i { color: #5a3e00; }
.lb-medal::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #b8860b; }
.lb-text .lb-label { font-size: 12px; opacity: 0.8; margin-bottom: 2px; }
.lb-text .lb-level { font-size: 18px; font-weight: 800; color: #d4a017; line-height: 1.1; }
.lb-text .lb-xp { font-size: 12px; color: #fff; font-weight: 600; margin-top: 2px; }
.lb-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.3); margin: 0 16px; }
.lb-right-info { flex: 1; }
.lb-right-info .lb-top { font-size: 13px; color: #fff; margin-bottom: 6px; }
.lb-right-info .lb-top strong { font-size: 15px; font-weight: 800; }
.lb-right-info .lb-bar { background: rgba(255,255,255,0.2); border-radius: 10px; height: 8px; overflow: hidden; margin-bottom: 4px; }
.lb-right-info .lb-bar-fill { background: linear-gradient(90deg, #d4a017, #f5c842); height: 100%; border-radius: 10px; }
.lb-right-info .lb-bottom { font-size: 11px; color: rgba(255,255,255,0.7); text-align: right; }
.lb-right-info .lb-bottom strong { color: #d4a017; }

/* Advantages card */
.adv-card { background: #fff; border: 1px solid var(--mkt-border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.adv-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.adv-title { font-size: 14px; font-weight: 700; color: var(--mkt-text); }
.adv-pct { font-size: 22px; font-weight: 800; color: var(--mkt-green); border: 2px solid var(--mkt-green); border-radius: 8px; padding: 2px 10px; }
.adv-sub { font-size: 13px; color: var(--mkt-muted); line-height: 1.5; margin-bottom: 16px; }
.adv-sub strong { color: var(--mkt-text); }

/* Price table */
.price-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; }
.pr-label { color: var(--mkt-muted); }
.pr-value { font-weight: 500; }
.pr-value.strike { text-decoration: line-through; color: var(--mkt-muted); }
.pr-value.green { color: var(--mkt-green); }
.price-final-row { border-top: 2px solid var(--mkt-border); margin-top: 8px; padding-top: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.pf-label { font-size: 15px; font-weight: 700; color: var(--mkt-text); }
.pf-value { font-size: 28px; font-weight: 800; color: var(--mkt-text); }
.xp-earned { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mkt-orange); font-weight: 700; margin: 12px 0; }
.xp-earned i { font-size: 13px; }

/* WhatsApp button */
.whatsapp-btn { width: 100%; background: #25D366; color: #fff; border: none; padding: 15px 16px; border-radius: 25px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 10px; transition: 0.2s; letter-spacing: 0.2px; }
.whatsapp-btn:hover { background: #20ba5a; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(37,211,102,0.4); }
.whatsapp-btn i { font-size: 20px; }
.whatsapp-note { font-size: 11px; color: var(--mkt-muted); text-align: center; line-height: 1.5; margin-bottom: 4px; }

/* How it works mini card */
.how-card { background: var(--mkt-bg); border-radius: 12px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--mkt-border); }
.how-title { font-size: 13px; font-weight: 700; color: var(--mkt-text); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.how-title i { color: var(--mkt-green); font-size: 14px; }
.how-steps { display: flex; gap: 8px; }
.how-step { flex: 1; text-align: center; }
.how-step-icon { width: 36px; height: 36px; background: #fff; border: 1px solid var(--mkt-border); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-size: 16px; }
.how-step-text { font-size: 10px; color: var(--mkt-muted); line-height: 1.4; }

/* Code card */
.code-card { background: #fff; border: 1px solid var(--mkt-border); border-radius: 12px; padding: 14px; }
.code-label { font-size: 12px; font-weight: 600; color: var(--mkt-text); margin-bottom: 3px; }
.code-sub { font-size: 11px; color: var(--mkt-muted); margin-bottom: 8px; }
.code-box { display: flex; align-items: center; justify-content: space-between; background: var(--mkt-bg); border: 1.5px dashed var(--mkt-border); border-radius: 8px; padding: 9px 14px; }
.code-text { font-size: 15px; font-weight: 700; font-family: monospace; color: var(--mkt-text); letter-spacing: 2px; }
.code-copy { color: var(--mkt-green); cursor: pointer; font-size: 15px; transition: 0.15s; }
.code-copy:hover { color: var(--mkt-green-dark); transform: scale(1.1); }

/* Review Items */
.review-item { padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.review-item .review-stars { color: var(--mkt-orange); margin-bottom: 4px; }
.review-item .review-comment { font-size: 13px; color: var(--mkt-text); margin: 4px 0; }
.review-item .review-date { font-size: 11px; color: var(--mkt-muted); }

/* Detail page responsive */
@media (max-width: 1200px) {
    .page-body { grid-template-columns: 1fr; }
    .right-col { position: static; }
    .gallery-row { flex-direction: column; }
    .gallery-wrap { flex: 1; }
    .impact-side { flex: 1; }
}

/* Forms */
.marketplace-form .form-group { margin-bottom: 1rem; }
.marketplace-form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--mkt-text); }

/* === Responsive === */
@media (max-width: 1200px) {
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .marketplace-right-sidebar { width: 250px; min-width: 250px; }
    .filters { width: 160px; }
}

@media (max-width: 992px) {
    .marketplace-layout { flex-direction: column; }
    .marketplace-sidebar { width: 100%; min-width: 100%; height: auto; position: static; flex-direction: row; padding: 0; overflow-x: auto; }
    .sidebar-brand { display: none; }
    .sidebar-section-label { display: none; }
    .sidebar-nav { display: flex; gap: 0; padding: 0; overflow-x: auto; }
    .sidebar-nav-item { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; padding: 10px 14px; }
    .sidebar-nav-item.active { border-bottom-color: var(--mkt-green); border-left-color: transparent; }
    .sidebar-impact-card, .sidebar-help { display: none; }
    .marketplace-right-sidebar { width: 100%; min-width: 100%; position: static; height: auto; }
    .marketplace-inner-row { flex-direction: column; }
    .filters { width: 100%; display: flex; flex-wrap: wrap; gap: 16px; }
    .filter-section { flex: 1; min-width: 150px; }
    .detail-top-row { flex-direction: column; }
    .detail-bottom-row { flex-direction: column; }
}

@media (max-width: 768px) {
    .products-grid { grid-template-columns: 1fr 1fr; }
    .marketplace-content { padding: 12px; }
    .loyalty-banner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
    .loyalty-divider { display: none; }
    .products-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}


/* ============================================================
   SHOWCASE-STYLE PAGINATION
============================================================ */
.showcase-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f4f0;
    border-radius: 50px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.showcase-pagination .spag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 40px;
    background: #fff;
    border: 1.5px solid #e0e6e0;
    color: var(--primary-green, #3d7a56);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s, color .2s, box-shadow .2s;
    white-space: nowrap;
}
.showcase-pagination .spag-btn:hover {
    background: var(--primary-green, #3d7a56);
    color: #fff;
    border-color: var(--primary-green, #3d7a56);
    box-shadow: 0 4px 12px rgba(61,122,86,.25);
}

.showcase-pagination .spag-pages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.showcase-pagination .spag-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e0e6e0;
    color: #2d4a3e;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.showcase-pagination .spag-page:hover {
    background: #e8f2ec;
    border-color: var(--primary-green, #3d7a56);
    color: var(--primary-green, #3d7a56);
}
.showcase-pagination .spag-page.spag-active {
    background: var(--primary-green, #3d7a56);
    border-color: var(--primary-green, #3d7a56);
    color: #fff;
    box-shadow: 0 4px 12px rgba(61,122,86,.3);
    cursor: default;
    pointer-events: none;
}

.showcase-pagination .spag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    color: #8a9e92;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Video thumbnail overlay in gallery */
.gallery-thumb {
    position: relative;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#mainProductVideo {
    border-radius: 10px;
    width: 100%;
    aspect-ratio: 16/9;
}
