/* =========================================================
   Progetto Ombra - HEADER (single bar + drawer)
   File: header.css (CLEAN)
   ========================================================= */

:root{
  --g:#06A34E;
  --y:#F9EF05;
  --k:#0F0F0E;

  --line:rgba(15,15,14,.10);

  --max:1180px;
  --pad:clamp(18px, 3vw, 46px);

  --shadow: 0 18px 46px rgba(2,6,23,.10);
  --shadow2: 0 10px 24px rgba(2,6,23,.06);
  --ease: cubic-bezier(.2,.9,.2,1);

  /* altezza header per compensazione mobile fixed */
  --po-header-h: 66px;
}

/* Container */
.po-hcontainer{
  width:min(var(--max), calc(100% - (var(--pad)*2)));
  margin-inline:auto;
}

/* Lock scroll per drawer */
html.po-lock, body.po-lock{ overflow:hidden; }

/* Skip link */
.po-skip{
  position:absolute;
  left:-999px;
  top:12px;
  z-index:99999;
  background:#fff;
  border:1px solid rgba(15,15,14,.14);
  border-radius:999px;
  padding:10px 14px;
  box-shadow: var(--shadow2);
}
.po-skip:focus{
  left:12px;
  outline:3px solid rgba(6,163,78,.18);
  outline-offset:2px;
}

/* =========================================================
   HEADER BASE
   ========================================================= */

/* Desktop sticky */
.po-header{
  position: sticky;
  top: 0;
  z-index: 9990;
}

/* WP admin bar */
.admin-bar .po-header{ top: 32px; }
@media (max-width: 782px){
  .admin-bar .po-header{ top: 46px; }
}

/* Mainbar */
.po-mainbar{
  background:#fff;
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  will-change: box-shadow, transform;
  transition: box-shadow .22s var(--ease), transform .22s var(--ease);
}

/* Soft shadow always, stronger when sticky */
@media (min-width: 981px){
  .po-mainbar{ box-shadow: 0 6px 18px rgba(2,6,23,.04); }
  .po-header.is-sticky .po-mainbar{ box-shadow: var(--shadow2); }
}

/* Grid */
.po-maingrid{
  display:grid;
  grid-template-columns: auto 1fr auto;
  align-items:center;
  gap:14px;
  padding: 16px 0;
}

/* Brand */
.po-brand{display:flex; align-items:center;}
.po-logo{
  display:flex;
  align-items:center;
  border-radius: 14px;
  text-decoration:none;
}
/* =========================================================
   FORCE LOGO SIZE (override Blocksy)
   ========================================================= */

.po-header .po-logo img{
  height: 64px !important;
  max-height: none !important;
  width: auto;
}

@media (max-width: 980px){
  .po-header .po-logo img{
    height: 52px !important;
  }
}



/* Nav desktop */
.po-nav{ justify-self:center; }

/* Menu base */
.po-menu{
  list-style:none;
  display:flex;
  align-items:center;
  gap: 18px;
  margin:0;
  padding:0;
}
.po-menu > li{ position:relative; }

/* Link desktop */
.po-menu a{
  position:relative;
  display:inline-flex;
  align-items:center;
  padding: 10px 10px;
  border-radius: 999px;
  font-weight:1000;
  font-size:14px;
  color: rgba(15,15,14,.86);
  text-decoration:none;
  transition: background .18s var(--ease), transform .18s var(--ease), color .18s var(--ease);
}
.po-menu a:hover{
  background: rgba(6,163,78,.05);
  transform: translateY(-1px);
}

/* Underline animata VERDE (no gradient, come footer) */
.po-menu a::after{
  content:"";
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--g);
  opacity: 0;
  transform: scaleX(0);
  transform-origin:left;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.po-menu a:hover::after{ opacity:.95; transform: scaleX(1); }

.po-menu .current-menu-item > a::after,
.po-menu .current_page_item > a::after,
.po-menu .current-menu-ancestor > a::after{
  opacity:.95;
  transform: scaleX(1);
}

/* Focus */
.po-menu a:focus-visible{
  outline:3px solid rgba(6,163,78,.18);
  outline-offset:2px;
}

/* =========================================================
   DESKTOP DROPDOWN (WP sub-menu)
   ========================================================= */

.po-menu .sub-menu{
  position:absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 230px;

  list-style:none;
  margin:0;
  padding: 10px;

  background:#fff;
  border:1px solid rgba(15,15,14,.10);
  border-radius: 18px;
  box-shadow: var(--shadow2);

  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  z-index: 10000;
}

