/* Fulwari v5.1 — global header source of truth */
.fv-topbar{background:#4D2923;color:#FFF8EE;font-size:var(--fv-type-muted-size)}
.fv-topbar-inner{min-height:34px;display:flex;align-items:center;justify-content:center;gap:10px 24px;flex-wrap:wrap;padding:6px 0;text-align:center}

.fv-header{position:sticky;top:0;z-index:100;background:rgba(255,253,248,.98);border-bottom:1px solid rgba(116,57,47,.12);box-shadow:0 4px 18px rgba(68,39,27,.035);backdrop-filter:blur(10px)}
.admin-bar .fv-header{top:32px}

.fv-header-inner{direction:ltr;display:grid;grid-template-columns:auto minmax(220px,300px) minmax(330px,1fr) auto;grid-template-areas:"actions search nav brand";align-items:center;gap:18px;min-height:88px}
.fv-brand{grid-area:brand;direction:rtl;display:flex;align-items:center;justify-content:flex-end;min-width:92px;min-height:58px;text-decoration:none}
.fv-brand img,.fv-brand .custom-logo,.fv-brand .fv-logo-img{display:block;width:auto!important;height:auto!important;max-width:145px!important;max-height:58px!important;object-fit:contain!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;margin:0!important}
.fv-brand-name{color:var(--fv-dark);font-size:var(--fv-type-section-size);font-weight:800;line-height:1.3}

.fv-nav{grid-area:nav;direction:rtl;min-width:0}
.fv-nav ul{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px;list-style:none;margin:0;padding:0}
.fv-nav li{position:relative;margin:0}
.fv-nav a{display:flex;align-items:center;min-height:42px;padding:8px 10px;border-radius:9px;color:var(--fv-dark);font-size:var(--fv-type-body-size);font-weight:700;line-height:1.4;white-space:nowrap;text-decoration:none}
.fv-nav a:hover,.fv-nav .current-menu-item>a{color:#74392F;background:#F5EBDD}
.fv-nav .sub-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:130;display:none!important;min-width:220px;max-width:300px;margin:0!important;padding:8px!important;border:1px solid var(--fv-border);border-radius:14px;background:var(--fv-surface);box-shadow:var(--fv-shadow)}
.fv-nav li:hover>.sub-menu,.fv-nav li:focus-within>.sub-menu{display:block!important}
.fv-nav .sub-menu ul{display:block}
.fv-nav .sub-menu a{white-space:normal}

.fv-header-search{grid-area:search;direction:rtl;position:relative;display:flex;align-items:center;width:100%;max-width:300px;height:46px;margin:0;padding:0;border:1px solid #E4D5BF;border-radius:13px;background:#FFFDF8;box-shadow:none;overflow:hidden;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}
.fv-header-search:focus-within{border-color:#C99736;background:#fff;box-shadow:0 0 0 3px rgba(201,151,54,.13)}
.fv-header-search-input{direction:rtl;flex:1 1 auto;width:100%!important;min-width:0!important;height:44px!important;margin:0!important;padding:0 13px 0 46px!important;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;color:var(--fv-dark)!important;font-family:"Vazirmatn",Tahoma,Arial,sans-serif!important;font-size:var(--fv-type-body-size)!important;line-height:1.4!important;text-align:right!important}
.fv-header-search-input::placeholder{color:#9A8978;opacity:1}
.fv-header-search-btn{position:absolute!important;left:4px!important;top:4px!important;display:inline-grid!important;place-items:center!important;width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;margin:0!important;padding:0!important;border:0!important;border-radius:10px!important;background:transparent!important;color:#5A463C!important;box-shadow:none!important;cursor:pointer!important;z-index:2!important}
.fv-header-search-btn:hover{background:#F5EBDD!important;color:#74392F!important}
.fv-header-search-btn:focus-visible{outline:2px solid #C99736!important;outline-offset:1px!important}
.fv-header-search-btn svg{width:19px;height:19px}

.fv-actions{grid-area:actions;direction:rtl;display:flex;align-items:center;justify-content:flex-start;gap:8px;white-space:nowrap}
.fv-icon-btn{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px;min-width:44px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0 11px!important;border:1px solid #E7D8C3!important;border-radius:12px!important;background:#FFFDF8!important;color:var(--fv-dark)!important;font-family:"Vazirmatn",Tahoma,Arial,sans-serif!important;font-size:var(--fv-type-muted-size)!important;font-weight:700!important;line-height:1!important;text-align:center!important;text-decoration:none!important;box-shadow:none!important;transform:none!important;cursor:pointer!important}
.fv-icon-btn:hover{background:#F5EBDD!important;color:#74392F!important}
.fv-icon-btn svg{width:19px;height:19px;flex:0 0 19px}
.fv-count{position:absolute;top:-7px;left:-6px;display:flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#D2A142;color:#211B18;font-size:var(--fv-type-caption-size);font-weight:800;line-height:1}

/* Critical fix: menu button MUST stay hidden on desktop */
.fv-menu-toggle{display:none!important;grid-area:menu}

@media(max-width:1099px){
  .fv-header-inner{grid-template-columns:auto minmax(44px,1fr) auto;grid-template-areas:"actions menu brand" "search search search";gap:10px 12px;min-height:0;padding-top:10px;padding-bottom:10px}
  .fv-brand{min-height:46px}
  .fv-brand img,.fv-brand .custom-logo,.fv-brand .fv-logo-img{max-width:118px!important;max-height:46px!important}
  .fv-menu-toggle{display:inline-flex!important;justify-self:center!important;width:44px!important;min-width:44px!important;padding:0!important}
  .fv-header-search{max-width:none;height:44px}
  .fv-header-search-input{height:42px!important;font-size:var(--fv-type-muted-size)!important}
  .fv-nav,.admin-bar .fv-nav{position:absolute!important;top:calc(100% + 8px)!important;right:12px!important;left:12px!important;z-index:140!important;display:none!important;max-height:min(70vh,520px)!important;overflow-y:auto!important;margin:0!important;padding:10px!important;border:1px solid var(--fv-border)!important;border-radius:16px!important;background:var(--fv-surface)!important;box-shadow:var(--fv-shadow)!important}
  .fv-nav.is-open{display:block!important}
  .fv-nav ul{display:block!important}
  .fv-nav a{min-height:44px!important;padding:10px 12px!important}
  .fv-nav .sub-menu{position:static!important;display:block!important;min-width:0;max-width:none;margin:3px 10px 6px!important;padding:4px!important;border:0!important;border-radius:8px!important;background:#FBF5EA!important;box-shadow:none!important}
  .fv-nav .sub-menu a{min-height:40px!important;font-size:var(--fv-type-muted-size)!important}
  .fv-actions .label{display:none!important}
}

@media(max-width:782px){.admin-bar .fv-header{top:46px}}

@media(max-width:640px){
  .fv-topbar{display:none}
  .fv-header-inner{width:calc(100% - 20px)!important;grid-template-columns:auto 44px auto;gap:8px 10px;padding-top:8px;padding-bottom:9px}
  .fv-brand{min-width:0;min-height:42px}
  .fv-brand img,.fv-brand .custom-logo,.fv-brand .fv-logo-img{max-width:94px!important;max-height:42px!important}
  .fv-actions{gap:6px}
  .fv-icon-btn{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;border-radius:11px!important}
  .fv-menu-toggle{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
  .fv-header-search{height:43px;border-radius:12px}
  .fv-header-search-input{height:41px!important;padding-right:12px!important;padding-left:44px!important;font-size:var(--fv-type-muted-size)!important}
  .fv-header-search-btn{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;left:3px!important;top:3px!important}
}

/* =========================================================
   v6.7 — reliable active state for the TOP primary menu
   Works with both an assigned WordPress menu and the theme fallback menu.
   ========================================================= */
@media (min-width:1100px){
  .fv-header .fv-nav > ul > li > a{
    position:relative!important;
    background-repeat:no-repeat!important;
    transition:color .18s ease,background-color .18s ease,background-size .18s ease!important;
  }

  .fv-header .fv-nav > ul > li.current-menu-item > a,
  .fv-header .fv-nav > ul > li.current_page_item > a,
  .fv-header .fv-nav > ul > li.current-menu-ancestor > a,
  .fv-header .fv-nav > ul > li.current_page_parent > a,
  .fv-header .fv-nav > ul > li.fv-current-menu-item > a,
  .fv-header .fv-nav > ul > li > a[aria-current="page"]{
    color:var(--fv-blue-deep,#365D75)!important;
    background-color:transparent!important;
    background-image:linear-gradient(var(--fv-gold,#C79A32),var(--fv-gold,#C79A32))!important;
    background-size:calc(100% - 20px) 2px!important;
    background-position:center calc(100% - 2px)!important;
    background-repeat:no-repeat!important;
  }

  /* Avoid a second/competing pseudo underline from older layers. */
  .fv-header .fv-nav > ul > li.current-menu-item > a::after,
  .fv-header .fv-nav > ul > li.current_page_item > a::after,
  .fv-header .fv-nav > ul > li.current-menu-ancestor > a::after,
  .fv-header .fv-nav > ul > li.current_page_parent > a::after,
  .fv-header .fv-nav > ul > li.fv-current-menu-item > a::after,
  .fv-header .fv-nav > ul > li > a[aria-current="page"]::after{
    content:none!important;
  }
}
