.ad-detail { margin-block:24px; color:#302c3c; }
.ad-detail h1 { font-size:clamp(25px,3vw,38px); margin-bottom:22px; line-height:1.3; overflow-wrap:anywhere; }
.ad-detail__layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(300px,1fr); gap:24px; align-items:start; }
.ad-gallery { min-width:0; }
.ad-gallery [hidden] { display:none!important; }
.ad-gallery__stage { position:relative; overflow:hidden; border-radius:22px; background:#f7f1f5; }
.ad-gallery__slide { aspect-ratio:4/3; }
.ad-gallery__slide a { display:block; height:100%; }
.ad-gallery__slide img { display:block; width:100%; height:100%; object-fit:contain; }
.ad-gallery__prev,.ad-gallery__next { position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px; display:grid; place-items:center; border:0; border-radius:50%; background:#fffffff2; color:#ed297c; font-size:32px; cursor:pointer; box-shadow:0 3px 14px #29172a20; }
.ad-gallery__prev { left:14px; }.ad-gallery__next { right:14px; }
.ad-gallery__count { position:absolute; top:12px; left:12px; padding:6px 14px; border-radius:12px; color:#fff; background:#342c4abf; font-size:14px; }
.ad-gallery__thumbnails { position:relative; display:flex; gap:10px; overflow-x:auto; padding:4px 2px 8px; margin-top:10px; }
.ad-gallery__thumbnails button { flex:0 0 23%; min-width:75px; padding:3px; border:1px solid transparent; border-radius:13px; background:transparent; cursor:pointer; }
.ad-gallery__thumbnails [aria-current] { border-color:#ed287a; }
.ad-gallery__thumbnails img { display:block; width:100%; aspect-ratio:2; object-fit:cover; border-radius:9px; }
.ad-detail__author,.ad-detail-body .ad-detail__description,.ad-detail-body .ad-detail__about { padding:24px; border:1px solid #f5dce9; border-radius:22px; background:#fff; box-shadow:0 3px 14px #e02c7c07; }
.ad-detail__online { font-size:13px; color:#25a964; margin-bottom:10px; }
.ad-detail__author h2 { font-size:28px; margin:0 0 12px; }
.ad-detail__meta,.ad-detail__stats { display:flex; flex-wrap:wrap; gap:8px 16px; line-height:1.5; }
.ad-detail__meta { color:#716576; }.ad-detail__stats { font-size:12px; margin-top:18px; color:#88758a; }
.ad-detail__contacts { display:flex; align-items:start; flex-wrap:wrap; gap:12px; margin-top:22px; }
.ad-detail__contacts > * { flex:1 1 150px; min-width:0; }
.ad-detail__contacts .btn { display:flex; align-items:center; justify-content:center; height:auto; min-height:46px; padding:12px; border-radius:12px; text-align:center; background:linear-gradient(100deg,#f34592,#ed2177); color:#fff; }
.ad-detail__phone { border:1px solid #ed438b; border-radius:12px; text-align:center; color:#e62b7a; }
.ad-detail__phone summary { min-height:44px; padding:12px; list-style:none; cursor:pointer; font-size:14px; }
.ad-detail__phone summary::-webkit-details-marker { display:none; }
.ad-detail__phone > a { display:block; padding:0 12px 14px; overflow-wrap:anywhere; }
.ad-detail__socials { display:flex; flex-wrap:wrap; gap:12px; margin-top:14px; font-size:13px; color:#a92861; }
.ad-detail__preferences { display:grid; gap:20px; padding-top:22px; margin-top:22px; border-top:1px solid #f0e7ed; }
.ad-detail__preferences h3 { font-size:14px; font-weight:500; margin-bottom:12px; }
.ad-detail__categories { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.ad-detail__categories a { position:relative; min-height:72px; overflow:hidden; border-radius:12px; background:#fff1f7; }
.ad-detail__categories img { width:100%; height:100%; min-height:72px; object-fit:cover; }
.ad-detail__categories span { position:absolute; inset:auto 5px 5px; border-radius:7px; padding:5px; background:#ed277be8; color:#fff; font-size:10px; line-height:1.4; text-align:center; }
.ad-detail__interests { display:flex; flex-wrap:wrap; gap:8px; }.ad-detail__interests span { padding:8px 12px; border:1px solid #f597bf; border-radius:10px; color:#df307a; font-size:12px; }
.ad-detail-body .ad-detail__description,.ad-detail-body .ad-detail__about { margin-bottom:18px; }
.ad-detail-body .ad-detail__description h2,.ad-detail-body .ad-detail__about h2 { font-size:20px; margin-bottom:12px; }
.ad-detail-body .ad-detail__description p,.ad-detail-body .ad-detail__about p { line-height:1.7; overflow-wrap:anywhere; }
.ad-detail__about > a { display:inline-block; margin-top:16px; padding:10px 16px; border:1px solid #ed438b; border-radius:10px; color:#e52d7c; }
.ad-gallery :is(button,a):focus-visible,.ad-detail :is(a,button,summary):focus-visible { outline:3px solid #9b379c; outline-offset:3px; }
@media(max-width:900px) { .ad-detail__layout { grid-template-columns:minmax(0,1fr); gap:18px; }.ad-detail__preferences { grid-template-columns:repeat(2,minmax(0,1fr)); }.ad-gallery__slide { aspect-ratio:16/9; } }
@media(max-width:500px) { .ad-detail__author,.ad-detail-body .ad-detail__description,.ad-detail-body .ad-detail__about { padding:16px; border-radius:18px; }.ad-detail__preferences { gap:14px; }.ad-detail__categories { grid-template-columns:minmax(0,1fr); }.ad-detail__contacts { gap:10px; }.ad-detail__contacts > * { flex-basis:130px; }.ad-gallery__stage { border-radius:16px; }.ad-gallery__prev,.ad-gallery__next { width:36px; height:36px; font-size:26px; }.ad-gallery__slide { aspect-ratio:4/3; } }
.ad-detail__author { position:relative; }
.ad-detail__author > .ad-public-menu { position:absolute; top:14px; right:14px; z-index:5; }
.ad-detail__author > .ad-public-menu summary { padding:8px 12px; background:transparent; color:#ed277b; }
.ad-detail__author > .ad-public-menu > div { left:auto; right:0; max-width:calc(100vw - 64px); }
.ad-detail__author h2 { padding-right:44px; overflow-wrap:anywhere; }
.ad-detail__stats > :is(span,a) { display:inline-flex; align-items:center; gap:7px; }
.ad-detail__stats img { width:18px; height:18px; }

.ad-detail__author .ad-public-menu > div { width:230px; box-sizing:border-box; }
.ad-detail__author .ad-public-menu :is(button,a) { font:inherit; font-size:14px; text-align:left; line-height:1.5; }
.ad-detail__author .ad-public-menu button { border:0; padding:0; background:transparent; cursor:pointer; color:inherit; }
.ad-detail__author .ad-public-menu form { margin:0; }

.ad-related__track { overflow-x:auto; scroll-snap-type:x proximity; padding:4px 2px 14px; }
.ad-related__track > .ad-list { display:grid; grid-auto-flow:column; grid-template-columns:none; grid-auto-columns:calc((100% - 36px)/3); gap:18px; }
.ad-related__track .ad-card { scroll-snap-align:start; padding:10px; gap:12px; grid-template-columns:36% minmax(0,1fr); border-radius:16px; }
.ad-related__track .ad-card__photo { align-self:stretch; }
.ad-related__track .ad-card__photo img { height:100%; aspect-ratio:auto; object-fit:cover; }
.ad-related__track .ad-card__text,.ad-related__track .ad-card__phone,.ad-related__track .ad-card__footer > a { display:none; }
.ad-related__track .ad-card h2 { font-size:14px; }
.ad-related__track .ad-card__content { gap:8px; }
.ad-related__track .ad-card__author a { flex-basis:100%; font-size:16px; }
.ad-related__controls:not([hidden]) { display:flex; justify-content:flex-end; gap:12px; margin-top:8px; }
.ad-related__controls button { width:44px; height:44px; border:1px solid #f1d4e2; border-radius:50%; color:#ed277b; background:white; cursor:pointer; }
.ad-related__controls button:disabled { opacity:.4; cursor:default; }
.ad-related__track:focus-visible { outline:2px solid #a72560; outline-offset:3px; }
@media(max-width:1000px) { .ad-related__track > .ad-list { grid-auto-columns:calc((100% - 18px)/2); } }
@media(max-width:600px) { .ad-related__track > .ad-list { grid-auto-columns:88%; gap:12px; } }

.ad-detail__heading { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; margin-bottom:22px; }
.ad-detail__heading h1 { min-width:0; margin-bottom:0; }
.ad-detail__badge { flex:none; padding:5px 10px; border-radius:8px; font-size:14px; font-weight:700; line-height:1.4; }
.ad-detail__badge--vip { color:#583500; background:#ffdc81; }
.ad-detail__badge--x2 { color:#9c1756; background:#ffe1ef; }

/* The reference places the thumbnail strip beside the main photo. */
.ad-gallery--multiple { position:relative; padding-right:28%; }
.ad-gallery--multiple .ad-gallery__thumbnails { position:absolute; inset:0 0 0 auto; width:calc(28% - 10px); margin:0; padding:2px; flex-direction:column; overflow-x:hidden; overflow-y:auto; gap:8px; }
.ad-gallery--multiple .ad-gallery__thumbnails button { flex:0 0 calc((100% - 16px)/3); min-width:0; min-height:44px; padding:2px; }
.ad-gallery--multiple .ad-gallery__thumbnails img { height:100%; aspect-ratio:auto; }
.ad-detail-body { display:grid; grid-template-columns:minmax(0,1fr); gap:18px 24px; align-items:start; }
.ad-detail-body--with-author { grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); }
.ad-detail-body .ad-detail__description,.ad-detail-body .ad-detail__about { margin-bottom:0; }
.ad-detail-body > .ad-detail__preferences,.ad-detail-body > .ad-owner-tools,.ad-detail-body > .ad-access-request { grid-column:1/-1; }
@media(max-width:900px) { .ad-detail-body { grid-template-columns:minmax(0,1fr); } }
@media(max-width:500px) { .ad-gallery--multiple .ad-gallery__thumbnails { width:calc(28% - 6px); gap:6px; }.ad-gallery--multiple .ad-gallery__thumbnails button { flex-basis:calc((100% - 12px)/3); }.ad-gallery--multiple .ad-gallery__prev { left:6px; }.ad-gallery--multiple .ad-gallery__next { right:6px; } }

.ad-related__track > .ad-list { align-items:start; }
.ad-related__track .ad-card { align-items:start; }
.ad-related .ad-related__track .ad-card__photo { height:130px; min-height:0; align-self:start; }
.ad-related .ad-related__track .ad-card__photo img { height:100%; min-height:0; }
.ad-related__track .ad-card__content { align-self:start; }
.ad-related__track .ad-card__footer { margin-top:0; }

.ad-related__track .ad-card h2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.ad-related__track .ad-card__categories a { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ad-related__track .ad-card__author > :last-child { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
