/* Products — Modern cards */

.filters-bar { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.tab-pill {
    padding: 0.55rem 1.2rem; border-radius: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-2);
    font-weight: 600; font-size: 0.82rem;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.tab-pill:hover { color: var(--accent); border-color: rgba(255,159,28,0.3); }
.tab-pill.active {
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    color: #000; border-color: transparent;
    box-shadow: 0 4px 18px -4px var(--accent-glow);
}
.filter-spacer { flex: 1; }

.theme-select-wrap { position: relative; display: inline-block; }
.theme-select-wrap::after {
    content: ''; position: absolute;
    right: 0.9rem; top: 50%; transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 6px solid var(--accent);
    pointer-events: none; z-index: 2;
}

/* Products grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.product-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    transition: all 0.35s cubic-bezier(.2,.9,.4,1.1);
    overflow: hidden;
    animation: fadeInScale .5s ease backwards;
    animation-delay: calc(var(--card-index, 0) * 0.04s);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
}
@keyframes fadeInScale { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.product-image, .product-img {
    height: 160px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 4.5rem;
    margin-bottom: 1rem;
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(255,159,28,0.08), rgba(167,139,250,0.06));
    background-size: cover; background-position: center;
}
.product-image.fruits, .product-img.fruits { background: linear-gradient(135deg, rgba(251,113,133,0.15), rgba(255,159,28,0.12)); }
.product-image.raids, .product-img.raids { background: linear-gradient(135deg, rgba(167,139,250,0.18), rgba(99,102,241,0.12)); }
.product-image.boosts, .product-img.boosts { background: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(59,130,246,0.12)); }
.product-image.bounty, .product-img.bounty { background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(245,158,11,0.12)); }
.product-image.mastery, .product-img.mastery { background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(34,197,94,0.12)); }
.product-image.service, .product-img.service { background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(96,165,250,0.12)); }
.product-image.ability, .product-img.ability { background: linear-gradient(135deg, rgba(236,72,153,0.18), rgba(167,139,250,0.12)); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 0.3rem; flex-direction: column; z-index: 2; }
.p-badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; backdrop-filter: blur(8px); }
.p-badge.new { background: var(--green); color: #000; }
.p-badge.hot { background: var(--red); color: #fff; }
.p-badge.sale { background: var(--accent); color: #000; }
.p-badge.epic { background: linear-gradient(135deg, #a855f7, #6366f1); color: #fff; }
.p-badge.leg { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.fav-btn {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-2);
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
}
.fav-btn:hover { color: var(--red); transform: scale(1.1); }
.fav-btn.active { color: var(--red); background: rgba(251,113,133,0.2); }
.product-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.product-desc { font-size: 0.78rem; color: var(--text-3); margin-bottom: 0.8rem; line-height: 1.4; min-height: 2.2em; }
.product-rating { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.8rem; font-size: 0.75rem; color: var(--text-3); }
.product-rating .stars { color: var(--accent); }
.product-bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 0.8rem;
}
.price-block { display: flex; flex-direction: column; }
.old-price { text-decoration: line-through; color: var(--text-3); font-size: 0.7rem; }
.current-price { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.buy-btn-direct {
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    color: #000; border: none;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700; font-size: 0.8rem;
    display: flex; align-items: center; gap: 0.4rem;
    transition: all var(--transition-fast);
    font-family: inherit;
    box-shadow: 0 4px 12px -2px rgba(255,159,28,0.3);
    min-height: 44px;
    touch-action: manipulation;
}
.buy-btn-direct:hover:not(:disabled) { transform: scale(1.04); box-shadow: 0 6px 18px -2px var(--accent-glow); }
.buy-btn-direct:disabled { opacity: 0.5; cursor: not-allowed; }
.stock-info { font-size: 0.68rem; margin-top: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }
.stock-info.in { color: var(--green); }
.stock-info.out { color: var(--red); }

/* Reviews */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.review-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-spring);
    position: relative;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
}
.review-stars { color: var(--accent); margin-bottom: 0.8rem; font-size: 0.9rem; }
.review-text { color: var(--text-2); margin-bottom: 1.2rem; line-height: 1.5; font-size: 0.9rem; }
.review-author { display: flex; align-items: center; gap: 0.7rem; }
.author-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #000; font-size: 0.95rem;
}
.author-name { font-weight: 700; font-size: 0.88rem; }
.author-role { font-size: 0.72rem; color: var(--text-3); }

