/***
Pers theme - single listing (item) page

Keeps the detail page aligned with the homepage and the search/listings
page. The search bar itself now lives in the header (see the persistent
header search in pers-home.css, shown on every non-home page), so this file
only styles:

  1. .pers-item-topbar / .pers-item-crumb -> the breadcrumb trail at the top
                                             of the detail page.
  2. .pers-related                        -> the "Related listings" block,
                                             rebuilt to use the same card
                                             design (.pers-card) as the
                                             homepage and search results.

All colours come from the theme's own tokens (--pers-primary / -hover /
-soft) and the neutral greys used across pers-home.css / pers-cards.css, so
the backoffice colour pickers keep working.
***/

/* =========================================================
   BREADCRUMB
   ========================================================= */
.pers-item-topbar {
    margin: 16px 0 2px;
}
.pers-item-crumb {
    margin: 0 2px;
    min-height: 18px;
}
.pers-item-crumb ul.breadcrumb {
    display: block;
    margin: 0;
    padding: 0;
    background: none;
    font-size: 13px;
    line-height: 1.6;
}
.pers-item-crumb ul.breadcrumb > li {
    display: inline;
    color: #667085;
}
.pers-item-crumb ul.breadcrumb > li > a { color: #475467; }
.pers-item-crumb ul.breadcrumb > li > a:hover { color: var(--pers-primary); text-decoration: none; }
.pers-item-crumb ul.breadcrumb > li > span { color: #98a2b3; }
.pers-item-crumb ul.breadcrumb > li.active,
.pers-item-crumb ul.breadcrumb > li:last-child { color: #101828; }
.pers-item-crumb ul.breadcrumb > li + li:before {
    content: "\f105";
    font-family: FontAwesome;
    color: #cbd2dc;
    padding: 0 9px;
}

/* =========================================================
   RELATED LISTINGS - reuse the .pers-card design in a grid
   ========================================================= */
.pers-related {
    margin: 30px 0 8px;
}
.pers-related-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eceef2;
}
.pers-related-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #101828;
    line-height: 1.3;
}
.pers-related-title .fa { color: var(--pers-primary); margin-right: 7px; }
.pers-related-all {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 15px;
    border-radius: 999px;
    border: 1px solid var(--pers-primary);
    color: var(--pers-primary);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.pers-related-all:hover {
    text-decoration: none;
    background: var(--pers-primary);
    color: #fff;
}

.pers-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
/* neutralise the float / bootstrap-column geometry the shared .listing-card
   carries so the grid alone controls placement and sizing */
.pers-related-grid > .listing-card {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    left: auto;
}

/* the item content column is only ~58-66% wide, so step down earlier than a
   full-width grid would */
@media (max-width: 991px) {
    .pers-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
    .pers-related-grid { grid-template-columns: 1fr; }
}


/* =========================================================
   DETAIL PAGE CHROME
   The base #content box (white panel + border) is dropped here so each
   section below (gallery, description, details) becomes its own clean
   card, matching the homepage / listings card look.
   ========================================================= */
body.item #content {
    background: transparent;
    border: 0;
    padding: 0;
}
body.item .item-title { margin: 6px 0 16px; }
body.item .item-title h2 {
    font-size: 26px;
    font-weight: 700;
    color: #101828;
    line-height: 1.25;
    margin: 0 0 8px;
}
body.item .item-title .location,
body.item .item-title .category,
body.item .item-title .posted {
    font-size: 13px;
    color: #667085;
}
body.item .item-title span i { color: var(--pers-primary); }

/* =========================================================
   GALLERY (Dubizzle-style: big stage + thumbnail rail)
   ========================================================= */
.pers-gallery { margin: 0 0 20px; }

.pers-gallery-stage {
    position: relative;
    border: 1px solid #e8ebf0;
    border-radius: 14px;
    overflow: hidden;
    background: #eef1f5;
}
.pers-gallery-viewport {
    position: relative;
    width: 100%;
    padding-bottom: 62%;   /* stage aspect ratio */
}
.pers-gallery-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    padding: 6px;
}
.pers-gallery-slide.is-active { opacity: 1; visibility: visible; }

.pers-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    border: 1px solid #e8ebf0;
    color: #101828;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(16,24,40,.14);
    transition: background .15s ease, box-shadow .15s ease;
}
.pers-gallery-nav:hover { background: #fff; box-shadow: 0 4px 12px rgba(16,24,40,.2); }
.pers-gallery-nav .fa { font-size: 16px; }
.pers-gallery-prev { left: 12px; }
.pers-gallery-next { right: 12px; }

.pers-gallery-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    background: rgba(16,24,40,.72);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    pointer-events: none;
}
.pers-gallery-count .fa { margin-right: 5px; }

.pers-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.pers-gallery-thumb {
    flex: 0 0 auto;
    width: 92px;
    height: 68px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #eef1f5;
    cursor: pointer;
    opacity: .75;
    transition: opacity .15s ease, border-color .15s ease;
}
.pers-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pers-gallery-thumb:hover { opacity: 1; }
.pers-gallery-thumb.is-active { opacity: 1; border-color: var(--pers-primary); }

/* =========================================================
   CONTENT PANELS (description, additional details)
   ========================================================= */
