/* ===============================
   WC PEF - Premium Purchase UI
   =============================== */

/* منطقة الشراء الأساسية */
.single-product form.cart,
.single-product form.cart .woocommerce-variation-add-to-cart{
  display:flex !important;
  flex-direction:column !important;
  gap:14px !important;
  align-items:stretch !important;
}

/* RTL */
html[dir="rtl"] .single-product form.cart,
html[dir="rtl"] .single-product form.cart .woocommerce-variation-add-to-cart{
  direction: rtl !important;
}

/* كرت للحقل */
.single-product form.cart .wc-pef-premium{
  padding: 14px 14px 12px !important;
  border: 1px solid rgba(0,0,0,.08) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.04) !important;
}

/* label */
.single-product form.cart .wc-pef-premium label{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  margin: 0 0 10px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: .2px !important;
  opacity: .95 !important;
}

.single-product form.cart .wc-pef-premium label .required{
  font-size: 14px !important;
  line-height: 1 !important;
}

/* input */
.single-product form.cart .wc-pef-premium input[type="email"],
.single-product form.cart .wc-pef-premium .input-text{
  width:100% !important;
  height:56px !important;
  border-radius: 14px !important;
  border:1px solid rgba(0,0,0,.14) !important;
  background: rgba(0,0,0,.02) !important;
  padding: 0 14px !important;
  font-size: 15px !important;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
}

.single-product form.cart .wc-pef-premium input::placeholder{
  opacity: .7 !important;
}

.single-product form.cart .wc-pef-premium input[type="email"]:focus,
.single-product form.cart .wc-pef-premium .input-text:focus{
  background:#fff !important;
  border-color: var(--wp--preset--color--primary, #1e73be) !important;
  box-shadow: 0 0 0 4px rgba(30,115,190,.14) !important;
  outline: none !important;
}

/* زر إضافة للسلة */
.single-product form.cart button.single_add_to_cart_button{
  width: 100% !important;
  min-height: 58px !important;
  border-radius: 16px !important;
  font-weight: 900 !important;
  letter-spacing: .3px !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.10) !important;
  transform: translateY(0) !important;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease !important;
}

.single-product form.cart button.single_add_to_cart_button:hover{
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.14) !important;
}

/* form-row */
.single-product form.cart .form-row{
  margin: 0 !important;
  padding: 0 !important;
}

/* رسالة الخطأ تحت الحقل + تمييز */
.single-product form.cart .wc-pef-field-error{
  margin-top: 10px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(214,54,56,.25) !important;
  background: rgba(214,54,56,.08) !important;
  color: #7a1b1d !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
}

.single-product form.cart .wc-pef-premium .wc-pef-invalid{
  border-color: #d63638 !important;
  box-shadow: 0 0 0 4px rgba(214,54,56,.12) !important;
  background: rgba(214,54,56,.04) !important;
}

/* عندما تكون اللغة Both */
.single-product form.cart .wc-pef-bilingual label{
  line-height: 1.35 !important;
  opacity: .98 !important;
}

@media (min-width: 992px){
  .single-product form.cart,
  .single-product form.cart .woocommerce-variation-add-to-cart{
    max-width: 640px !important;
  }
}

/* ===============================
   WoodMart Sticky Add to Cart UI
   =============================== */

.wc-pef-sticky{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  padding: 8px 10px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(0,0,0,.10) !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.10) !important;
  margin-inline-end: 12px !important;
}

.wc-pef-sticky-label{
  font-size: 12px !important;
  font-weight: 800 !important;
  opacity: .85 !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

.wc-pef-sticky-input{
  width: 240px !important;
  max-width: 40vw !important;
  height: 42px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.14) !important;
  background: #fff !important;
  padding: 0 12px !important;
  outline: none !important;
  font-size: 14px !important;
}

.wc-pef-sticky-input:focus{
  border-color: var(--wp--preset--color--primary, #1e73be) !important;
  box-shadow: 0 0 0 4px rgba(30,115,190,.14) !important;
}

/* خطأ على sticky input */
.wc-pef-sticky-input.wc-pef-invalid{
  border-color: #d63638 !important;
  box-shadow: 0 0 0 4px rgba(214,54,56,.12) !important;
}

@media (max-width: 768px){
  .wc-pef-sticky{
    width: 100% !important;
    margin: 8px 0 !important;
  }
  .wc-pef-sticky-input{
    width: 100% !important;
    max-width: none !important;
  }
}


/* --- Sticky bar: integrate better with WoodMart layout --- */
.wc-pef-sticky{
  box-shadow: none !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin-inline-end: 10px !important;
  gap: 8px !important;
}

.wc-pef-sticky-label{
  font-size: 12px !important;
  font-weight: 700 !important;
  opacity: .85 !important;
}

.wc-pef-sticky-input{
  height: 40px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0,0,0,.18) !important;
  background: #fff !important;
}

/* Mobile sticky: hide label for space */
@media (max-width: 768px){
  .wc-pef-sticky-label{ display:none !important; }
}


/* --- WoodMart sticky: do NOT hide other buttons (wishlist/compare) --- */
.wc-pef-sticky{
  flex: 0 0 auto !important;
  min-width: 0 !important;
  margin: 0 10px 0 0 !important;
}

html[dir="rtl"] .wc-pef-sticky{
  margin: 0 0 0 10px !important;
}

.wc-pef-sticky-input{
  width: 180px !important;
  max-width: 22vw !important;
}

@media (max-width: 1200px){
  .wc-pef-sticky-input{ width: 160px !important; }
}

@media (max-width: 768px){
  .wc-pef-sticky-input{
    width: 140px !important;
    max-width: 46vw !important;
  }
}


