.ad-page {
    background: linear-gradient(180deg, #f8faf8 0%, #f4f6f4 100%);
    padding: 1.5rem 0 4rem;
    min-height: 70vh;
}

.ad-topbar,
.ad-gallery,
.ad-card-detail,
.ad-contact,
.ad-seller-detail{
    background: #fff;
    border: 1px solid rgba(16, 24, 40, 0.06);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.ad-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.ad-topbar__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ad-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #f0f2f0;
    color: #475467;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ad-chip--verified {
    background: rgba(199, 167, 91, 0.14);
    border: 1px solid rgba(199, 167, 91, 0.2);
    color: #8a6d1b;
}

.ad-chip--sold {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.16);
    color: #dc3545;
}

.ad-topbar__title {
    margin: 0 0 0.75rem;
    color: var(--primary-color);

    font-size: clamp(1.8rem, 1.45rem + 1.2vw, 2.8rem);
    line-height: 1.1;
}

.ad-topbar__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.ad-topbar__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #667085;
    font-size: 0.9rem;
    font-weight: 500;
}

.ad-topbar__meta-item svg {
    color: var(--secondary-color);
    flex-shrink: 0;
}

.ad-topbar__right {
    flex: 0 0 212px;
    text-align: right;
}

.ad-topbar__price {
    color: var(--primary-color);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.ad-topbar__price-label {
    margin-top: 0.3rem;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ad-topbar__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.ad-topbar__save-form {
    display: contents;
}

.ad-topbar__action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.ad-topbar__action-btn.is-saved {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.06);
    border-color: rgba(220, 53, 69, 0.2);
}

.ad-grid-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}

.ad-main-detail {
    min-width: 0;
}

/* ── Gallery ── */
.ad-gallery {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.ad-gallery__main {
    position: relative;
    overflow: hidden;
    background: #f5f7f5;
    border-radius: 16px;
}

.ad-gallery__slide {
    display: none;
    position: relative;
}

.ad-gallery__slide.active {
    display: block;
}

.ad-gallery__image,
.ad-gallery__video {
    width: 100%;
    height: 520px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.ad-gallery__thumbs {
    padding: 0.85rem 1rem 1rem;
}

.ad-gallery__thumb-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.ad-gallery__thumb {
    flex: 0 0 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    background: none;
}

.ad-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.ad-gallery__thumb.active {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(199, 167, 91, 0.2);
}

.ad-gallery__video-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.ad-gallery__counter {
    position: absolute;
    left: 16px;
    bottom: 84px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
}

.ad-gallery__sold-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
}

.ad-gallery__sold-overlay img {
    width: 55%;
    height: auto;
    object-fit: contain;
}

.ad-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1f3d2b;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.ad-gallery__arrow--prev { left: 16px; }
.ad-gallery__arrow--next { right: 16px; }

.ad-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.92);
}

.ad-lightbox.show { display: flex; }
.ad-lightbox__body { max-width: min(96vw, 1600px); max-height: 92vh; width: 100%; text-align: center; }
.ad-lightbox img, .ad-lightbox video { max-width: 100%; max-height: 88vh; border-radius: 12px; }
.ad-lightbox__close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.16); color: #fff; font-size: 1.8rem; }
.ad-lightbox__counter { display: inline-block; margin-top: 0.75rem; padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(255,255,255,0.1); color: #fff; }

.ad-card-detail {
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.ad-card-detail__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(16, 24, 40, 0.06);
}

.ad-card-detail__header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.06rem;
    font-weight: 700;
}

.ad-card-detail__header svg {
    color: var(--secondary-color);
    flex-shrink: 0;
}

.ad-card-detail__header--warm {
    background: linear-gradient(135deg, rgba(199, 167, 91, 0.08), rgba(199, 167, 91, 0.03));
}

