/* ==========================================================================
   روح ستور — Editorial Light Footer (WordPress footer.php aligned module)
   - Prefix: ag-footer* | Fully scoped under .ag-footer (zero global leaks)
   - Structure mirrors /tmp/prod-src/footer.php & template-parts/logo.php
   - Palette: 100% warm light off-white & stone, copper/rust accent, zero black
   - Direction: RTL-first logical properties | Mobile (390px) & Desktop (1366px)
   ========================================================================== */

.ag-footer {
  --ag-bg: #f4f0e8;
  --ag-surface: #fbf9f5;
  --ag-surface-alt: #ece6da;
  --ag-border: #ddd5c7;
  --ag-border-strong: #c8bdae;
  --ag-ink: #443b33;
  --ag-ink-soft: #64594f;
  --ag-muted: #75695e;
  --ag-accent: #9e472a;
  --ag-accent-hover: #80371f;
  --ag-accent-soft: #f3e6e0;
  --ag-accent-border: #d9b5a6;
  --ag-wa-bg: #edf5ef;
  --ag-wa-hover: #e2efe6;
  --ag-wa-border: #bfd7c6;
  --ag-wa-ink: #216344;
  --ag-radius-sm: 8px;
  --ag-radius-md: 12px;
  --ag-radius-pill: 999px;
  --ag-transition: 180ms ease;

  position: relative;
  background: var(--ag-bg);
  color: var(--ag-ink);
  border-top: 1px solid var(--ag-border-strong);
  font-family: "Cairo", "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  direction: rtl;
  text-align: start;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.ag-footer,
.ag-footer *,
.ag-footer *::before,
.ag-footer *::after {
  box-sizing: border-box;
}

.ag-footer p,
.ag-footer h2,
.ag-footer h3,
.ag-footer ul,
.ag-footer li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag-footer a,
.ag-footer button {
  color: inherit;
  font-family: inherit;
  text-decoration: none;
  transition: color var(--ag-transition),
    border-color var(--ag-transition),
    background-color var(--ag-transition),
    transform var(--ag-transition);
}

.ag-footer svg {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.ag-footer :focus-visible {
  outline: 2px solid var(--ag-accent);
  outline-offset: 2px;
}

.ag-footer .ag-footer-container {
  position: relative;
  width: min(1220px, calc(100% - 48px));
  margin-inline: auto;
}

/* ==========================================================================
   Band 1: Light Editorial Back-to-Top Strip (replaces dark #backToTop bar)
   ========================================================================== */
.ag-footer .ag-footer-backtop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--ag-surface);
  border: 0;
  border-bottom: 1px solid var(--ag-border);
  color: var(--ag-ink-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ag-footer .ag-footer-backtop:hover {
  background: var(--ag-accent-soft);
  color: var(--ag-accent-hover);
}

.ag-footer .ag-footer-backtop svg {
  width: 15px;
  height: 15px;
  color: var(--ag-accent);
  transition: transform var(--ag-transition);
}

.ag-footer .ag-footer-backtop:hover svg {
  transform: translateY(-2px);
}

/* ==========================================================================
   Band 2: 3-Column Editorial Structure matching footer.php
   ========================================================================== */
.ag-footer .ag-footer-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 32px;
  padding-block: 36px 32px;
  align-items: start;
}

.ag-footer .ag-footer-col {
  min-width: 0;
}

.ag-footer .ag-footer-col + .ag-footer-col {
  padding-inline-start: 32px;
  border-inline-start: 1px solid var(--ag-border);
}

.ag-footer .ag-footer-col-title {
  display: inline-block;
  position: relative;
  padding-bottom: 8px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ag-accent);
  line-height: 1.4;
}

.ag-footer .ag-footer-col-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 28px;
  height: 2px;
  background: var(--ag-accent-border);
}

.ag-footer .ag-footer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ag-footer .ag-footer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding-block: 7px;
  border-bottom: 1px solid var(--ag-border);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ag-ink);
}

.ag-footer .ag-footer-list > li:last-child .ag-footer-link {
  border-bottom-color: transparent;
}

.ag-footer .ag-footer-link svg {
  width: 14px;
  height: 14px;
  color: var(--ag-muted);
  opacity: 0.72;
  transition: color var(--ag-transition), transform var(--ag-transition), opacity var(--ag-transition);
}

.ag-footer .ag-footer-link:hover {
  color: var(--ag-accent-hover);
  border-bottom-color: var(--ag-accent);
}

.ag-footer .ag-footer-link:hover svg {
  color: var(--ag-accent);
  opacity: 1;
  transform: translateX(-3px);
}

/* Contact Column (footer-wa-col) */
.ag-footer .ag-footer-contact-note {
  font-size: 14px;
  color: var(--ag-ink-soft);
  line-height: 1.65;
  margin-bottom: 12px;
}

.ag-footer .ag-footer-contact-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--ag-surface);
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius-sm);
  font-size: 13.5px;
}

.ag-footer .ag-footer-contact-line strong {
  font-weight: 700;
  color: var(--ag-ink-soft);
}

