/**
 * Dermosa Footer Pro — Mobile Layer
 *
 * این فایل با media="(max-width: BREAKPOINT)" لود می‌شود؛ بنابراین هیچ‌کدام از
 * قوانین آن روی دسکتاپ اعمال نمی‌شود و چیدمان دسکتاپ کاملاً دست‌نخورده باقی می‌ماند.
 * متغیرهای اندازه و تایپوگرافی از پنل مدیریت تزریق می‌شوند.
 */

/* ---------- Shell ---------- */

.drm-footer {
  padding-inline: var(--footer-m-gutter, 12px);
  overflow-x: clip;
}

.drm-footer__container {
  width: 100%;
  max-width: 100%;
}

/* ---------- Benefits ---------- */

/*
 * روی موبایل هر مزیت یک کارت مستقل می‌شود. این کار باعث می‌شود تعداد فرد آیتم‌ها
 * سلول خالیِ رنگی در انتهای گرید نسازد و چیدمان با هر تعداد ستون سالم بماند.
 */
.drm-footer__benefits {
  grid-template-columns: repeat(var(--footer-m-benefit-cols, 2), minmax(0, 1fr));
  gap: 8px;
  margin-block-end: 14px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.drm-footer__benefit {
  min-height: var(--footer-benefit-height);
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 11px;
  border: 1px solid var(--footer-benefit-border);
  border-radius: var(--footer-card-radius);
}

.drm-footer__benefit-icon {
  flex-basis: var(--footer-benefit-icon);
  border-radius: 12px;
}

.drm-footer__benefit-title,
.drm-footer__benefit-text {
  white-space: normal;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.drm-footer__benefit-title { margin-block-end: 2px; }

/* ---------- Main box ---------- */

.drm-footer__box {
  padding: var(--footer-padding);
  border-radius: var(--footer-main-radius);
  box-shadow: 0 10px 30px rgba(20, 23, 29, .1);
}

.drm-footer__box::before,
.drm-footer__box::after { display: none; }

/*
 * برند و ارتباط با ما تمام‌عرض می‌مانند و دو منوی لینک کنار هم در یک ردیف قرار می‌گیرند
 * تا طول اسکرول موبایل کوتاه شود.
 */
.drm-footer__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--footer-layout-gap) var(--footer-m-menu-gap, 14px);
}

.drm-footer__grid > .drm-footer__column { grid-column: 1 / -1; }
.drm-footer__grid > nav.drm-footer__column { grid-column: auto; }

/* ---------- Brand ---------- */

.drm-footer__brand-row { margin-block-end: 12px; }
.drm-footer__logo { border-radius: 16px; }
.drm-footer__about { line-height: 2; }

/* ---------- Headings & links ---------- */

.drm-footer__heading { margin-block-end: 12px; }

.drm-footer__links {
  grid-template-columns: repeat(var(--footer-m-link-cols, 1), minmax(0, 1fr));
  gap: 2px 12px;
}

.drm-footer__link {
  min-height: var(--footer-m-tap, 44px);
  width: 100%;
  max-width: 100%;
  padding-block: 6px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ---------- Contacts ---------- */

.drm-footer__contacts {
  grid-template-columns: repeat(var(--footer-m-contact-cols, 1), minmax(0, 1fr));
  gap: 8px;
}

.drm-footer__contact {
  min-height: var(--footer-contact-height);
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
}

/* ---------- Newsletter ---------- */

.drm-footer__newsletter {
  margin-block-start: 14px;
  border-radius: 14px;
}

.drm-footer__newsletter-input,
.drm-footer__newsletter-button { height: var(--footer-m-tap, 44px); }

.drm-footer__newsletter-button { min-width: 86px; }

/* ---------- App download ---------- */

.drm-footer__app-download {
  height: auto;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-block-start: 20px;
  padding: 14px;
  border-radius: var(--footer-card-radius);
}

.drm-footer__app-main { gap: 11px; }
.drm-footer__app-logo { border-radius: 14px; }
.drm-footer__app-text { line-height: 1.9; }

.drm-footer__app-buttons {
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
}

.drm-footer__store-button {
  width: auto;
  min-width: 0;
  flex: 1 1 138px;
  height: var(--footer-m-store-height, 46px);
  min-height: var(--footer-m-store-height, 46px);
  padding: 6px 8px;
  gap: 7px;
}

.drm-footer__store-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 9px;
}

/* ---------- Trust banner & badges ---------- */

.drm-footer__trust {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block-start: 12px;
}

.drm-footer__trust-banner {
  grid-column: 1 / -1;
  height: var(--footer-trust-height);
  min-height: var(--footer-trust-height);
  border-radius: var(--footer-card-radius);
  clip-path: inset(0 round var(--footer-card-radius));
}

.drm-footer__trust-card {
  height: var(--footer-m-badge-height, 96px);
  min-height: var(--footer-m-badge-height, 96px);
  padding: 9px;
  border-radius: var(--footer-card-radius);
}

.drm-footer__trust-card svg { width: 40px; height: 40px; }

.drm-footer__trust-media {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
}

.drm-footer__trust-media > img,
.drm-footer__trust-media > a > img {
  max-width: 54px !important;
  max-height: 54px !important;
}

.drm-footer__trust-embed,
.drm-footer__trust-embed > a {
  width: 54px !important;
  height: 54px !important;
}

/* ---------- Social row ---------- */

.drm-footer__social-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-block-start: 20px;
  padding-block-start: 18px;
}

/*
 * دکمه‌های شبکه اجتماعی با عرض کاملاً مساوی در یک ردیف پخش می‌شوند
 * و با هر تعداد آیکون و هر عرض صفحه ریسپانسیو می‌مانند.
 */
