@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@600;700&display=swap');

:root {
  --giws-wa: #25D366;
  --giws-call: #2F6FB1;
  --giws-bar-bg-transparent: rgba(255, 255, 255, 0);
  --giws-bar-bg-solid: rgba(255, 255, 255, 0.98);
  --giws-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --giws-shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --giws-shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --giws-radius: 50%;
  --giws-bar-radius: 16px;
  --giws-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --giws-font: 'Cairo', sans-serif;
}

/* =========================================
   الأزرار العائمة الجانبية
   ========================================= */
.giws-cta-floating {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--giws-font);
}

.giws-cta-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--giws-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  box-shadow: var(--giws-shadow-md);
  transition: var(--giws-transition);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.giws-cta-btn--call {
  background: linear-gradient(135deg, var(--giws-call) 0%, #1E5A8E 100%);
}

.giws-cta-btn--wa {
  background: linear-gradient(135deg, var(--giws-wa) 0%, #1EBE4F 100%);
}

.giws-cta-icon {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: var(--giws-transition);
}

.giws-cta-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: var(--giws-shadow-lg);
}

.giws-cta-btn:hover .giws-cta-icon {
  transform: scale(1.1);
}

.giws-cta-btn:active {
  transform: scale(0.95);
}

/* Tooltip */
.giws-cta-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--giws-transition);
  box-shadow: var(--giws-shadow-sm);
  font-family: var(--giws-font);
}

.giws-cta-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(0, 0, 0, 0.85);
}

.giws-cta-btn:hover .giws-cta-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* للأزرار على اليمين */
body .giws-cta-floating.giws-position-right .giws-cta-tooltip {
  right: auto;
  left: calc(100% + 12px);
  transform: translateY(-50%) translateX(-10px);
}

body .giws-cta-floating.giws-position-right .giws-cta-tooltip::after {
  left: auto;
  right: 100%;
  border-right-color: transparent;
  border-left-color: rgba(0, 0, 0, 0.85);
}

body .giws-cta-floating.giws-position-right .giws-cta-btn:hover .giws-cta-tooltip {
  transform: translateY(-50%) translateX(0);
}

/* =========================================
   الشريط السفلي - خلفية شفافة افتراضياً
   ========================================= */
.giws-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9997;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: var(--giws-bar-bg-transparent);
  padding: 16px clamp(16px, 4vw, 24px);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  box-shadow: none;
  border-top: 1px solid transparent;
  backdrop-filter: blur(0px);
  font-family: var(--giws-font);
  transition: var(--giws-transition);
  pointer-events: none;
}

/* عند الوصول للفوتر - خلفية بيضاء */
.giws-cta-bar.giws-near-footer {
  background: var(--giws-bar-bg-solid);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  border-top-color: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.giws-cta-bar-btn {
  flex: 1 1 0;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  text-decoration: none;
  border-radius: var(--giws-bar-radius);
  box-shadow: var(--giws-shadow-sm);
  transition: var(--giws-transition);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.giws-cta-bar-btn--call {
  background: linear-gradient(135deg, var(--giws-call) 0%, #1E5A8E 100%);
}

.giws-cta-bar-btn--wa {
  background: linear-gradient(135deg, var(--giws-wa) 0%, #1EBE4F 100%);
}

.giws-cta-bar-text {
  white-space: nowrap;
  font-family: var(--giws-font);
  color: #fff;
}

.giws-cta-bar-icon {
  width: 22px;
  height: 22px;
  fill: #fff;
  transition: var(--giws-transition);
}

.giws-cta-bar-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--giws-shadow-md);
}

.giws-cta-bar-btn:hover .giws-cta-bar-icon {
  transform: scale(1.1);
}

.giws-cta-bar-btn:active {
  transform: translateY(0);
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
  .giws-cta-floating {
    left: 16px;
    bottom: 16px;
    gap: 12px;
  }

  .giws-cta-btn {
    width: 56px;
    height: 56px;
  }

  .giws-cta-icon {
    width: 24px;
    height: 24px;
  }

  .giws-cta-tooltip {
    font-size: 13px;
    padding: 6px 12px;
  }

  .giws-cta-bar {
    gap: 12px;
    padding: 14px 12px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
  }

  .giws-cta-bar-btn {
    padding: 14px 20px;
    font-size: 16px;
  }

  .giws-cta-bar-icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .giws-cta-btn {
    width: 52px;
    height: 52px;
  }

  .giws-cta-icon {
    width: 22px;
    height: 22px;
  }

  .giws-cta-bar-btn {
    padding: 12px 16px;
    font-size: 15px;
  }

  .giws-cta-bar-text {
    font-size: 15px;
  }
}

/* شاشات كبيرة جداً - تجنب التمدد الزائد */
@media (min-width: 1400px) {
  .giws-cta-bar {
    justify-content: center;
  }
  
  .giws-cta-bar-btn {
    max-width: 400px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .giws-cta-bar.giws-near-footer {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .giws-cta-floating,
  .giws-cta-btn,
  .giws-cta-bar,
  .giws-cta-bar-btn,
  .giws-cta-tooltip,
  .giws-cta-icon,
  .giws-cta-bar-icon {
    transition: none;
  }

  .giws-cta-btn:hover,
  .giws-cta-bar-btn:hover {
    transform: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .giws-cta-btn,
  .giws-cta-bar-btn {
    border: 2px solid currentColor;
  }
}

/* تأكد من عدم حجب الفوتر */
body {
  padding-bottom: 0 !important;
}

/* إضافة مسافة للمحتوى إذا كان الشريط ظاهر */
body.giws-bar-active {
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  body.giws-bar-active {
    padding-bottom: 75px;
  }
}

@media (max-width: 480px) {
  body.giws-bar-active {
    padding-bottom: 70px;
  }
}