/* ==========================================================================
   Pinneh — Needs / Ads listing page
   Scoped design system. Every rule lives under .pn-browse so this file
   cannot leak into other pages. Colour tokens defer to custom.css.
   ========================================================================== */

.pn-browse {
    /* surfaces */
    --np-bg: #fafafa;
    --np-surface: var(--bg-color2);
    --np-surface-soft: #f5f5f5;
    --np-border: #ededed;
    --np-border-strong: #e0e0e0;

    /* text */
    --np-text: var(--text-color);
    --np-muted: var(--text2-color);

    /* accent */
    --np-red: var(--header-color2);
    --np-red-soft: rgba(210, 0, 0, 0.08);

    /* geometry */
    --np-radius: 10px;
    --np-radius-sm: 8px;
    --np-radius-lg: 14px;

    /* spacing scale */
    --np-gap-xs: 6px;
    --np-gap-sm: 10px;
    --np-gap: 16px;
    --np-gap-md: 20px;
    --np-gap-lg: 28px;

    background: var(--np-bg);
    font-family: "vazirmatn", sans-serif;
    padding-bottom: var(--np-gap-lg);
}

[data-theme="dark"] .pn-browse {
    --np-bg: #232323;
    --np-surface-soft: #2e2e2e;
    --np-border: #343434;
    --np-border-strong: #3d3d3d;
    --np-red-soft: rgba(136, 57, 57, 0.22);
}

/* Shared container — matches the reference content width. */
.pn-browse .np-container {
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
    padding-inline: 32px;
    box-sizing: border-box;
}

@media (max-width: 991px) {
    .pn-browse .np-container {
        padding-inline: 20px;
    }
}

@media (max-width: 575px) {
    .pn-browse .np-container {
        padding-inline: 14px;
    }
}

.pn-browse .np-section {
    margin-top: var(--np-gap-md);
}

/* ==========================================================================
   1. Hero
   ========================================================================== */

.pn-browse .np-hero {
    margin-top: var(--np-gap);
    display: flex;
    align-items: stretch;
    gap: var(--np-gap);
}

.pn-browse .np-hero__content {
    flex: 0 0 30%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pn-browse .np-hero__summary,
.pn-browse .np-hero__about {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-lg);
    padding: 20px 22px;
}

.pn-browse .np-hero__summary {
    text-align: right;
}

.pn-browse .np-hero__title {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--np-red) !important;
    margin: 0 0 10px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

.pn-browse .np-hero__desc {
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--np-muted);
    margin: 0 0 10px;
}

/* Category description comes from the DB as rich text — keep it tame. */
.pn-browse .np-hero__desc * {
    font-size: inherit !important;
    color: inherit !important;
    margin-bottom: 0 !important;
}

.pn-browse .np-hero__count {
    display: inline-flex;
    align-items: center;
    gap: var(--np-gap-xs);
    font-size: 12px;
    color: var(--np-muted);
}

.pn-browse .np-hero__about {
    position: relative;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
    text-align: right;
}

.pn-browse .np-hero__about-title {
    position: relative;
    margin: 0 0 10px;
    padding-right: 12px;
    color: var(--np-red);
    font-size: 16px;
    font-weight: 800;
}

.pn-browse .np-hero__about-title::before {
    content: "";
    position: absolute;
    inset: 1px 0 1px auto;
    width: 3px;
    border-radius: 2px;
    background: var(--np-red);
}

.pn-browse .np-hero__about-excerpt {
    max-height: 4.6em;
    overflow: hidden;
    color: var(--np-muted);
    font-size: 12.5px;
    line-height: 2.3;
}

.pn-browse .np-hero__about-excerpt :where(p, ul, ol) {
    margin-top: 0;
    margin-bottom: 0;
}

.pn-browse .np-hero__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--np-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pn-browse .np-hero__more:hover,
.pn-browse .np-hero__more:focus-visible {
    color: var(--np-red);
}

