/* ==========================================================================
   Modern UI system — shared by the auth screens, the account panel, and
   the ad-posting page. One file so all three feel like the same product
   instead of three different eras of the codebase.
   ========================================================================== */

:root {
    --brand: #00398f;
    --brand-dark: #002a68;
    --brand-soft: #eaf0fb;
    --accent: #fbb040;
    --accent-dark: #e69a2b;
    --ink: #16233f;
    --ink-soft: #5b6b8c;
    --line: #e7ecf5;
    --surface: #ffffff;
    --surface-soft: #f5f8fd;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-soft: 0 20px 45px -20px rgba(0, 57, 143, .25);
    --shadow-card: 0 6px 20px rgba(20, 35, 70, .07);
}

/* ---------- shared primitives ---------- */

.mu-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

a.mu-card:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.mu-field label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .4rem;
    display: inline-block;
}

.mu-field .form-control,
.mu-field .form-select,
.mu-input {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .7rem .9rem;
    background: var(--surface-soft);
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-size: .95rem;
}

.mu-field .form-control:focus,
.mu-field .form-select:focus,
.mu-input:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.mu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: none;
    border-radius: 999px;
    padding: .75rem 1.6rem;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 12px 24px -10px rgba(0, 57, 143, .55);
    transition: transform .15s, box-shadow .15s, opacity .15s;
}

.mu-btn:hover, .mu-btn:focus {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 28px -10px rgba(0, 57, 143, .6);
}

.mu-btn:disabled, .mu-btn[disabled] {
    opacity: .65;
    transform: none;
}

.mu-btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: 0 12px 24px -10px rgba(230, 154, 43, .55);
}

.mu-btn-ghost {
    background: var(--surface);
    color: var(--brand);
    border: 1.5px solid var(--line);
    box-shadow: none;
}

.mu-btn-ghost:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: none;
}

.mu-btn-block { width: 100%; }

/* ---------- auth screens ---------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    background: var(--surface-soft);
}

.auth-visual {
    flex: 0 0 42%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    color: #fff;
    background: linear-gradient(155deg, var(--brand) 0%, var(--brand-dark) 65%, #001d4d 100%);
}

.auth-visual::before, .auth-visual::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.auth-visual::before { width: 340px; height: 340px; top: -110px; inset-inline-end: -90px; }
.auth-visual::after { width: 220px; height: 220px; bottom: -80px; inset-inline-start: -60px; background: rgba(251, 176, 64, .18); }

.auth-visual .auth-logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.auth-visual .auth-logo img { height: 42px; border-radius: 10px; background: #fff; padding: 4px; }

.auth-visual h1 {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.auth-visual p {
    color: rgba(255, 255, 255, .8);
    font-size: 1rem;
    line-height: 1.9;
    margin-top: 1rem;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-visual ul {
    list-style: none;
    padding: 0;
    margin: 2.2rem 0 0;
    position: relative;
    z-index: 1;
}

.auth-visual ul li {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .9rem;
    color: rgba(255, 255, 255, .92);
    font-size: .92rem;
}

.auth-visual ul li i {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}

.auth-box { width: 100%; max-width: 440px; }

.auth-box .auth-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--ink-soft);
    font-size: .85rem;
    margin-bottom: 1.25rem;
    text-decoration: none;
}

.auth-box .auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: .35rem;
}

.auth-box .auth-subtitle {
    color: var(--ink-soft);
    font-size: .92rem;
    margin-bottom: 1.75rem;
}

.auth-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    border: 1px solid var(--line);
}

.auth-choice {
    display: block;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    text-align: center;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    transition: all .15s;
    background: var(--surface-soft);
}

.auth-choice:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
    transform: translateY(-2px);
}

.auth-foot {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .88rem;
    color: var(--ink-soft);
}

.auth-foot a { color: var(--brand); font-weight: 700; text-decoration: none; }

@media (max-width: 991px) {
    .auth-visual { display: none; }
}

/* ---------- auth screen animation ---------- */

@keyframes auth-blob-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-18px, 22px) scale(1.08); }
}

