/* کارنو پلاس — ریسپانسیو سراسری (موبایل‌اول) — v20260630 */

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* SVG داخل آیکون‌ها — جلوگیری از بزرگ شدن تمام‌عرض روی موبایل */
.bento-tool-card__icon svg,
.svc-icon svg,
.ann-bell svg,
.nav-toggle svg,
.hs-code svg {
  width: auto;
  height: auto;
  max-width: none;
}

.container {
  width: min(var(--container, 1320px), calc(100% - clamp(1rem, 4vw, 3rem)));
}

/* ─── بخش‌ها — فشرده‌تر روی موبایل ─── */
@media (max-width: 640px) {
  .section {
    padding: 2.75rem 0;
  }

  .section__head {
    margin-bottom: 1.75rem;
  }

  .section__title {
    font-size: clamp(1.15rem, 5vw, 1.45rem);
    line-height: 1.55;
  }

  .section__desc {
    font-size: 0.88rem;
    line-height: 1.75;
  }

  .hero {
    padding: calc(var(--nav-h) + 1.25rem) 0 2.25rem;
  }

  .hero h1 {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    line-height: 1.5;
  }

  .hero__lead {
    font-size: 0.9rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
  }

  .hero__card {
    padding: 1.1rem;
  }

  .stat strong {
    font-size: 1.2rem;
  }

  .stat span {
    font-size: 0.72rem;
  }
}

/* ─── دستیارها (bento-tools) ─── */
.bento-tools {
  gap: 0.85rem;
}

