/* =========================================================
   features.css — styles for all new features
   ========================================================= */

:root {
  --olive:       #5c6b3a;
  --olive-dark:  #3d4a26;
  --gold:        #d4af37;
  --gold-dark:   #b8960c;
  --wa-green:    #25d366;
  --wa-hover:    #20ba5a;
  --white:       #faf5ef;
  --cream:       #f0e8df;
  --gray2:       #e0d0c0;
  --text:        #1a1a14;
  --muted:       #5c5c46;
  --radius:      16px;
}

/* =========================================================
   PWA INSTALL BUTTON
   ========================================================= */
.pwa-install-btn {
  position: fixed;
  bottom: 80px;
  left: 16px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--olive-dark);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(61,74,38,.4);
  transition: all .3s;
  font-family: inherit;
}
.pwa-install-btn:hover {
  background: var(--olive);
  transform: translateY(-2px);
}
/* على الموبايل: اخفي الزر الثابت — البانر كافي */
@media(max-width:768px){
  .pwa-install-btn { display: none !important; }
}

/* =========================================================
   PWA INSTALL BANNER
   ========================================================= */
.pwa-banner {
  position: fixed;
  bottom: -120px;
  left: 0;
  right: 0;
  z-index: 9001;
  padding: 0 16px 16px;
  transition: bottom .4s cubic-bezier(.4,0,.2,1);
}
.pwa-banner.show { bottom: 0; }

.pwa-banner-content {
  background: #fff;
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -2px 24px rgba(0,0,0,.12), 0 8px 32px rgba(0,0,0,.1);
  border: 1px solid var(--gray2);
  max-width: 480px;
  margin: 0 auto;
}

.pwa-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.pwa-banner-icon img { width: 100%; height: 100%; object-fit: cover; }

.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-title { font-weight: 700; font-size: 14px; color: var(--text); }
.pwa-banner-desc  { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pwa-banner-install {
  background: var(--olive-dark);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background .2s;
}
.pwa-banner-install:hover { background: var(--olive); }

.pwa-banner-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color .2s;
}
.pwa-banner-close:hover { color: var(--text); }

/* =========================================================
   PWA iOS INSTRUCTIONS
   ========================================================= */
.pwa-ios-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.pwa-ios-content {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.pwa-ios-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.pwa-ios-content ol { padding-right: 20px; }
.pwa-ios-content li { font-size: 14px; line-height: 2; color: var(--muted); }
.pwa-ios-ok {
  width: 100%; margin-top: 20px;
  background: var(--olive-dark); color: #fff;
  border: none; border-radius: 999px; padding: 14px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.pwa-ios-close {
  position: absolute; top: 14px; left: 14px;
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--muted);
}

/* =========================================================
   PWA UPDATE NOTIFICATION
   ========================================================= */
.pwa-update-notification {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: top .4s;
  width: max-content;
  max-width: 90vw;
}
.pwa-update-notification.show { top: 16px; }
.pwa-update-content {
  background: var(--olive-dark);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(61,74,38,.5);
}
.pwa-update-content button {
  background: var(--gold);
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
}

/* =========================================================
   WHATSAPP FOLLOW-UP MODAL
   ========================================================= */
.followup-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.followup-modal.show {
  opacity: 1;
  pointer-events: all;
}

.followup-content {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px 24px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
  text-align: center;
  transform: translateY(40px);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.followup-modal.show .followup-content { transform: translateY(0); }

.followup-close {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--cream);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .2s;
}
.followup-close:hover { background: var(--gray2); }

.followup-icon { font-size: 48px; margin-bottom: 12px; }
.followup-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  font-family: 'Playfair Display', serif;
}
.followup-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}
.followup-stars {
  font-size: 28px;
  margin-bottom: 20px;
  letter-spacing: 4px;
}
.followup-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--wa-green);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 800;
  width: 100%;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.35);
  transition: all .25s;
  margin-bottom: 10px;
}
.followup-wa-btn:hover {
  background: var(--wa-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,211,102,.4);
}
.followup-dismiss {
  width: 100%;
  background: none;
  border: 1px solid var(--gray2);
  border-radius: 999px;
  padding: 12px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.followup-dismiss:hover { border-color: var(--muted); color: var(--text); }

/* =========================================================
   SMART RECOMMENDATIONS SECTION
   ========================================================= */
.rec-section {
  padding: 60px 24px;
  background: var(--cream);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 1024px) { .rec-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .rec-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 480px)  { .rec-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.rec-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray2);
  cursor: pointer;
  transition: all .25s;
}
.rec-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.1);
  border-color: var(--gold);
}

.rec-card-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}
.rec-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.rec-card:hover .rec-card-img img { transform: scale(1.07); }

.rec-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-hot   { background: #e53e3e; color: #fff; }
.badge-offer { background: var(--gold); color: #fff; }
.badge-new   { background: #38a169; color: #fff; }

.rec-card-body { padding: 12px; }
.rec-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-card-price { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rec-old  { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.rec-new  { font-size: 16px; font-weight: 900; color: var(--gold); font-family: 'Playfair Display', serif; }

.rec-share-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rec-btn {
  flex: 1;
  padding: 9px 0;
  background: var(--olive);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}
.rec-btn:hover { background: var(--olive-dark); }

.rec-share {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.rec-share:hover { background: var(--wa-hover); }

/* =========================================================
   FORM SHARE BUTTON (داخل فورم الطلب)
   ========================================================= */
.form-share-btn {
  width: 100%;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(37,211,102,.1);
  border: 1px dashed var(--wa-green);
  color: #1a8a45;
  border-radius: 999px;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.form-share-btn:hover {
  background: rgba(37,211,102,.18);
  border-style: solid;
}

/* =========================================================
   UTM SOURCE BADGE (للتطوير فقط — اخفه في الإنتاج)
   ========================================================= */
#utm-debug-badge {
  position: fixed;
  bottom: 140px;
  left: 12px;
  background: var(--olive-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 8999;
  opacity: .85;
  pointer-events: none;
  display: none; /* يظهر فقط إذا كان هناك UTM */
}
#utm-debug-badge.visible { display: block; }

/* =========================================================
   SHARE FLOATING BUTTON (يظهر على صفحة المنتج)
   ========================================================= */
.product-share-fab {
  position: fixed;
  bottom: 140px;
  right: 16px;
  z-index: 9000;
  width: 48px;
  height: 48px;
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  transition: all .3s;
}
.product-share-fab:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 8px 28px rgba(37,211,102,.6);
}