.pn-browse .np-hero__more i {
    font-size: 9px;
}

.pn-browse .np-hero__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--np-red);
    flex: none;
}

/* --- TOP category banner (PublicBannerResolver::mainPageBanner) -------- */

.pn-browse .np-hero__banner {
    flex: 1 1 70%;
    min-width: 0;
    border-radius: var(--np-radius-lg);
    overflow: hidden;
}

/* The banner partial renders <picture><img style="width:100%;height:auto">,
   so the image keeps its real aspect ratio on its own — this wrapper only
   caps how tall it can get on very wide screens. Never crop, never stretch. */
.pn-browse .np-hero__banner :where(.image-banner) {
    display: block;
    width: 100%;
    border-radius: var(--np-radius-lg);
    overflow: hidden;
    aspect-ratio: 2.8 / 1;
}

.pn-browse .np-hero__banner :where(.image-banner) img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    background: var(--np-surface-soft);
}

.pn-browse .np-list-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.pn-browse .np-btn--map { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; border: 1px solid var(--np-border-strong); background: var(--np-surface); color: var(--np-text); }

/*
 * TOP slider — shown only when there is no purchased/admin-reservation
 * banner and more than one admin Gallery banner qualifies for this
 * category. Reuses /ads's carousel classes (main-banner-wrapper,
 * banner-style-one, carousel-btn-block) so public/js/owl.js's global
 * ".banner-style-one" auto-init handles it with no extra JS. Each slide's
 * .image-banner/img already inherits the sizing/object-fit rules above
 * (same descendant selectors), so slides never stretch or crop either.
 */
.pn-browse .np-hero__slider {
    position: relative;
    width: 100%;
}

.pn-browse .np-hero__slider .banner-style-one .slide {
    height: 260px;
    display: flex;
    align-items: center;
}

/* Global .carousel-btn is 70px and white-on-transparent, sized for a
   full-bleed dark hero — re-skinned here to fit this compact light slot. */
.pn-browse .np-hero__slider .carousel-btn-block {
    top: 50%;
    bottom: auto;
}

.pn-browse .np-hero__slider .carousel-btn {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 12px;
    background: var(--np-surface);
    color: var(--np-muted);
    border: 1px solid var(--np-border-strong);
    box-shadow: none;
}

.pn-browse .np-hero__slider .carousel-btn:hover {
    color: var(--np-red);
    border-color: var(--np-red);
    background: var(--np-surface);
}

.pn-browse .np-hero__slider .carousel-btn.left-btn {
    left: 10px;
}

.pn-browse .np-hero__slider .carousel-btn.right-btn {
    right: 10px;
}

/* Clean empty state when there is neither a purchased nor an admin banner
   for this category — never falls back to unrelated artwork. */
.pn-browse .np-hero__banner-empty {
    width: 100%;
    height: auto;
    aspect-ratio: 2.8 / 1;
    border-radius: var(--np-radius-lg);
    border: 1px dashed var(--np-border-strong);
    background: var(--np-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--np-border-strong);
    font-size: 26px;
    overflow: hidden;
}

.pn-browse .np-hero__banner-empty img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Use the tablet/mobile artwork at its natural ratio, matching /ads. */
@media (max-width: 1199.98px) {
    .pn-browse .np-hero__banner :where(.image-banner) {
        aspect-ratio: auto;
    }

    .pn-browse .np-hero__banner :where(.image-banner) picture {
        display: block;
    }

    .pn-browse .np-hero__banner :where(.image-banner) img {
        display: block;
        height: auto !important;
        object-fit: contain;
    }

    .pn-browse .np-hero__slider .banner-style-one .slide {
        height: auto;
        align-items: stretch;
    }
}

@media (max-width: 991px) {
    .pn-browse .np-hero__content {
        flex-basis: 36%;
    }

}

