﻿/* ═══ Products Index — Dark Glassmorphism (KaraMarket) ═══ */

.market-page {
    position: relative;
    padding: 2rem 0 4rem;
    overflow: hidden;
}

/* ── اورب‌های پس‌زمینه ── */
.page-orbs {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: .35;
    animation: orb-float 16s ease-in-out infinite;
}

.orb-1 {
    width: 480px;
    height: 480px;
    top: -140px;
    right: -120px;
    background: radial-gradient(circle, rgba(34, 211, 238, .35), transparent 70%);
}

.orb-2 {
    width: 420px;
    height: 420px;
    bottom: -100px;
    left: -140px;
    background: radial-gradient(circle, rgba(59, 130, 246, .30), transparent 70%);
    animation-delay: -8s;
}

@keyframes orb-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: .30;
    }

    50% {
        transform: translateY(50px) scale(1.12);
        opacity: .45;
    }
}

.market-container {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ── مسیر صفحه (Breadcrumb) ── */
.market-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--text-muted, #8b93b5);
    margin-bottom: 1.5rem;
}

    .market-breadcrumb a {
        color: var(--text-muted, #8b93b5);
        text-decoration: none;
        transition: color .2s;
    }

        .market-breadcrumb a:hover {
            color: var(--accent, #22d3ee);
        }

    .market-breadcrumb .crumb-home {
        margin-inline-end: .25rem;
    }

    .market-breadcrumb .sep {
        opacity: .5;
    }

/* ── بخش هیرو ── */
.market-hero {
    text-align: center;
    padding: 3rem 2rem 2.5rem;
    border-radius: 24px;
    margin-bottom: 2rem;
    background: radial-gradient(600px 200px at 20% 0%, rgba(34, 211, 238, .08), transparent 60%), radial-gradient(600px 200px at 80% 100%, rgba(59, 130, 246, .08), transparent 60%), var(--glass-bg, rgba(15, 23, 52, .55));
    border: 1px solid var(--glass-border, rgba(148, 163, 255, .14));
    backdrop-filter: blur(18px);
}

.hero-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: .5rem;
    background: linear-gradient(120deg, #ffffff, #9ad8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    color: var(--text-muted, #8b93b5);
    margin-bottom: 1.75rem;
}

.hero-search {
    position: relative;
    max-width: 640px;
    margin-inline: auto;
}

    .hero-search input {
        width: 100%;
        padding: 1rem 3.25rem 1rem 1.25rem;
        border-radius: 16px;
        border: 1px solid rgba(148, 163, 255, .18);
        background: rgba(5, 8, 20, .55);
        color: var(--text, #e2e8ff);
        font: inherit;
        transition: border-color .25s, box-shadow .25s;
    }

        .hero-search input:focus {
            outline: none;
            border-color: rgba(34, 211, 238, .6);
            box-shadow: 0 0 0 4px rgba(34, 211, 238, .12);
        }

    .hero-search button {
        position: absolute;
        inset-inline-start: .75rem;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: 0;
        color: var(--accent, #22d3ee);
        font-size: 1.3rem;
        cursor: pointer;
    }

/* ── ساختار کلی صفحه (Layout) ── */
.market-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 960px) {
    .market-layout {
        grid-template-columns: 1fr;
    }

    .market-sidebar {
        order: -1;
    }
}

/* ── گرید کارت‌های محصول ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: var(--glass-bg, rgba(15, 23, 52, .55));
    border: 1px solid var(--glass-border, rgba(148, 163, 255, .14));
    backdrop-filter: blur(14px);
    transition: transform .3s, box-shadow .3s, border-color .3s;
}

    .product-card:hover {
        transform: translateY(-5px);
        border-color: rgba(34, 211, 238, .45);
        box-shadow: 0 18px 45px -18px rgba(34, 211, 238, .35);
    }

.product-card-visual {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0a0f24;
    overflow: hidden;
}

    .product-card-visual img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .5s;
    }

.product-card:hover .product-card-visual img {
    transform: scale(1.06);
}

.card-glow-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 8, 20, .75), transparent 60%);
}

.category-chip.on-image {
    position: absolute;
    top: .75rem;
    inset-inline-start: .75rem;
    z-index: 2;
    padding: .3rem .7rem;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    color: #04121a;
    background: linear-gradient(120deg, #22d3ee, #3b82f6);
}

.visual-fallback {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 3rem;
    font-weight: 800;
    color: rgba(34, 211, 238, .35);
}

.product-card-body {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: 1rem 1.1rem 1.1rem;
    flex: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    margin: 0;
}

    .product-title a {
        color: var(--text, #e2e8ff);
        text-decoration: none;
        transition: color .2s;
    }

        .product-title a:hover {
            color: var(--accent, #22d3ee);
        }

.product-meta {
    font-size: .8rem;
    color: var(--text-muted, #8b93b5);
}

    .product-meta strong {
        color: #a5f3fc;
        font-weight: 600;
    }

.card-divider {
    height: 1px;
    background: linear-gradient(to left, transparent, rgba(148, 163, 255, .2), transparent);
    margin-block: .15rem;
}

.product-card-footer {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    margin-top: auto;
}

.price-box .amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent, #22d3ee);
}

.price-box .currency {
    font-size: .75rem;
    color: var(--text-muted, #8b93b5);
}

.card-actions {
    display: flex;
    gap: .6rem;
    margin-top: .35rem;
}

.btn-details-link {
    flex: 1;
    text-align: center;
    padding: .55rem;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    color: #04121a;
    background: linear-gradient(120deg, #22d3ee, #3b82f6);
    box-shadow: 0 8px 22px -10px rgba(34, 211, 238, .6);
    transition: filter .2s, transform .2s;
}

    .btn-details-link:hover {
        filter: brightness(1.15);
        transform: translateY(-1px);
    }

.btn-cart-icon {
    display: grid;
    place-items: center;
    width: 42px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1rem;
    color: var(--accent, #22d3ee);
    border: 1px solid rgba(34, 211, 238, .35);
    background: rgba(34, 211, 238, .08);
    transition: background .2s, border-color .2s;
}

    .btn-cart-icon:hover {
        background: rgba(34, 211, 238, .18);
        border-color: rgba(34, 211, 238, .6);
    }

/* ── نوار وضعیت پایین و صفحه‌بندی ── */
.market-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .85rem 1.25rem;
    border-radius: 16px;
    background: var(--glass-bg, rgba(15, 23, 52, .55));
    border: 1px solid var(--glass-border, rgba(148, 163, 255, .14));
    backdrop-filter: blur(14px);
}

.total-chip {
    font-size: .85rem;
    color: var(--text-muted, #8b93b5);
}

    .total-chip .chip-icon {
        color: var(--accent, #22d3ee);
        margin-inline-end: .35rem;
    }

.market-pagination {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.page-link {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding-inline: .5rem;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted, #8b93b5);
    border: 1px solid rgba(148, 163, 255, .15);
    background: rgba(15, 23, 52, .4);
    transition: all .2s;
}

    .page-link:hover {
        color: var(--accent, #22d3ee);
        border-color: rgba(34, 211, 238, .5);
    }

    .page-link.active {
        color: #04121a;
        background: linear-gradient(120deg, #22d3ee, #3b82f6);
        border-color: transparent;
        box-shadow: 0 8px 20px -8px rgba(34, 211, 238, .7);
    }

    .page-link.dots {
        border: 0;
        background: none;
        cursor: default;
    }

/* ── سایدبار فیلتر ── */
.market-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 5.5rem;
}

.filter-panel,
.trust-panel {
    border-radius: 18px;
    padding: 1.4rem;
    background: var(--glass-bg, rgba(15, 23, 52, .55));
    border: 1px solid var(--glass-border, rgba(148, 163, 255, .14));
    backdrop-filter: blur(14px);
}

.filter-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.filter-group {
    margin-bottom: 1.25rem;
}

    .filter-group label,
    .group-label {
        display: block;
        font-size: .85rem;
        font-weight: 700;
        margin-bottom: .55rem;
    }

.select-wrap {
    position: relative;
}

.filter-group select {
    width: 100%;
    padding: .7rem .9rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 255, .18);
    background: rgba(5, 8, 20, .55);
    color: var(--text, #e2e8ff);
    font: inherit;
    appearance: none;
    cursor: pointer;
}

.select-wrap::after {
    content: "⌄";
    position: absolute;
    inset-inline-start: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #8b93b5);
    pointer-events: none;
}

.filter-group select:focus {
    outline: none;
    border-color: rgba(34, 211, 238, .6);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.sort-options {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .8rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 255, .12);
    background: rgba(5, 8, 20, .4);
    font-size: .85rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

    .sort-option:hover {
        border-color: rgba(34, 211, 238, .4);
    }

    .sort-option input {
        accent-color: #22d3ee;
    }

    .sort-option:has(input:checked) {
        border-color: rgba(34, 211, 238, .55);
        background: rgba(34, 211, 238, .07);
    }

.btn-glow-primary,
.btn-filter-apply {
    display: block;
    width: 100%;
    padding: .75rem;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    color: #04121a;
    cursor: pointer;
    background: linear-gradient(120deg, #22d3ee, #3b82f6);
    box-shadow: 0 10px 26px -10px rgba(34, 211, 238, .65);
    transition: filter .2s, transform .2s;
    text-align: center;
    text-decoration: none;
}

    .btn-glow-primary:hover,
    .btn-filter-apply:hover {
        filter: brightness(1.12);
        transform: translateY(-1px);
    }

.btn-filter-reset {
    display: block;
    width: 100%;
    margin-top: .65rem;
    padding: .7rem;
    border-radius: 12px;
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted, #8b93b5);
    border: 1px solid rgba(148, 163, 255, .15);
    transition: color .2s, border-color .2s;
}

    .btn-filter-reset:hover {
        color: var(--accent, #22d3ee);
        border-color: rgba(34, 211, 238, .5);
    }

/* ── پنل اعتماد ── */
.trust-panel h3 {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.trust-panel ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin: 0;
    padding: 0;
    font-size: .85rem;
    color: var(--text-muted, #8b93b5);
}

.trust-icon {
    color: var(--accent, #22d3ee);
    margin-inline-end: .5rem;
}

/* ── حالت خالی (Empty State) ── */
.market-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    border-radius: 20px;
    background: var(--glass-bg, rgba(15, 23, 52, .55));
    border: 1px solid var(--glass-border, rgba(148, 163, 255, .14));
    backdrop-filter: blur(14px);
}

.empty-icon {
    font-size: 3rem;
    color: rgba(34, 211, 238, .5);
    margin-bottom: .75rem;
}

.market-empty h2 {
    font-size: 1.2rem;
    margin-bottom: .4rem;
}

.market-empty p {
    color: var(--text-muted, #8b93b5);
    margin-bottom: 1.5rem;
}

.market-empty .btn-glow-primary {
    display: inline-block;
    width: auto;
    padding-inline: 2rem;
}

/* ── ریسپانسیو ── */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .market-bottom-bar {
        justify-content: center;
    }
}