/* Listings */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.listing-card {
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    transition: all 0.35s cubic-bezier(.2,.9,.4,1.1);
    animation: fadeInScale .5s ease backwards;
    animation-delay: calc(var(--card-index, 0) * 0.05s);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
}
.listing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.listing-icon {
    font-size: 2.5rem; width: 60px; height: 60px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(255,159,28,0.08), rgba(167,139,250,0.06));
}
.listing-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.listing-desc { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.8rem; line-height: 1.4; min-height: 2em; }
.listing-bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 0.8rem;
}
.listing-price { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.listing-meta { font-size: 0.75rem; color: var(--text-3); display: flex; align-items: center; gap: 0.3rem; }
.listing-image { width: 100%; height: 180px; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.8rem; }
.listing-image img { width: 100%; height: 100%; object-fit: cover; }

/* Chat */
.chat-container { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; height: calc(100vh - 200px); min-height: 500px; }
.chat-sidebar { border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.chat-sidebar-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); font-weight: 700; }
.chat-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.chat-list-item {
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex; gap: 0.7rem;
    margin-bottom: 0.3rem;
}
.chat-list-item:hover { background: rgba(255,159,28,0.05); }
.chat-list-item.active { background: rgba(255,159,28,0.1); }
.chat-list-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #000; flex-shrink: 0;
}
.chat-list-avatar.worker { background: linear-gradient(135deg, #60A5FA, #3B82F6); color: #fff; }
.chat-list-info { flex: 1; overflow: hidden; min-width: 0; }
.chat-list-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-product { font-size: 0.7rem; color: var(--accent); }
.chat-list-last { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.2rem; }
.chat-main { border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; align-items: center; gap: 0.8rem;
}
.chat-header-left { display: flex; align-items: center; gap: 0.8rem; flex: 1; min-width: 0; }
.chat-header-avatar {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #000; flex-shrink: 0;
}
.chat-header-avatar.worker { background: linear-gradient(135deg, #60A5FA, #3B82F6); color: #fff; }
.chat-header-avatar.admin { background: linear-gradient(135deg, var(--purple), #6366F1); color: #fff; }
.chat-header-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-header-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-product { font-size: 0.78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.chat-status { font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-weight: 700; }
.chat-status.pending { background: rgba(251,191,36,0.12); color: #FBBF24; }
.chat-status.assigned { background: rgba(96,165,250,0.12); color: var(--blue); }
.chat-status.worker_done { background: rgba(167,139,250,0.12); color: #A78BFA; }
.chat-status.completed { background: rgba(52,211,153,0.12); color: var(--green); }
.chat-messages {
    flex: 1; overflow-y: auto; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 0.6rem;
}
.chat-msg {
    max-width: 70%;
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    font-size: 0.9rem; line-height: 1.4;
    word-wrap: break-word;
    animation: msgIn .2s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.in { background: rgba(255,255,255,0.06); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.in .chat-msg-sender { color: #60A5FA; }
.chat-msg.out {
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    color: #000; align-self: flex-end;
    border-bottom-right-radius: 4px; font-weight: 500;
    box-shadow: 0 4px 12px -2px rgba(255,159,28,0.25);
}
.chat-msg.out .chat-msg-sender { color: #000; opacity: 0.8; }
.chat-msg-time { font-size: 0.65rem; opacity: 0.65; margin-top: 0.2rem; }
.chat-msg.system { background: rgba(167,139,250,0.12); color: #C4B5FD; align-self: center; font-size: 0.78rem; border-radius: 20px; padding: 0.4rem 0.9rem; }
.chat-msg.system .chat-msg-sender { color: #C4B5FD; }
.chat-msg.system.success { background: rgba(52,211,153,0.12); color: var(--green); }
.chat-msg.system.danger { background: rgba(251,113,133,0.12); color: var(--red); }
.chat-input-area { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 0.5rem; }
.chat-input {
    flex: 1; padding: 0.7rem 1rem;
    border-radius: 20px;
    background: rgba(22,32,54,0.8);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-1);
    font-family: inherit; font-size: 0.9rem;
}
.chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,159,28,0.1); }
.chat-send {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #FF6B00);
    border: none; color: #000;
    transition: all var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(255,159,28,0.3);
}
.chat-send:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(255,159,28,0.4); }
.chat-actions { padding: 0.8rem 1rem; border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Orders */
.orders-list { display: flex; flex-direction: column; gap: 0.8rem; }
.order-card {
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    display: grid; grid-template-columns: auto 1fr auto auto;
    gap: 1rem; align-items: center;
    transition: all var(--transition-fast);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
}
.order-card:hover { border-color: rgba(255,159,28,0.15); }
.order-icon {
    font-size: 2.5rem; width: 60px; height: 60px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(255,159,28,0.08), rgba(167,139,250,0.06));
}
.order-name { font-weight: 700; margin-bottom: 0.2rem; }
.order-meta { font-size: 0.78rem; color: var(--text-3); }
.order-status { font-size: 0.72rem; padding: 0.3rem 0.7rem; border-radius: 20px; font-weight: 700; white-space: nowrap; }
.order-status.pending { background: rgba(251,191,36,0.12); color: #FBBF24; }
.order-status.assigned { background: rgba(96,165,250,0.12); color: var(--blue); }
.order-status.worker_done { background: rgba(167,139,250,0.12); color: #A78BFA; }
.order-status.completed { background: rgba(52,211,153,0.12); color: var(--green); }
.order-status.cancelled { background: rgba(251,113,133,0.12); color: var(--red); }
.order-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Mobile product improvements */
@media (max-width: 768px) {
    .fav-btn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
    .product-card { padding: 0.6rem; }
    .product-image, .product-img { height: 80px; font-size: 2rem; }
    .product-title { font-size: 0.78rem; }
    .product-desc { font-size: 0.66rem; min-height: 1.4em; }
    .product-bottom { flex-direction: column; gap: 0.3rem; align-items: stretch; }
    .buy-btn-direct { width: 100%; justify-content: center; padding: 0.5rem; font-size: 0.7rem; }
    .current-price { font-size: 0.95rem; }
    .old-price { font-size: 0.65rem; }
    .listing-card { padding: 1rem; }
    .listing-bottom { flex-direction: column; gap: 0.5rem; align-items: stretch; }
    .listing-price { font-size: 1.1rem; }
    .review-card { padding: 1rem; }
    .review-text { font-size: 0.82rem; }
    .order-card { grid-template-columns: 1fr; gap: 0.5rem; padding: 0.8rem; }
    .order-icon { width: 40px; height: 40px; font-size: 1.5rem; }
    .order-actions { flex-direction: column; }
    .order-actions .btn { width: 100%; min-height: 44px; }
    .chat-container { grid-template-columns: 1fr; height: auto; }
    .chat-sidebar { max-height: 180px; }
    .chat-main { min-height: 350px; }
    .chat-msg { max-width: 85%; font-size: 0.82rem; }
    .chat-input { font-size: 0.82rem; }
    .chat-actions { padding: 0.5rem; }
    .chat-input-area { padding: 0.6rem; }
    .chat-send { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
    .chat-header { padding: 0.7rem 1rem; }
    .chat-messages { padding: 1rem; }
    .filters-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .filters-bar::-webkit-scrollbar { display: none; }
    .tab-pill { white-space: nowrap; flex-shrink: 0; padding: 0.45rem 0.9rem; font-size: 0.75rem; min-height: 44px; }
    .filter-spacer { display: none; }
    .theme-select-wrap { width: 100%; }
    .theme-select-wrap select { width: 100%; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .product-card { padding: 0.4rem; border-radius: 0.6rem; }
    .product-image, .product-img { height: 70px; font-size: 1.8rem; border-radius: 0.5rem; }
    .product-title { font-size: 0.72rem; }
    .product-desc { font-size: 0.6rem; min-height: 1.2em; }
    .product-bottom { padding-top: 0.4rem; }
    .current-price { font-size: 0.85rem; }
    .buy-btn-direct { padding: 0.4rem 0.5rem; font-size: 0.65rem; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .feature-card { padding: 0.5rem; }
    .feature-icon { width: 28px; height: 28px; font-size: 0.7rem; margin-bottom: 0.4rem; }
    .feature-card h4 { font-size: 0.7rem; }
    .feature-card p { font-size: 0.6rem; }
    .listing-card { padding: 0.8rem; }
    .listing-icon { width: 36px; height: 36px; font-size: 1.2rem; }
    .listing-title { font-size: 0.82rem; }
    .review-card { padding: 0.8rem; }
    .review-text { font-size: 0.78rem; }
    .order-card { padding: 0.6rem; }
    .order-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.7rem; }
}