@media (max-width: 767px) {
    .pn-browse .np-hero {
        flex-direction: column;
        align-items: stretch;
        gap: var(--np-gap-sm);
    }

    .pn-browse .np-hero__content {
        flex-basis: auto;
    }

    .pn-browse .np-hero__count {
        justify-content: flex-start;
    }

    .pn-browse .np-hero__title {
        font-size: 19px;
    }

    .pn-browse .np-hero__banner {
        flex-basis: auto;
    }

}

body.np-modal-open {
    overflow: hidden;
}

.np-description-modal[hidden] {
    display: none;
}

.np-description-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.np-description-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(2px);
}

.np-description-modal__dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--np-border);
    border-radius: 16px;
    background: var(--np-surface);
    color: var(--np-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    outline: none;
}

.np-description-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--np-border);
}

.np-description-modal__header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.np-description-modal__close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--np-surface-soft);
    color: var(--np-muted);
    cursor: pointer;
}

.np-description-modal__close:hover {
    color: var(--np-red);
}

.np-description-modal__content {
    padding: 20px 22px 24px;
    overflow-y: auto;
    color: var(--np-muted);
    font-size: 14px;
    line-height: 2.15;
}

.np-description-modal__content > :last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   2. Category navigation strip
   ========================================================================== */

.pn-browse .np-catnav {
    position: relative;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    padding: 12px 44px;
}

.pn-browse .np-catnav__track {
    display: flex;
    align-items: flex-start;
    justify-content: space-evenly;
    gap: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pn-browse .np-catnav.is-scrollable .np-catnav__track {
    justify-content: flex-start;
}

.pn-browse .np-catnav__track::-webkit-scrollbar {
    display: none;
}

.pn-browse .np-catnav__item {
    flex: 0 0 auto;
    width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--np-gap-xs);
    padding: 8px 4px;
    border-radius: var(--np-radius-sm);
    text-decoration: none;
    transition: background 0.18s ease;
}

.pn-browse .np-catnav__item:hover {
    background: var(--np-surface-soft);
}

.pn-browse .np-catnav__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--np-surface-soft);
    border: 1px solid var(--np-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.pn-browse .np-catnav__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pn-browse .np-catnav__icon i {
    font-size: 19px;
    color: var(--np-muted);
}

.pn-browse .np-catnav__label {
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    color: var(--np-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Active category — the only red element in the strip. */
.pn-browse .np-catnav__item.is-active .np-catnav__icon {
    background: var(--np-red-soft);
    border-color: var(--np-red);
}

.pn-browse .np-catnav__item.is-active .np-catnav__icon i {
    color: var(--np-red);
}

.pn-browse .np-catnav__item.is-active .np-catnav__label {
    color: var(--np-red);
    font-weight: 700;
}

/* Scroll arrows */
.pn-browse .np-catnav__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--np-surface);
    border: 1px solid var(--np-border-strong);
    color: var(--np-muted);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    z-index: 2;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.pn-browse .np-catnav.is-scrollable .np-catnav__arrow {
    display: flex;
}

.pn-browse .np-catnav__arrow:hover {
    color: var(--np-red);
    border-color: var(--np-red);
}

.pn-browse .np-catnav__arrow--prev {
    right: 8px;
}

.pn-browse .np-catnav__arrow--next {
    left: 8px;
}

@media (max-width: 767px) {
    .pn-browse .np-catnav {
        padding: 10px 12px;
    }

    /* Touch scrolling replaces the arrows on mobile. */
    .pn-browse .np-catnav__arrow {
        display: none;
    }

    .pn-browse .np-catnav.is-scrollable .np-catnav__arrow {
        display: none;
    }

    .pn-browse .np-catnav__item {
        width: 78px;
    }

    .pn-browse .np-catnav__icon {
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================================
   3. Filter panel
   ========================================================================== */

.pn-browse .np-filter {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    padding: 16px 20px;
}

.pn-browse .np-filter__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--np-gap);
    align-items: end;
}

.pn-browse .np-filter__field {
    min-width: 0;
}

.pn-browse .np-filter__label {
    display: block;
    font-size: 11.5px;
    color: var(--np-muted);
    margin-bottom: var(--np-gap-xs);
}

.pn-browse .np-filter__control,
.pn-browse .np-filter select.filter-select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--np-border-strong);
    border-radius: var(--np-radius-sm);
    background: var(--np-surface);
    color: var(--np-text);
    font-size: 13px;
    font-family: inherit;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.18s ease;
}

