/* ======================================================================
   Header refresh (template: templates/_partials/header.tpl, script: assets/js/custom.js; own file, linked from header.tpl with ?v=N so browsers fetch it fresh)
   Info strip | logo + search + "Programează-te" + account + cart | main menu.
   The strip scrolls away; the rest of the header stays stuck (header top = minus strip height), so nothing jumps.
   ====================================================================== */
:root { --dl-strip-h: 2.25rem; }
/* anchors: the theme script already sets scroll-padding-top to the header height + 1rem, so nothing is covered */
.header {
  top: calc(-1 * var(--dl-strip-h)); /* the strip is exactly --dl-strip-h tall and slides out of view on scroll */
  box-shadow: 0 8px 20px -16px rgba(35, 35, 46, .35);
}

/* --- info strip --- */
.dl-strip { background: var(--dl-ink); color: #fff; height: var(--dl-strip-h); font-size: .8125rem; line-height: 1; overflow: hidden; }
.dl-strip__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; white-space: nowrap; }
.dl-strip a, .dl-strip a:hover, .dl-strip a:focus { color: #fff; text-decoration: none; }
.dl-strip .ps-contactinfo__phone, .dl-strip__tel { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; letter-spacing: .01em; }
.dl-strip .ps-contactinfo__phone::before, .dl-strip__tel::before {
  content: ""; width: .95rem; height: .95rem; background: var(--dl-amber);
  -webkit-mask: var(--dl-ico-phone) center / contain no-repeat; mask: var(--dl-ico-phone) center / contain no-repeat;
}
.dl-strip a:hover { text-decoration: underline; text-decoration-color: var(--dl-amber); text-underline-offset: 3px; }
.dl-strip a:focus-visible { outline: 2px solid var(--dl-amber); outline-offset: 3px; border-radius: 3px; }
.dl-strip__facts { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; color: #E7E7EF; }
.dl-strip__fact + .dl-strip__fact::before { content: ""; display: inline-block; width: 1px; height: .8rem; margin: 0 .9rem; vertical-align: -.1rem; background: rgba(255, 255, 255, .35); }
@media (max-width: 767.98px) {
  :root { --dl-strip-h: 2rem; }
  .dl-strip { font-size: .75rem; }
  .dl-strip__inner { padding-inline: 1rem; }
}
@media (max-width: 379.98px) { .dl-strip__facts { display: none; } .dl-strip__inner { justify-content: center; } }
:root {
  --dl-ico-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
}

/* --- logo row --- */
.header-bottom { padding: .6rem 0; border-bottom: 1px solid var(--dl-line); }
.header-bottom .navbar-brand .logo { max-height: 3.1rem; }
@media (min-width: 768px) {
  .header-bottom__row { align-items: center !important; }
  #_desktop_ps_searchbar { flex: 1 1 18rem; max-width: 33rem; margin: 0 auto 0 1.25rem !important; }
  #_desktop_ps_searchbar .ps-searchbar { margin-block: 0; min-width: 0; width: 100%; }
  .dl-actions { gap: .25rem; margin-left: auto; }
}
@media (min-width: 768px) and (max-width: 1199.98px) { .header-bottom__row { flex-wrap: nowrap; } }

/* search field: rounded, soft shadow, amber ring on focus (ink/slate edge keeps the 3:1 contrast of the control) */
.ps-searchbar__input.form-control {
  height: 2.75rem; border-radius: 999px; border: 1px solid var(--dl-slate); background: #fff; color: var(--dl-ink);
  padding-inline: 2.75rem 2.5rem; box-shadow: 0 2px 8px rgba(35, 35, 46, .08); transition: box-shadow .15s, border-color .15s;
}
.ps-searchbar__input.form-control::placeholder { color: var(--dl-slate-dark); opacity: 1; }
.ps-searchbar__input.form-control:hover { border-color: var(--dl-slate-dark); }
.ps-searchbar__input.form-control:focus { border-color: var(--dl-slate-dark); box-shadow: 0 0 0 4px rgba(255, 181, 81, .55), 0 2px 8px rgba(35, 35, 46, .08); outline: 0; }
.ps-searchbar__magnifier { left: 1rem; color: var(--dl-slate-dark); }
.ps-searchbar__dropdown { border-radius: 16px; top: calc(100% + .4rem); box-shadow: 0 14px 36px rgba(35, 35, 46, .14); }

/* "Programează-te": the one amber button of the header */
.dl-cta {
  align-items: center; padding: .6rem 1.15rem; margin-right: .5rem; border-radius: 999px; white-space: nowrap;
  background: var(--dl-amber); color: var(--dl-ink); font-weight: 600; font-size: .9rem; text-decoration: none; line-height: 1.2;
  transition: background-color .15s, box-shadow .15s;
}
.dl-cta:hover { background: var(--dl-amber-hover); color: var(--dl-ink); }
.dl-cta:focus-visible, .header-block__action-btn:focus-visible, .ps-mainmenu__mobile-toggle .menu-toggle:focus-visible {
  outline: 2px solid var(--dl-ink); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 181, 81, .6);
}

/* account / cart: quiet icon buttons, readable cart badge */
.header-bottom .header-block__action-btn { border-radius: 12px; color: var(--dl-ink); padding: .5rem .65rem; min-height: 2.75rem; min-width: 2.75rem; justify-content: center; transition: background-color .15s; }
.header-bottom .header-block__action-btn[href]:hover, .header-bottom .header-block__action-btn[href]:focus { background: var(--dl-tint); color: var(--dl-ink); }
.header-bottom .header-block__icon { font-size: 1.5rem; color: var(--dl-slate-dark); }
.header-bottom .header-block__title { font-size: .92rem; font-weight: 500; }
.header-bottom .header-block__badge, .header-bottom .header-block__badge {
  position: absolute; top: .1rem; right: .05rem; height: 1.2rem; min-width: 1.2rem; padding: 0 .3rem;
  font-size: .72rem; font-weight: 700; background: var(--dl-amber); color: var(--dl-ink); box-shadow: 0 0 0 2px #fff;
}
.blockcart.inactive .header-block__badge { background: var(--dl-tint); color: var(--dl-slate-dark); box-shadow: 0 0 0 1px var(--dl-line); }
@media (min-width: 768px) {
  /* badge next to the label on desktop, not floating over the icon */
  .header-bottom #_desktop_ps_shoppingcart .header-block__badge { position: static; box-shadow: none; }
  .header-bottom #_desktop_ps_shoppingcart .blockcart.inactive .header-block__badge { box-shadow: 0 0 0 1px var(--dl-line); }
}
/* labels shrink to icons below lg; the accessible names stay */
@media (min-width: 768px) and (max-width: 991.98px) {
  .header-bottom .header-block__title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 767.98px) {
  .header-bottom { padding: .35rem 0; }
  .header-bottom .header-block__action-btn { min-height: 2.75rem; min-width: 2.75rem; padding: .5rem; }
  .ps-mainmenu__mobile-toggle .menu-toggle { min-width: 2.75rem; min-height: 2.75rem; }
}

/* --- main menu row: slate text, amber underline on hover / focus / current page --- */
@media (min-width: 1200px) {
  .header-bottom .ps-mainmenu--desktop { margin-top: .5rem; border-top: 1px solid var(--dl-line); }
  .ps-mainmenu__tree > li .ps-mainmenu__tree-link {
    position: relative; padding-block: .8rem; color: var(--dl-ink); font-weight: 500; letter-spacing: .005em;
  }
  .ps-mainmenu__tree > li .ps-mainmenu__tree-link::after {
    content: ""; position: absolute; left: .6rem; right: .6rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
    background: var(--dl-amber); transform: scaleX(0); transition: transform .18s ease-out;
  }
  .ps-mainmenu__tree > li:hover > .ps-mainmenu__tree-item-wrapper .ps-mainmenu__tree-link::after,
  .ps-mainmenu__tree > li .ps-mainmenu__tree-link:focus-visible::after,
  .ps-mainmenu__tree > li.current .ps-mainmenu__tree-link::after { transform: scaleX(1); }
  .ps-mainmenu__tree > li.current .ps-mainmenu__tree-link { color: var(--dl-ink); font-weight: 600; }
  .ps-mainmenu__tree > li .ps-mainmenu__tree-dropdown-toggle { color: var(--dl-slate-dark); padding-block: .8rem; }
  .ps-mainmenu__tree > li .ps-mainmenu__tree-link:focus,
  .ps-mainmenu__tree > li .ps-mainmenu__tree-dropdown-toggle:focus { outline: 2px solid var(--dl-ink); outline-offset: 0; border-radius: 6px; }
  /* the "Reduceri" entry is the only one worth a hint of emphasis: nothing extra, kept calm on purpose */
}
@media (prefers-reduced-motion: reduce) {
  .ps-mainmenu__tree > li .ps-mainmenu__tree-link::after, .dl-cta, .ps-searchbar__input.form-control { transition: none; }
}