.pers-detail-body { }
.pers-panel {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 20px 22px;
    margin: 0 0 18px;
}
.pers-panel-title {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #101828;
    padding-bottom: 11px;
    border-bottom: 1px solid #f0f2f5;
}
.pers-desc {
    color: #344054;
    font-size: 14.5px;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.pers-desc p { margin: 0 0 10px; }
.pers-desc p:last-child { margin-bottom: 0; }

/* Additional-details table as a clean spec list (overrides the old
   style.css #custom_fields look; higher specificity via body.item). */
body.item #custom_fields table {
    width: 100%;
    margin: 0 !important;
    background: transparent;
    border: 0;
}
body.item #custom_fields table tr,
body.item #custom_fields table tr.grey {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f2f4f7;
}
body.item #custom_fields table tr:last-child { border-bottom: 0; }
body.item #custom_fields table td {
    padding: 10px 4px;
    font-size: 14px;
    vertical-align: top;
    line-height: 1.5;
}
body.item #custom_fields table td:first-child { width: 42%; color: #667085; }
body.item #custom_fields table td:last-child { width: 58%; color: #101828; font-weight: 600; }
body.item #custom_fields table td strong { font-weight: inherit; }

/* the plugin detail block (#extra-fields -> .pers-veh-detail etc.) already
   renders as its own card; just give the wrapper consistent spacing */
.pers-extra-fields { margin: 0; }

/* social share row */
body.item .item-bottom { margin: 2px 0 18px; }

@media (max-width: 767px) {
    .pers-gallery-viewport { padding-bottom: 70%; }
    .pers-gallery-thumb { width: 76px; height: 56px; }
    body.item .item-title h2 { font-size: 22px; }
    .pers-panel { padding: 16px 16px; }
}


/* =========================================================
   GALLERY EXPAND BUTTON + LIGHTBOX
   ========================================================= */
.pers-gallery-expand {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(16,24,40,.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.pers-gallery-expand:hover { background: rgba(16,24,40,.78); }
.pers-gallery-expand .fa { font-size: 15px; }

.pers-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: none;
}
.pers-lightbox.is-open { display: block; }
body.pers-lb-open { overflow: hidden; }

.pers-lightbox-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(9,12,20,.97);
    cursor: zoom-out;
}
.pers-lightbox-stage {
    position: absolute;
    top: 60px; left: 0; right: 0; bottom: 116px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
}
.pers-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 44px rgba(0,0,0,.5);
}
.pers-lightbox-btn {
    position: absolute;
    z-index: 2;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.pers-lightbox-btn:hover { background: rgba(255,255,255,.26); }
.pers-lightbox-btn .fa { font-size: 18px; }
.pers-lightbox-close { top: 18px; right: 18px; }
.pers-lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.pers-lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }
.pers-lightbox-counter {
    position: absolute;
    top: 26px;
    left: 24px;
    z-index: 2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
}
.pers-lightbox-thumbs {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 100px;
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding: 14px 18px;
    scrollbar-width: thin;
}
.pers-lightbox-thumb {
    flex: 0 0 auto;
    width: 96px;
    height: 68px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #1a2230;
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s ease, border-color .15s ease;
}
.pers-lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pers-lightbox-thumb:hover { opacity: .85; }
.pers-lightbox-thumb.is-active { opacity: 1; border-color: #fff; }

/* =========================================================
   ROUND EVERYTHING: sidebar widgets, comments, share row
   Turns the remaining flat blocks into the same rounded white cards
   the gallery / description / related sections already use. Scoped to
   body.item so no other page is touched. Higher specificity (body.item
   + #id) beats the base style.css rules.
   ========================================================= */

/* ----- sidebar widgets ----- */
body.item #sidebar div.widget {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
    margin-bottom: 16px;
    overflow: hidden;
}
/* base css joins the first two widgets (price + publisher) into one block;
   restore them as separate rounded cards */
body.item #sidebar div.widget:first-child {
    margin-bottom: 16px;
    border: 1px solid #eef0f4;
    border-bottom: 1px solid #eef0f4;
}
body.item #sidebar div.widget h3 {
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
    font-size: 16px;
    font-weight: 700;
    color: #101828;
    padding: 14px 16px;
}
body.item #sidebar .price {
    height: auto;
    min-height: 52px;
    padding: 16px 18px;
    overflow: visible;
}
body.item #sidebar .price .col-sm-9 span,
body.item #sidebar .price .col-sm-12 span {
    font-size: 26px;
    font-weight: 800;
    color: var(--pers-primary);
}
body.item #sidebar .publisher { padding: 16px 18px; }
body.item #sidebar .googlemap,
body.item #sidebar .usefulinfo,
body.item #sidebar .gadsense,
body.item #sidebar .sellerlisting { padding-left: 16px; padding-right: 16px; }

/* ----- comments ----- */
body.item #comments {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    overflow: hidden;
    margin: 18px 0;
}
body.item #comments h2 {
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
    font-size: 18px;
    font-weight: 700;
    color: #101828;
    padding: 15px 18px;
}
body.item #comments h2 .fa { color: var(--pers-primary); }
body.item .no-comments { color: #667085; }

/* ----- share / actions row as a card ----- */
body.item .item-bottom {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 12px 10px;
}

@media (max-width: 767px) {
    .pers-lightbox-stage { top: 52px; bottom: 96px; }
    .pers-lightbox-thumbs { height: 84px; }
    .pers-lightbox-thumb { width: 74px; height: 54px; }
    .pers-lightbox-btn { width: 40px; height: 40px; }
}


/* address fallback shown in the sidebar when no map is available */
body.item #sidebar .googlemap .pers-loc-text {
    margin: 0;
    padding: 4px 2px;
    color: #344054;
    font-size: 14px;
    line-height: 1.5;
}
body.item #sidebar .googlemap .pers-loc-text .fa {
    color: var(--pers-primary);
    margin-right: 6px;
}