.ag-footer .ag-footer-tel {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ag-ink);
  letter-spacing: 0.02em;
  unicode-bidi: isolate;
}

.ag-footer .ag-footer-tel:hover {
  color: var(--ag-accent-hover);
}

.ag-footer .ag-footer-channel-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ag-footer .ag-footer-channel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: var(--ag-radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
}

.ag-footer .ag-footer-channel-btn svg {
  width: 16px;
  height: 16px;
}

.ag-footer .ag-footer-wa-btn {
  background: var(--ag-wa-bg);
  border: 1px solid var(--ag-wa-border);
  color: var(--ag-wa-ink);
}

.ag-footer .ag-footer-wa-btn:hover {
  background: var(--ag-wa-hover);
  border-color: var(--ag-wa-ink);
  transform: translateY(-1px);
}

.ag-footer .ag-footer-fb-btn {
  background: var(--ag-surface);
  border: 1px solid var(--ag-border-strong);
  color: var(--ag-ink);
}

.ag-footer .ag-footer-fb-btn svg {
  color: var(--ag-accent);
}

.ag-footer .ag-footer-fb-btn:hover {
  background: var(--ag-accent-soft);
  border-color: var(--ag-accent);
  color: var(--ag-accent-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Band 3: Brand Lockup (logo.php khatam-star mark) & Payment Methods Strip
   ========================================================================== */
.ag-footer .ag-footer-settings {
  border-top: 1px solid var(--ag-border);
  border-bottom: 1px solid var(--ag-border);
  background: var(--ag-surface);
  padding-block: 18px;
}

.ag-footer .ag-footer-settings-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.ag-footer .ag-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ag-ink);
}

.ag-footer .ag-footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.ag-footer .ag-footer-brand-mark svg {
  width: 42px;
  height: 42px;
}

.ag-footer .ag-footer-brand-word {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ag-footer .ag-footer-brand-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ag-ink);
}

.ag-footer .ag-footer-brand-tagline {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ag-ink-soft);
}

.ag-footer .ag-footer-payments {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.ag-footer .ag-footer-payments-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ag-muted);
}

.ag-footer .ag-footer-payments-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ag-footer .ag-footer-payment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--ag-radius-pill);
  background: var(--ag-bg);
  border: 1px solid var(--ag-border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ag-ink);
  line-height: 1.35;
}

.ag-footer .ag-footer-payment-pill svg {
  width: 14px;
  height: 14px;
  color: var(--ag-accent);
}

/* ==========================================================================
   Band 4: Legal Policies & Copyright
   ========================================================================== */
.ag-footer .ag-footer-bottom {
  padding-block: 18px 24px;
}

.ag-footer .ag-footer-bottom-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.ag-footer .ag-footer-policies {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.ag-footer .ag-footer-policy-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-block: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ag-muted);
}

.ag-footer .ag-footer-policy-link + .ag-footer-policy-link::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ag-border-strong);
  margin-inline-end: 10px;
  flex-shrink: 0;
}

.ag-footer .ag-footer-policy-link:hover {
  color: var(--ag-accent-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ag-footer .ag-footer-copy {
  font-size: 13px;
  font-weight: 700;
  color: var(--ag-ink-soft);
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & 390px Mobile)
   ========================================================================== */
@media (max-width: 980px) {
  .ag-footer .ag-footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }

  .ag-footer .ag-footer-col:nth-child(2) {
    padding-inline-start: 28px;
  }

  .ag-footer .ag-footer-col:nth-child(3) {
    grid-column: 1 / -1;
    padding-inline-start: 0;
    border-inline-start: 0;
    padding-top: 24px;
    border-top: 1px solid var(--ag-border);
  }
}

@media (max-width: 600px) {
  .ag-footer .ag-footer-container {
    width: min(1220px, calc(100% - 32px));
  }

  .ag-footer .ag-footer-cols {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-block: 24px;
  }

  .ag-footer .ag-footer-col + .ag-footer-col {
    padding-inline-start: 0;
    border-inline-start: 0;
    padding-top: 20px;
    border-top: 1px solid var(--ag-border);
  }

  .ag-footer .ag-footer-channel-actions {
    grid-template-columns: 1fr;
  }

  .ag-footer .ag-footer-settings {
    padding-block: 16px;
  }

  .ag-footer .ag-footer-settings-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .ag-footer .ag-footer-payments {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ag-footer .ag-footer-bottom-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ag-footer .ag-footer-policies {
    gap: 2px 16px;
  }

  .ag-footer .ag-footer-policy-link + .ag-footer-policy-link::before {
    display: none;
  }

  .ag-footer .ag-footer-policy-link {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-footer *,
  .ag-footer *::before,
  .ag-footer *::after {
    transition-duration: 0.001ms !important;
  }
}

.ag-footer .ag-footer-lockup { display: block; width: auto; height: 45px; max-width: 100%; }
.ag-footer .ag-footer-brand-word { gap: 6px; }
