/*
 * AzadBazar theme: one small set of colours, lines, shadows and shapes for the whole site.
 * One blue (Google blue) for everything blue: logo, prices, links, buttons; white cards, light grey,
 * thin grey lines and soft shadows.
 * Loaded after app.css / custom.css / style.css (layouts/tweaks), so it wins over the old rules.
 * New markup uses its own ab- classes, so the old .card / .card-body rules never touch it.
 */
:root {
    --ab-blue: #1a73e8;
    --ab-blue-dark: #1967d2;
    --ab-blue-soft: #e8f0fe;
    --ab-green: #137333;
    --ab-green-soft: #e6f4ea;
    --ab-wa: #1a8d4a;          /* WhatsApp button (darker than WhatsApp's own green, so white text reads) */
    --ab-ink: #202124;
    --ab-muted: #5f6368;
    --ab-line: #dadce0;
    --ab-bg: #f8f9fa;
    --ab-radius: 12px;
    --ab-shadow: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
    --ab-shadow-hi: 0 1px 3px 0 rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
    --ab-font: "Lato", "Vazirmatn", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
    --ab-font-regular: "Lato Regular", "Vazirmatn", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
}

/* ---------- ad card (layouts/card): home, categories, search, seller page, similar ads ---------- */
.ab-card { position: relative; display: flex; flex-direction: column; height: 100%; background: #fff;
    border-radius: var(--ab-radius); box-shadow: var(--ab-shadow); overflow: hidden; transition: box-shadow .2s; }