.pn-browse .np-filter__control:focus,
.pn-browse .np-filter select.filter-select:focus {
    border-color: var(--np-red);
}

/* Category opener is a button, not a select — match the control shell. */
.pn-browse button.np-filter__control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--np-gap-xs);
    text-align: start;
    cursor: pointer;
}

.pn-browse .np-filter__control .np-filter__chev {
    font-size: 10px;
    color: var(--np-muted);
    flex: none;
}

.pn-browse .np-filter__reset {
    justify-self: end;
    align-self: end;
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: var(--np-gap-xs);
    background: none;
    border: none;
    padding: 0;
    font-size: 12.5px;
    color: var(--np-muted);
    cursor: pointer;
    white-space: nowrap;
}

.pn-browse .np-filter__reset:hover {
    color: var(--np-red);
}

.pn-browse .np-filter__actions {
    display: flex;
    align-items: center;
    gap: var(--np-gap-sm);
    margin-top: var(--np-gap);
}

.pn-browse .np-btn {
    height: 44px;
    padding: 0 26px;
    border-radius: var(--np-radius-sm);
    font-size: 13.5px;
    font-family: inherit;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--np-gap-xs);
    text-decoration: none;
    transition: opacity 0.18s ease, background 0.18s ease;
}

.pn-browse .np-btn--primary {
    background: var(--np-red);
    color: #fff;
}

.pn-browse .np-btn--primary:hover {
    opacity: 0.9;
    color: #fff;
}

.pn-browse .np-btn--ghost {
    background: var(--np-surface);
    border-color: var(--np-border-strong);
    color: var(--np-text);
}

.pn-browse .np-btn--ghost:hover {
    border-color: var(--np-red);
    color: var(--np-red);
}

.pn-browse .np-btn--block {
    width: 100%;
}

/* Select2 has to inherit the control shell or the row breaks visually. */
.pn-browse .np-filter .select2-container {
    width: 100% !important;
}

.pn-browse .np-filter .select2-container--default .select2-selection--single {
    height: 44px;
    border: 1px solid var(--np-border-strong);
    border-radius: var(--np-radius-sm);
    background: var(--np-surface);
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.pn-browse
    .np-filter
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    line-height: normal;
    color: var(--np-text);
    font-size: 13px;
    padding: 0;
}

.pn-browse
    .np-filter
    .select2-container--default
    .select2-selection--single
    .select2-selection__arrow {
    height: 42px;
    left: 8px;
    right: auto;
}

@media (max-width: 1199px) {
    .pn-browse .np-filter__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pn-browse .np-filter__reset {
        grid-column: 1 / -1;
        justify-self: start;
        height: auto;
    }
}

@media (max-width: 575px) {
    .pn-browse .np-filter {
        padding: 14px;
    }

    .pn-browse .np-filter__grid {
        grid-template-columns: 1fr;
        gap: var(--np-gap-sm);
    }

    .pn-browse .np-filter__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pn-browse .np-filter__actions .np-btn {
        width: 100%;
    }
}

/* ==========================================================================
   4. Marketplace layout — pinned ads at left, results at right
   ========================================================================== */

.pn-browse .np-main {
    display: flex;
    align-items: start;
    gap: var(--np-gap);
    direction: ltr;
}

.pn-browse .np-main--without-pinned .np-listing {
    width: 100%;
}