@media (max-width: 720px) {
  .bento-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .bento-tool-card {
    padding: 1rem 0.9rem;
  }

  .bento-tool-card__icon {
    width: 38px;
    height: 38px;
    margin-bottom: 0.65rem;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .bento-tool-card__icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .bento-tool-card h3 {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .bento-tool-card p {
    font-size: 0.74rem;
    line-height: 1.55;
  }

  .bento-tool-card__cta {
    font-size: 0.74rem;
    margin-top: 0.55rem;
  }
}

@media (max-width: 480px) {
  .bento-tools {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .bento-tool-card {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.7rem;
    row-gap: 0.15rem;
    align-items: start;
    padding: 0.8rem 0.85rem;
    border-right-width: 3px;
  }

  .bento-tool-card__icon {
    grid-row: 1 / span 2;
    width: 2.25rem !important;
    height: 2.25rem !important;
    min-width: 2.25rem;
    max-width: 2.25rem;
    margin-bottom: 0;
    align-self: center;
    border-radius: 8px;
  }

  .bento-tool-card__icon svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
  }

  .bento-tool-card h3 {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .bento-tool-card p {
    grid-column: 2;
    font-size: 0.72rem;
    line-height: 1.5;
  }

  .bento-tool-card__cta {
    grid-column: 1 / -1;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--line);
    font-size: 0.72rem;
  }

  .bento-card > .svc-icon {
    width: 2rem !important;
    height: 2rem !important;
    max-width: 2rem;
  }

  .bento-card > .svc-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* ─── کارت‌های خدمات (bento) ─── */
@media (max-width: 640px) {
  .bento-card {
    padding: 1.15rem 1rem;
  }

  .bento-card > .svc-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0.65rem;
  }

  .bento-card > .svc-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .bento-card h3 {
    font-size: 0.9rem;
  }

  .bento-card p {
    font-size: 0.8rem;
    line-height: 1.65;
  }
}

/* ─── چهار مسیر پلتفرم ─── */
@media (max-width: 640px) {
  .platform-paths {
    padding: 2.25rem 0 2.5rem;
  }

  .platform-path {
    padding: 1.15rem 1rem 1.1rem;
    min-height: 0;
  }

  .platform-path h3 {
    font-size: 1rem;
  }

  .platform-path p {
    font-size: 0.8rem;
  }

  .platform-path__cta {
    font-size: 0.75rem;
  }
}

/* ─── محصولات ─── */
.products-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .product-card__body {
    padding: 0.85rem 0.9rem 1rem;
  }

  .product-card__title {
    font-size: 0.92rem;
  }

  .product-card__summary {
    font-size: 0.8rem;
  }
}

.product-detail__grid {
  gap: 1.25rem;
}

.product-detail__actions,
.zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-detail__actions .btn,
.zone-actions .btn {
  flex: 1 1 auto;
  min-width: min(100%, 10rem);
  text-align: center;
  justify-content: center;
}

/* ─── ستون‌های چرا ما ─── */
@media (max-width: 640px) {
  .pillar {
    padding: 1.25rem 1.1rem;
  }

  .pillar__num {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    font-size: 0.9rem;
  }
}

/* ─── نوار اعتماد ─── */
@media (max-width: 640px) {
  .trust-bar__inner {
    gap: 0.5rem;
    padding: 0.85rem 0;
    justify-content: stretch;
  }

  .trust-bar__inner span {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
    text-align: center;
  }
}

/* ─── فوتر ─── */
@media (max-width: 640px) {
  .footer__grid {
    gap: 1.5rem;
  }

  .footer__trust-row {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .footer__bottom--split {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .consult {
    padding: 1.5rem 1.1rem;
  }
}

/* ─── هدر موبایل ─── */
@media (max-width: 960px) {
  .nav-toggle {
    display: flex;
  }

  .brand__tag {
    display: none;
  }

  .brand {
    max-width: min(56vw, 220px);
  }

  .nav__tools {
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.5rem;
    margin-inline-start: 0;
    padding-inline-start: 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
    gap: 0.45rem;
  }

  .nav__tools .ann-bell {
    order: -1;
  }

  .nav__cta--tool {
    flex: 1 1 calc(50% - 0.35rem);
    width: auto;
    text-align: center;
    margin-top: 0;
    margin-right: 0;
    font-size: 0.74rem !important;
    padding: 0.48rem 0.55rem !important;
  }

  .nav-item__trigger {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  :root {
    --nav-h: 64px;
  }

  .brand__logo {
    width: 40px;
    height: 40px;
  }

  .brand__name {
    font-size: 0.95rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .nav__cta--tool {
    flex: 1 1 100%;
  }

  .zone-siblings__grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 961px) {
  .bento-tools {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ─── اطلاع‌رسانی ─── */
@media (max-width: 640px) {
  .ann-bar {
    padding: 0.45rem 0.65rem;
    font-size: 0.76rem;
  }

  .ann-bar__inner {
    justify-content: flex-start;
    text-align: right;
  }

  .ann-bar__text {
    text-align: right;
    flex: 1 1 100%;
  }
}

/* ─── نتیجه تعرفه — باکس‌های یکسان ─── */
.best-match {
  padding: clamp(1.1rem, 4vw, 2.1rem) clamp(1rem, 3.5vw, 2rem);
}

.best-match__code-wrap {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .best-match__code-wrap {
    flex-direction: row;
    align-items: center;
  }
}

.best-match__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 720px) {
  .best-match__meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

.best-match__meta > div {
  min-height: 5.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.75rem 0.85rem;
}

.best-match__meta dt {
  font-size: 0.72rem;
  margin-bottom: 0.4rem;
}

.best-match__meta dd {
  font-size: clamp(0.82rem, 2.8vw, 0.92rem);
  flex: 1;
}

.best-match__title {
  font-size: clamp(1rem, 4.2vw, 1.35rem);
  word-break: break-word;
}

.best-match__desc {
  font-size: clamp(0.85rem, 3.2vw, 0.92rem);
}

.hs-code {
  gap: 0.4rem 0.55rem;
  justify-content: center;
}

.hs-code__seg {
  min-width: 2.5rem;
}

.hs-code__seg-val {
  font-size: clamp(1.1rem, 5vw, 1.5rem) !important;
}

/* ─── جستجو ─── */
.tariff-search__row {
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 600px) {
  .tariff-search__row {
    flex-direction: row;
    align-items: stretch;
  }
}

.tariff-search__btn {
  width: 100%;
}

@media (min-width: 600px) {
  .tariff-search__btn {
    width: auto;
    flex-shrink: 0;
  }
}

/* ─── کارت‌های نتایج ─── */
.card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .card__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card__meta-item {
  min-height: 4.5rem;
}

/* ─── ISIC / تعرفه موبایل ─── */
@media (max-width: 640px) {
  .page-tariff .isic-hit {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    text-align: right;
  }

  .page-tariff .tariff-intro__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .page-tariff .tariff-intro__stats li {
    min-width: 0;
  }
}

/* ─── اکانت / paywall ─── */
@media (max-width: 600px) {
  .kp-auth-modal {
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.35rem 1.1rem 1.1rem;
  }

  .kp-paywall-card {
    width: calc(100% - 1.5rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
}

/* ─── جلوگیری از بیرون‌زدگی متن ─── */
pre,
code,
.hs-code,
.best-match__code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* safe area برای گوشی‌های ناچ */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .topbar,
  .ann-bar {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}