@keyframes auth-fade-in-side {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes auth-fade-in-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-logo-pop {
    from { opacity: 0; transform: scale(.85); }
    to { opacity: 1; transform: scale(1); }
}

/* Two floating brand-colored circles instead of static ones -- a slow,
   staggered drift (18s/14s, offset delay) so the panel feels alive without
   being distracting behind form fields the user is actually reading. */
.auth-visual::before, .auth-visual::after {
    animation: auth-blob-drift 18s ease-in-out infinite;
}
.auth-visual::after { animation-duration: 14s; animation-delay: -4s; }

.auth-visual .auth-logo { animation: auth-logo-pop .5s ease-out both; }
.auth-visual h1 { animation: auth-fade-in-side .55s ease-out .1s both; }
.auth-visual p { animation: auth-fade-in-side .55s ease-out .2s both; }

.auth-visual ul li {
    opacity: 0;
    animation: auth-fade-in-side .5s ease-out both;
}
.auth-visual ul li:nth-child(1) { animation-delay: .32s; }
.auth-visual ul li:nth-child(2) { animation-delay: .42s; }
.auth-visual ul li:nth-child(3) { animation-delay: .52s; }

.auth-box { animation: auth-fade-in-up .5s ease-out .15s both; }

/* The form itself feels static without a submit affordance -- a light
   sheen sweeps across the primary button on hover instead of a flat
   color-shift, echoing the shimmer already used on brand CTAs elsewhere. */
.auth-panel .mu-btn {
    position: relative;
    overflow: hidden;
}
.auth-panel .mu-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s ease;
}
.auth-panel .mu-btn:hover::after { transform: translateX(120%); }

@media (prefers-reduced-motion: reduce) {
    .auth-visual::before, .auth-visual::after,
    .auth-visual .auth-logo, .auth-visual h1, .auth-visual p, .auth-visual ul li,
    .auth-box, .auth-panel .mu-btn::after {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* ---------- account panel ---------- */

.acc-sidebar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--line);
    overflow: hidden;
}

.acc-sidebar-head {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 1.75rem 1.25rem;
    text-align: center;
    color: #fff;
}

.acc-sidebar-head img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .55);
    object-fit: cover;
    margin-bottom: .7rem;
}

.acc-sidebar-head b { display: block; font-size: 1.02rem; }

.acc-nav { padding: .6rem; }

.acc-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .2rem;
    transition: background .15s, color .15s, transform .15s;
}

.acc-nav a .acc-ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    flex: none;
    transition: background .15s, color .15s;
}

.acc-nav a:hover { background: var(--surface-soft); transform: translateX(-2px); }
.acc-nav a.active { background: var(--brand-soft); color: var(--brand); }
.acc-nav a.active .acc-ico { background: var(--brand); color: #fff; }

.acc-nav a.logout { color: #c0392b; }
.acc-nav a.logout .acc-ico { color: #c0392b; }

.acc-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: .9rem;
    height: 100%;
}

.acc-stat .acc-stat-ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: none;
    color: #fff;
}

.acc-stat .acc-stat-num { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.acc-stat .acc-stat-label { font-size: .8rem; color: var(--ink-soft); }

.acc-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
}

.acc-panel-title {
    font-weight: 800;
    color: var(--ink);
    font-size: 1.02rem;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.acc-panel-title i { color: var(--brand); }

/* ---------- ad-posting page ---------- */

.ad-form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

.ad-form-section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    color: var(--ink);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: .9rem;
    border-bottom: 1px dashed var(--line);
}

.ad-form-section-title .num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex: none;
}

.ad-preview-wrap { position: sticky; top: 1rem; }

