/* Listing & seller cards */
.listing-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.listing-card__main {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.listing-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
    border-color: #dde3ec;
    z-index: 2;
}

.listing-card__image-wrap {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f4f6f9;
    position: relative;
}

.listing-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.listing-card:hover .listing-card__image {
    transform: scale(1.03);
}

.listing-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8edf3 100%);
}

.listing-card__body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.listing-card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.2em;
    margin: 0;
}

.listing-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.listing-card__price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #16a34a;
    white-space: nowrap;
}

.listing-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #0d9488;
    background: #ccfbf1;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.listing-card__badge i {
    color: #f59e0b;
    font-size: 0.6rem;
}

.listing-card__badge--stock {
    color: #64748b;
    background: #f1f5f9;
}

.listing-card__badge--stock i {
    display: none;
}

.listing-card__seller {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.5rem 0.75rem 0.75rem;
    border-top: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.listing-card__seller:hover {
    background: #f8fafc;
}

.listing-card__seller-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.5625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.listing-card__seller-name {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* —— VIP & Doping (RGB accent — color only) —— */
@keyframes listing-accent-rgb {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes listing-border-rgb {
    0% { border-color: #ff3366; }
    16% { border-color: #ff9500; }
    33% { border-color: #ffee00; }
    50% { border-color: #33ff99; }
    66% { border-color: #00ccff; }
    83% { border-color: #9933ff; }
    100% { border-color: #ff3366; }
}

@keyframes listing-border-top-rgb {
    0% { border-top-color: #ff3366; }
    16% { border-top-color: #ff9500; }
    33% { border-top-color: #ffee00; }
    50% { border-top-color: #33ff99; }
    66% { border-top-color: #00ccff; }
    83% { border-top-color: #9933ff; }
    100% { border-top-color: #ff3366; }
}

.listing-card--vip,
.listing-card--doping {
    border: 2px solid #ff3366;
    animation: listing-border-rgb 4s linear infinite;
}

.listing-card--vip:hover,
.listing-card--doping:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.listing-card__featured-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    color: #fff;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(
        90deg,
        #ff3366,
        #ff9500,
        #ffee00,
        #33ff99,
        #00ccff,
        #9933ff,
        #ff3366
    );
    background-size: 200% 100%;
    animation: listing-accent-rgb 4s linear infinite;
}

.listing-card__featured-badge i {
    font-size: 0.6rem;
}

.listing-card__meta--featured {
    border-top: 2px solid #ff3366;
    padding-top: 0.5rem;
    margin-top: 0.1rem;
    animation: listing-border-top-rgb 4s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .listing-card--vip,
    .listing-card--doping,
    .listing-card__featured-badge,
    .listing-card__meta--featured,
    .seller-other-card--featured,
    .seller-other-card__featured-badge {
        animation: none;
    }
}

/* Seller shop cards */
.seller-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.seller-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.seller-card__avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.seller-card__info {
    flex: 1;
    min-width: 0;
}

.seller-card__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seller-card__stats {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.seller-card__link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: #eff6ff;
    transition: background 0.15s;
}

.seller-card__link:hover {
    background: #dbeafe;
}

/* Grids */
.home-listings-grid,
.listings-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 480px) {
    .home-listings-grid,
    .listings-page-grid {
        gap: 1.125rem;
    }
}

@media (min-width: 640px) {
    .home-listings-grid,
    .listings-page-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .home-listings-grid,
    .listings-page-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.375rem;
    }
}

@media (min-width: 1024px) {
    .home-listings-grid,
    .listings-page-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.home-sellers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .home-sellers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .home-sellers-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.home-listings-section {
    margin-bottom: 2.5rem;
}

.home-listings-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.home-listings-section__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

@media (min-width: 1024px) {
    .home-listings-section__title {
        font-size: 1.5rem;
    }
}

.home-listings-section__link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-hstock-blue, #2563eb);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.home-listings-section__link:hover {
    text-decoration: underline;
}

/* Listings page layout & filters */
.listings-page-container {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 1280px) {
    .listings-page-container {
        max-width: 88rem;
    }
}

.listings-page-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.listings-page-main {
    flex: 1;
    min-width: 0;
}

.listings-filters {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    padding: 1.25rem;
}

.listings-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.listings-filters__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listings-filters__title i {
    color: #2563eb;
    font-size: 0.875rem;
}

.listings-filters__close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
}

.listings-filters__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.listings-filters__group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.listings-filters__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.listings-filters__input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.listings-filters__input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.listings-filters__search-wrap {
    position: relative;
}

.listings-filters__search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8125rem;
}

.listings-filters__search-wrap .listings-filters__input {
    padding-left: 2.25rem;
}

.listings-filters__options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.listings-filters__options::-webkit-scrollbar {
    width: 5px;
}

.listings-filters__options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.listings-filters__options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.listings-filters__radio {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #334155;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s;
}

.listings-filters__radio:hover {
    background: #f8fafc;
}

.listings-filters__radio input {
    margin-top: 0.15rem;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.listings-filters__meta {
    color: #94a3b8;
    margin-left: 0.25rem;
}

.listings-filters__count {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.6875rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.listings-filters__rating {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.listings-filters__rating-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.listings-filters__rating-radio {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

.listings-filters__rating-item:hover,
.listings-filters__rating-item.is-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.listings-filters__stars {
    display: inline-flex;
    gap: 0.1rem;
    pointer-events: none;
}

.listings-filters__stars i {
    font-size: 0.6875rem;
    color: #cbd5e1;
}

.listings-filters__stars i.is-filled {
    color: #f59e0b;
}

.listings-filters__rating-text {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
    pointer-events: none;
}

.listings-filters__price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listings-filters__price-sep {
    color: #94a3b8;
    flex-shrink: 0;
}

.listings-filters__hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.listings-filters__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #334155;
    cursor: pointer;
}

.listings-filters__checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563eb;
}

.listings-filters__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.listings-filters__submit {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.listings-filters__submit:hover {
    background: #1d4ed8;
}

.listings-filters__reset {
    display: block;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    text-decoration: none;
}

.listings-filters__reset:hover {
    color: #2563eb;
}

.listings-sort-form {
    flex-shrink: 0;
}

.listings-sort-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #334155;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 1rem;
    appearance: none;
    cursor: pointer;
}

.listings-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
}

.listings-filter-toggle__badge {
    width: 0.5rem;
    height: 0.5rem;
    background: #2563eb;
    border-radius: 999px;
}

.listings-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.listings-active-filters__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
}

.listings-active-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s;
}

.listings-active-filters__chip:hover {
    background: #e2e8f0;
}

.listings-active-filters__chip i {
    font-size: 0.625rem;
    color: #94a3b8;
}

.listings-active-filters__clear {
    font-size: 0.75rem;
    color: #2563eb;
    text-decoration: none;
    margin-left: 0.25rem;
}

.listings-active-filters__clear:hover {
    text-decoration: underline;
}

/* Seller public profile header */
.seller-profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
}

.seller-profile-header__avatar {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.seller-profile-header__name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.seller-profile-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.seller-profile-header__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.seller-profile-header__meta i {
    color: #94a3b8;
    font-size: 0.8125rem;
}

/* Listing detail — seller info sidebar */
.seller-info-card__main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.seller-info-avatar {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    border-radius: 9999px;
    background: #3b82f6;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.seller-info-avatar--sm {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    font-size: 0.6875rem;
}

.seller-info-card__divider {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.seller-other-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.seller-other-card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.seller-other-card__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.seller-other-card__meta {
    min-width: 0;
    flex: 1;
}

.seller-other-card__name {
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-other-card:hover .seller-other-card__name {
    color: #1d4ed8;
}

.seller-other-card__price {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ef4444;
    flex-shrink: 0;
    white-space: nowrap;
}

.seller-other-card--featured {
    border-width: 2px;
    border-color: #ff3366;
    animation: listing-border-rgb 4s linear infinite;
}

.seller-other-card__featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.25rem;
    font-size: 0.5625rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    color: #fff;
    line-height: 1.2;
    background: linear-gradient(
        90deg,
        #ff3366,
        #ff9500,
        #ffee00,
        #33ff99,
        #00ccff,
        #9933ff,
        #ff3366
    );
    background-size: 200% 100%;
    animation: listing-accent-rgb 4s linear infinite;
}

.seller-other-card__featured-badge i {
    font-size: 0.5rem;
}

@media (min-width: 1024px) {
    .listings-page-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .listings-filters {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 1rem;
    }
}

@media (max-width: 1023px) {
    .listings-filters {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 50;
        border-radius: 0;
        max-height: none;
        overflow-y: auto;
        padding: 1rem;
        background: rgba(15, 23, 42, 0.4);
        border: none;
    }

    .listings-filters.is-open {
        display: block;
    }

    .listings-filters__form,
    .listings-filters__header {
        background: #fff;
        border-radius: 12px;
        padding: 1rem;
        max-width: 400px;
        margin: 2rem auto 0;
    }

    .listings-filters__header {
        margin-bottom: 0;
        border-radius: 12px 12px 0 0;
        max-width: 400px;
    }

    .listings-filters__form {
        border-radius: 0 0 12px 12px;
        margin-top: 0;
    }
}