/* show on hover/focus-within */
.po-menu > li:hover > .sub-menu,
.po-menu > li:focus-within > .sub-menu{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* dropdown links */
.po-menu .sub-menu a{
  width: 100%;
  justify-content: flex-start;
  border-radius: 14px;
  padding: 10px 10px;
  font-weight: 950;
  font-size: 13px;
}
.po-menu .sub-menu a:hover{
  transform: none;
}
.po-menu .sub-menu a::after{
  left: 10px;
  right: 10px;
  bottom: 6px;
}

/* little caret for parents (only desktop) */
@media (min-width: 981px){
  .po-menu > li.menu-item-has-children > a::before{
    content:"▾";
    font-weight: 1000;
    font-size: 12px;
    opacity: .55;
    margin-right: 8px;
    transform: translateY(-1px);
  }
}

/* =========================================================
   ACTIONS
   ========================================================= */

.po-actions{
  display:flex;
  align-items:center;
  gap:10px;
  justify-self:end;
}

/* Buttons */
.po-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 14px;
  border-radius: 999px;
  border:1px solid transparent;
  font-weight:1000;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  text-decoration:none;
  white-space:nowrap;
}
.po-btn:hover{ transform: translateY(-1px); }
.po-btn:focus-visible{ outline:3px solid rgba(6,163,78,.18); outline-offset:2px; }

/* =========================================================
   CTA PRIMARY — opaco, profondo, niente giallo
   ========================================================= */

.po-btn-primary{
  position: relative;
  background: var(--g);
  color:#fff;
  border:0;
  box-shadow:
    0 10px 26px rgba(6,163,78,.32),
    inset 0 1px 0 rgba(255,255,255,.18);
  overflow:hidden;
}

/* layer opaco dietro */
.po-btn-primary::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.18); /* opaco */
  opacity:0;
  transition: opacity .18s var(--ease);
  pointer-events:none;
}

/* hover = affonda */
.po-btn-primary:hover{
  transform: translateY(-1px);
  box-shadow:
    0 14px 34px rgba(6,163,78,.38),
    inset 0 1px 0 rgba(255,255,255,.14);
}

/* attiva overlay opaco */
.po-btn-primary:hover::before{
  opacity:1;
}

/* focus accessibile */
.po-btn-primary:focus{
  outline:3px solid rgba(6,163,78,.28);
  outline-offset:2px;
}


