/* =========================================================
   EGX Desktop Header v2 (RTL) — Clean Build (No Conflicts)
   Namespace: .egx-hdr-
   Target: template-parts/headers/header-desktop.php
   ========================================================= */

.egx-hdr-wrap{
  --egx-font: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;

  --egx-bg: #ffffff;
  --egx-top-bg: #111827;          /* dark top bar */
  --egx-top-text: rgba(255,255,255,.80);
  --egx-top-text-strong: rgba(255,255,255,.92);

  --egx-text: #0f172a;
  --egx-muted: #64748b;

  --egx-border: rgba(15,23,42,.10);

  --egx-primary: #1d4ed8;         /* blue */
  --egx-primary-2: #2563eb;

  --egx-accent: #e11d48;          /* red accent for offer pill */

  --egx-radius: 14px;
  --egx-pill: 999px;

  --egx-shadow: 0 10px 30px rgba(15,23,42,.10);
  --egx-shadow-sm: 0 1px 2px rgba(15,23,42,.06);

  direction: rtl;
  font-family: var(--egx-font);
  background: var(--egx-bg);
  position: relative;
  z-index: 50;
}

/* container */
.egx-hdr-container{
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* ============ TOP BAR ============ */
.egx-hdr-top{
  background: var(--egx-top-bg);
  color: var(--egx-top-text);
  font-size: 13px;
}
.egx-hdr-top .egx-hdr-container{
  height: 42px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
}

.egx-hdr-top-left,
.egx-hdr-top-right{
  display:flex;
  align-items:center;
  gap: 14px;
}

/* Social (small, soft, no circles) */
.egx-hdr-social{
  list-style:none;
  display:flex;
  align-items:center;
  gap: 10px;
  margin:0;
  padding:0;
}
.egx-hdr-social a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 18px;
  height: 18px;
  text-decoration:none;
  opacity: .85;
  transition: opacity .2s ease, transform .2s ease;
}
.egx-hdr-social a svg{
  width: 14px;
  height: 14px;
  display:block;
}
.egx-hdr-social a svg path{ fill: rgba(255,255,255,.65); transition: fill .2s ease; }
.egx-hdr-social a:hover{ opacity: 1; transform: translateY(-1px); }
.egx-hdr-social a:hover svg path{ fill: rgba(255,255,255,.92); }

.egx-hdr-top-welcome{
  color: var(--egx-top-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top links (login/currency/lang) */
.egx-hdr-top-links{
  display:flex;
  align-items:center;
  gap: 12px;
  white-space: nowrap;
}
.egx-hdr-top-links a{
  color: var(--egx-top-text-strong);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  opacity: .9;
  transition: opacity .2s ease;
}
.egx-hdr-top-links a:hover{ opacity: 1; }
.egx-hdr-top-links .egx-hdr-top-sep{
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.18);
  display:inline-block;
}
.egx-hdr-flag{
  width: 18px;
  height: 12px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15);
  display:inline-block;
  object-fit: cover;
}

/* ============ MAIN ROW ============ */
.egx-hdr-main{
  background:#fff;
  border-bottom: 1px solid var(--egx-border);
}
.egx-hdr-main .egx-hdr-container{
  padding-block: 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 18px;
}

/* Brand */
.egx-hdr-brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 260px;
}
.egx-hdr-logo{
  display:inline-flex;
  align-items:center;
  text-decoration:none;
}
.egx-hdr-logo img{
  max-height: 56px;
  width:auto;
  display:block;
}
.egx-hdr-brand-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.egx-hdr-brand-title{
  font-size: 18px;
  font-weight: 900;
  color: var(--egx-text);
  line-height: 1.1;
}
.egx-hdr-brand-tagline{
  font-size: 12px;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--egx-muted);
  line-height: 1.2;
}

/* Search */
.egx-hdr-search{
  flex: 1 1 auto;
  max-width: 720px;
}
.egx-hdr-search-box{
  display:flex;
  align-items:stretch;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 10px;
  overflow:hidden;
  box-shadow: var(--egx-shadow-sm);
}
.egx-hdr-search-cat{
  min-width: 180px;
  border-inline-start: 1px solid rgba(15,23,42,.10);
  background: #f8fafc;
  display:flex;
  align-items:center;
}
.egx-hdr-search-cat select{
  width:100%;
  height:100%;
  border:0;
  background: transparent;
  padding: 0 14px;
  font-size: 13px;
  color: #334155;
  font-weight: 700;
  appearance: none;
  cursor: pointer;
}
.egx-hdr-search-cat select:focus{ outline:none; }