.pn-browse .np-listing {
    flex: 1 1 auto;
    min-width: 0;
    direction: rtl;
}

.pn-browse .np-featured {
    flex: 0 0 calc(25% - 12px);
    min-width: 0;
    direction: rtl;
}

.pn-browse .np-featured__header {
    margin-bottom: 12px;
}

.pn-browse .np-featured__title {
    position: relative;
    margin: 0;
    padding-right: 11px;
    color: var(--np-text);
    font-size: 13.5px;
    font-weight: 800;
}

.pn-browse .np-featured__title::before {
    position: absolute;
    inset: 1px 0 1px auto;
    width: 3px;
    border-radius: 3px;
    background: var(--np-red);
    content: "";
}

.pn-browse .np-featured__track {
    display: flex;
    flex-direction: column;
    gap: var(--np-gap);
}

.pn-browse .np-featured__card {
    width: 100%;
    min-width: 0;
}

/* ==========================================================================
   5. Ads grid + card
   ========================================================================== */

.pn-browse .np-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--np-gap);
}

.pn-browse .np-main--without-pinned .np-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1199px) {
    .pn-browse .np-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .pn-browse .np-main {
        flex-direction: column;
    }

    .pn-browse .np-featured,
    .pn-browse .np-listing {
        width: 100%;
        flex-basis: auto;
    }

    .pn-browse .np-featured__viewport {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 5px;
        scrollbar-width: thin;
        overscroll-behavior-inline: contain;
    }

    .pn-browse .np-featured__track {
        width: max-content;
        flex-direction: row;
    }

    .pn-browse .np-featured__card {
        width: min(290px, calc(100vw - 72px));
    }

    .pn-browse .np-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pn-browse .np-main--without-pinned .np-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .pn-browse .np-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--np-gap-sm);
    }
}

/* Full-bleed rows inside the grid (banner / reportage / teaser slots). */
.pn-browse .np-grid__full {
    grid-column: 1 / -1;
}

/*
 * MIDDLE banner breakpoint slots.
 *
 * <x-banners.middle-slots> emits one hidden-by-default duplicate per column
 * count it supports (c1/c2/c3/c4 = 1/2/3/4-column layouts), directly as
 * full-width grid rows. Exactly one must be visible at a time —
 * whichever matches .np-grid's current column count above —
 * or the same banner stacks multiple times in one spot.
 *
 * Thresholds mirror .np-grid's own breakpoints exactly:
 *   <=767px -> 1 col, 768-1199px -> 3 col, >=1200px -> 4 col.
 */
.pn-browse .middle-banner-slot {
    display: none;
}

.pn-browse .middle-banner-slot--c1 {
    display: block;
}

.pn-browse .middle-banner-slot .image-banner {
    display: block;
    width: 100%;
    border-radius: var(--np-radius);
    overflow: hidden;
}

.pn-browse .middle-banner-slot .image-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    margin-inline: auto;
}

@media (min-width: 768px) {
    .pn-browse .middle-banner-slot--c1 {
        display: none;
    }

    .pn-browse .middle-banner-slot--c3 {
        display: block;
    }
}

@media (min-width: 1200px) {
    .pn-browse .middle-banner-slot--c3 {
        display: none;
    }

    .pn-browse .middle-banner-slot--c4 {
        display: block;
    }

    /* With a pinned column, the standard results area has three tracks. */
    .pn-browse .np-main:not(.np-main--without-pinned) .middle-banner-slot--c3 {
        display: block;
    }

    .pn-browse .np-main:not(.np-main--without-pinned) .middle-banner-slot--c4 {
        display: none;
    }
}

