/* ---------------------------------------------
  CWP Promo Popup — Dark theme friendly styling
  Targets #cwp-promo-popup (your popup HTML wrapper)
---------------------------------------------- */

/* Ensure RTL and center alignment inside the popup */
#cwp-promo-popup {
  direction: rtl !important;
  text-align: right !important;
  color: #ffffff !important;       /* default text color (light) */
  max-width: 640px !important;
  width: calc(100% - 60px) !important;
  padding: 32px !important;
  box-sizing: border-box !important;
}

/* Heading */
#cwp-promo-popup h2,
#cwp-promo-popup h3 {
  color: #ffffff !important;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: 0.2px;
}

/* Intro paragraph */
#cwp-promo-popup p {
  color: rgba(255,255,255,0.85) !important;
  line-height: 1.6;
  margin: 0 0 14px 0;
  font-size: 14px;
}

/* Form container (if you wrap it) */
#cwp-promo-popup form#cwp-promo-form {
  margin-top: 8px;
}

/* Inputs: make them visibly lighter on dark background */
#cwp-promo-popup input[type="text"],
#cwp-promo-popup input[type="email"],
#cwp-promo-popup textarea {
  width: 100% !important;
  padding: 10px 12px !important;
  margin-bottom: 12px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(255,255,255,0.06) !important; /* slightly translucent light */
  color: #ffffff !important;
  font-size: 14px;
  box-shadow: none !important;
  outline: none;
}

/* Placeholder color (lighter) */
#cwp-promo-popup input::placeholder,
#cwp-promo-popup textarea::placeholder {
  color: rgba(255,255,255,0.6) !important;
}

/* Input focus: brighter border */
#cwp-promo-popup input:focus,
#cwp-promo-popup textarea:focus {
  border-color: rgba(30,115,190,0.95) !important; /* blue tint */
  background: rgba(255,255,255,0.04) !important;
  box-shadow: 0 0 0 3px rgba(30,115,190,0.08) !important;
}

/* Checkbox & label */
#cwp-promo-popup input[type="checkbox"] {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  accent-color: #1e73be; /* modern browsers */
}
#cwp-promo-popup label {
  color: rgba(255,255,255,0.9) !important;
  font-size: 13px;
  margin-left: 8px;
}

/* Submit button */
#cwp-promo-popup button[type="submit"],
#cwp-promo-popup .button {
  background: linear-gradient(180deg,#1e73be,#1762a6) !important;
  color: #ffffff !important;
  border: 0 !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 22px rgba(30,115,190,0.18) !important;
  transition: transform .08s ease, box-shadow .12s ease;
}

/* Button hover/focus */
#cwp-promo-popup button[type="submit"]:hover,
#cwp-promo-popup button[type="submit"]:focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(30,115,190,0.24) !important;
}

/* Center small note text and make it light */
#cwp-promo-popup .small-note {
  color: rgba(255,255,255,0.68) !important;
  font-size: 12px;
  margin-top: 10px;
}

/* Success message styling: green on dark */
.cwp-promo-success {
  background: rgba(5,95,40,0.12);
  border: 1px solid rgba(50,200,120,0.12);
  color: #dff6e1;
  padding: 14px;
  border-radius: 8px;
  text-align: center;
  margin-top: 8px;
}

/* Make sure inner elements that theme forces to white text are overridden */
#cwp-promo-popup * { color: inherit !important; }

/* Responsive: tighten padding on small screens */
@media (max-width: 480px) {
  #cwp-promo-popup { padding: 18px !important; }
  #cwp-promo-popup h2 { font-size: 18px; }
  #cwp-promo-popup input[type="text"], #cwp-promo-popup input[type="email"] { padding: 10px !important; }
  #cwp-promo-popup button[type="submit"] { width: 100%; display:block; text-align:center; }
}

/* جعل كل محتوى البوب أب في المنتصف */
#cwp-promo-popup {
    text-align: center !important;   /* وسط */
    direction: rtl !important;       /* يظل RTL */
}

/* العنوان وسط */
#cwp-promo-popup h2,
#cwp-promo-popup h3 {
    text-align: center !important;
}

/* الفقرات وسط */
#cwp-promo-popup p {
    text-align: center !important;
}

/* Checkbox label وسط */
#cwp-promo-popup label {
    display: block !important;
    text-align: center !important;
}

/* الزر وسط */
#cwp-promo-popup button[type="submit"],
#cwp-promo-popup .button {
    display: block !important;
    margin: 12px auto !important;  /* يجعل الزر في المنتصف */
}

/* الحقول: تظهر في المنتصف ولكن النص داخلها يبقى RTL */
#cwp-promo-popup input[type="text"],
#cwp-promo-popup input[type="email"],
#cwp-promo-popup textarea {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: right !important;   /* كتابة عربية داخل الحقل */
    direction: rtl !important;
}

/* --- Center popup content vertically & horizontally (robust selectors for Woodmart popups) --- */

/* 1) Make the popup content wrapper a flex container and center its children */
.woodmart-popup__content,
.woodmart-popup .popup-content,
.popup-content,
#cwp-promo-popup { /* fallback selectors */
  display: flex !important;
  align-items: center !important;    /* vertical center */
  justify-content: center !important; /* horizontal center */
  flex-direction: column !important; /* stack elements vertically */
  min-height: 220px !important;      /* ensure some vertical space */
  box-sizing: border-box !important;
}

/* 2) Ensure the inner card (your #cwp-promo-popup) does not stretch full height */
#cwp-promo-popup {
  width: 620px !important;           /* fixed width to keep things centered */
  max-width: calc(100% - 60px) !important;
  margin: 0 auto !important;
  padding: 32px !important;
  transform: none !important;        /* avoid theme transforms */
  position: relative !important;
}

/* 3) If theme applies padding on inner wrappers, remove it to avoid offset */
.woodmart-popup__content > * { margin: 0 !important; padding: 0 !important; }

/* 4) If the popup container has top padding/margin that pushes content up, neutralize it */
.woodmart-popup,
.woodmart-popup__container,
.woodmart-popup__inner,
.popup-wrapper,
.popup-overlay {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 5) Make sure the form itself is centered inside the card */
#cwp-promo-popup form#cwp-promo-form {
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 auto !important;
  display: block !important;
}

/* 6) Small screens: allow auto height and padding */
@media (max-width: 600px) {
  .woodmart-popup__content,
  .woodmart-popup .popup-content,
  #cwp-promo-popup {
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
  }
  #cwp-promo-popup { width: calc(100% - 36px) !important; }
}