.ad-preview-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.ad-preview-label {
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: .78rem;
    font-weight: 700;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.ad-preview-photo {
    height: 200px;
    background: var(--surface-soft) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    font-size: .85rem;
}

.ad-preview-body { padding: 1.1rem 1.2rem 1.4rem; }
.ad-preview-title { font-weight: 800; color: var(--ink); font-size: 1.05rem; margin-bottom: .4rem; min-height: 1.4em; }
.ad-preview-price { color: var(--brand); font-weight: 800; font-size: 1rem; margin-bottom: .55rem; }
.ad-preview-meta { display: flex; align-items: center; gap: .4rem; color: var(--ink-soft); font-size: .82rem; }

.upload-drop {
    border: 2px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    padding: 1.4rem;
    text-align: center;
    position: relative;
    transition: border-color .15s, background .15s;
}

.upload-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-drop i { font-size: 1.6rem; color: var(--brand); margin-bottom: .4rem; display: block; }

.pill-choice { display: flex; flex-wrap: wrap; gap: .6rem; }
.pill-choice label {
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: .5rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    background: var(--surface-soft);
    transition: all .15s;
}
.pill-choice input { display: none; }
.pill-choice input:checked + label,
.pill-choice label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- ad-posting wizard ---------- */

/* Opacity-only on purpose - transform is never touched, even transiently.
   `.ad-form-card`/`.wizard-pane.active` use this animation and otherwise
   never set a transform, so animating `transform: translateY(...)` here
   (even fading it out to nothing in the `to` keyframe) leaves each of them
   holding a *resolved* `matrix(1,0,0,1,0,0)` once `fill-mode: both` pins
   the end state - getComputedStyle reports that as a real matrix, not the
   keyword `none`, even though it's the identity transform, and per spec
   ANY non-`none` transform (this included) makes the element its own
   permanent stacking context. With no explicit z-index of its own, that
   silently made each `.ad-form-card` paint as one opaque unit in DOM
   order: the location-map card, coming later in the markup, covered the
   whole earlier contact-info card - including the city/country dropdown
   panel - no matter how high the panel's own z-index was set, because it
   was trapped inside its card's context and never got compared against
   the map's z-index directly. Confirmed live (see repro): before this,
   getComputedStyle(.ad-form-card).transform was "matrix(1, 0, 0, 1, 0, 0)"
   even with `to {}` omitting `transform` entirely mid-fix. Opacity has no
   such matrix-serialization quirk - once held at 1 (its default) it's
   just the number 1, which per spec does not trigger a stacking context. */
@keyframes muFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ad-fade-in { animation: muFadeIn .35s ease both; }

.ad-wizard .ad-form-card { animation: muFadeIn .3s ease both; }

.wizard-steps {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.4rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: none;
}

.wizard-step[wire\:click] { cursor: pointer; }

.wizard-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    background: var(--surface-soft);
    color: var(--ink-soft);
    border: 2px solid var(--line);
    transition: all .25s;
    flex: none;
}

.wizard-step.active .wizard-step-circle {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 0 0 5px var(--brand-soft);
}

.wizard-step.done .wizard-step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.wizard-step-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
}

.wizard-step.active .wizard-step-label { color: var(--ink); }

.wizard-step-line {
    flex: 1 1 auto;
    height: 3px;
    background: var(--line);
    margin: 0 .8rem;
    border-radius: 2px;
    transition: background .3s;
}

.wizard-step-line.done { background: var(--accent); }

.wizard-pane {
    display: none;
}

.wizard-pane.active {
    display: block;
    animation: muFadeIn .35s ease both;
}

@media (max-width: 575px) {
    .wizard-step-label { display: none; }
    .wizard-steps { padding: .9rem; }
}

.gallery-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.gallery-tile {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--line);
}

.gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-tile-remove {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    padding: 0;
    line-height: 1;
}

.gallery-tile-add {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    border: 1.5px dashed var(--line);
    color: var(--brand);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all .15s;
}

.gallery-tile-add:hover { border-color: var(--brand); background: var(--brand-soft); }
.gallery-tile-add input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------- account panel: motion + table polish ---------- */

.acc-panel,
.acc-stat {
    animation: muFadeIn .4s ease both;
    transition: transform .2s ease, box-shadow .2s ease;
}

.acc-panel:hover,
.acc-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.acc-sidebar { animation: muFadeIn .4s ease both; }

.acc-sidebar-head img { animation: muFadeIn .5s ease both; }

