/* ============ Hegazy Offers – UI ============ */
/* Variables (easy theming) */
:root{
  --hgof-bg: #ffffff;
  --hgof-fg: #0f172a;        /* slate-900 */
  --hgof-muted: #64748b;     /* slate-500 */
  --hgof-border: #e5e7eb;    /* gray-200 */
  --hgof-accent: #2563eb;    /* blue-600 */
  --hgof-accent-contrast: #ffffff;

  --hgof-ok-bg: #ecfdf5;     /* emerald-50 */
  --hgof-ok-fg: #065f46;     /* emerald-800 */
  --hgof-err-bg: #fef2f2;    /* rose-50 */
  --hgof-err-fg: #991b1b;    /* rose-800 */

  --hgof-radius: 12px;
  --hgof-radius-pill: 999px;
  --hgof-shadow: 0 10px 30px rgba(2,6,23,.18);

  --hgof-gap: 12px;
  --hgof-pad: 20px;
  --hgof-z: 99999;
}

/* Optional dark mode (auto) */
@media (prefers-color-scheme: dark){
  :root{
    --hgof-bg: #0b1220;
    --hgof-fg: #e5e7eb;
    --hgof-muted: #9aa4b2;
    --hgof-border: #1f2937;
    --hgof-ok-bg: #063f33;
    --hgof-ok-fg: #d1fae5;
    --hgof-err-bg: #3b0b0b;
    --hgof-err-fg: #fee2e2;
  }
}
/* Or force with body.dark .hgof-modal__dialog { ... } */

/* Small helper: RTL adjustments */
[dir="rtl"] .hgof-close{ right:auto; left:10px; }
[dir="rtl"] .hgof-offers-head{ flex-direction: row-reverse; }
[dir="rtl"] .hgof-offers-list li{ justify-content: flex-end; }

/* Estimate label above price */
.hgof-estimate-label{
  display:block;
  font-size:.92em;
  color:var(--hgof-muted);
  margin:0 0 4px;
}

/* ============ Modal ============ */
.hgof-modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:var(--hgof-z);
  -webkit-backdrop-filter:saturate(120%) blur(2px);
  backdrop-filter:saturate(120%) blur(2px);
}

.hgof-modal__dialog{
  background:var(--hgof-bg);
  color:var(--hgof-fg);
  max-width:640px;
  margin:6vh auto;
  padding:var(--hgof-pad);
  border-radius:var(--hgof-radius);
  position:relative;
  box-shadow:var(--hgof-shadow);
  border:1px solid var(--hgof-border);
  animation: hgof-in .16s ease-out;
}
@keyframes hgof-in{
  from{ transform:translate3d(0,8px,0); opacity:0 }
  to  { transform:translate3d(0,0,0); opacity:1 }
}

.hgof-close{
  position:absolute;
  right:10px; top:10px;
  border:0; background:transparent;
  color:inherit; font-size:22px; cursor:pointer;
  line-height:1; padding:4px; border-radius:8px;
}
.hgof-close:focus-visible{ outline:2px solid var(--hgof-accent); outline-offset:2px; }