.ad-card-detail__body { padding: 1.5rem; }
.ad-card-detail__body--flush { padding: 0; }
.ad-description { color: #344054; line-height: 1.85; }
.ad-description__empty { color: #98a2b3; font-style: italic; text-align: center; }

.ad-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.ad-detail-group {
    border: 1px solid rgba(16, 24, 40, 0.06);
    border-radius: 16px;
    overflow: hidden;
}

.ad-detail-group__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    background: rgba(16, 24, 40, 0.02);
    border-bottom: 1px solid rgba(16, 24, 40, 0.06);
}

.ad-detail-group__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.08), rgba(199, 167, 91, 0.08));
}

.ad-detail-group__header h4 { margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--primary-color); }
.ad-detail-group__rows { padding: 0.4rem 0; }
.ad-detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 1.1rem; }
.ad-detail-row__label { color: #667085; font-size: 0.86rem; }
.ad-detail-row__value { display: inline-flex; align-items: center; gap: 0.35rem; color: #101828; font-size: 0.88rem; font-weight: 600; }
.ad-detail-row__value.is-yes { color: #039855; }
.ad-detail-row__value.is-no { color: #d92d20; }
.ad-health-note { display: flex; gap: 0.75rem; margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 16px; background: #fffaf0; border: 1px solid rgba(199, 167, 91, 0.2); }
.ad-map, .ad-card-detail__body--flush iframe { width: 100%; height: 360px; border: 0; display: block; }
.ad-similar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 767.98px) { .ad-similar-grid { grid-template-columns: 1fr; } }
.ad-similar-card { display: flex; flex-direction: column; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; color: inherit; text-decoration: none; }
.ad-similar-card__img { position: relative; height: 200px; background: #f0f2f0; }
.ad-similar-card__img img { width: 100%; height: 100%; object-fit: cover; }
.ad-similar-card__price, .ad-similar-card__photos { position: absolute; z-index: 2; }
.ad-similar-card__price { top: 10px; right: 10px; padding: 0.3rem 0.75rem; border-radius: 10px; background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #fff; font-size: 0.82rem; font-weight: 700; }
.ad-similar-card__photos { right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.6rem; border-radius: 8px; background: rgba(0,0,0,0.5); color: #fff; font-size: 0.72rem; }
.ad-similar-card__body { padding: 0.9rem 1rem 1rem; }
.ad-similar-card__tag { display: inline-flex; margin-bottom: 0.45rem; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.ad-similar-card__tag.sale { background: #eef4ef; color: #173f2e; }
.ad-similar-card__tag.stud { background: #fff3da; color: #8a5a00; }
.ad-similar-card__title { margin: 0 0 0.35rem; font-size: 0.96rem; color: #101828; }
.ad-similar-card__breed, .ad-similar-card__location { margin: 0; color: #667085; font-size: 0.82rem; }
.ad-similar-card__location { display: flex; align-items: center; gap: 0.3rem; }
.ad-safety__intro { margin: 0 0 1.25rem; color: #667085; }
.ad-safety__list { display: flex; flex-direction: column; gap: 0.75rem; }
.ad-safety__item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.95rem 0; border-bottom: 1px solid rgba(16, 24, 40, 0.05); }
.ad-safety__item:last-child { border-bottom: 0; padding-bottom: 0; }
.ad-safety__num { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, rgba(27, 67, 50, 0.08), rgba(199, 167, 91, 0.08)); color: var(--primary-color); font-size: 0.72rem; font-weight: 800; }
.ad-safety__item p { margin: 0; color: #344054; line-height: 1.55; }
.ad-sidebar-detail { position: sticky; top: 90px; }
.ad-contact, .ad-seller-detail { margin-bottom: 1.25rem; overflow: hidden; }
.ad-contact__header { padding: 1.25rem 1.35rem; background: linear-gradient(145deg, #1a4633 0%, #255a44 100%); }
.ad-contact__label { display: block; color: #fff; font-size: 1.05rem; font-weight: 700; }
.ad-contact__sub { margin: 0.3rem 0 0; color: rgba(255,255,255,0.72); font-size: 0.82rem; }
.ad-contact__sold { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1rem; background: rgba(220,53,69,0.06); color: #dc3545; font-size: 0.88rem; font-weight: 700; }
.ad-contact__buttons { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem 1.25rem; }
.ad-btn-detail { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.82rem 1rem; border-radius: 12px; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.ad-btn-detail--primary { background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #fff; }
.ad-btn-detail--gold { background: linear-gradient(135deg, var(--secondary-color), #d4af37); color: #fff; }
.ad-btn-detail--outline { background: #fff; color: var(--primary-color); border: 1.5px solid #e5e7eb; }
.ad-contact__stats { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid rgba(16,24,40,0.06); }
.ad-contact__stat { display: flex; flex-direction: column; align-items: center; padding: 0.85rem 0.5rem; border-right: 1px solid rgba(16,24,40,0.06); }
.ad-contact__stat:last-child { border-right: 0; }
.ad-contact__stat-val { color: var(--primary-color); font-weight: 800; }
.ad-contact__stat-label { color: #98a2b3; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.ad-seller-detail__top { display: flex; align-items: center; gap: 0.85rem; padding: 1.25rem; }
.ad-seller-detail__photo { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #e5e7eb; object-fit: cover; }
.ad-seller-detail__name { margin: 0; color: #101828; font-size: 1rem; font-weight: 700; }
.ad-seller-detail__badge { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.25rem; color: #8a6d1b; font-size: 0.78rem; font-weight: 600; }
.ad-seller-detail__meta { border-top: 1px solid rgba(16,24,40,0.06); }
.ad-seller-detail__meta-row { display: flex; justify-content: space-between; padding: 0.72rem 1.25rem; border-bottom: 1px solid rgba(16,24,40,0.04); color: #667085; font-size: 0.85rem; }
.ad-seller-detail__meta-row:last-child { border-bottom: 0; }
.ad-seller-detail__meta-row strong { color: #101828; }


@media (max-width: 991.98px) {
    .ad-grid-detail { grid-template-columns: 1fr; }
    .ad-sidebar-detail { position: static; }
    .ad-details-grid { grid-template-columns: 1fr; }
    .ad-similar-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .ad-topbar { flex-direction: column; gap: 1rem; padding: 1.25rem; }
    .ad-topbar__right { width: 100%; text-align: left; flex: none; }
    .ad-topbar__actions { justify-content: flex-start; flex-wrap: wrap; }
    .ad-gallery__image, .ad-gallery__video { height: 340px !important; }
    /* .ad-contact__stats { grid-template-columns: 1fr; } */
    .ad-contact__stat { border-right: 0; border-bottom: 1px solid rgba(16,24,40,0.06); }
    .ad-contact__stat:last-child { border-bottom: 0; }
}

/* advert detail refinement */
.ad-page {
    background:
        radial-gradient(circle at top left, rgba(199, 167, 91, 0.12), transparent 24%),
        linear-gradient(180deg, #f6f4ee 0%, #f7f8f5 42%, #eef3ee 100%);
}

.ad-topbar {
    padding: 1rem;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,248,0.94));
    box-shadow: 0 18px 48px rgba(27, 41, 32, 0.1);
}
.ad-topbar__title {

    font-size: clamp(2rem, 2rem + 1.2vw, 3rem);
    letter-spacing: -0.03em;
}

.ad-topbar__meta {
    gap: 0.9rem 1.2rem;
}

.ad-topbar__meta-item {
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: #f6f7f4;
    border: 1px solid rgba(16, 24, 40, 0.05);
    font-weight: 600;
}

.ad-topbar__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-height: 100%;
    padding: 0.5rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(23,63,46,0.03), rgba(199,167,91,0.08));
}

.ad-topbar__price {
    font-size: clamp(1.8rem, 2.2rem + 0.8vw, 2rem);
}

.ad-grid-detail {
    /* grid-template-columns: minmax(0, 1fr) 360px; */
    gap: 1.8rem;
}

.ad-gallery,
.ad-card-detail,
.ad-contact,
.ad-seller-detail {
    border-radius: 26px;
    border-color: rgba(24, 38, 30, 0.08);
    box-shadow: 0 18px 44px rgba(17, 24, 39, 0.07);
}

.ad-gallery {
    padding: 1rem;
    background: linear-gradient(180deg, #fffefb 0%, #fbfcfa 100%);
}

.ad-gallery__main {
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f7f1 0%, #eef2ec 100%);
}

.ad-gallery__image,
.ad-gallery__video {
    height: 640px;
    padding: 1.25rem;
    background: transparent;
}

.ad-gallery__thumbs {
    padding: 1rem 0.15rem 0.15rem;
}

.ad-gallery__thumb {
    border-radius: 16px;
}

.ad-gallery__thumb img {
    border-radius: 14px;
}

.ad-gallery__video-thumb {
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
}

.ad-gallery__counter {
    left: 28px;
    bottom: 118px;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.ad-gallery__arrow {
    width: 52px;
    height: 52px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.14);
}

.ad-gallery__arrow--prev { left: 24px; }
.ad-gallery__arrow--next { right: 24px; }

.ad-card-detail {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,251,248,0.98));
}

.ad-card-detail__header {
    padding: 1.35rem 1.6rem;
}

.ad-card-detail__header h3 {
    font-size: 1.35rem;
}

.ad-card-detail__body {
    padding: 1.6rem;
}

.ad-description {
    font-size: 1rem;
    line-height: 1.95;
    color: #36454f;
}

.ad-details-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.ad-detail-group {
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(19, 41, 31, 0.08);
}

.ad-detail-group__header {
    padding: 1.15rem 1.2rem;
    background: linear-gradient(135deg, rgba(27,67,50,0.05), rgba(199,167,91,0.08));
}

.ad-detail-group__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
}

.ad-detail-group__header h4 {
    font-size: 1.02rem;
}

.ad-detail-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
}

.ad-detail-row__label {
    font-size: 0.95rem;
    line-height: 1.45;
}

.ad-detail-row__value {
    justify-self: end;
    text-align: right;
    font-size: 0.98rem;
}

.ad-health-note {
    margin-top: 1.25rem;
    border-radius: 18px;
}

.ad-contact {
    overflow: hidden;
}

.ad-contact__header {
    padding: 1.5rem;
    background: linear-gradient(145deg, #173f2e 0%, #1f5a42 100%);
}

.ad-contact__label {
    font-size: 1.8rem;
    line-height: 1;
}

.ad-contact__sub {
    margin-top: 0.55rem;
    font-size: 0.96rem;
    line-height: 1.6;
}

.ad-contact__buttons {
    padding: 1.15rem;
    gap: 0.85rem;
}

.ad-btn-detail {
    justify-content: flex-start;
    min-height: 58px;
    padding: 0.95rem 1.05rem;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(16,24,40,0.06);
}

.ad-btn-detail svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.ad-btn-detail--primary {
    background: linear-gradient(135deg, #173f2e, #245c44);
    color: #fff;
}

.ad-btn-detail--gold {
    background: linear-gradient(135deg, #c7a75b, #d7b867);
    color: #183528;
}

.ad-btn-detail--outline {
    background: #f8faf8;
    color: #173f2e;
    border: 1px solid rgba(23,63,46,0.12);
}

.ad-contact__stat {
    padding: 1rem 0.6rem;
}

.ad-contact__stat-val {
    font-size: 1.15rem;
}

.ad-seller-detail__top {
    padding: 1.4rem;
}

.ad-seller-detail__photo {
    width: 66px;
    height: 66px;
    border-width: 3px;
}

.ad-seller-detail__name {
    font-size: 1.1rem;
}


.ad-safety {
    margin-top: 0;
}

.ad-sidebar-detail .ad-safety .ad-card-detail__header {
    padding: 1.1rem 1.2rem;
}

.ad-sidebar-detail .ad-safety .ad-card-detail__header h3 {
    font-size: 1.05rem;
}

.ad-sidebar-detail .ad-safety .ad-card-detail__body {
    padding: 1rem 1.15rem 1.2rem;
}

.ad-sidebar-detail .ad-safety__intro {
    margin-bottom: 0.9rem;
    font-size: 0.88rem;
    line-height: 1.6;
}

.ad-sidebar-detail .ad-safety__list {
    gap: 0.5rem;
}

.ad-sidebar-detail .ad-safety__item {
    gap: 0.65rem;
    padding: 0.6rem 0;
}

.ad-sidebar-detail .ad-safety__num {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
}

.ad-sidebar-detail .ad-safety__item p {
    font-size: 0.84rem;
    line-height: 1.45;
}

.ad-similar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.ad-similar-card {
    border-radius: 20px;
    border-color: rgba(19,41,31,0.08);
    box-shadow: 0 10px 24px rgba(17,24,39,0.05);
}

.ad-similar-card__img {
    height: 235px;
    background: linear-gradient(180deg, #f8f7f1 0%, #eef2ec 100%);
}

.ad-similar-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.ad-similar-card__body {
    padding: 1rem 1rem 1.1rem;
}

.ad-similar-card__title {
    font-size: 1.05rem;
    line-height: 1.3;
}

@media (max-width: 1199.98px) {
    /* .ad-grid-detail {
        grid-template-columns: minmax(0, 1fr) 330px;
    } */

    .ad-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}



@media (max-width: 767.98px) {
    .ad-topbar {
        padding: 0.8rem;
        border-radius: 22px;
    }

    .ad-topbar__meta-item {
        width: 100%;
        justify-content: flex-start;
    }

    .ad-gallery {
        padding: 0.75rem;
    }

    .ad-gallery__image,
    .ad-gallery__video {
        height: 420px !important;
        padding: 0.75rem;
    }

    .ad-gallery__counter {
        left: 20px;
        bottom: 104px;
    }

    .ad-detail-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .ad-detail-row__value {
        justify-self: start;
        text-align: left;
    }
}

.ad-sidebar-detail {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-self: start;
}

.ad-sidebar-detail > .ad-contact,
.ad-sidebar-detail > .ad-seller-detail,
.ad-sidebar-detail > .ad-quicknav,
.ad-sidebar-detail > .ad-safety {
    width: 100%;
    margin-bottom: 0;
}

/* sidebar and media centering fix */
.ad-grid-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
}

.ad-main-detail {
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.ad-sidebar-detail {
    min-width: 0;
    width: 100%;
}

.ad-lightbox {
    display: none;
    align-items: center;
    justify-content: center;
}

.ad-lightbox.show {
    display: flex;
}

.ad-lightbox__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: min(94vw, 1500px);
    max-height: 92vh;
    margin: 0 auto;
}

.ad-lightbox img,
.ad-lightbox video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 84vh;
    margin: 0 auto;
    object-fit: contain;
}


/* final responsive overrides */
.ad-page {
    overflow-x: hidden;
}

.ad-topbar__left,
.ad-topbar__right,
.ad-contact,
.ad-seller-detail,
.ad-card-detail,
.ad-detail-group {
    min-width: 0;
}

.ad-topbar__meta-item,
.ad-btn-detail,
.ad-seller-detail__meta-row strong,
.ad-detail-row__value {
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .ad-topbar {
        gap: 1rem;
    }

    .ad-topbar__right {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    .ad-topbar__actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .ad-topbar__save-form {
        display: block;
        flex: 1 1 180px;
    }

    .ad-topbar__action-btn {
        width: 100%;
        justify-content: center;
    }

    .ad-grid-detail {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .ad-sidebar-detail {
        position: static;
        top: auto;
    }

    .ad-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .ad-page {
        padding: 1rem 0 2.5rem;
    }

    .ad-topbar,
    .ad-gallery,
    .ad-card-detail,
    .ad-contact,
    .ad-seller-detail
     {
        border-radius: 18px;
    }

    .ad-topbar {
        padding: 0.8rem;
    }



    .ad-topbar__meta {
        gap: 0.65rem;
    }

    .ad-topbar__meta-item {
        width: 100%;
        padding: 0.7rem 0.85rem;
        border-radius: 14px;
    }

    .ad-topbar__right {
        padding: 1rem;
        border-radius: 16px;
    }



    .ad-topbar__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ad-topbar__save-form,
    .ad-topbar__actions > .ad-topbar__action-btn {
        flex: 1 1 auto;
        width: 100%;
    }

    .ad-gallery {
        padding: 0.65rem;
    }

    .ad-gallery__main {
        border-radius: 16px;
    }

    .ad-gallery__image,
    .ad-gallery__video {
        height: clamp(240px, 64vw, 360px) !important;
        padding: 0.5rem;
    }

    .ad-gallery__arrow {
        width: 40px;
        height: 40px;
    }

    .ad-gallery__arrow--prev {
        left: 12px;
    }

    .ad-gallery__arrow--next {
        right: 12px;
    }

    .ad-gallery__counter {
        left: 12px;
        right: 12px;
        bottom: 84px;
        justify-content: center;
    }

    .ad-gallery__thumbs {
        padding: 0.75rem 0.1rem 0.1rem;
    }

    .ad-gallery__thumb {
        flex: 0 0 60px;
        height: 60px;
    }

    .ad-card-detail__header,
    .ad-card-detail__body,
    .ad-contact__header,
    .ad-contact__buttons,
    .ad-seller-detail__top {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .ad-card-detail__header {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .ad-card-detail__body {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .ad-detail-group,
    .ad-health-note,
    .ad-btn-detail {
        border-radius: 14px;
    }

    .ad-detail-group__header,
    .ad-detail-row,
    .ad-seller-detail__meta-row {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .ad-detail-row,
    .ad-seller-detail__meta-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .ad-detail-row__value {
        justify-self: start;
        text-align: left;
    }

    .ad-seller-detail__top,
    .ad-seller-detail__meta-row {
        flex-wrap: wrap;
    }

    .ad-contact__label {
        font-size: 1.45rem;
    }

    /* .ad-contact__stats {
        grid-template-columns: 1fr;
    } */

    .ad-contact__stat {
        border-right: 0;
        border-bottom: 1px solid rgba(16, 24, 40, 0.06);
    }

    .ad-contact__stat:last-child {
        border-bottom: 0;
    }

    .ad-similar-card__img {
        height: 200px;
    }
}

@media (max-width: 479.98px) {
    .ad-topbar {
        padding: 0.7rem;
    }

    .ad-topbar__action-btn,
    .ad-btn-detail {
        min-height: 52px;
        padding: 0.85rem 0.9rem;
        font-size: 0.86rem;
    }

    .ad-gallery__image,
    .ad-gallery__video {
        height: clamp(220px, 72vw, 300px) !important;
    }

    .ad-gallery__counter {
        position: static;
        margin: 0.75rem 0 0;
        width: 100%;
    }

    .ad-gallery__thumb {
        flex: 0 0 54px;
        height: 54px;
    }
}

@media (max-width: 767.98px) {
    .ad-similar-grid {
        grid-template-columns: 1fr !important;
    }
}

.ad-contact--mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .ad-contact--mobile {
        display: block;
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }

    .ad-contact--desktop {
        display: none;
    }
}

.ad-seller-detail--mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .ad-seller-detail--mobile {
        display: block;
        margin-bottom: 1.5rem;
    }

    .ad-seller-detail--desktop {
        display: none;
    }
}

/* final typography and width normalization */
/* .ad-grid-detail {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
} */

/* .ad-topbar {
    padding: 1.55rem 1.65rem;
} */

.ad-topbar__title {
    font-size: clamp(1.5rem, 1.7rem + 1.2vw, 2rem);
    line-height: 1.12;
}

.ad-topbar__meta-item {
    font-size: 0.76rem;
}

.ad-card-detail__header h3 {
    font-size: 1.15rem;
}

.ad-card-detail__body {
    padding: 1.35rem;
}

.ad-description {
    font-size: 0.95rem;
    line-height: 1.82;
}

.ad-detail-group__header h4 {
    font-size: 0.94rem;
}

.ad-detail-row__label {
    font-size: 0.88rem;
}

.ad-detail-row__value {
    font-size: 0.92rem;
}

.ad-contact__label {
    font-size: 1.45rem;
}

.ad-contact__sub {
    font-size: 0.9rem;
}

.ad-btn-detail {
    font-size: 0.88rem;
}

.ad-contact__stat-val {
    font-size: 1.02rem;
}

.ad-seller-detail__name {
    font-size: 1rem;
}

.ad-seller-detail__meta-row {
    font-size: 0.82rem;
}


.ad-similar-card__title {
    font-size: 0.96rem;
}

.ad-similar-card__breed,
.ad-similar-card__location {
    font-size: 0.8rem;
}



@media (max-width: 767.98px) {
    .ad-topbar {
        padding: 0.6rem;
    }

    .ad-topbar__title {
        font-size: clamp(1.45rem, 1.15rem + 3vw, 1.5rem);
    }

    .ad-topbar__meta-item {
        font-size: 0.83rem;
    }

    .ad-topbar__price {
        font-size: clamp(1.45rem, 1.55rem + 4vw, 1.5rem);
    }

    .ad-card-detail__header h3 {
        font-size: 1rem;
    }

    .ad-card-detail__body {
        padding: 1rem;
    }

    .ad-description {
        font-size: 0.91rem;
        line-height: 1.72;
    }

    .ad-detail-group__header h4 {
        font-size: 0.9rem;
    }

    .ad-detail-row__label,
    .ad-detail-row__value,
    .ad-contact__sub,
    .ad-btn-detail,
    .ad-seller-detail__meta-row,
    .ad-similar-card__breed,
    .ad-similar-card__location {
        font-size: 0.84rem;
    }

    .ad-contact__label {
        font-size: 1.22rem;
    }

    .ad-contact__stat-val {
        font-size: 0.98rem;
    }

    .ad-seller-detail__name,
    .ad-similar-card__title {
        font-size: 0.92rem;
    }
}

.ad-safety--mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .ad-safety--mobile {
        display: block;
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

    .ad-safety--desktop {
        display: none;
    }
}

/* mobile gallery stability fix */
@media (max-width: 767.98px) {
    .ad-gallery {
        display: block;
        width: 100%;
        overflow: hidden;
    }

    .ad-gallery__main {
        position: relative;
        display: block;
        width: 100%;
        min-height: 260px;
        overflow: hidden;
    }

    .ad-gallery__slide,
    .ad-gallery__slide.active {
        width: 100%;
        min-height: 260px;
    }

    .ad-gallery__slide.active {
        display: block;
    }

    .ad-gallery__image,
    .ad-gallery__video {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        object-fit: contain;
        object-position: center;
    }

    .ad-gallery__thumbs {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .ad-gallery__thumb-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        width: max-content;
        min-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .ad-gallery__thumb,
    .ad-gallery__video-thumb {
        flex: 0 0 60px;
    }

    .ad-gallery__counter {
        z-index: 6;
    }
}

@media (max-width: 479.98px) {
    .ad-gallery__main {
        min-height: 220px;
    }

    .ad-gallery__slide,
    .ad-gallery__slide.active {
        min-height: 220px;
    }

    .ad-gallery__thumb-list {
        min-width: max-content;
    }

    .ad-gallery__thumb,
    .ad-gallery__video-thumb {
        flex: 0 0 54px;
    }
}

.ad-seller-detail__badge--pending {
    color: #946200;
}

.ad-seller-detail__meta-row--link {
    align-items: center;
}

.ad-seller-detail__doc-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(23, 63, 46, 0.14);
    background: rgba(23, 63, 46, 0.04);
    color: #173f2e;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.ad-seller-detail__doc-link:hover {
    background: rgba(23, 63, 46, 0.08);
    color: #173f2e;
}