.stagger-fade > * {
    animation: muFadeIn .45s ease both;
}
.stagger-fade > *:nth-child(1) { animation-delay: .02s; }
.stagger-fade > *:nth-child(2) { animation-delay: .07s; }
.stagger-fade > *:nth-child(3) { animation-delay: .12s; }
.stagger-fade > *:nth-child(4) { animation-delay: .17s; }
.stagger-fade > *:nth-child(5) { animation-delay: .22s; }
.stagger-fade > *:nth-child(6) { animation-delay: .27s; }
.stagger-fade > *:nth-child(7) { animation-delay: .32s; }
.stagger-fade > *:nth-child(8) { animation-delay: .37s; }
.stagger-fade > *:nth-child(9) { animation-delay: .42s; }
.stagger-fade > *:nth-child(10) { animation-delay: .47s; }
.stagger-fade > *:nth-child(11) { animation-delay: .52s; }
.stagger-fade > *:nth-child(12) { animation-delay: .57s; }
.stagger-fade > *:nth-child(13) { animation-delay: .62s; }
.stagger-fade > *:nth-child(14) { animation-delay: .67s; }
.stagger-fade > *:nth-child(15) { animation-delay: .72s; }

.acc-table-wrap { overflow-x: auto; }

.acc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.acc-table thead th {
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 700;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.acc-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.acc-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.acc-table tbody tr {
    animation: muFadeIn .4s ease both;
    transition: background .15s;
}

.acc-table tbody tr:hover { background: var(--surface-soft); }

.acc-table tbody td {
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: .88rem;
}

.acc-table tbody tr:last-child td { border-bottom: none; }

/* Bootstrap's badge-* color variants aren't in this bundle's CSS, so status
   badges (e.g. review_status->color()) rendered without a background —
   defining them here so "وضعیت" is actually readable. */
.badge-primary { background-color: #007bff; color: #fff; }
.badge-secondary { background-color: #6c757d; color: #fff; }
.badge-success { background-color: #28a745; color: #fff; }
.badge-info { background-color: #17a2b8; color: #fff; }
.badge-warning { background-color: #ffc107; color: #1f2d3d; }
.badge-danger { background-color: #dc3545; color: #fff; }
.badge-light { background-color: #f8f9fa; color: #1f2d3d; }
.badge-dark { background-color: #343a40; color: #fff; }

.acc-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: background .15s, transform .15s;
    animation: muFadeIn .4s ease both;
}

.acc-list-row:last-child { border-bottom: none; }
.acc-list-row:hover { background: var(--surface-soft); color: var(--ink); transform: translateX(-3px); }

/* ---------- listing detail page ---------- */

.pd-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    animation: muFadeIn .4s ease both;
}

.pd-gallery-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    background: var(--surface);
}

/* Shrinks to the photo's own rendered size, so the nav arrows, counter
   and favorite button are positioned on the photo itself. */
.pd-gallery-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}
.pd-gallery-frame > :not(img) { line-height: normal; }

.pd-gallery-main img#pdMainImage {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 340px;
    border-radius: var(--radius-md);
    transition: opacity .15s ease;
}

.pd-video {
    display: block;
    width: 100%;
    max-height: 380px;
    border-radius: var(--radius-md);
    background: #000;
}

.pd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    color: var(--muted, #6b7280);
}
.pd-breadcrumb a { color: var(--muted, #6b7280); text-decoration: none; }
.pd-breadcrumb a:hover { color: var(--brand); }
.pd-breadcrumb a:last-child { color: var(--ink); font-weight: 700; }
.pd-breadcrumb .sep { color: #9aa3af; }

.pd-gallery-count {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: .3rem .75rem;
    border-radius: 999px;
    letter-spacing: .5px;
    direction: ltr;
    unicode-bidi: isolate;
}

.pd-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--ink);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    z-index: 2;
}

.pd-gallery-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.pd-gallery-nav.prev { right: 12px; }
.pd-gallery-nav.next { left: 12px; }

.pd-gallery-thumbs {
    display: flex;
    gap: .5rem;
    padding: .7rem;
    overflow-x: auto;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.pd-gallery-thumbs img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    opacity: .55;
    transition: all .15s;
    flex: none;
}

.pd-gallery-thumbs img.active,
.pd-gallery-thumbs img:hover { opacity: 1; border-color: var(--brand); }

.pd-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    margin: 1.3rem 0 .7rem;
}

.pd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem;
    color: var(--ink-soft);
    font-size: .85rem;
    margin-bottom: 1.1rem;
}

.pd-meta span i { color: var(--brand); margin-left: .35rem; }

.pd-price-box {
    background: var(--brand-soft);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .8rem;
    margin-bottom: 1.3rem;
}

.pd-price-box .amount { font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.pd-price-box .amount .unit { font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-right: .35rem; }

.pd-actions { display: flex; gap: .6rem; }

.pd-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
}

.pd-icon-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.pd-icon-btn.active { background: #e0507a; border-color: #e0507a; color: #fff; }

.pd-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.2rem;
}

.pd-spec-item { text-align: center; }
.pd-spec-item .label { display: block; font-size: .78rem; color: var(--ink-soft); margin-bottom: .35rem; }
.pd-spec-item .value { font-weight: 700; color: var(--ink); font-size: .92rem; }

/* Attributes marked "برجسته" in admin: a Divar-style key-facts strip. */
.pd-keyfacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
}
.pd-keyfact { text-align: center; padding: .85rem .5rem; }
.pd-keyfact + .pd-keyfact { border-inline-start: 1px solid var(--line, #e5e7eb); }
.pd-keyfact .label { display: block; font-size: .75rem; color: var(--ink-soft); margin-bottom: .3rem; }
.pd-keyfact .value { display: block; font-weight: 800; color: var(--ink); font-size: .95rem; }

.pd-desc {
    position: relative;
    max-height: 160px;
    overflow: hidden;
    line-height: 2.2;
    font-size: 1.08rem;
    font-weight: 500;
    color: #111827;
    transition: max-height .3s ease;
}

.pd-desc.expanded { max-height: 2000px; }
.pd-desc p, .pd-desc li, .pd-desc span { font-size: inherit; color: inherit; }

.pd-desc:not(.expanded)::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--surface));
}

.pd-desc-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--brand);
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    margin-top: .7rem;
    background: none;
    border: none;
    padding: 0;
}