/* ===============================
   WoodMart Sticky - Compact Email Pill (keeps other buttons visible)
   =============================== */

/* Make the email field a compact pill that can shrink without pushing icons away */
.wc-pef-sticky{
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 0 12px !important;
  border: 1px solid rgba(0,0,0,.16) !important;
  border-radius: 999px !important;
  background: #fff !important;
  height: 40px !important;

  /* key: allow shrinking */
  flex: 0 1 220px !important;
  max-width: 220px !important;
  min-width: 140px !important;
  margin: 0 10px 0 0 !important;
}

/* envelope icon */
.wc-pef-sticky::before{
  content: "✉" !important;
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 14px !important;
  opacity: .75 !important;
  pointer-events: none !important;
}

html[dir="rtl"] .wc-pef-sticky{
  margin: 0 0 0 10px !important;
}

html[dir="rtl"] .wc-pef-sticky::before{
  left: auto !important;
  right: 12px !important;
}

/* Hide label inside sticky to save space */
.wc-pef-sticky-label{
  display:none !important;
}

/* Input inside pill */
.wc-pef-sticky-input{
  width: 100% !important;
  max-width: 100% !important;
  height: 38px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 0 0 26px !important;
  outline: none !important;
  border-radius: 999px !important;
  font-size: 13.5px !important;
}

html[dir="rtl"] .wc-pef-sticky-input{
  padding: 0 26px 0 0 !important;
}

/* Focus ring */
.wc-pef-sticky:focus-within{
  border-color: var(--wp--preset--color--primary, #1e73be) !important;
  box-shadow: 0 0 0 4px rgba(30,115,190,.14) !important;
}

/* Invalid state */
.wc-pef-sticky-input.wc-pef-invalid,
.wc-pef-sticky.wc-pef-invalid{
  border-color: #d63638 !important;
  box-shadow: 0 0 0 4px rgba(214,54,56,.12) !important;
}

@media (max-width: 1200px){
  .wc-pef-sticky{
    flex-basis: 190px !important;
    max-width: 190px !important;
    min-width: 130px !important;
  }
}

@media (max-width: 768px){
  .wc-pef-sticky{
    flex-basis: 160px !important;
    max-width: 160px !important;
    min-width: 120px !important;
  }
  .wc-pef-sticky-input{
    font-size: 13px !important;
  }
}


/* ===============================
   WoodMart Sticky - Expandable Email (keeps buttons)
   =============================== */

/* collapsed (icon only) */
.wc-pef-sticky.wc-pef-collapsed{
  flex: 0 0 44px !important;
  max-width: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  justify-content: center !important;
}

.wc-pef-sticky.wc-pef-collapsed::before{
  left: 50% !important;
  right: auto !important;
  transform: translate(-50%, -50%) !important;
}

html[dir="rtl"] .wc-pef-sticky.wc-pef-collapsed::before{
  right: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.wc-pef-sticky.wc-pef-collapsed .wc-pef-sticky-input{
  width: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* expanded */
.wc-pef-sticky.wc-pef-open{
  flex: 0 1 220px !important;
  max-width: 220px !important;
  min-width: 160px !important;
  padding: 0 12px !important;
}

.wc-pef-sticky.wc-pef-open .wc-pef-sticky-input{
  width: 100% !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Smooth transition */
.wc-pef-sticky,
.wc-pef-sticky-input{
  transition: all .18s ease !important;
}


/* ===============================
   WoodMart Sticky - Popover Email (no layout shift)
   =============================== */

.wc-pef-sticky{
  position: relative !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  margin: 0 10px 0 0 !important;
}

html[dir="rtl"] .wc-pef-sticky{
  margin: 0 0 0 10px !important;
}

.wc-pef-sticky-trigger{
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0,0,0,.16) !important;
  background: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
}

.wc-pef-sticky-trigger::before{
  content: "✉" !important;
  font-size: 16px !important;
  opacity: .85 !important;
}

.wc-pef-sticky.wc-pef-invalid .wc-pef-sticky-trigger{
  border-color: #d63638 !important;
  box-shadow: 0 0 0 4px rgba(214,54,56,.12) !important;
}

.wc-pef-sticky-popover{
  position: absolute !important;
  top: calc(100% + 10px) !important;
  left: 0 !important;
  width: 280px !important;
  max-width: 70vw !important;
  padding: 12px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  background: #fff !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.16) !important;
  z-index: 99999 !important;
  display: none !important;
}

html[dir="rtl"] .wc-pef-sticky-popover{
  left: auto !important;
  right: 0 !important;
}

.wc-pef-sticky.wc-pef-open .wc-pef-sticky-popover{
  display: block !important;
}

.wc-pef-sticky-title{
  font-size: 12px !important;
  font-weight: 800 !important;
  opacity: .9 !important;
  margin: 0 0 8px !important;
}

.wc-pef-sticky-popover .wc-pef-sticky-input{
  width: 100% !important;
  height: 42px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.16) !important;
  padding: 0 12px !important;
  background: #fff !important;
  font-size: 14px !important;
  outline: none !important;
}

.wc-pef-sticky-popover .wc-pef-sticky-input:focus{
  border-color: var(--wp--preset--color--primary, #1e73be) !important;
  box-shadow: 0 0 0 4px rgba(30,115,190,.14) !important;
}

@media (max-width: 768px){
  .wc-pef-sticky-popover{
    width: 86vw !important;
  }
}


/* Inline error (blocks cart drawer until valid email) */
.wc-pef-inline-error{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d63638;
}
input.wc-pef-invalid{
  border-color: #d63638 !important;
  box-shadow: 0 0 0 4px rgba(214,54,56,.12) !important;
}