.pn-browse .np-card {
    position: relative;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.pn-browse .np-card:hover {
    border-color: var(--np-border-strong);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .pn-browse .np-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* --- media ------------------------------------------------------------- */

.pn-browse .np-card__media {
    position: relative;
    display: block;
    /* Fixed ratio keeps every card identical and prevents layout shift. */
    aspect-ratio: 4 / 3;
    background: var(--np-surface-soft);
    overflow: hidden;
}

.pn-browse .np-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pn-browse .np-card__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #767678;
    color: var(--np-border-strong);
    font-size: 30px;
}

.pn-browse .np-card__media--empty .np-card__media-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.pn-browse .np-card__media--empty img {
    width: 80%;
    height: auto;
    max-height: 80%;
    object-fit: contain;
}

.pn-browse .np-card__image-count {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 7px;
    border-radius: 6px;
    background: rgba(20, 20, 20, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    direction: ltr;
    pointer-events: none;
}

.pn-browse .np-card__image-count i {
    font-size: 11px;
}

/* Favourite / bookmark — readable over light and dark photography. */
.pn-browse .np-card__fav {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    font-size: 13px;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    transition: color 0.18s ease;
    text-decoration: none;
}

.pn-browse .np-card__fav:hover,
.pn-browse .np-card__fav.is-active {
    color: var(--np-red);
}

/* Promoted / urgent state — real backend flags only. */
.pn-browse .np-card__flag {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: var(--np-red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 9px;
    border-radius: 6px;
}

/* Category badge sits bottom-start of the media, as in the reference. */
.pn-browse .np-card__cat {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(4px);
    color: #3a3a3a;
    font-size: 10.5px;
    line-height: 1;
    padding: 5px 9px;
    border-radius: 6px;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- body -------------------------------------------------------------- */

.pn-browse .np-card__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: var(--np-gap-xs);
    flex: 1 1 auto;
}

.pn-browse .np-card__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
    color: var(--np-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.pn-browse a.np-card__title-link {
    text-decoration: none;
    color: inherit;
}

.pn-browse .np-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--np-gap-xs);
    font-size: 10.5px;
    color: var(--np-muted);
    margin-top: auto;
    padding-top: 2px;
}

.pn-browse .np-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pn-browse .np-card__meta i {
    font-size: 9.5px;
    flex: none;
}

/* Seller line — package tier icons are real subscription data. */
.pn-browse .np-card__seller {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--np-muted);
    min-width: 0;
}

.pn-browse .np-card__seller img.np-card__tier {
    height: 14px;
    width: auto;
    flex: none;
}

.pn-browse .np-card__seller span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ==========================================================================
   6. Sidebar blocks
   ========================================================================== */

.pn-browse .np-panel {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: 12px;
    padding: 18px;
}

.pn-browse .np-panel__title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--np-text);
    margin: 0 0 12px;
}

.pn-browse .np-panel__desc {
    font-size: 12px;
    line-height: 1.9;
    color: var(--np-muted);
    margin: 0 0 14px;
}

/* --- popular categories ------------------------------------------------ */

.pn-browse .np-catlist {
    display: flex;
    flex-direction: column;
}

.pn-browse .np-catlist__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--np-gap-sm);
    padding: 9px 0;
    font-size: 12.5px;
    color: var(--np-text);
    text-decoration: none;
    border-bottom: 1px solid var(--np-border);
    transition: color 0.18s ease;
}

.pn-browse .np-catlist__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pn-browse .np-catlist__row:hover {
    color: var(--np-red);
}

.pn-browse .np-catlist__row.is-active {
    color: var(--np-red);
    font-weight: 700;
}

.pn-browse .np-catlist__name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --- register-ad CTA ---------------------------------------------------- */

.pn-browse .np-cta__art {
    width: 100%;
    height: 88px;
    border-radius: var(--np-radius-sm);
    background: var(--np-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--np-red);
    font-size: 30px;
}

/* --- pinned ads --------------------------------------------------------- */

.pn-browse .np-pinned {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pn-browse .np-pinned__row {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--np-gap-sm);
    padding: 9px 0;
    text-decoration: none;
    border-bottom: 1px solid var(--np-border);
}