.drm-footer__socials {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}

.drm-footer__social {
  width: 100%;
  height: var(--footer-social-icon);
  border-radius: 12px;
}

.drm-footer__social svg {
  width: calc(var(--footer-social-icon) * .45);
  height: calc(var(--footer-social-icon) * .45);
}

/* ---------- Bottom bar ---------- */

.drm-footer__bottom {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-block-start: calc(var(--footer-scroll-button) / 2 + 10px);
  padding-block-start: calc(var(--footer-scroll-button) / 2 + 16px);
  text-align: center;
}

.drm-footer__copyright { text-align: center; }

.drm-footer__legal {
  justify-content: center;
  gap: 2px 14px;
}

.drm-footer__legal a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

/*
 * پدینگ پیش‌فرض مرورگر روی <button> (معمولاً 1px 6px) جعبه محتوا را کوچک و
 * آیکون را از مرکز خارج می‌کند. صفر کردن آن باعث می‌شود فلش دقیقاً وسط بنشیند.
 */
.drm-footer__scroll-top {
  padding: 0;
  border-width: 4px;
  line-height: 0;
}

/*
 * اندازه آیکون با پیکسل صریح تعیین می‌شود، نه درصد.
 * درصد روی <svg> بدون width/height ذاتی به‌راحتی توسط قوانین قالب فرو می‌ریزد
 * و آیکون به یک نقطه تبدیل می‌شود. min-width و min-height هم به‌عنوان ضمانت اضافه شده‌اند.
 */
.drm-footer__scroll-top svg {
  width: var(--footer-m-scroll-icon, 25px);
  height: var(--footer-m-scroll-icon, 25px);
  min-width: var(--footer-m-scroll-icon, 25px);
  min-height: var(--footer-m-scroll-icon, 25px);
  max-width: none;
  max-height: none;
  flex: none;
  display: block;
  margin: auto;
  justify-self: center;
  align-self: center;
}

/* کل کارت نماد (پس‌زمینه و برچسب زیر آن) قابل کلیک می‌شود */
.drm-footer__trust-card--embed.drm-is-clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.drm-footer__trust-card--embed.drm-is-clickable:focus-visible {
  outline: 2px solid var(--footer-primary);
  outline-offset: 2px;
}

/* ---------- Collapsible sections (optional) ---------- */

.drm-footer__column.drm-is-acc > .drm-footer__heading {
  justify-content: flex-start;
  min-height: var(--footer-m-tap, 44px);
  margin-block-end: 0;
  padding-block: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.drm-footer__column.drm-is-acc > .drm-footer__heading::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-inline-start: auto;
  margin-block-end: 4px;
  border-inline-end: 2px solid rgba(255, 255, 255, .5);
  border-block-end: 2px solid rgba(255, 255, 255, .5);
  transform: rotate(45deg);
  transition: transform 220ms var(--footer-ease);
}

.drm-footer__column.drm-is-acc.drm-acc-open > .drm-footer__heading::after {
  transform: rotate(-135deg);
  margin-block-end: 0;
  margin-block-start: 4px;
}

.drm-footer__column.drm-is-acc > .drm-footer__heading:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .55);
  outline-offset: 3px;
  border-radius: 6px;
}

.drm-footer__column.drm-is-acc .drm-acc-panel {
  max-height: 0;
  margin-block-start: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 280ms var(--footer-ease), opacity 200ms var(--footer-ease), margin 280ms var(--footer-ease);
}

.drm-footer__column.drm-is-acc.drm-acc-open .drm-acc-panel {
  max-height: 1600px;
  margin-block-start: 13px;
  opacity: 1;
}

/* ---------- Touch devices: no sticky hover ---------- */

@media (hover: none) {
  .drm-footer__link:hover,
  .drm-footer__link:focus-visible { transform: none; }

  .drm-footer__store-button:hover,
  .drm-footer__social:hover,
  .drm-footer__trust-card:hover,
  .drm-footer__trust-card--embed:hover { transform: none; }

  .drm-footer__trust-banner:hover img { transform: scale(1.003); }
  .drm-footer__scroll-top:hover { transform: translate(50%, -50%); }
}

/* ---------- Tablets: restore horizontal rows where there is room ---------- */

@media (min-width: 620px) {
  .drm-footer__benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drm-footer__contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* در تبلت جای کافی هست، پس ستون‌ها همیشه باز می‌مانند. */
  .drm-footer__column.drm-is-acc > .drm-footer__heading { cursor: default; }
  .drm-footer__column.drm-is-acc > .drm-footer__heading::after { display: none; }
  .drm-footer__column.drm-is-acc .drm-acc-panel {
    max-height: none;
    margin-block-start: 13px;
    overflow: visible;
    opacity: 1;
  }

  .drm-footer__app-download {
    flex-direction: row;
    align-items: center;
  }

  .drm-footer__app-buttons {
    width: auto;
    flex-wrap: nowrap;
  }

  .drm-footer__store-button { flex: 0 0 auto; min-width: 146px; }

  .drm-footer__social-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .drm-footer__socials {
    display: flex;
    width: auto;
  }

  .drm-footer__social { width: var(--footer-social-icon); }
  .drm-footer__social svg { width: 45%; height: 45%; }

  .drm-footer__bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-block-start: 23px;
    padding-block-start: 21px;
    text-align: right;
  }

  .drm-footer__copyright { text-align: right; }
  .drm-footer__legal { justify-content: flex-start; }
}

/* ---------- Very small screens ---------- */

@media (max-width: 360px) {
  .drm-footer__store-button { flex: 1 1 100%; }

  .drm-footer__benefit {
    gap: 8px;
    padding: 11px 9px;
  }

  .drm-footer__benefit-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
}