.pd-desc-toggle i { transition: transform .25s; }
.pd-desc-toggle.open i { transform: rotate(180deg); }

.pd-section-title {
    font-weight: 800;
    color: var(--ink);
    font-size: 1.02rem;
    margin-bottom: 1.1rem;
    padding-bottom: .8rem;
    border-bottom: 1px dashed var(--line);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.pd-section-title i { color: var(--brand); }

.pd-swap-card {
    display: block;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--line);
    padding: .8rem;
    transition: all .15s;
    height: 100%;
}

.pd-swap-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.pd-swap-card.selected { border-color: var(--accent); background: #fff7ea; }

.pd-seller-card { position: sticky; top: 1rem; }

.pd-seller-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    flex: none;
}

.pd-phone-reveal { position: relative; min-height: 44px; }

.pd-phone-number {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--ink);
    letter-spacing: .5px;
    filter: blur(6px);
    transition: filter .3s ease;
    user-select: none;
    text-align: center;
    padding: .55rem;
}

.pd-phone-reveal.revealed .pd-phone-number { filter: blur(0); user-select: text; }
.pd-phone-reveal.revealed .pd-phone-btn { opacity: 0; pointer-events: none; }

.pd-phone-btn {
    position: absolute;
    inset: 0;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    cursor: pointer;
    transition: background .15s, opacity .2s;
}

.pd-phone-btn:hover { background: var(--brand-dark); }

.pd-map { height: 260px; border-radius: var(--radius-md); overflow: hidden; }

.pd-nav-apps { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.pd-nav-app-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1.5px solid var(--line);
    background: var(--surface-soft);
    color: var(--ink);
    border-radius: 999px;
    padding: .5rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}

.pd-nav-app-btn i { color: var(--brand); }
.pd-nav-app-btn:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); transform: translateY(-2px); }

@media (max-width: 991px) {
    .pd-gallery-main img#pdMainImage { max-height: 280px; }
    .pd-seller-card { position: static; }
}

.listing-map {
    height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
    z-index: 1;
}

/* ---------- listing plans page (renew / boost / post checkout) ---------- */

.plan-card {
    position: relative;
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 1.7rem 1.1rem 1.3rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
}

.plan-card input { position: absolute; opacity: 0; pointer-events: none; }

