/* Unslop styling guidance adapted from Damir Sokolovsky, CC BY 4.0. */
.ep-market-feed-card {
    --market-border: var(--color-grey-line, #E8E7E3);
    background: var(--bg-surface, #fff);
    border: 1px solid var(--market-border);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 1px 2px rgba(41, 42, 45, .05);
    color: var(--color-charcoal, #424347);
    margin: 0 auto 16px;
    max-width: 720px;
    overflow: visible;
    width: 100%;
}

.ep-market-feed-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
    padding: 16px 16px 8px;
}

.ep-market-seller {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 12px;
    min-width: 0;
}

.ep-market-avatar {
    align-items: center;
    background: var(--color-orange-subtle, #FDF5F0);
    border: 1px solid var(--color-orange-border, rgba(243, 107, 43, .22));
    border-radius: 50%;
    color: var(--color-charcoal, #424347);
    display: flex;
    flex: 0 0 40px;
    font-size: 12px;
    font-weight: 500;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.ep-market-avatar-link {
    border-radius: 50%;
    display: flex;
    flex: 0 0 40px;
    text-decoration: none;
}

.ep-market-avatar-link:focus-visible,
.ep-market-seller-link:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--color-orange, #F36B2B);
    outline-offset: 3px;
}

.ep-market-seller-copy,
.ep-market-seller-name-row {
    min-width: 0;
}

.ep-market-seller-name-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.ep-market-seller-name {
    color: var(--color-charcoal, #424347);
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-market-seller-link {
    text-decoration: none;
}

.ep-market-seller-link:hover {
    color: var(--color-charcoal, #424347);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ep-market-verified {
    align-items: center;
    color: var(--color-grey-secondary, #74777D);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
}

.ep-market-verified svg {
    flex: 0 0 16px;
    height: 16px;
    overflow: visible;
    width: 16px;
}

.ep-market-verified-circle {
    fill: var(--color-info, #2563EB);
}

.ep-market-verified-check {
    fill: none;
    stroke: #fff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.ep-market-meta {
    align-items: center;
    color: var(--color-grey-secondary, #74777D);
    display: flex;
    font-size: 12px;
    gap: 6px;
    line-height: 1.5;
    margin-top: 2px;
    min-width: 0;
}

.ep-market-location {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-market-icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--color-grey-secondary, #74777D);
    cursor: pointer;
    display: inline-flex;
    height: 44px;
    justify-content: center;
    padding: 0;
    width: 44px;
}

.ep-market-icon-button:hover,
.ep-market-icon-button:focus-visible {
    background: var(--bg-subtle-box, #F5F4F0);
    color: var(--color-charcoal, #424347);
    outline: none;
}

.ep-market-icon-button:focus-visible,
.ep-market-action:focus-visible,
.ep-market-see-more:focus-visible {
    box-shadow: 0 0 0 3px var(--color-orange-border, rgba(243, 107, 43, .22));
}

.ep-market-icon-button svg,
.ep-market-overflow-menu svg,
.ep-market-action svg,
.ep-market-image-fallback svg,
.ep-market-inline-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.ep-market-icon-button svg {
    height: 20px;
    width: 20px;
}

.ep-market-overflow-wrap {
    flex: 0 0 auto;
    position: relative;
}

.ep-market-overflow-menu {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--market-border);
    border-radius: var(--radius-sm, 8px);
    box-shadow: 0 4px 12px rgba(41, 42, 45, .08);
    inset-block-start: calc(100% + 4px);
    inset-inline-end: 0;
    min-width: 176px;
    padding: 4px;
    position: absolute;
    z-index: 20;
}

.ep-market-overflow-menu button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--color-charcoal, #424347);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 8px;
    min-height: 40px;
    padding: 8px;
    text-align: start;
    width: 100%;
}

.ep-market-overflow-menu button:hover,
.ep-market-overflow-menu button:focus-visible {
    background: var(--bg-subtle-box, #F5F4F0);
    outline: none;
}

.ep-market-overflow-menu svg {
    color: var(--color-grey-secondary, #74777D);
    height: 18px;
    width: 18px;
}

.ep-market-context {
    align-items: center;
    color: var(--color-grey-secondary, #74777D);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px;
    line-height: 1.5;
    padding-block-end: 8px;
    padding-inline-end: 16px;
    padding-inline-start: 68px;
}

.ep-market-copy {
    padding: 0 16px 12px;
}

.ep-market-title-line {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.ep-market-title-line h2 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ep-market-title-line h2 a {
    color: var(--color-charcoal, #424347);
    text-decoration: none;
}

.ep-market-title-line h2 a:hover {
    color: var(--color-orange-active, #C7480C);
}

.ep-market-negotiable {
    background: var(--bg-subtle-box, #F5F4F0);
    border-radius: 6px;
    color: var(--color-charcoal-muted, #54575E);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 400;
    padding: 4px 8px;
}

.ep-market-price-line {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.ep-market-price {
    color: var(--color-orange-active, #C7480C);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.4;
}

.ep-market-pricing-unit,
.ep-market-old-price {
    color: var(--color-grey-secondary, #74777D);
    font-size: 12px;
}

.ep-market-old-price {
    text-decoration: line-through;
}

.ep-market-description {
    margin-top: 8px;
}

.ep-market-description p {
    color: var(--color-charcoal-muted, #54575E);
    font-family: var(--font-sans, var(--font-urdu, sans-serif));
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
    overflow-wrap: anywhere;
    text-align: start;
}

.ep-market-description p:dir(rtl) {
    font-family: var(--font-urdu, serif);
    line-height: 1.75;
}

.ep-market-description p.is-collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.ep-market-description p.is-expanded {
    white-space: pre-line;
}

.ep-market-see-more {
    background: none;
    border: 0;
    color: var(--color-grey-secondary, #74777D);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    padding: 4px 0;
}

.ep-market-see-more:hover {
    color: var(--color-orange-active, #C7480C);
}

.ep-market-attributes {
    color: var(--color-grey-secondary, #74777D);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px;
    margin-top: 8px;
}

.ep-market-attributes span + span::before {
    color: var(--color-grey-light, #9DA0A6);
    content: "·";
    margin-inline-end: 8px;
}

.ep-market-attributes strong {
    color: var(--color-charcoal, #424347);
    font-weight: 500;
    margin-inline-end: 4px;
}

.ep-market-image-link {
    align-items: center;
    background: var(--bg-surface, #fff);
    display: flex;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
    width: 100%;
}

.ep-market-image-link img {
    display: block;
    height: auto;
    max-height: none;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    width: 100%;
}

.ep-market-image-fallback {
    align-items: center;
    color: var(--color-grey-secondary, #74777D);
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 8px;
    justify-content: center;
    min-height: 180px;
}

.ep-market-image-fallback svg {
    height: 32px;
    width: 32px;
}

.ep-market-stock-note {
    background: rgba(41, 42, 45, .88);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    inset-block-end: 12px;
    inset-inline-start: 12px;
    padding: 6px 8px;
    position: absolute;
}

.ep-market-actions {
    align-items: stretch;
    border-top: 1px solid var(--market-border);
    display: flex;
    justify-content: center;
    margin: 0 16px;
}

.ep-market-action {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--color-grey-secondary, #74777D);
    cursor: pointer;
    display: inline-flex;
    flex: 1;
    font: inherit;
    justify-content: center;
    margin: 4px 0;
    min-height: 44px;
    padding: 8px;
    text-decoration: none;
}

.ep-market-action:hover {
    background: var(--bg-subtle-box, #F5F4F0);
    color: var(--color-charcoal, #424347);
    text-decoration: none;
}

.ep-market-action.is-selected {
    background: var(--color-orange-subtle, #FDF5F0);
    color: var(--color-orange-active, #C7480C);
}

.ep-market-save-action.is-selected svg {
    fill: currentColor;
}

.ep-market-action svg {
    height: 20px;
    width: 20px;
}

.ep-market-feedback {
    color: var(--color-charcoal-muted, #54575E);
    font-size: 12px;
    padding: 0 16px 12px;
    text-align: center;
}

.ep-market-categories {
    background: var(--bg-surface, #fff) !important;
    border: 1px solid var(--color-grey-line, #E8E7E3) !important;
    border-radius: var(--radius-md, 12px) !important;
    box-shadow: none !important;
}

.ep-market-category-rail {
    gap: 8px !important;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.ep-market-category-rail::-webkit-scrollbar {
    display: none;
}

.ep-market-category {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--color-grey-secondary, #74777D);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    white-space: nowrap;
}

.ep-market-category:hover {
    background: var(--bg-subtle-box, #F5F4F0);
    color: var(--color-charcoal, #424347);
}

.ep-market-category.is-selected {
    background: var(--color-orange-subtle, #FDF5F0);
    border-color: var(--color-orange-border, rgba(243, 107, 43, .22));
    color: var(--color-orange-active, #C7480C);
    font-weight: 500;
}

.ep-market-category:focus-visible,
.ep-market-search-input :focus-visible {
    box-shadow: 0 0 0 3px var(--color-orange-border, rgba(243, 107, 43, .22));
    outline: none;
}

.ep-feed-search {
    align-items: center;
    display: flex;
    gap: 8px;
    width: 100%;
}

.ep-feed-search-field {
    align-items: center;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--color-grey-line, #E8E7E3);
    border-radius: 10px;
    display: flex;
    flex: 1 1 auto;
    min-height: 48px;
    min-width: 0;
    padding: 0 10px;
    transition: border-color var(--transition-smooth, 0.22s), box-shadow var(--transition-smooth, 0.22s);
}

.ep-feed-search-field:focus-within {
    border-color: var(--color-orange, #F36B2B);
    box-shadow: 0 0 0 3px var(--color-orange-tint, rgba(243, 107, 43, .08));
}

.ep-feed-search-icon,
.ep-feed-search-submit svg {
    fill: none;
    flex: 0 0 18px;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 18px;
}

.ep-feed-search-icon {
    color: var(--color-grey-secondary, #74777D);
}

.ep-feed-search-input {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--color-charcoal, #424347);
    flex: 1 1 auto;
    font: inherit;
    font-size: 14px;
    min-height: 44px;
    min-width: 0;
    outline: 0;
    padding: 0 9px;
}

.ep-feed-search-input::placeholder {
    color: var(--color-grey-secondary, #74777D);
    opacity: 1;
}

.ep-feed-search-clear {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--color-grey-secondary, #74777D);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 32px;
    font: inherit;
    font-size: 21px;
    height: 32px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 32px;
}

.ep-feed-search-clear:hover {
    background: var(--color-grey-subtle, #F2F1ED);
    color: var(--color-charcoal, #424347);
}

.ep-feed-search-submit {
    align-items: center;
    background: var(--color-orange, #F36B2B);
    border: 0;
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 48px;
    height: 48px;
    justify-content: center;
    padding: 0;
    transition: background-color var(--transition-smooth, 0.22s);
    width: 48px;
}

.ep-feed-search-submit:hover {
    background: var(--color-orange-hover, #E05818);
}

.ep-feed-search-submit:focus-visible,
.ep-feed-search-clear:focus-visible {
    box-shadow: 0 0 0 3px var(--color-orange-border, rgba(243, 107, 43, .22));
    outline: none;
}

.ep-market-filter-panel,
.ep-market-post-prompt,
.ep-mobile-discovery {
    background: var(--bg-surface, #fff) !important;
    border: 1px solid var(--color-grey-line, #E8E7E3) !important;
    border-radius: var(--radius-md, 12px) !important;
    box-shadow: none !important;
}

.ep-market-active-filters {
    color: var(--color-grey-secondary, #74777D);
    font-size: 12px !important;
}

.ep-market-filter-tag {
    align-items: center;
    background: var(--bg-subtle-box, #F5F4F0);
    border-radius: 6px;
    color: var(--color-charcoal, #424347);
    display: inline-flex;
    font-size: 12px;
    gap: 4px;
    padding: 4px 6px;
}

.ep-market-filter-tag button {
    background: transparent;
    border: 0;
    color: var(--color-grey-secondary, #74777D);
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.ep-market-error-state {
    align-items: center;
    background: var(--bg-surface, #fff) !important;
    border: 1px solid var(--color-grey-line, #E8E7E3) !important;
    border-radius: var(--radius-md, 12px) !important;
    color: var(--color-charcoal, #424347);
    gap: 12px;
}

.ep-market-empty-icon {
    color: var(--color-grey-secondary, #74777D);
}

.ep-market-search-input input,
.ep-market-search-input select,
.ep-market-search-input button {
    min-height: 44px;
}

.ep-market-search-submit {
    align-items: center;
    background: var(--color-orange-subtle, #FDF5F0);
    border: 1px solid var(--color-orange-border, rgba(243, 107, 43, .22));
    border-radius: 8px;
    color: var(--color-orange-active, #C7480C);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 500;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    text-decoration: none;
}

.ep-market-search-submit svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    width: 18px;
}

.ep-market-loading-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--color-grey-line, #E8E7E3);
    border-radius: var(--radius-md, 12px);
    box-shadow: none;
}

.ep-market-search-input input,
.ep-market-search-input select {
    background: var(--bg-subtle-box, #F5F4F0) !important;
    border-color: transparent !important;
    color: var(--color-charcoal, #424347);
}

.ep-market-post-link {
    align-items: center;
    background: var(--bg-subtle-box, #F5F4F0);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--color-grey-secondary, #74777D);
    display: flex;
    font-size: 14px;
    min-height: 44px;
    padding: 8px 12px;
    text-decoration: none;
}

.ep-market-post-link:hover,
.ep-market-post-link:focus-visible {
    border-color: var(--color-grey-line, #E8E7E3);
    color: var(--color-charcoal, #424347);
    text-decoration: none;
}

.ep-market-prompt-icon {
    align-items: center;
    background: var(--bg-subtle-box, #F5F4F0);
    border-radius: 8px;
    color: var(--color-grey-secondary, #74777D);
    display: flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.ep-market-prompt-icon svg,
.ep-market-inline-icon svg {
    height: 18px;
    width: 18px;
}

.ep-market-inline-icon {
    align-items: center;
    color: var(--color-grey-secondary, #74777D);
    display: inline-flex;
    flex: 0 0 20px;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.ep-market-empty-state,
.ep-market-error-state,
.ep-market-sidebar-card {
    background: var(--bg-surface, #fff) !important;
    border: 1px solid var(--color-grey-line, #E8E7E3) !important;
    border-radius: var(--radius-md, 12px) !important;
    box-shadow: none !important;
}

.ep-market-empty-state svg,
.ep-market-error-state svg {
    color: var(--color-grey-secondary, #74777D);
    height: 24px;
    width: 24px;
}

.ep-mobile-seller-filter {
    background: var(--bg-subtle-box, #F5F4F0) !important;
    border: 1px solid var(--color-grey-line, #E8E7E3) !important;
    border-radius: 8px !important;
}

.ep-mobile-seller-filter .btn {
    border-radius: 6px !important;
    color: var(--color-grey-secondary, #74777D);
    font-size: 13px !important;
    font-weight: 400 !important;
    min-height: 40px;
    padding: 8px;
}

.ep-mobile-seller-filter .btn.is-selected {
    background: var(--bg-surface, #fff) !important;
    border: 1px solid var(--color-grey-line, #E8E7E3) !important;
    color: var(--color-charcoal, #424347) !important;
}

.ep-market-load-more {
    border-radius: 8px !important;
    box-shadow: none !important;
    min-height: 44px;
}

@media (max-width: 767.98px) {
    .ep-market-feed-card {
        margin: 0 0 12px;
        max-width: none;
    }

    .ep-market-feed-header {
        padding: 12px 12px 8px;
    }

    .ep-market-context {
        padding-block-end: 8px;
        padding-inline-end: 12px;
        padding-inline-start: 64px;
    }

    .ep-market-copy {
        padding: 0 12px 12px;
    }

    .ep-market-actions {
        margin: 0 12px;
    }

    .ep-market-categories {
        border: 0 !important;
        margin-inline: -2px;
        padding-inline: 4px !important;
    }

    .ep-market-post-prompt,
    .ep-market-filter-panel,
    .ep-mobile-discovery {
        margin-bottom: 12px !important;
        padding: 12px !important;
    }

    .ep-market-category {
        min-height: 36px;
        padding-inline: 12px;
    }
}

@media (max-width: 380px) {
    .ep-market-seller-name {
        max-width: 180px;
    }

    .ep-market-verified span {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .ep-market-feed-card {
        transition: border-color 160ms ease;
    }

    .ep-market-feed-card:hover {
        border-color: #D7D5D0;
    }
}