/* Burger */
.po-burger{
  display:none; /* shown on mobile */
  width:44px;
  height:44px;
  border-radius: 16px;
  border: 1px solid rgba(15,15,14,.12);
  background: rgba(15,15,14,.02);
  cursor:pointer;
  position:relative;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.po-burger:hover{
  transform: translateY(-1px);
  border-color: rgba(6,163,78,.22);
  background: rgba(6,163,78,.04);
}
.po-burger:active{ transform: translateY(0) scale(.98); }
.po-burger:focus-visible{
  outline:3px solid rgba(6,163,78,.18);
  outline-offset:2px;
}

.po-burger span{
  position:absolute;
  left: 12px;
  right: 12px;
  height:2px;
  background: rgba(15,15,14,.78);
  border-radius:999px;
  transition: transform .22s var(--ease), top .22s var(--ease), opacity .18s var(--ease);
  transform-origin:center;
}
.po-burger span:nth-child(1){ top: 14px; }
.po-burger span:nth-child(2){ top: 21px; }
.po-burger span:nth-child(3){ top: 28px; }

/* Burger -> X */
.po-burger.is-active span:nth-child(1){ top: 21px; transform: rotate(45deg); }
.po-burger.is-active span:nth-child(2){ opacity: 0; }
.po-burger.is-active span:nth-child(3){ top: 21px; transform: rotate(-45deg); }

/* =========================================================
   DRAWER MOBILE
   ========================================================= */

.po-drawer{
  position:fixed;
  inset:0;
  z-index: 9999;
  opacity:0;
  pointer-events:none;
  transition: opacity .22s var(--ease);
}
.po-drawer.is-open{
  opacity:1;
  pointer-events:auto;
}

.po-drawer-overlay{
  position:absolute;
  inset:0;
  background: rgba(15,15,14,.42);
  opacity:0;
  transition: opacity .22s var(--ease);
  cursor:pointer;
}
.po-drawer.is-open .po-drawer-overlay{ opacity:1; }

.po-drawer-panel{
  position:absolute;
  right: 10px;
  top: 10px;
  bottom: 10px;
  width: min(420px, calc(100% - 20px));
  border-radius: 22px;
  background:#fff;
  border:1px solid rgba(15,15,14,.10);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;

  transform: translateX(24px) scale(.985);
  opacity: .98;
  will-change: transform, opacity;
  transition: transform .26s var(--ease), opacity .22s var(--ease);
}
.po-drawer.is-open .po-drawer-panel{
  transform: translateX(0) scale(1);
  opacity: 1;
}

.po-drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.po-drawer-brand img{
  height:40px;
  width:auto;
  display:block;
}

.po-drawer-x{
  width:44px;
  height:44px;
  border-radius: 16px;
  border:1px solid rgba(15,15,14,.12);
  background: rgba(15,15,14,.02);
  cursor:pointer;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.po-drawer-x:hover{
  transform: translateY(-1px);
  border-color: rgba(6,163,78,.22);
  background: rgba(6,163,78,.04);
}
.po-drawer-x:active{ transform: translateY(0) scale(.98); }
.po-drawer-x:focus-visible{
  outline:3px solid rgba(6,163,78,.18);
  outline-offset:2px;
}

.po-drawer-body{
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display:grid;
  gap:14px;
  overflow:auto;
}

.po-drawer-menu{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}

/* main links */
.po-drawer-menu a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-radius: 18px;
  border:1px solid rgba(15,15,14,.10);
  background:#fff;
  font-weight:1000;
  color: rgba(15,15,14,.86);
  text-decoration:none;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.po-drawer-menu a:hover{
  transform: translateY(-1px);
  border-color: rgba(6,163,78,.22);
  background: rgba(6,163,78,.04);
}

/* sub-menu indentation */
.po-drawer-menu .sub-menu{
  list-style:none;
  margin: 8px 0 0 0;
  padding: 0 0 0 10px;
  display:grid;
  gap:8px;
}
.po-drawer-menu .sub-menu a{
  border-radius: 16px;
  font-size: 13px;
  padding: 12px 12px;
}

/* CTAs in drawer */
.po-drawer-ctas{
  display:grid;
  gap:10px;
}
.po-drawer-ctas .po-btn{
  width:100%;
  justify-content:center;
}

/* Mini info */
.po-drawer-mini{
  display:grid;
  gap:10px;
}
.po-mini{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 18px;
  border:1px solid rgba(15,15,14,.10);
  background: rgba(15,15,14,.02);
  font-size:12px;
  font-weight:900;
  color: rgba(15,15,14,.70);
}
.po-mini i{ color: var(--g); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Mobile: header FIXED + body compensate */
@media (max-width: 980px){
  .po-header{
    position: fixed;
    top:0; left:0; right:0;
    z-index: 9990;
  }

  .po-nav{ display:none; }
  .po-cta-desktop{ display:none; }
  .po-burger{ display:inline-flex; }

  .po-maingrid{ padding: 14px 0; }
  .po-logo img{ height: 40px; }

  body{ padding-top: var(--po-header-h); }
}

/* Mobile small */
@media (max-width: 520px){
  :root{ --po-header-h: 62px; }
}


@media (min-width: 981px){
  .po-mainbar{ box-shadow: none; } /* a riposo: pulito */
  .po-header.is-sticky .po-mainbar{
    box-shadow: 0 12px 28px rgba(2,6,23,.10);
  }
}

/* Preferenze accessibilità */
@media (prefers-reduced-motion: reduce){
  .po-mainbar,
  .po-menu a,
  .po-btn,
  .po-burger,
  .po-drawer,
  .po-drawer-overlay,
  .po-drawer-panel,
  .po-menu .sub-menu{
    transition:none !important;
  }
}

/* FIX gap mobile: l’admin-bar non deve spostare l’header */
@media (max-width: 980px){
  .admin-bar .po-header{ top: 0 !important; }
}

/* =========================================================
   Desktop shrink: quando sticky diventa "compatto"
   ========================================================= */
@media (min-width: 981px){

  /* stato normale */
  .po-maingrid{
    padding: 16px 0;
  }
  .po-logo img{
    height: 44px;
    transition: height .22s var(--ease);
  }

  /* stato compatto */
  .po-header.is-compact .po-maingrid{
    padding: 10px 0;
  }
  .po-header.is-compact .po-logo img{
    height: 38px;
  }

  /* opzionale: CTA leggermente più stretta (più premium) */
  .po-header.is-compact .po-btn{
    padding: 10px 12px;
  }

  /* pulse quando entra sticky (lo rendiamo visibile) */
  .po-header.sticky-anim .po-mainbar{
    transform: translateY(-8px);
  }
  .po-header.is-sticky .po-mainbar{
    transform: translateY(0);
  }
}

/* =========================================================
   BTN RECENSIONI — outline pulito, zero glow
   ========================================================= */

.po-btn-recensioni{
  background: transparent;
  color: var(--g);
  border: 1.5px solid rgba(6,163,78,.6);
  box-shadow: none;
  transition:
    transform .14s ease,
    background .14s ease,
    border-color .14s ease;
}

.po-btn-recensioni:hover{
  background: rgba(6,163,78,.08); /* opaco, non luminoso */
  border-color: var(--g);
  transform: translateY(-1px);
}


/* =========================================================
   HARD STOP: niente giallo sui bottoni
   ========================================================= */

.po-header .po-btn,
.po-header .po-btn:hover,
.po-header .po-btn:focus,
.po-header .po-btn:active{
  color: inherit !important;
}

/* forza colori corretti */
.po-header .po-btn-primary{ color:#fff !important; }
.po-header .po-btn-recensioni{ color: var(--g) !important; }
.po-header .po-btn-recensioni:hover{ color: var(--g) !important; }