.plan-card:hover { border-color: var(--brand); transform: translateY(-4px); box-shadow: var(--shadow-card); }

.plan-card:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: var(--shadow-soft);
    transform: translateY(-4px);
}

.plan-card-check {
    position: absolute;
    top: .7rem;
    left: .7rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    color: transparent;
    transition: all .2s ease;
}

.plan-card:has(input:checked) .plan-card-check {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.plan-card-ribbon {
    position: absolute;
    top: -11px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .3rem .8rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 6px 14px -6px rgba(230, 154, 43, .6);
}

.plan-card-name { font-weight: 800; color: var(--ink); font-size: 1rem; margin-top: .6rem; }

.plan-card-duration {
    font-size: .78rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: .3rem;
}

.plan-card-price { margin-top: .3rem; }
.plan-card-price .old { display: block; text-decoration: line-through; color: var(--ink-soft); font-size: .8rem; margin-bottom: .15rem; }
.plan-card-price .amount { font-weight: 800; font-size: 1.25rem; color: var(--brand); }
.plan-card-price .unit { font-size: .78rem; color: var(--ink-soft); margin-right: .2rem; }

.plan-card-perday {
    font-size: .72rem;
    color: var(--ink-soft);
    background: var(--surface-soft);
    padding: .2rem .6rem;
    border-radius: 999px;
    margin-top: .3rem;
}

.plans-summary-bar {
    position: sticky;
    bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .8rem;
}

.plans-summary-label { display: block; font-size: .78rem; color: var(--ink-soft); }
.plans-summary-amount { display: block; font-weight: 800; font-size: 1.15rem; color: var(--ink); transition: transform .25s ease, color .25s ease; }
.plans-summary-amount.is-pulsing { animation: plansAmountPop .35s ease; }

/* ---------- listing plans page: cinematic hero + stepper ---------- */

.plans-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 2.4rem 1.5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, #1c5fc9);
    background-size: 220% 220%;
    animation: plansHeroDrift 12s ease-in-out infinite;
    box-shadow: var(--shadow-soft);
    color: #fff;
}

.plans-hero::before,
.plans-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: .35;
    pointer-events: none;
}

.plans-hero::before {
    width: 260px;
    height: 260px;
    background: var(--accent);
    top: -90px;
    inset-inline-start: -60px;
    animation: plansBlobFloat 9s ease-in-out infinite;
}

.plans-hero::after {
    width: 220px;
    height: 220px;
    background: #6fb1ff;
    bottom: -100px;
    inset-inline-end: -50px;
    animation: plansBlobFloat 11s ease-in-out infinite reverse;
}

.plans-hero-inner { position: relative; z-index: 1; }

.plans-hero-icon {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(4px);
}

.plans-hero-icon::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    animation: plansIconPulse 2.2s ease-out infinite;
}

.plans-hero-title { font-weight: 800; font-size: 1.35rem; margin-bottom: .4rem; }
.plans-hero-subtitle { color: rgba(255, 255, 255, .82); font-size: .92rem; max-width: 480px; margin: 0 auto .9rem; }

.plans-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    padding: .4rem 1rem;
    border-radius: 999px;
}

.plans-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: 1.5rem 0;
}

.plans-stepper-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 700;
}

.plans-stepper-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 1.5px solid var(--line);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    transition: all .2s ease;
}

.plans-stepper-step.is-active .plans-stepper-dot {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.plans-stepper-step.is-active { color: var(--brand); }

.plans-stepper-line {
    width: 40px;
    height: 2px;
    background: var(--line);
    border-radius: 2px;
}

@keyframes plansHeroDrift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes plansBlobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(18px, -14px) scale(1.08); }
}

@keyframes plansIconPulse {
    0% { transform: scale(.9); opacity: 1; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes plansAmountPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); color: var(--brand); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .plans-hero,
    .plans-hero::before,
    .plans-hero::after,
    .plans-hero-icon::after,
    .plans-summary-amount.is-pulsing {
        animation: none !important;
    }
}

/* ---------- swap options: accordion + category-first target picker ---------- */

.swap-option-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }

.swap-option {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: border-color .2s ease, box-shadow .2s ease;
    overflow: hidden;
}