.pn-browse .np-pinned__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pn-browse .np-pinned__thumb {
    position: relative;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: var(--np-radius-sm);
    overflow: visible;
    background: var(--np-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--np-border-strong);
    font-size: 15px;
}

.pn-browse .np-pinned__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pn-browse .np-pinned__thumb > img:not(.np-pinned__pin) {
    border-radius: inherit;
}

.pn-browse .np-pinned__row > .np-pinned__pin {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 23px;
    height: 23px;
    padding: 4px;
    border: 1px solid rgba(230, 0, 0, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    object-fit: contain;
    box-shadow: 0 2px 7px rgba(77, 0, 0, 0.18);
    z-index: 1;
}

.pn-browse .np-pinned__content {
    min-width: 0;
    flex: 1 1 auto;
}

.pn-browse .np-pinned__title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--np-text);
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pn-browse .np-pinned__meta {
    display: flex;
    align-items: center;
    gap: var(--np-gap-xs);
    font-size: 10.5px;
    color: var(--np-muted);
}

.pn-browse .np-pinned__mark {
    flex: none;
    color: var(--np-red);
    font-size: 9.5px;
}

/* ==========================================================================
   7. Empty state, pagination
   ========================================================================== */

.pn-browse .np-empty {
    grid-column: 1 / -1;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    padding: 56px 20px;
    text-align: center;
}

.pn-browse .np-listing--empty .np-grid {
    grid-template-columns: minmax(0, 1fr);
}

.pn-browse .np-listing--empty .np-empty {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pn-browse .np-empty i {
    font-size: 40px;
    color: var(--np-border-strong);
    margin-bottom: 14px;
}

.pn-browse .np-empty h4 {
    font-size: 16px;
    color: var(--np-text);
    margin: 0 0 6px;
}

.pn-browse .np-empty p {
    font-size: 12.5px;
    color: var(--np-muted);
    margin: 0;
}

.pn-browse .np-pager {
    margin-top: var(--np-gap-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--np-gap-sm);
}

.pn-browse .np-pager__count {
    font-size: 12px;
    color: var(--np-muted);
    margin: 0;
}

.pn-browse #load-more-btn {
    height: 44px;
    padding: 0 34px;
    border-radius: var(--np-radius-sm);
    border: 1px solid var(--np-border-strong);
    background: var(--np-surface);
    color: var(--np-text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.pn-browse #load-more-btn:hover:not(:disabled) {
    border-color: var(--np-red);
    color: var(--np-red);
}

.pn-browse #load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Story component — contained to the page rhythm. */
.pn-browse .np-story:empty {
    display: none;
}

.pn-browse .category-long-description {
    margin-top: var(--np-gap-lg);
    padding: 24px;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    color: var(--np-text);
}

.pn-browse .category-long-description__title {
    margin: 0 0 16px;
    font-size: 19px;
    font-weight: 700;
}

.pn-browse .category-long-description__content {
    color: var(--np-muted);
    font-size: 14px;
    line-height: 2;
}

.pn-browse .category-long-description__content > :last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   8. Card hover toolbar
   Preserved behaviour from the previous cards — public/js/order-actions.js
   binds to these exact class names. Restyled to sit over the media without
   adding card height.
   ========================================================================== */

.pn-browse .ad-hover-toolbar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 12px);
    overflow: auto;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    border-radius: 40px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 4;
    scrollbar-width: none;
}

.pn-browse .ad-hover-toolbar::-webkit-scrollbar {
    display: none;
}

.pn-browse .ad-card-hover-container:hover .ad-hover-toolbar {
    opacity: 1;
    visibility: visible;
}

.pn-browse .toolbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: #fff;
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 10px;
    transition: background 0.18s ease;
}

.pn-browse .toolbar-item:hover {
    background: rgba(255, 255, 255, 0.14);
}

.pn-browse .toolbar-item i {
    font-size: 12px;
}

.pn-browse .toolbar-count {
    font-size: 8.5px;
    font-weight: 600;
    white-space: nowrap;
}

