/* ===== Base / Sticky ===== */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

.footer {
  background: #2d4766;
  color: #fff;
  margin-top: auto;
  padding: 1.8rem 1rem 1.25rem;
  overflow: visible;
}

/* ===== Layout ===== */
.custom-footer {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  /* يمين | لوجو | يسار */
  justify-items: center;
  align-items: center;
  gap: .6rem;
}

/* ===== Right (text) ===== */
.footer-right {
  text-align: center;
}

.footer-right p {
  margin: .25rem 0;
  font-size: 1rem;
  line-height: 1.7;
  opacity: .95;
}

/* ===== Center (logo) ===== */
.footer-center {
  text-align: center;
}

/* اللوجو أكبر + أنيميشن طلوع/نزول + لف Y 360° */
.footer-logo {
  max-height: 110px;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .18));
  transform-style: preserve-3d;

  /* نستخدم متغيرات علشان ندمج حركتين */
  --ty: 0px;
  --ry: 0deg;
  transform: translateY(var(--ty)) rotateY(var(--ry));
  animation: floatY 3s ease-in-out infinite, spinY 3s linear infinite;
}

@keyframes floatY {

  0%,
  100% {
    --ty: 0px;
  }

  50% {
    --ty: -10px;
  }
}

@keyframes spinY {
  0% {
    --ry: 0deg;
  }

  100% {
    --ry: 360deg;
  }
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  .footer-logo {
    animation: none;
  }
}

/* ===== Left (social) ===== */
.footer-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  /* مسافة واضحة بين العناصر */
}

/* سطر دعوة للتواصل */
.footer-cta {
  font-size: 1.6rem;
  font-weight: 700;
  direction: rtl;
  opacity: .95;
  margin-bottom: .35rem;
}

/* عنصر السوشيال */
.social-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: rgba(255, 255, 255, .10);
  padding: .8rem 1.2rem;
  border-radius: 16px;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  width: 100%;
  max-width: 440px;

  /* دخول لطيف */
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp .7s ease forwards;
}

.social-item:nth-child(2) {
  animation-delay: .15s;
}

.social-item:nth-child(3) {
  animation-delay: .3s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social-item img {
  width: 28px;
  height: 28px;
}

.social-item a {
  color: #fff;
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: .2px;
  transition: opacity .25s ease, transform .25s ease, color .25s ease;
}

.social-item:hover {
  background: rgba(255, 255, 255, .18);
  transform: translateY(-3px);
}

.social-item a:hover {
  opacity: .95;
  color: #ffd36b;
}

/* ===== Fallback لو flex-gap مش مدعوم ===== */
.footer-left .social-item+.social-item {
  margin-top: 18px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .footer-logo {
    max-height: 100px;
  }
}

@media (max-width: 768px) {
  .custom-footer {
    grid-template-columns: 1fr;
    /* Stack */
    gap: 1.1rem;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    display: block !important;
    text-align: center;
  }

  .footer-logo {
    max-height: 92px;
  }

  /* مسافة مريحة ومضمونة بين عناصر السوشيال */
  .footer-left {
    gap: 2rem;
  }

  .footer-left .social-item+.social-item {
    margin-top: 22px !important;
  }

  .social-item {
    max-width: 460px;
    margin: 0 auto;
    padding: .9rem 1.25rem;
    gap: 1rem;
  }

  .social-item img {
    width: 28px;
    height: 28px;
  }

  .social-item a {
    font-size: 1.14rem;
  }
}

/* موبايل صغير (أغلب الأجهزة الحديثة) */
@media (max-width: 480px) {
  .footer {
    padding: 1.35rem .8rem 1rem;
  }

  .footer-logo {
    max-height: 86px;
  }

  .social-item {
    max-width: 400px;
  }

  .footer-left {
    gap: 1.8rem;
  }
}

/* شاشات صغيرة جدًا */
@media (max-width: 360px) {
  .social-item {
    max-width: 340px;
  }
}