.ab-card:hover { box-shadow: var(--ab-shadow-hi); }
.ab-card__link, .ab-card__link:hover, .ab-card__link:focus { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.ab-card__img { position: relative; flex: none; aspect-ratio: 4 / 3; background: #e8eaed; overflow: hidden; }
.ab-card__img img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; object-fit: cover; display: block; }
.ab-card__chips { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; gap: 6px; }
.ab-card__body { display: flex; flex-direction: column; gap: 3px; flex: 1; padding: 10px 12px 12px; min-width: 0; }
.ab-card__title { margin: 0; font-family: var(--ab-font-regular); font-size: 15px; font-weight: 400; line-height: 1.3; color: var(--ab-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; text-align: start; }
.ab-card__price { font-size: 14.5px; font-weight: 700; color: var(--ab-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-card__price small { font-size: 12px; font-weight: 300; color: var(--ab-muted); }
.ab-card__meta { margin-top: auto; font-size: 11.5px; color: var(--ab-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767.98px) {
    .ab-card__title { font-size: 14px; }
    .ab-card__price { font-size: 14px; }
    .ab-card__body { padding: 9px 10px 10px; }
}

/* list view (the "list" switch on listing pages): the same card, photo on the side */
.ab-card--row .ab-card__link { flex-direction: row; }
.ab-card--row .ab-card__img { width: 38%; max-width: 260px; aspect-ratio: 4 / 3; }
.ab-card--row .ab-card__body { padding: 12px 14px; }
.ab-card--row .ab-card__title { min-height: 0; }
.ab-list-gap { margin-bottom: 12px; }

/* ---------- small labels ("chips") ---------- */
.ab-chip { display: inline-block; font-size: 11.5px; font-weight: 700; line-height: 1.4; padding: 3px 10px; border-radius: 999px;
    background: #fff; color: var(--ab-ink); box-shadow: var(--ab-shadow); white-space: nowrap; }
.ab-chip--new { background: var(--ab-blue-soft); color: var(--ab-blue); }
.ab-chip--rent { background: var(--ab-green-soft); color: var(--ab-green); }

/* ---------- buttons ---------- */
.ab-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: 999px;
    font-size: 15px; font-weight: 700; line-height: 1.2; border: 1px solid transparent; text-decoration: none; cursor: pointer; }
.ab-btn:hover, .ab-btn:focus { text-decoration: none; }
.ab-btn svg { flex: none; }
.ab-btn--blue, .ab-btn--blue:hover, .ab-btn--blue:focus { background: var(--ab-blue); color: #fff; }
.ab-btn--wa, .ab-btn--wa:hover, .ab-btn--wa:focus { background: var(--ab-wa); color: #fff; }
.ab-btn--line, .ab-btn--line:hover, .ab-btn--line:focus { background: #fff; color: var(--ab-blue); border-color: var(--ab-line); }
.ab-btn--sm { padding: 6px 12px; font-size: 13px; }
.ab-btn:hover { filter: brightness(1.06); }

/* ---------- white box ---------- */
.ab-box { background: #fff; border-radius: var(--ab-radius); box-shadow: var(--ab-shadow); padding: 16px 18px; }
.ab-h2 { font-size: 18px; font-weight: 400; color: var(--ab-ink); margin: 0 0 12px; }

/* ---------- ad page (Sell/details) ---------- */
.ab-ad { display: flex; flex-direction: column; gap: 12px; color: var(--ab-ink); }
.ab-ad__side { display: flex; flex-direction: column; gap: 12px; }
/* computers: photo and the main box on the left, seller and share on the right (stays in view while scrolling) */
@media (min-width: 992px) {
    .ab-ad { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px 24px; align-items: start; }
    .ab-ad__gal { grid-column: 1; grid-row: 1; }
    .ab-ad__main { grid-column: 1; grid-row: 2; }
    .ab-ad__side { gap: 16px; grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
}

.ab-gal { position: relative; overflow: hidden; background: #202124; aspect-ratio: 4 / 3; max-height: 560px; width: 100%; }
@media (min-width: 768px) { .ab-gal { border-radius: var(--ab-radius); } }
.ab-gal .carousel, .ab-gal .carousel-inner, .ab-gal .carousel-item { height: 100%; }
.ab-gal__slide { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.ab-gal__blur { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(22px) brightness(.72); }
.ab-gal__slide img { position: relative; display: block; width: 100% !important; height: 100% !important; object-fit: contain; }
.ab-gal__count { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.ab-gal__back { position: absolute; left: 10px; top: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ab-ink);
    display: flex; align-items: center; justify-content: center; box-shadow: var(--ab-shadow); }
.ab-gal__back:hover, .ab-gal__back:focus { color: var(--ab-ink); box-shadow: var(--ab-shadow-hi); }
.ab-gal .carousel-control-prev, .ab-gal .carousel-control-next { width: 56px; z-index: 2; opacity: .85; }
.ab-gal .carousel-control-prev-icon, .ab-gal .carousel-control-next-icon { width: 34px; height: 34px; border-radius: 50%; background-color: rgba(0, 0, 0, .45); background-size: 45% 45%; }

.ab-ad__title { font-family: var(--ab-font-regular); font-size: 21px; font-weight: 400; line-height: 1.3; margin: 0 0 6px; text-align: start; }
@media (min-width: 992px) { .ab-ad__title { font-size: 24px; } }
.ab-ad__price { font-family: var(--ab-font-regular); font-size: 23px; font-weight: 400; color: var(--ab-blue); }
.ab-ad__price small { font-size: 15px; color: var(--ab-muted); }
.ab-ad__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font-size: 13px; color: var(--ab-muted); }
.ab-ad__line { border: 0; border-top: 1px solid var(--ab-line); margin: 16px 0 14px; }
.ab-ad__status { margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: #fff3cd; color: #7a5200; font-size: 14px; }

.ab-seller { display: flex; gap: 12px; align-items: center; }
.ab-seller__avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--ab-blue); color: #fff; flex: none;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.ab-seller__name { font-weight: 700; font-size: 16px; }
.ab-seller__sub { font-size: 13px; color: var(--ab-muted); }
.ab-seller__sub a { color: var(--ab-blue); }
.ab-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ab-contact .ab-btn:only-child { grid-column: 1 / -1; }
.ab-contact .js-phone-number { direction: ltr; unicode-bidi: isolate; }
/* phones: Call / WhatsApp stay at the bottom of the screen instead */
@media (max-width: 991.98px) { .ab-ad__seller .ab-contact { display: none; } }
.ab-contactbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--ab-line); }
.ab-contactbar .ab-contact { margin-top: 0; }
@media (min-width: 992px) { .ab-contactbar { display: none; } }

.ab-desc { font-size: 16px; line-height: 1.9; word-wrap: break-word; }
.ab-desc [dir="auto"], .ab-desc div, .ab-desc p { text-align: start; }
.ab-hidnum { display: inline-block; border: 0; border-radius: 6px; padding: 0 6px; margin: 0 2px; background: var(--ab-blue-soft); color: var(--ab-blue);
    font: inherit; line-height: 1.6; direction: ltr; unicode-bidi: isolate; cursor: pointer; }

.ab-share { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 2px; }
.ab-share__label { font-size: 14px; color: var(--ab-muted); margin-inline-end: 4px; white-space: nowrap; }
.ab-share .ab-btn { white-space: nowrap; }

.ab-similar { margin-top: 28px; }
.ab-similar .ab-h2 { margin-bottom: 4px; }

/* ---------- floating "+" (post an ad) on phones ---------- */
.ab-fab { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
    background: var(--ab-blue); color: #fff; box-shadow: var(--ab-shadow-hi); }
.ab-fab:hover, .ab-fab:focus { color: #fff; }

/* ---------- header: the logo and Sell button in the one blue; icons Google grey ---------- */
[fill="#1E84C6"], [fill="#1e84c6"] { fill: var(--ab-blue); }
[stroke="#1E84C6"], [stroke="#1e84c6"] { stroke: var(--ab-blue); }
.m-nav-icons { gap: 6px !important; }
.m-nav-icon-link, .m-nav-icon-link:hover, .m-nav-icon-link:focus { color: var(--ab-muted) !important; display: flex; align-items: center;
    justify-content: center; width: 40px; height: 40px; border-radius: 50%; }
.m-nav-icon-link:hover { background: #f1f3f4; }
.m-nav-icon-link .icon { width: 25px !important; height: 25px !important; }
.header_location, .header_profile, .header_profile a { color: #3c4043; }
.header_location .text-primary { color: var(--ab-blue) !important; }
.text-primary-custom { color: var(--ab-blue) !important; }

/* ---------- page numbers: round, Google-style ---------- */
.listing-pagination .page-link { display: flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 8px;
    margin: 2px; border: 0; border-radius: 999px !important; color: var(--ab-blue); background: transparent; font-size: 15px; }
.listing-pagination .page-link:hover { background: #f1f3f4; color: var(--ab-blue-dark); }
.listing-pagination .page-item.active .page-link { background: var(--ab-blue); color: #fff; }
.listing-pagination .page-item.disabled .page-link { color: var(--ab-muted); background: transparent; }

/* ---------- quick links and footer ---------- */
.ab-chiplink { display: inline-flex; align-items: center; padding: 7px 14px; border: 1px solid var(--ab-line); border-radius: 999px;
    background: #fff; color: #3c4043; font-size: 14px; text-decoration: none; white-space: nowrap; }
.ab-chiplink:hover, .ab-chiplink:focus { background: #f1f3f4; color: var(--ab-blue-dark); text-decoration: none; }
.ab-quick { padding: 28px 0 32px; text-align: center; }
.ab-quick__title { font-size: 16px; font-weight: 700; color: var(--ab-blue); margin: 0 0 14px; }
.ab-quick__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ab-footer { background: var(--ab-bg); border-top: 1px solid var(--ab-line); padding: 32px 0 20px; }
.ab-footer__col { margin-bottom: 22px; }
.ab-footer h2 { font-size: 14px; font-weight: 700; color: var(--ab-blue); margin: 0 0 10px; }
.ab-footer__col > a, .ab-footer__col > span { display: block; padding: 4px 0; font-size: 14.5px; color: #3c4043; text-decoration: none; }
.ab-footer__col > a:hover { color: var(--ab-blue); text-decoration: underline; }
.ab-footer__social { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-copyright { background: var(--ab-bg); border-top: 1px solid var(--ab-line); padding: 14px 16px 18px; text-align: center; font-size: 13px; color: var(--ab-muted); }
@media (max-width: 767.98px) { .ab-copyright { padding-bottom: 84px; } }
@media (max-width: 575.98px) {
    .listing-pagination .page-link { min-width: 32px; height: 32px; margin: 1px; padding: 0 6px; font-size: 14px; }
}

/* photo zooms in a little when the mouse is over a card (like about.google/products); mouse only, not on phones */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .ab-card__img img { transition: transform .45s cubic-bezier(.2, 0, 0, 1); }
    .ab-card:hover .ab-card__img img, .ab-card__link:focus-visible .ab-card__img img { transform: scale(1.06); }
}

/* ---------- parallax window between the listings (layouts/promos/parallax) ---------- */
/* The photo is fixed to the screen; the window is a clipped hole in the page, so while the listings
   scroll, the photo stays still and is uncovered from top to bottom. clip (old) + clip-path (new)
   both clip fixed children, which also works on iPhone and Android. */
.ab-parallax { position: relative; display: block; height: 68vh; min-height: 320px; max-height: 620px; margin: 22px 0 6px;
    border-radius: var(--ab-radius); overflow: hidden; box-shadow: var(--ab-shadow); color: var(--ab-ink); text-decoration: none; }
.ab-parallax:hover, .ab-parallax:focus { color: var(--ab-ink); text-decoration: none; }
.ab-parallax__clip { position: absolute; inset: 0; clip: rect(0, auto, auto, 0); clip-path: inset(0); }
/* smooth scrolling: the photo gets its own layer (no repaint while scrolling), and 100lvh keeps its
   height the same when a phone's address bar slides away (100vh jumps there) */
.ab-parallax__bg { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; background-color: #202124;
    background-size: cover; background-position: center; pointer-events: none;
    will-change: transform; transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
/* phones: edge to edge with square corners, a real gap between the listings (a rounded clip costs a repaint every frame) */
@media (max-width: 767.98px) {
    .ab-parallax { margin-left: -12px; margin-right: -12px; border-radius: 0; box-shadow: none; }
    .ab-similar .ab-parallax { margin-left: -15px; margin-right: -15px; }
}
@media (min-width: 768px) {
    .ab-parallax__clip { clip-path: inset(0 round var(--ab-radius)); }
}
.ab-parallax__bg--plain { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
    background-image: linear-gradient(160deg, var(--ab-blue) 0%, #174ea6 100%); color: #fff; }
.ab-parallax__bg--plain b { font-size: clamp(44px, 12vw, 140px); font-weight: 700; letter-spacing: -.02em; line-height: 1; opacity: .95; }
.ab-parallax__bg--plain i { font-style: normal; font-size: clamp(16px, 2.6vw, 26px); opacity: .85; }
.ab-parallax__tag { position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92);
    font-size: 11.5px; font-weight: 700; color: var(--ab-muted); }
.ab-parallax__box { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    padding: 12px 14px; border-radius: var(--ab-radius); background: rgba(255, 255, 255, .95); box-shadow: var(--ab-shadow); }
.ab-parallax__title { flex: 1 1 220px; font-size: 16px; font-weight: 700; line-height: 1.3; }
.ab-parallax__text { flex: 1 1 100%; order: 2; font-size: 14px; color: var(--ab-muted); }
.ab-parallax__box .ab-btn { order: 1; }
@media (min-width: 768px) {
    .ab-parallax__box { left: auto; right: 16px; bottom: 16px; max-width: 460px; }
}
@media (prefers-reduced-motion: reduce) {
    .ab-parallax__bg { position: absolute; height: 100%; }
}