.pn-browse .toolbar-item.active i {
    color: #ff6b6b !important;
}

.pn-browse .toolbar-report.reported {
    opacity: 0.5;
    cursor: not-allowed !important;
}

/* Touch devices have no hover — the toolbar would be unreachable, and the
   card links are the primary action there anyway. */
@media (hover: none) {
    .pn-browse .ad-hover-toolbar {
        display: none;
    }
}
/* Shared company/listing ad card, used on /needs and /ads-company pages. */
.cp-ad{
    --cp-card-bg:#f4f4f5;
    --cp-card-media:#fff;
    --cp-card-border:#e0e2e5;
    --cp-card-title:#333;
    --cp-card-muted:#777;
    --cp-card-shadow:#00000012;
    --cp-card-accent:var(--header-color2,#e60023);
    background:var(--cp-card-bg);border:1px solid var(--cp-card-border);border-radius:13px;padding:13px 13px 0;min-width:0;overflow:hidden;transition:.2s
}
[data-theme="dark"] .cp-ad,.dark .cp-ad{
    --cp-card-bg:#2c3139;
    --cp-card-media:#20242a;
    --cp-card-border:#3c434d;
    --cp-card-title:#f1f3f5;
    --cp-card-muted:#b9c0c9;
    --cp-card-shadow:#00000055;
    color-scheme:dark
}
.cp-ad:hover{transform:translateY(-3px);box-shadow:0 8px 20px var(--cp-card-shadow)}
.cp-ad-img{position:relative;height:185px;background:var(--cp-card-media);border:1px solid var(--cp-card-border);border-radius:11px;display:flex;overflow:hidden}
.cp-ad-img img{width:100%;height:100%;object-fit:contain;padding:9px}
.cp-ad--pinned{border-color:rgba(230,0,0,.7);background:rgba(230,0,0,.07);background:color-mix(in srgb,var(--cp-card-bg) 92%,var(--cp-card-accent) 8%)}
.cp-ad--pinned:hover{border-color:var(--cp-card-accent)}
.cp-ad--laddered,.cp-ad--laddered:hover{border-color:var(--cp-card-accent)}
.cp-ad-promotion{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;gap:4px;padding:6px 9px;border-radius:999px;background:rgba(255,255,255,.94);color:var(--cp-card-accent);font-size:10.5px;font-weight:700;line-height:1;box-shadow:0 1px 5px #6200001f}
.cp-ad-promotion img{width:13px;height:13px;padding:0;object-fit:contain}
.cp-ad-body{padding:13px 3px;min-height:82px}
.cp-ad-body h2{font-size:16px;font-weight:800;margin:0 0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-ad-body h2 a{color:var(--cp-card-title)!important}
.cp-ad-body p{font-size:12px;color:var(--cp-card-muted);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-ad-meta{min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;padding:0 0 9px;color:var(--cp-card-muted);font-size:10.5px;direction:rtl}
.cp-ad-meta span{min-width:0;display:flex;align-items:center;justify-content:center;gap:5px;padding-inline:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-ad-meta span+span{border-right:1px solid var(--cp-card-border)}
.cp-ad-meta i{flex:0 0 auto;font-size:12px}
.cp-ad-foot{height:40px;border-top:1px solid var(--cp-card-border);display:flex;align-items:center;justify-content:space-between;font-size:12px}
.cp-ad-foot a{font-weight:700;color:var(--cp-card-title)!important}
.cp-ad-foot span{color:var(--cp-card-muted)}

@media(max-width:700px){
    .cp-ad{padding:7px 7px 0}
    .cp-ad-img{height:130px}
    .cp-ad-body{padding:9px 2px;min-height:68px}
    .cp-ad-body h2{font-size:13px}
    .cp-ad-meta{font-size:9.5px}
    .cp-ad-meta span{gap:3px;padding-inline:3px}
}