/* ============ Form ============ */
.hgof-row{ margin-bottom: var(--hgof-gap); }
.hgof-row label{
  display:block; margin-bottom:6px;
  font-weight:600; color:var(--hgof-fg);
}
.hgof-row input[type="text"],
.hgof-row input[type="email"],
.hgof-row input[type="number"],
.hgof-row input[type="tel"],
.hgof-row textarea{
  width:100%;
  border:1px solid var(--hgof-border);
  background:transparent;
  color:inherit;
  border-radius:10px;
  padding:10px 12px;
}
.hgof-row input:focus,
.hgof-row textarea:focus{
  outline:none;
  border-color: var(--hgof-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.hgof-row--actions{ text-align:right; }
[dir="rtl"] .hgof-row--actions{ text-align:left; }




.hgof-offer-btn,
.hgof-offer-form .button.button-primary,
.button.hgof-offer-btn {
  background: #e53935 !important; /* أحمر */
  border-color: #e53935 !important; 
  color: #fff !important;
}

.button.hgof-offer-btn:hover {
  background: #c62828 !important; /* أحمر أغمق للهوفر */
  border-color: #c62828 !important;
  filter: brightness(1) !important; /* ممكن تشيل الفلتر أو تسيبه 1 */
}






/* Submit button look (inherits Woo if present) */
.hgof-offer-btn,
.hgof-offer-form .button.button-primary{
  background: var(--hgof-accent);
  color: var(--hgof-accent-contrast);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.hgof-offer-form .button.button-primary:hover{
  filter: brightness(0.96);
}

/* Status messages */
.hgof-status{
  margin-top:10px; padding:10px;
  border-radius:8px; border:1px solid var(--hgof-border);
}
.hgof-status.ok { background:var(--hgof-ok-bg); color:var(--hgof-ok-fg); }
.hgof-status.err{ background:var(--hgof-err-bg); color:var(--hgof-err-fg); }

/* Tabs (login/register) */
.hgof-tabs{ display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.hgof-tab{
  border:1px solid var(--hgof-border);
  background:#f8fafc; color:inherit;
  padding:6px 10px; border-radius:8px; cursor:pointer;
}
.hgof-tab.is-active{ background:var(--hgof-bg); }

/* Countdown */
.hgof-deadline{ margin:10px 0; font-weight:600; color:var(--hgof-fg); }

/* ============ Widget ============ */
.hgof-offers-widget{
  border:1px solid var(--hgof-border);
  padding:12px; border-radius:10px;
  margin:16px 0; background:var(--hgof-bg); color:var(--hgof-fg);
}
.hgof-offers-head{
  display:flex; justify-content:space-between; align-items:center;
  gap:10px; margin-bottom:8px;
}
.hgof-badge{
  background:#f1f5f9; color:#0f172a;
  padding:4px 8px; border-radius:var(--hgof-radius-pill);
  margin-inline-start:6px; font-size:.85em; display:inline-block;
}

.hgof-offers-list{ list-style:none; margin:0; padding:0; }
.hgof-offers-list li{
  display:flex; gap:8px; align-items:center;
  padding:8px 0; border-bottom:1px dashed var(--hgof-border);
}
.hgof-offers-list li:last-child{ border-bottom:0; }
.hgof-offer-name{ font-weight:600; }
.hgof-offer-dot{ opacity:.55; }

/* Optional color hints per status */
.hgof-offer-item.hgof-status-accepted .hgof-offer-amount{ color:#059669; }   /* green-600 */
.hgof-offer-item.hgof-status-declined .hgof-offer-amount{ color:#dc2626; }   /* red-600 */
.hgof-offer-item.hgof-status-negotiating .hgof-offer-amount{ color:#d97706; }/* amber-600 */

/* ============ Archive placements ============ */
.hgof-archive{ margin:8px 0; }
.hgof-archive--above{ margin-bottom:10px; }
.hgof-archive--below{ margin-top:10px; }

/* ============ intl-tel-input fixes ============ */
#hgof-whats{ width:100%; }
.iti{ width:100%; } /* make dropdown full-width in modal */
.iti__country-list{ max-width:100%; } /* prevent overflow */

/* ============ Small screens (Updated for Fullscreen) ============ */
@media (max-width: 640px) {

    /* --- جعل النافذة تملأ الشاشة --- */
    .hgof-modal {
        padding: 0 !important; /* تأكد من عدم وجود padding خارجي */
    }
    .hgof-modal__dialog {
        position: fixed !important; 
        inset: 0 !important;        
        width: 100% !important;
        height: 100vh !important;   
        max-width: none !important; 
        max-height: none !important;
        border-radius: 0 !important;
        transform: none !important; 
        display: flex !important;   
        flex-direction: column !important;
        overflow: hidden !important; 
        border: none !important;    
        box-shadow: none !important;
        margin: 0 !important; /* ألغِ الهوامش الافتراضية */
        padding: 0 !important; /* Padding سيتم إضافته داخليًا */
        
        /* مساحات أمان لأجهزة مثل الآيفون */
        padding-top: env(safe-area-inset-top, 0px) !important;
        /* padding-bottom: env(safe-area-inset-bottom, 0px) !important; */ /* تم نقله للفوتر */
    }
    @supports (height: 100dvh) {
      .hgof-modal__dialog { height: 100dvh !important; }
    }


    /* --- تنظيم التمرير الداخلي --- */
    
    /* العنوان وأزرار التاب (ثابتين في الأعلى) */
    .hgof-modal__dialog #hgof-title,
    .hgof-modal__dialog .hgof-auth .hgof-tabs {
        flex-shrink: 0; 
        background: var(--hgof-bg); 
        z-index: 2; 
        padding-left: 15px; /* Padding جانبي */
        padding-right: 15px;
    }
     .hgof-modal__dialog #hgof-title {
         padding-top: 15px; /* مسافة فوق العنوان */
         padding-bottom: 10px; 
         margin-bottom: 0; 
         border-bottom: 1px solid var(--hgof-border); 
     }
     .hgof-modal__dialog .hgof-auth .hgof-tabs {
         padding-top: 10px; 
         border-bottom: 1px solid var(--hgof-border); 
     }

    /* منطقة المحتوى (هي التي تتمرر) */
    .hgof-modal__dialog #hgof-form,
    .hgof-modal__dialog .hgof-auth .hgof-pane {
        flex-grow: 1; 
        overflow-y: auto; 
        padding: 15px; /* Padding داخلي للمحتوى */
        min-height: 0; 
        -webkit-overflow-scrolling: touch; 
    }
    
     /* أزل padding الفورم وأضفه للعناصر الداخلية */
     .hgof-modal__dialog #hgof-form {
         padding: 0; 
     }
     .hgof-modal__dialog #hgof-form .hgof-row {
         padding: 0 15px; 
         margin-bottom: 15px; 
     }
     .hgof-modal__dialog #hgof-form .hgof-highest-offer { /* استخدمنا highest offer الآن */
         padding: 10px 15px; 
         margin-bottom: 10px;
         border-bottom: 1px dashed var(--hgof-border); 
     }

    /* منطقة الأزرار والحالة (ثابتين في الأسفل) */
    .hgof-modal__dialog .hgof-row--actions,
    .hgof-modal__dialog .hgof-status {
        flex-shrink: 0; 
        padding: 10px 15px; 
        border-top: 1px solid var(--hgof-border); 
        background: #f9fafb; 
        margin-top: auto; 
        z-index: 2; 
        /* مساحة أمان سفلية */
         padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    .hgof-modal__dialog .hgof-status {
         background: transparent; 
         border-top: none; 
         padding-top: 5px; 
         padding-bottom: 5px; 
         margin-top: 0;
         text-align: center; /* توسيط رسالة الحالة */
    }
     /* إذا جاءت الحالة بعد الأزرار */
     .hgof-modal__dialog .hgof-row--actions + .hgof-status {
        padding-top: 5px; 
    }

    /* --- زر الإرسال بعرض الشاشة --- */
    .hgof-modal__dialog .hgof-row--actions button[type="submit"] {
        width: 100% !important;      
        box-sizing: border-box !important; 
        padding: 12px 15px !important; 
        font-size: 1.1em !important;   
    }
    
    /* زر الإغلاق */
     .hgof-modal__dialog .hgof-close {
         position: absolute !important;
         top: calc(10px + env(safe-area-inset-top, 0px)) !important; 
         right: 10px !important; 
         z-index: 3 !important; 
         font-size: 26px !important;
         padding: 8px !important;
         background-color: rgba(0, 0, 0, 0.1) !important; /* خلفية أغمق قليلًا */
         border-radius: 50% !important;
         line-height: 1 !important;
         color: var(--hgof-fg) !important; /* لون النص الافتراضي */
     }
     [dir="rtl"] .hgof-modal__dialog .hgof-close {
         right: auto !important;
         left: 10px !important;
         left: calc(10px + env(safe-area-inset-right, 0px)) !important; 
     }
     
     /* دمج التنسيق القديم لـ 640px (إذا كان هناك شيء مهم) */
      .hgof-offers-head{ align-items:flex-start; } /* هذا كان موجودًا */

} 
/* --- نهاية Media Query --- */

/* ============ High-contrast focus for a11y ============ */
.hgof-tab:focus-visible,
.hgof-offer-btn:focus-visible,
.hgof-close:focus-visible,
.hgof-row input:focus-visible,
.hgof-row textarea:focus-visible{
  outline:2px solid var(--hgof-accent);
  outline-offset:2px;
}

















