.npa-wrap {
    --npa-base: #999999;
    --npa-has: #4ecc81;
    --npa-hover: #c33a2c;
    direction: rtl;
    font-family: inherit;
    box-sizing: border-box;
}

.npa-wrap *,
.npa-wrap *::before,
.npa-wrap *::after { box-sizing: border-box; }

.npa-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}

/* لیست ۵۵٪ و نقشه ۴۵٪ مثل طرح اصلی */
.npa-layout-map_list .npa-main { grid-template-columns: 42fr 58fr; }

/* نقشه */
.npa-map { width: 100%; max-width: 640px; margin-inline: auto; }
.npa-layout-map .npa-map { max-width: 700px; }
.npa-map svg { display: block; width: 100%; height: auto; }

.npa-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.npa-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.npa-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.npa-legend i.is-has { background: var(--npa-has); }
.npa-legend i.is-none { background: var(--npa-base); }

.npa-map svg .iran { fill: #fff; }
.npa-map svg .caspian,
.npa-map svg .persian-gulf { fill: #6caed8; }

.npa-map path.npa-province {
    fill: var(--npa-base);
    stroke: #fff;
    stroke-width: .8;
    cursor: pointer;
    transition: fill .2s;
    outline: none;
}

.npa-map path.npa-province.has-agent { fill: var(--npa-has); }

.npa-map path.npa-province:hover,
.npa-map path.npa-province:focus-visible,
.npa-map path.npa-province.active,
.npa-map path.npa-province.is-hovered { fill: var(--npa-hover); }

/* لیست استان‌ها */
.npa-list-title {
    margin: 0 0 10px;
    font-size: 16px;
}

/* دکمه‌ها در شبکه‌ی منظم با تعداد ستون ثابت */
.npa-buttons {
    display: grid;
    grid-template-columns: repeat(var(--npa-cols, 3), minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 18px;
}

.npa-btn {
    display: block;
    width: 100%;
    cursor: pointer;
    padding: 6px 4px;
    border: 0;
    border-radius: 8px;
    background: var(--npa-btn, #34495e);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    transition: background-color .2s;
}

.npa-btn.has-agent { background: var(--npa-has); }

.npa-btn:hover,
.npa-btn:focus-visible,
.npa-btn.active,
.npa-btn.is-hovered { background: var(--npa-hover); }

/* برچسب هاور */
.npa-tooltip {
    position: absolute;
    z-index: 1000;
    display: none;
    padding: 6px 10px;
    border-radius: 5px;
    background: #222;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

/* نتایج */
.npa-results { margin-top: 28px; }
.npa-results:empty { display: none; }

.npa-province-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    background: none;
    color: #1f2d3a;
    font-size: 19px;
    font-weight: 700;
}

.npa-province-title::before {
    content: "";
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: var(--npa-btn, #34495e);
}

.npa-agent-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.npa-agent {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(31, 45, 58, .06);
    transition: box-shadow .2s, transform .2s;
}

.npa-agent:hover {
    box-shadow: 0 8px 22px rgba(31, 45, 58, .12);
    transform: translateY(-2px);
}

.npa-agent.is-inactive { opacity: .65; }

.npa-agent-name {
    margin: 0 0 8px;
    color: #1f2d3a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.npa-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.npa-chip {
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #44566a;
    font-size: 12px;
    line-height: 1.8;
}

.npa-chip.is-code { background: #f3f3f3; color: #666; }
.npa-chip.is-off { background: #fdecea; color: #b3261e; }

.npa-rows {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid #eef1f4;
    list-style: none;
}

.npa-rows li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 0;
    color: #3a4856;
    font-size: 13.5px;
    line-height: 1.8;
    word-break: break-word;
}

.npa-ico {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 5px;
    color: var(--npa-btn, #34495e);
    opacity: .75;
}

.npa-rows a,
.npa-rows a:hover,
.npa-rows a:focus {
    color: inherit;
    text-decoration: none;
    border: 0;
    box-shadow: none;
}

.npa-rows a:hover { color: var(--npa-hover, #c33a2c); }

.npa-ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

.npa-socials {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eef1f4;
}

.npa-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform .15s, filter .15s;
}

.npa-social:hover { transform: scale(1.1); filter: brightness(1.08); }

.npa-social svg { width: 16px; height: 16px; fill: #fff; }
.npa-social-telegram { background: #0088cc; }
.npa-social-whatsapp { background: #25d366; }
.npa-social-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.npa-social-twitter { background: #000; }

.npa-empty {
    margin: 0;
    color: var(--npa-hover);
    font-weight: 700;
}

.npa-loading { margin: 0; color: #666; }

@media (max-width: 767px) {
    .npa-layout-map_list .npa-main { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .npa-layout-map_list .npa-main { grid-template-columns: 1fr; }
    .npa-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* جلوگیری از بزرگ شدن دکمه‌ها توسط استایل دکمه‌ی قالب */
.npa-wrap button.npa-btn {
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 6px 4px;
    line-height: 1.5;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
}

@media (max-width: 1100px) { .npa-agent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .npa-agent-list { grid-template-columns: 1fr; } }

/* جستجو */
.npa-search {
    position: relative;
    max-width: 640px;
    margin: 0 auto 22px;
}

.npa-search .npa-ico {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0;
    color: #8896a4;
    pointer-events: none;
}

.npa-wrap input.npa-search-input {
    display: block;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 46px;
    border: 1px solid #dfe5eb;
    border-radius: 999px;
    background: #fff;
    color: #1f2d3a;
    font: inherit;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(31, 45, 58, .05);
    transition: border-color .2s, box-shadow .2s;
}

.npa-wrap input.npa-search-input:focus {
    outline: none;
    border-color: var(--npa-btn, #34495e);
    box-shadow: 0 0 0 3px rgba(52, 73, 94, .12);
}

.npa-wrap button.npa-search-clear {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    width: 28px;
    height: 28px;
    min-height: 0;
    margin: -14px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f6;
    color: #44566a;
    font-size: 18px;
    line-height: 28px;
    cursor: pointer;
}

.npa-search-clear[hidden] { display: none; }

/* تعداد نمایندگی روی دکمه‌ی استان */
.npa-count {
    display: inline-block;
    min-width: 18px;
    margin-inline-start: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .28);
    font-size: 11px;
    line-height: 18px;
}

.npa-chip.is-province { background: var(--npa-btn, #34495e); color: #fff; }

.npa-result-count {
    margin-inline-start: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #44566a;
    font-size: 12px;
    font-weight: 500;
}