.egx-hdr-search-input{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  background:#fff;
}
.egx-hdr-search-input input{
  width:100%;
  border:0;
  padding: 0 14px;
  font-size: 13.5px;
  color: var(--egx-text);
  background: transparent;
}
.egx-hdr-search-input input:focus{ outline:none; }
.egx-hdr-search-btn{
  width: 62px;
  border:0;
  background: linear-gradient(180deg, var(--egx-primary-2), var(--egx-primary));
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.egx-hdr-search-btn svg{ width: 18px; height: 18px; }
.egx-hdr-search-btn svg path{ fill:#fff; }

/* Right utilities: call + cart */
.egx-hdr-utils{
  display:flex;
  align-items:center;
  gap: 18px;
  min-width: 280px;
  justify-content: flex-end;
}
.egx-hdr-call{
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--egx-text);
}
.egx-hdr-call-ic{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(37,99,235,.22);
  background: rgba(37,99,235,.08);
  display:flex;
  align-items:center;
  justify-content:center;
}
.egx-hdr-call-ic svg{ width: 22px; height: 22px; }
.egx-hdr-call-ic svg path{ fill: var(--egx-primary); }
.egx-hdr-call-text{
  display:flex;
  flex-direction:column;
  line-height:1.15;
}
.egx-hdr-call-label{
  font-size: 12px;
  color: var(--egx-muted);
  font-weight: 700;
}
.egx-hdr-call-number{
  font-size: 15px;
  font-weight: 900;
  color: var(--egx-text);
  text-decoration:none;
  direction:ltr;
  unicode-bidi: plaintext;
}
.egx-hdr-call-number:hover{ color: var(--egx-primary); }

.egx-hdr-cart{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
  color: var(--egx-text);
  font-weight: 800;
}
.egx-hdr-cart-ic{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
}
.egx-hdr-cart-ic svg{ width: 22px; height: 22px; }
.egx-hdr-cart-ic svg path{ fill: #0f172a; }
.egx-hdr-cart-badge{
  position:absolute;
  top: -7px;
  inset-inline-start: -7px; /* RTL */
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--egx-pill);
  background: var(--egx-accent);
  color:#fff;
  font-size: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 18px rgba(225,29,72,.25);
}

/* ============ NAV ROW ============ */
.egx-hdr-nav{
  background:#fff;
  border-bottom: 1px solid var(--egx-border);
}
.egx-hdr-nav .egx-hdr-container{
  height: 56px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
}

.egx-hdr-cats{
  min-width: 320px;
}
.egx-hdr-cats-btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--egx-primary-2), var(--egx-primary));
  color:#fff;
  text-decoration:none;
  font-weight: 900;
}
.egx-hdr-cats-btn svg{ width: 18px; height: 18px; }
.egx-hdr-cats-btn svg path{ fill:#fff; }

.egx-hdr-menu{
  flex: 1 1 auto;
  display:flex;
  align-items:center;
  gap: 18px;
  overflow:hidden;
}
.egx-hdr-menu ul{
  list-style:none;
  display:flex;
  align-items:center;
  gap: 22px;
  margin:0;
  padding:0;
}
.egx-hdr-menu a{
  text-decoration:none;
  color: #111827;
  font-weight: 900;
  font-size: 14px;
  padding: 10px 4px;
  position:relative;
  opacity:.92;
  white-space: nowrap;
}
.egx-hdr-menu a:hover{ color: var(--egx-primary); opacity: 1; }
.egx-hdr-menu a.current-menu-item,
.egx-hdr-menu .current-menu-item > a{ color: var(--egx-primary); }

.egx-hdr-offer{
  min-width: 200px;
  display:flex;
  justify-content:flex-end;
}
.egx-hdr-offer a{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--egx-pill);
  background: var(--egx-accent);
  color:#fff;
  text-decoration:none;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(225,29,72,.22);
}
.egx-hdr-offer a svg{ width: 18px; height: 18px; }
.egx-hdr-offer a svg path{ fill:#fff; }

/* Sticky */
.egx-hdr-wrap.egx-sticky{
  position: sticky;
  top: 0;
}
.egx-hdr-wrap.egx-sticky .egx-hdr-main{
  box-shadow: var(--egx-shadow);
}

/* responsive guards */
@media (max-width: 1200px){
  .egx-hdr-cats{ min-width: 280px; }
  .egx-hdr-brand{ min-width: 220px; }
  .egx-hdr-utils{ min-width: 240px; }
  .egx-hdr-search{ max-width: 620px; }
}
@media (max-width: 1024px){
  .egx-hdr-utils{ display:none; }      /* desktop-only: keep clean */
  .egx-hdr-cats{ min-width: 240px; }
  .egx-hdr-search-cat{ min-width: 150px; }
}
