/* UX polish V1: identity and search only; approved header row/nav/logo/CTA boxes remain owned by V2.4. */
.madar-header .madar-hf-brand {position:relative;}
.madar-header .madar-ux-identity {margin:0;inline-size:160px;flex:none;text-align:right;line-height:1.7;}
.madar-header .madar-ux-identity strong {display:block;font-size:17px;font-weight:700;color:#052b60;}
.madar-header .madar-ux-identity span {display:block;font-size:12px;font-weight:500;color:#28632e;}
.madar-header .madar-ux-search {position:relative!important;inset:auto!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;}
.madar-header .madar-ux-search-panel {position:absolute;top:calc(100% + 12px);right:0;inline-size:min(320px,calc(100vw - 32px));display:flex;align-items:center;gap:8px;padding:12px;background:#fff;border:1px solid #d9e4de;border-radius:12px;box-shadow:0 10px 28px #052b601a;z-index:45;direction:rtl;}
.madar-header .madar-ux-search-panel[hidden] {display:none;}
.madar-header .madar-ux-search-panel .wp-block-search__input {inline-size:100%;min-inline-size:0;padding:8px 4px;line-height:1.6;text-align:right;background:#fff;border-radius:4px;}
.madar-header .madar-ux-search-submit {font:inherit;font-size:13px;color:#fff;background:#28632e;border:0;border-radius:7px;padding:10px 12px;cursor:pointer;flex:none;}
@media(scripting:enabled){.madar-header .madar-ux-search:not(.is-enhanced) .madar-ux-search-panel {visibility:hidden;}}
@media(max-width:1199px){
 .madar-header .madar-ux-identity {position:absolute;right:calc(100% + 10px);top:50%;transform:translateY(-50%);inline-size:140px;}
}
@media(max-width:480px){
 .madar-header .madar-ux-identity {right:calc(100% + 5px);inline-size:min(130px,calc(100vw - 248px));line-height:1.65;}
 .madar-header .madar-ux-identity strong {font-size:.875rem;}
 .madar-header .madar-ux-identity span {font-size:.75rem;}
}
@media(scripting:none){.madar-header .madar-ux-search-panel {right:auto;left:0;}}
/* Preserve the original collapsed trigger footprint while its panel is open. */
.madar-header .madar-ux-search {inline-size:52px!important;flex:none;}
@media(max-width:767px){.madar-header .madar-ux-search {inline-size:44px!important;}}
.madar-scroll-top {transition:opacity 240ms ease,background-color 200ms ease,display 240ms allow-discrete;}
.madar-scroll-top[hidden] {opacity:0;}
@starting-style {.madar-scroll-top {opacity:0;}}
@media(prefers-reduced-motion:reduce){.madar-scroll-top {transition:none;}}

@media(scripting:none) and (max-width:1199px){.madar-header .madar-ux-search {position:static!important;}.madar-header .madar-ux-search-panel {left:auto;right:16px;top:calc(100% + 12px);}}

/* V1.1: the supplemental label yields to the unchanged logo and controls below 380px. */
@media(max-width:379px){.madar-header .madar-ux-identity {display:none;}}
@media(min-width:380px) and (max-width:480px){
 .madar-header .madar-ux-identity :is(strong,span) {white-space:nowrap;}
 .madar-header .madar-ux-identity.madar-ux-identity-crowded {visibility:hidden;}
}
/* Opening search creates one measured row below the existing mobile/tablet header row.
   Its synchronous reserved space prevents the panel from painting over page content. */
@media(max-width:1199px){
 .madar-header.madar-ux-search-row-open {padding-block-end:var(--madar-search-row-height,0px)!important;}
}
/* Native no-JS form stays in document flow, after Core's static navigation. */
@media(scripting:none) and (max-width:1199px){
 .madar-header .madar-ux-search {display:contents;}
 .madar-header .madar-ux-search-panel {position:static!important;inset:auto;flex:0 0 100%;order:2;inline-size:100%;margin-block:8px;}
 .madar-header .madar-hf-tools .madar-mobile-nav {order:1;}
}

/* V2 supplemental identity only: available wide-desktop brand cell measured before sizing. */
@media(min-width:1440px){
 .madar-header .madar-ux-identity {inline-size:180px;line-height:1.55;}
 .madar-header .madar-ux-identity strong {font-size:23px;font-weight:700;white-space:nowrap;}
 .madar-header .madar-ux-identity span {font-size:15px;font-weight:500;color:#38664b;white-space:nowrap;}
}
