/**
 * فوتر RJ — باکس اعتماد، ستون‌ها، آکاردئون موبایل.
 */

.rj-footer {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  background: var(--rj-cream-dark, #f3ede4);
  color: var(--rj-text, #1a1a1a);
}

/* ── Trust badges ── */
.rj-trust {
  padding-block: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--rj-white, #fff);
  border-block: 1px solid var(--rj-border, #e8e2d9);
}

.rj-trust__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rj-trust__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--rj-border, #e8e2d9);
  border-radius: var(--rj-radius, 14px);
  background: var(--rj-cream, #fcf9f5);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rj-trust__item:hover {
  border-color: var(--rj-primary-light, #e8b4bb);
  box-shadow: 0 4px 16px rgba(173, 95, 108, 0.08);
}

.rj-trust__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--rj-white, #fff);
  color: var(--color-primary, #ad5f6c);
  border: 1px solid var(--rj-border, #e8e2d9);
}

.rj-trust__title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--rj-text, #1a1a1a);
}

@media (min-width: 768px) {
  .rj-trust__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }

  .rj-trust__title {
    font-size: 0.875rem;
  }
}

/* ── Main footer ── */
.rj-footer__main {
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
}

.rj-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.rj-footer__col {
  border-bottom: 1px solid var(--rj-border, #e8e2d9);
}

.rj-footer__col:last-child {
  border-bottom: 0;
}

.rj-footer__heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.rj-footer__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 0;
  border: 0;
  background: none;
  color: var(--rj-text, #1a1a1a);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: inherit;
  cursor: pointer;
}

.rj-footer__chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  border-inline-end: 0;
  transform: rotate(45deg);
  margin-top: 1px;
  opacity: 0.55;
  transition: transform 0.2s;
}

.rj-footer__toggle[aria-expanded="true"] .rj-footer__chevron {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.rj-footer__panel {
  padding-bottom: 1.25rem;
}

.rj-footer__panel[hidden] {
  display: none;
}

.rj-footer__about-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--rj-text-muted, #6b6560);
  text-align: justify;
}

.rj-footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rj-footer__links li + li {
  margin-top: 0.5rem;
}

.rj-footer__links a {
  display: inline-block;
  padding: 0.2rem 0;
  color: var(--rj-text-muted, #6b6560);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

.rj-footer__links a:hover {
  color: var(--color-primary, #ad5f6c);
}

.rj-footer__contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rj-footer__contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--rj-text-muted, #6b6560);
}

.rj-footer__contact-list li + li {
  margin-top: 0.75rem;
}

.rj-footer__contact-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-top: 0.1rem;
  border-radius: 10px;
  background: var(--rj-white, #fff);
  color: var(--color-primary, #ad5f6c);
  border: 1px solid var(--rj-border, #e8e2d9);
}

.rj-footer__contact-list a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.rj-footer__contact-note {
  color: var(--rj-text-muted, #6b6560);
  font-size: 0.85em;
  white-space: nowrap;
}

.rj-footer__contact-list a:hover {
  color: var(--color-primary, #ad5f6c);
}

.rj-footer__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.rj-footer__badge-slot {
  width: 96px;
  height: 96px;
  border: 1px dashed color-mix(in srgb, var(--color-primary, #ad5f6c) 45%, #fff);
  border-radius: 12px;
  background: var(--rj-white, #fff);
}

.rj-footer__badges .widget {
  margin: 0;
}

.rj-footer__badges img {
  display: block;
  max-width: 96px;
  height: auto;
  border-radius: 8px;
}

/* ── Bottom bar ── */
.rj-footer__bar {
  padding-block: 1rem;
  border-top: 1px solid var(--rj-border, #e8e2d9);
  background: var(--rj-cream, #fcf9f5);
}

.rj-footer__bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem 0.625rem;
}

.rj-footer__copyright,
.rj-footer__credit {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
  color: var(--rj-text-muted, #6b6560);
}

.rj-footer__bar-sep {
  color: color-mix(in srgb, var(--rj-text-muted, #6b6560) 70%, transparent);
  font-size: 0.875rem;
  line-height: 1;
  user-select: none;
}

.rj-footer__credit a {
  color: var(--color-primary, #ad5f6c);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.rj-footer__credit a:hover,
.rj-footer__credit a:focus-visible {
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* فاصله از bottom nav موبایل */
@media (max-width: 1023px) {
  body.rj-site .rj-footer__bar {
    padding-bottom: calc(1rem + var(--rj-bottom-nav-h, 64px) + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 1024px) {
  body.rj-site .rj-footer__bar {
    padding-bottom: 1rem;
  }
}

/* ── Desktop layout ── */
@media (min-width: 1024px) {
  .rj-footer__grid {
    grid-template-columns: 1.35fr 0.85fr 0.85fr 1fr;
    gap: 2rem;
  }

  .rj-footer__col {
    border-bottom: 0;
  }

  .rj-footer__toggle {
    padding: 0 0 1rem;
    cursor: default;
    pointer-events: none;
  }

  .rj-footer__chevron {
    display: none;
  }

  .rj-footer__panel {
    display: block !important;
    padding-bottom: 0;
  }

  .rj-footer__panel[hidden] {
    display: block !important;
  }

  .rj-footer__heading .rj-footer__toggle {
    font-size: 1rem;
  }

  .rj-footer__about-text {
    font-size: 0.8125rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rj-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2rem;
  }

  .rj-footer__col {
    border-bottom: 0;
    margin-bottom: 1.5rem;
  }

  .rj-footer__col--about {
    grid-column: 1 / -1;
  }

  .rj-footer__toggle {
    padding: 0 0 0.875rem;
    cursor: default;
    pointer-events: none;
  }

  .rj-footer__chevron {
    display: none;
  }

  .rj-footer__panel {
    display: block !important;
    padding-bottom: 0;
  }

  .rj-footer__panel[hidden] {
    display: block !important;
  }
}