.swap-option:not(.is-collapsed) { border-color: var(--brand); box-shadow: var(--shadow-card); }

.swap-summary-wrap, .swap-panel-wrap {
    display: grid;
    transition: grid-template-rows .32s ease, opacity .28s ease;
}

.swap-summary-inner, .swap-panel-inner { overflow: hidden; min-height: 0; }

.swap-summary-wrap { grid-template-rows: 0fr; opacity: 0; }
.swap-option.is-collapsed .swap-summary-wrap { grid-template-rows: 1fr; opacity: 1; }

.swap-panel-wrap { grid-template-rows: 1fr; opacity: 1; }
.swap-option.is-collapsed .swap-panel-wrap { grid-template-rows: 0fr; opacity: 0; }

.swap-option-summary {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem;
}

.swap-summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: .9rem;
}

.swap-summary-text { flex: 1 1 auto; min-width: 0; font-size: .88rem; display: flex; flex-direction: column; gap: .1rem; }
.swap-summary-text strong { color: var(--ink); }
.swap-summary-text span {
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swap-summary-actions { display: flex; align-items: center; gap: .35rem; flex: none; }

.swap-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    cursor: pointer;
    transition: all .15s;
}

.swap-icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.swap-icon-btn.danger:hover { border-color: #dc3545; color: #dc3545; }

.swap-featured-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ink-soft);
    border: 1.5px solid var(--line);
    transition: all .15s;
    flex: none;
}

.swap-featured-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swap-featured-toggle:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }

.swap-panel-inner { padding: 1rem; }

.swap-category-listbox {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}

.swap-category-search {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid var(--line);
    background: var(--surface-soft);
    padding: .65rem .9rem;
    font-size: .85rem;
    color: var(--ink);
    outline: none;
}

.swap-category-list {
    max-height: 230px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.swap-category-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    border: none;
    border-bottom: 1px solid var(--line);
    background: none;
    text-align: right;
    width: 100%;
    padding: .6rem .9rem;
    font-size: .84rem;
    color: var(--ink);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.swap-category-row:last-child { border-bottom: none; }
.swap-category-row:hover { background: var(--brand-soft); color: var(--brand); }
.swap-category-row i { color: var(--ink-soft); font-size: .75rem; flex: none; transition: color .15s; }
.swap-category-row:hover i { color: var(--brand); }
.swap-category-row.is-hidden { display: none; }

.swap-category-crumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .7rem;
    font-size: .82rem;
}

.swap-category-crumb button {
    border: none;
    background: none;
    color: var(--brand);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: 0;
    cursor: pointer;
}

.swap-category-crumb-name { color: var(--ink-soft); font-weight: 600; }

.swap-result-list { display: flex; flex-direction: column; gap: .4rem; max-height: 260px; overflow-y: auto; }

/* Searchable dropdown for country/city fields - same listbox idea as the
   swap-category picker above, but collapsible (opens on click, closes on
   blur/pick) since it sits inline in a two-column row instead of owning
   a whole wizard step. */
.combo-select { position: relative; }
.combo-select-input { cursor: pointer; background: var(--surface-soft); }
.combo-select-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* Leaflet's own panes/controls (.leaflet-marker-pane, .leaflet-popup-pane,
       .leaflet-top) sit at z-index 600-1000, and the location map lives in
       its own later .ad-form-card in the same wizard step - clear its
       highest z-index with margin, not just enough to look big. (The other
       half of this - each .ad-form-card no longer trapping its own
       descendants in a separate stacking context after its entrance
       animation ends - is fixed at the muFadeIn keyframes above.) */
    z-index: 1500;
    margin-top: .35rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.combo-select.is-open .combo-select-panel { display: block; }
/* Inside a swap-option card (overflow:hidden for its collapse animation)
   an absolute panel gets clipped - open it in flow instead. */
