/* Only the public ad page. Catalog, forms, account and Messenger keep their CSS. */
.ad-detail { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(240px, 1fr); gap: 24px; color: #010101; }
.ad-detail *, .ad-detail *::before, .ad-detail *::after { box-sizing: border-box; }
.ad-detail [hidden] { display: none !important; }
.ad-detail-heading { grid-column: 1 / -1; }
.ad-detail h1 { font-size: 28px; margin: 0 0 12px; overflow-wrap: anywhere; }
.ad-detail h2 { font-size: 21px; margin: 0 0 16px; overflow-wrap: anywhere; }
.ad-detail-price { font-size: 25px; font-weight: 600; margin: 0 0 8px; }
.ad-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: #555; overflow-wrap: anywhere; }
.ad-detail-main, .ad-detail-sidebar { min-width: 0; }
.ad-detail-main-photo { display: block; }
.ad-detail-main-image { display: block; width: 100%; max-height: 520px; aspect-ratio: 4 / 3; object-fit: contain; background: #f5f5f5; }
.ad-detail-thumbnails { display: flex; gap: 8px; padding: 10px 0; overflow-x: auto; max-width: 100%; }
.ad-detail-thumbnails a { flex: 0 0 80px; border: 2px solid transparent; border-radius: 3px; padding: 2px; }
.ad-detail-thumbnails a[aria-current="true"] { border-color: #252d5e; }
.ad-detail-thumbnails img { display: block; width: 100%; height: 60px; object-fit: contain; background: #f5f5f5; }
.ad-detail button, .ad-detail-login, .ad-detail-paging a { min-height: 44px; padding: 9px 12px; border: 1px solid #bcbcbc; border-radius: 4px; background: #f5f5f5; color: #252d5e; cursor: pointer; font: inherit; }
.ad-detail button:disabled { cursor: default; opacity: .65; }
.ad-detail button[aria-pressed="true"] { border-color: #252d5e; background: #e8e9f2; }
.ad-detail a:focus-visible, .ad-detail button:focus-visible, .ad-detail input:focus-visible, .ad-detail select:focus-visible, .ad-detail textarea:focus-visible { outline: 3px solid #252d5e; outline-offset: 3px; }
.ad-detail-actions { display: flex; gap: 6px; align-items: stretch; }
.ad-detail-actions > * { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 4px; text-align: center; word-break: normal; overflow-wrap: normal; white-space: normal; hyphens: none; font-size: 14px; }
.ad-detail-actions img { width: 30px; height: 30px; object-fit: contain; }
.ad-detail-status { overflow-wrap: anywhere; margin: 12px 0; }
.ad-detail-phone { display: block; margin: 12px 0; min-height: 44px; padding: 4px 8px 4px 44px; overflow-wrap: anywhere; }
.ad-detail .ad-detail-phone { width: 100%; padding: 4px 8px 4px 44px; background: #f5f5f5 url('../img/phone.jpg') no-repeat 17px center; line-height: 36px; text-align: center; }
.ad-detail-seller { margin-top: 20px; overflow-wrap: anywhere; }
.ad-detail-seller .adview-logo { display: block; object-fit: cover; margin-bottom: 14px; }
.ad-detail-seller h2 { font-size: 20px; }
.ad-detail-seller button, .ad-detail-login, .ad-detail-seller-link { display: block; width: 100%; text-align: center; }
.ad-detail-seller-link { margin-top: 14px; min-height: 44px; padding: 6px; line-height: 1.5; }
.ad-detail-report { margin: 14px 0 24px; padding: 12px; border: 1px solid #ccc; border-radius: 4px; }
.ad-detail-report label, .ad-detail-copy { display: block; margin: 10px 0; }
.ad-detail-report select, .ad-detail-report textarea, .ad-detail-copy input { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; margin-top: 6px; font: inherit; padding: 8px; border: 1px solid #aaa; }
.ad-detail-report textarea { resize: vertical; }
.ad-detail-properties, .ad-detail-description, .ad-detail-related { margin-top: 28px; }
.ad-detail-properties dl { margin: 0; }
.ad-detail-properties dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #e5e5e5; }
.ad-detail-properties dt, .ad-detail-properties dd { margin: 0; overflow-wrap: anywhere; }
.ad-detail-properties dd, .ad-detail-description p { white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-detail-related .ads-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ad-detail-related .ads-grid .cont { width: auto; min-width: 0; float: none; margin: 0; padding: 0; overflow-wrap: anywhere; }
.ad-detail-related .ads-grid img { width: 100%; height: auto; }
.ad-detail-related .ads-grid .title { height: auto; min-height: 0; }
.ad-detail-paging { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.ad-detail-banner { margin-top: 24px; }
.ad-detail-banner img, .ad-detail .banner-adview img { max-width: 100%; height: auto; }
@media (max-width: 991px) {
    .ad-detail { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .ad-detail-heading { grid-row: 1; }
    .ad-detail-main { display: contents; }
    .ad-detail-gallery { grid-row: 2; }
    .ad-detail-description { grid-row: 3; margin-top: 0; }
    .ad-detail-description p { line-height: 1.5; }
    .ad-detail-description.is-collapsed p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        max-height: 6em;
        overflow: hidden;
    }
    .ad-detail-properties { grid-row: 4; }
    .ad-detail-sidebar { grid-row: 5; }
    .ad-detail-seller .adview-logo { float: left; margin-right: 16px; }
    .ad-detail-seller-link { clear: both; }
    .ad-detail-banner { display: none; }
}
@media (max-width: 575px) {
    .ad-detail h1 { font-size: 24px; }
    .ad-detail-related .ads-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .ad-detail-properties dl > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (min-width: 992px) {
    .ad-detail-description-toggle { display: none; }
}

/* Bound seller/similar/Top thumbnails; the main gallery and its photo count are unchanged. */
.ad-detail-related .ads-grid img { aspect-ratio: 4 / 3; object-fit: contain; }

/* Seller actions share the existing yellow/blue palette, including the followed state. */
.ad-detail-seller button[data-action="follow"],
.ad-detail-seller .ad-detail-login,
.ad-detail-seller .ad-detail-seller-link {
    clear: both;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    /* The existing seller link also has Bootstrap's important .border utility. */
    border: 1px solid #c6a961 !important;
    border-radius: 4px;
    background: #ffd562;
    color: #252d5f;
    line-height: 1.5;
    white-space: normal;
    text-align: center;
}
.ad-detail-seller button[data-action="follow"]:not(:disabled):hover,
.ad-detail-seller button[data-action="follow"]:focus-visible,
.ad-detail-seller .ad-detail-login:hover,
.ad-detail-seller .ad-detail-login:focus-visible,
.ad-detail-seller .ad-detail-seller-link:hover,
.ad-detail-seller .ad-detail-seller-link:focus-visible {
    border-color: #252d5f !important;
    color: #252d5f;
}
.ad-detail #seller-ads + .banner-adview { margin-top: 16px; }
@media (max-width: 991px) {
    /* Mobile already separates these grid items with a 20px gap. */
    .ad-detail #seller-ads + .banner-adview { margin-top: 0; }
}