.swap-option .combo-select-panel { position: static; margin-top: 4px; }
.combo-select-search {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid var(--line);
    background: var(--surface-soft);
    padding: .6rem .85rem;
    font-size: .85rem;
    color: var(--ink);
    outline: none;
}
.combo-select-list { max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; }
.combo-select-row {
    display: block;
    border: none;
    border-bottom: 1px solid var(--line);
    background: none;
    text-align: right;
    width: 100%;
    padding: .55rem .85rem;
    font-size: .84rem;
    color: var(--ink);
    cursor: pointer;
}
.combo-select-row:last-child { border-bottom: none; }
.combo-select-row:hover { background: var(--brand-soft); color: var(--brand); }
.combo-select-row.is-hidden { display: none; }

.swap-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: .6rem .8rem;
    font-size: .85rem;
    color: var(--ink);
    text-align: right;
    cursor: pointer;
    transition: all .15s;
}

.swap-result-item:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateX(-2px); }
.swap-result-item .price { color: var(--ink-soft); font-size: .78rem; white-space: nowrap; }

.swap-result-item-catalog { justify-content: flex-start; }
.swap-result-item-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex: 0 0 auto;
}
.swap-result-item-text { flex: 1 1 auto; min-width: 0; }

.swap-selected-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: var(--radius-sm);
    padding: .6rem .9rem;
    font-size: .85rem;
    font-weight: 600;
}

.swap-selected-chip span { flex: 1 1 auto; }
.swap-selected-chip button { border: none; background: none; color: var(--brand); cursor: pointer; }
.swap-selected-chip-img {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex: 0 0 auto;
}

.swap-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    border: 1.5px dashed var(--line);
    background: var(--surface-soft);
    color: var(--brand);
    border-radius: var(--radius-md);
    padding: .8rem;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: all .15s;
}

.swap-add-btn:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }

/* Ad form field guidance (listing/_form.blade.php): the exact limits and
   format for each field, the live price-in-words line under each price
   input, and the min-max range summary below the pair. */
.ad-form-card .form-hint {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.7;
    margin: 6px 0 0;
}
.ad-form-card .form-hint i {
    color: #9ca3af;
    margin-left: 2px;
}
.ad-form-card .price-input {
    font-weight: 600;
    letter-spacing: .5px;
}
.ad-form-card .price-words {
    color: #0f7b3f;
    font-size: 12px;
    min-height: 18px;
    margin-top: 4px;
}
.ad-form-card .price-range-summary {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f0f7ff;
    color: #1d4ed8;
    font-size: 13px;
}
.ad-form-card .price-range-summary.is-invalid {
    background: #fef2f2;
    color: #b91c1c;
}

/* ---------- Ad page: share ---------- */
.pd-share-link {
    margin-inline-start: auto;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--brand);
    border-radius: 999px;
    padding: .3rem .9rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.pd-share-link:hover { border-color: var(--brand); background: var(--brand-soft); }
.pd-share-link i { margin-left: .3rem; }

.pd-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .6rem;
}
.pd-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .7rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
}
.pd-share-btn i { font-size: 1.15rem; }
.pd-share-btn:hover { transform: translateY(-2px); }
.pd-share-btn.whatsapp { color: #128c4b; }
.pd-share-btn.whatsapp:hover { background: #25d366; border-color: #25d366; color: #fff; }
.pd-share-btn.email { color: var(--brand); }
.pd-share-btn.email:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.pd-share-btn.native:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Ad page: pick several own ads for a swap proposal ---------- */
.pd-swap-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .6rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 2px;
}
.pd-swap-pick-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    margin: 0;
    transition: all .15s;
}
.pd-swap-pick-item:hover { border-color: var(--brand); }
.pd-swap-pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.pd-swap-pick-item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pd-swap-pick-item .name { font-size: .8rem; font-weight: 600; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pd-swap-pick-item .check {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: .7rem;
    display: none;
    align-items: center;
    justify-content: center;
}
.pd-swap-pick-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pd-swap-pick-item:has(input:checked) .check { display: flex; }
.pd-swap-pick-item:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Ad page: what a similar ad has in common ---------- */
.pd-similar-item { min-width: 0; }
.pd-similar-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    margin-top: .35rem;
    font-size: .75rem;
}
.pd-similar-tags .lbl { color: var(--ink-soft); }
.pd-similar-tags .tag {
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: 999px;
    padding: .1rem .55rem;
    font-weight: 600;
}
