/* =========================================================
   EPHARO HEADER
   Header shell, topbar, logo, navigation, mega menu,
   language switcher and responsive header behavior
   AWS-ready staging file
   ========================================================= */


/* =========================================================
   1. TOOLTIP SYSTEM
   ========================================================= */

#lang-toggle:checked ~ .tooltip-bubble{
  opacity:0 !important;
  pointer-events:none;
  transform:translateX(-50%) translateY(4px);
}

.tooltip-wrap{
  position:relative;

  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.tooltip-bubble{
  position:absolute;
  top:120%;
  left:50%;

  padding:4px 10px;
  border-radius:999px;

  background:#3b3f46;
  color:#ffffff;

  font-size:11px;
  font-weight:600;
  white-space:nowrap;

  box-shadow:0 8px 20px rgba(0,0,0,.25);

  opacity:0;
  pointer-events:none;

  transform:translateX(-50%) translateY(4px);
  transition:opacity .15s ease, transform .15s ease;

  z-index:12000;
}

.tooltip-bubble::after{
  content:"";

  position:absolute;
  top:-4px;
  left:50%;

  border-width:4px 5px;
  border-style:solid;
  border-color:#3b3f46 transparent transparent transparent;

  transform:translateX(-50%);
}

.tooltip-wrap:hover .tooltip-bubble{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}


/* =========================================================
   2. FIXED HEADER SHELL
   ========================================================= */

#eph-header{
  position:fixed;
  inset:0 0 auto 0;

  z-index:10000;

  display:flex;
  flex-direction:column;

  padding-bottom:8px;

  background:var(--soft);
  color:var(--ink);

  border-bottom:0;

  backdrop-filter:saturate(160%) blur(6px);
  -webkit-backdrop-filter:saturate(160%) blur(6px);
}

html:has(#eph-header) body{
  padding-top:var(--hdr-h);
}

@media (max-width:980px){
  html:has(#eph-header) body{
    padding-top:var(--hdr-h-m);
  }
}

/* WordPress admin bar compatibility */
body.admin-bar #eph-header{
  top:32px;
}

@media (max-width:782px){
  body.admin-bar #eph-header{
    top:54px;
  }
}


/* =========================================================
   3. TOPBAR
   ========================================================= */

.eph-topbar{
  height:30px;

  background:var(--soft);

  font-size:12px;
}

.eph-topbar .inner{
  max-width:1140px;
  height:100%;

  margin:0 auto;
  padding:0 20px;

  display:flex;
  align-items:center;
  justify-content:space-between;
}

.eph-topbar-left{
  flex:1;

  display:flex;
  align-items:center;
  gap:8px;
}

/* AI pill in topbar is reserved, hidden for now */
.eph-topbar-left .pill-ai{
  display:none;
}

.pill-ai{
  display:inline-flex;
  align-items:center;
  gap:6px;

  padding:3px 10px;
  border-radius:999px;
  border:1px solid var(--line);

  background:rgba(255,255,255,.92);
  color:var(--ink);

  font-size:11px;
  font-weight:600;

  transition:
    box-shadow .15s ease,
    transform .12s ease,
    border-color .15s ease,
    background .15s ease;
}

.pill-ai span.icon{
  width:20px;
  height:19px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:999px;
  border:1px solid var(--line);

  background:#ffffff;

  box-shadow:0 10px 24px rgba(0,0,0,.06);

  transition:
    box-shadow .15s ease,
    transform .12s ease,
    border-color .15s ease,
    background .15s ease;
}

.pill-ai span.icon img{
  width:18px;
  height:18px;

  display:block;

  filter:grayscale(1) contrast(1.05);
}

.pill-ai:hover{
  background:#ffffff;
  border-color:#cde5d6;

  box-shadow:0 12px 26px rgba(0,0,0,.08);

  transform:translateY(-1px);
}

.pill-ai:hover span.icon{
  border-color:#cde5d6;

  transform:translateY(-1px);
}


/* =========================================================
   4. TOPBAR CENTER TOOLS
   A / A+ / A++, print, newsletter
   ========================================================= */

.eph-topbar-center{
  flex:1;

  display:flex;
  justify-content:flex-end;

  padding-right:269px;

  color:var(--muted);

  opacity:.95;
}

.top-tools{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;

  margin-top:4px;
}

.top-pill{
  min-width:40px !important;

  padding:10px 18px !important;
  border-radius:999px;
  border:1px solid var(--line) !important;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;

  background:#ffffff !important;
  color:var(--muted) !important;

  font-size:15px;
  font-weight:600;
  line-height:1;

  cursor:pointer;

  box-shadow:none !important;
  outline:none;

  transition:
    box-shadow .15s ease,
    transform .12s ease,
    border-color .15s ease,
    background .15s ease,
    color .15s ease;
}

.top-pill svg{
  width:22px;
  height:22px;

  display:block;

  stroke:currentColor;
  fill:none;

  transition:transform .12s ease;
}

.top-pill:hover,
.top-pill:focus,
.top-pill:active{
  background:#ffffff !important;
  color:var(--brand) !important;
  border-color:var(--line) !important;

  transform:translateY(-2px) scale(1.04);

  box-shadow:0 6px 16px rgba(0,0,0,.12);
}

.top-pill:hover svg,
.top-pill:focus svg,
.top-pill:active svg{
  transform:scale(1.08);
}


/* =========================================================
   5. TOPBAR RIGHT ICONS
   news, help, cart, account
   ========================================================= */

.eph-topbar-right{
  display:flex;
  align-items:center;
  gap:10px;

  margin-right:17px;
}

.eph-topbar-right .sep{
  color:var(--muted);
}

.topbar-profile,
.eph-topbar-right .topbar-profile{
  width:44px !important;
  height:44px !important;

  margin-left:0 !important;
  padding:0;

  border-radius:999px;
  border:1px solid var(--line);

  display:inline-flex;
  align-items:center;
  justify-content:center;

  background:#ffffff;
  color:var(--muted);

  text-decoration:none;

  box-shadow:0 0 0 rgba(0,0,0,0);

  transition:
    color .15s ease,
    background .15s ease,
    box-shadow .15s ease,
    transform .12s ease,
    border-color .15s ease;
}

.eph-topbar-right .topbar-profile svg,
.eph-topbar-right .topbar-profile img{
  width:20px !important;
  height:20px !important;
}

.topbar-profile svg{
  stroke:var(--muted);
  fill:none;
  stroke-width:1.8;
}

.eph-topbar-right a{
  text-decoration:none;
}

.eph-topbar-right .topbar-profile:hover,
.eph-topbar-right a:hover{
  background:#ffffff;
  color:var(--brand);
  border-color:#cde5d6;

  box-shadow:0 8px 18px rgba(0,0,0,.12);

  transform:translateY(-1px);
}

.eph-topbar-right .topbar-profile:hover svg{
  stroke:var(--brand);
}

/* News megaphone icon color */
.eph-topbar-right a[aria-label="Čo je nové"] img{
  filter:
    invert(31%)
    sepia(11%)
    saturate(900%)
    hue-rotate(84deg)
    brightness(92%)
    contrast(96%);
}

.eph-topbar-right a[aria-label="Čo je nové"]:hover img{
  filter:
    invert(31%)
    sepia(11%)
    saturate(1200%)
    hue-rotate(84deg)
    brightness(105%)
    contrast(98%);
}


/* =========================================================
   6. HEADER TOGGLES
   ========================================================= */

#eph-nav-toggle,
#eph-search-toggle{
  display:none;

  appearance:none;
  -webkit-appearance:none;

  border:0;
  outline:0;
}


/* =========================================================
   7. MAIN HEADER ROW
   ========================================================= */

.eph-main{
  height:72px;

  display:flex;
  align-items:center;
}

#eph-header .wrap{
  position:relative;

  width:100%;
  max-width:1160px;

  margin:0 auto;
  padding:0 20px;

  display:grid;
  grid-template-columns:210px 1fr auto;
  align-items:center;
  gap:16px;
}

#eph-header .eph-main .wrap::after{
  content:"";

  position:absolute;
  left:32px;
  right:26px;
  bottom:-5px;

  height:.5px;

  border-radius:999px;

  background:rgba(23,59,42,.16);
}


/* =========================================================
   8. LOGO
   ========================================================= */

.eph-logo{
  min-width:180px;
  min-height:60px;

  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;

  margin-top:-4px;
  padding:0 0 2px;
}

.eph-logo a{
  display:flex;
  align-items:center;

  color:var(--ink);

  text-decoration:none;

  transition:
    transform .15s ease,
    filter .15s ease;
}

.eph-logo a:hover{
  transform:translateY(-1px);
  filter:drop-shadow(0 6px 18px rgba(0,0,0,.12));
}

.eph-logo img{
  height:56px;
  width:auto;

  display:block;
}

.eph-logo .txt{
  display:none;

  font-weight:800;
  letter-spacing:.3px;
}

.logo-tagline{
  max-width:190px;

  color:var(--muted);

  font-size:10px;
  line-height:1.3;
  text-align:center;
}


/* =========================================================
   9. DESKTOP NAVIGATION
   ========================================================= */

#eph-header nav.eph-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:16px;

  position:relative;

  margin-top:29px;

  opacity:0;
  max-height:0;
  overflow:hidden;
  pointer-events:none;

  transform:translateX(18px);

  transition:
    opacity .18s ease,
    max-height .22s ease,
    transform .22s ease;
}

#eph-nav-toggle:checked ~ .eph-main nav.eph-nav{
  opacity:1;
  max-height:80px;
  overflow:visible;
  pointer-events:auto;

  transform:translateX(0);
}

.mnav-top-links a,
.mnav-main-links a,
.mnav-extra-links a,
#eph-header nav.eph-nav .nav-item > a{
  position:relative;

  display:inline-block;

  padding:7px 0;

  color:var(--ink);

  font-size:13px;
  font-weight:700;
  line-height:1.35;
  text-decoration:none;

  transition:color .15s ease;
}

#eph-header nav.eph-nav .nav-item > a::after{
  content:"";

  position:absolute;
  left:0;
  right:0;
  bottom:0;

  height:2px;

  background:var(--brand);

  transform:scaleX(0);
  transform-origin:left center;

  transition:transform .18s ease;
}

#eph-header nav.eph-nav .nav-item > a:hover{
  color:var(--brand);
}

#eph-header nav.eph-nav .nav-item > a:hover::after{
  transform:scaleX(1);
}

#eph-header .nav-item.current-menu-item > a,
#eph-header .nav-item > a.is-active{
  color:var(--brand);
}

#eph-header .nav-item.current-menu-item > a::after,
#eph-header .nav-item > a.is-active::after{
  transform:scaleX(1);
}


/* =========================================================
   10. MEGA MENU
   ========================================================= */

.nav-item.has-mega:hover .mega-menu{
  opacity:1;
  pointer-events:auto;

  transform:translate(-43%,0);
}

/* Open mega menu from hero/category trigger */
body.eph-hero-mega-open #eph-header .nav-item.has-mega .mega-menu{
  opacity:1;
  pointer-events:auto;

  transform:translate(-43%,0);
}

.mega-menu{
  position:absolute;
  left:50%;
  top:100%;

  width:min(960px,90vw);

  padding:18px 22px 20px;
  border-radius:18px;
  border:1px solid var(--line);

  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;

  background:var(--white);

  box-shadow:0 22px 60px rgba(7,38,19,.15);

  opacity:0;
  pointer-events:none;

  transform:translate(-40%,10px);
  transition:
    opacity .18s ease,
    transform .18s ease;

  z-index:9999;
}

.mega-title{
  grid-column:1 / -1;

  margin-bottom:4px;

  color:var(--muted);

  font-size:13px;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.mega-item{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  gap:10px;

  padding:10px 9px;
  border-radius:12px;

  color:var(--ink);

  text-decoration:none;

  transition:
    background .15s ease,
    transform .15s ease,
    box-shadow .15s ease;
}

.mega-item:hover{
  background:#eef6ef;

  transform:translateY(-1px);

  box-shadow:0 10px 25px rgba(0,0,0,.06);
}

.mega-item .emoji img{
  width:26px;
  height:26px;

  display:block;

  filter:
    invert(31%)
    sepia(11%)
    saturate(900%)
    hue-rotate(84deg)
    brightness(90%)
    contrast(95%);

  transition:
    filter .15s ease,
    transform .15s ease;
}

.mega-item:hover .emoji img{
  transform:translateY(-1px);

  filter:
    invert(31%)
    sepia(11%)
    saturate(1200%)
    hue-rotate(84deg)
    brightness(105%)
    contrast(98%);
}

.mega-item .txt{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.mega-item .name{
  font-size:14px;
  font-weight:700;
}

.mega-item .desc{
  color:var(--muted);

  font-size:13px;
}


/* =========================================================
   11. HEADER ACTIONS
   ========================================================= */

.eph-actions{
  position:relative;
  top:14px;

  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;

  margin-top:0 !important;
}

.icon-btn{
  width:44px !important;
  height:44px !important;

  border-radius:999px;
  border:1px solid var(--line);

  display:inline-flex;
  align-items:center;
  justify-content:center;

  background:#ffffff;

  cursor:pointer;

  transition:all .15s ease;
}

.icon-btn svg,
.icon-btn img,
.eph-actions .icon-btn svg,
.eph-actions .icon-btn img{
  width:20px !important;
  height:20px !important;
}

.icon-btn svg{
  stroke:var(--muted);
  fill:none;
  stroke-width:2;
}

.icon-btn:hover{
  background:#ffffff;
  border-color:#cde5d6;

  transform:translateY(-1px);

  box-shadow:0 10px 24px rgba(0,0,0,.06);
}

.icon-btn:hover svg{
  stroke:var(--brand);
}

/* Legacy AI head icon support */
.icon-btn.ai img.ai-head-icon{
  width:20px;
  height:20px;

  display:block;

  padding:1px;
  border-radius:4px;

  box-sizing:border-box;

  filter:grayscale(1) brightness(.42) contrast(2.1);

  transition:
    filter .15s ease,
    transform .12s ease;
}

.icon-btn.ai:hover img.ai-head-icon{
  filter:grayscale(1) brightness(.55) contrast(2.2);
  transform:translateY(-1px);
}


/* =========================================================
   12. LANGUAGE SWITCHER
   ========================================================= */

.lang-dropdown{
  position:relative;

  font-size:13px;
}

.lang-current{
  min-width:64px;

  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;

  padding:8px 16px;
  border-radius:12px;
  border:1px solid var(--line);

  background:#ffffff;
  color:var(--ink);

  font-size:14px;

  cursor:pointer;

  transition:
    box-shadow .15s ease,
    transform .12s ease,
    border-color .15s ease,
    background .15s ease,
    color .15s ease;
}

.lang-current span.chevron svg{
  width:14px;
  height:9px;

  display:block;

  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;

  transition:
    stroke .15s ease,
    transform .15s ease;
}

.lang-dropdown:hover .lang-current,
.lang-current:hover,
#lang-toggle:checked + .lang-dropdown .lang-current{
  background:#ffffff;
  color:var(--brand);
  border-color:#cde5d6;

  transform:translateY(-1px);

  box-shadow:0 10px 24px rgba(0,0,0,.06);
}

.lang-menu{
  position:absolute;
  right:0;

  min-width:70px;

  margin-top:4px;
  padding:4px 0;
  border-radius:12px;
  border:1px solid var(--line);

  background:#ffffff;

  box-shadow:0 14px 40px rgba(0,0,0,.14);

  opacity:0;
  pointer-events:none;

  transform:translateY(6px);
  transition:
    opacity .16s ease,
    transform .16s ease;

  z-index:9999;
}

.lang-menu a{
  display:block;

  padding:7px 12px;

  color:var(--ink);

  font-size:13px;
  white-space:nowrap;
  text-decoration:none;
}

.lang-menu a:hover{
  background:#eef6ef;
}

.lang-menu a.active{
  color:var(--brand);

  font-weight:700;
}

.mnav .lang-row a.active-lang{
  color:var(--brand);

  font-weight:700;
}

#lang-toggle{
  display:none;
}

#lang-toggle:checked + .lang-dropdown .lang-menu{
  opacity:1;
  pointer-events:auto;

  transform:translateY(0);
}


/* =========================================================
   13. BURGER
   ========================================================= */

.eph-actions .burger{
  position:relative;

  width:52px;
  height:52px;

  margin-top:0;
  margin-right:8px;

  border:0;
  border-radius:14px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  background:transparent;

  cursor:pointer;

  z-index:3;

  transition:
    background .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.eph-actions .burger span,
.eph-actions .burger::before,
.eph-actions .burger::after{
  content:"";

  position:absolute;
  left:50%;

  width:22px;
  height:2px;

  border-radius:999px;

  background:var(--ink);

  transform:translateX(-50%);

  transition:
    background .2s ease,
    transform .2s ease;
}

.eph-actions .burger span{
  top:50%;

  transform:translate(-50%,-50%);
}

.eph-actions .burger::before{
  top:calc(50% - 6px);
}

.eph-actions .burger::after{
  top:calc(50% + 6px);
}

.eph-actions .burger:hover{
  transform:translateY(-1px);

  box-shadow:0 6px 14px rgba(0,0,0,.12);
}

#eph-nav-toggle:checked ~ .eph-main .burger{
  background:#103155 !important;

  box-shadow:0 10px 22px rgba(0,0,0,.22) !important;
}

#eph-nav-toggle:checked ~ .eph-main .burger span,
#eph-nav-toggle:checked ~ .eph-main .burger::before,
#eph-nav-toggle:checked ~ .eph-main .burger::after{
  background:#ffffff !important;
}


/* =========================================================
   14. MOBILE / BURGER PANEL
   ========================================================= */

.mnav{
  position:fixed;
  top:var(--hdr-h);
  left:50%;

  width:min(1180px,100vw);
  max-height:calc(100vh - var(--hdr-h) - 24px);

  padding:20px 22px 24px;
  border-radius:18px;
  border:1px solid var(--line);

  background:rgba(246,251,247,.98);

  opacity:0;
  pointer-events:none;

  overflow-y:auto;

  transform:translate3d(-50%,-16px,0);

  box-shadow:0 0 0 rgba(0,0,0,0);

  transition:
    transform .28s cubic-bezier(.19,1,.22,1),
    opacity .20s ease,
    box-shadow .28s cubic-bezier(.19,1,.22,1);

  z-index:9990;
}

/*
   Current production CSS intentionally keeps .mnav hidden even when
   the nav checkbox is checked. This preserves current visual behavior.
   Drawer/category behavior is handled separately by JS when available.
*/
#eph-nav-toggle:checked + .eph-topbar + .eph-main + .mnav,
#eph-nav-toggle:checked ~ .mnav{
  opacity:0 !important;
  pointer-events:none !important;

  transform:translate3d(-50%,-16px,0) !important;

  box-shadow:none !important;
}

.mnav-inner{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:24px;
}

.mnav-section-title{
  margin:4px 0 6px;

  color:var(--muted);

  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.mnav-top-links,
.mnav-main-links,
.mnav-extra-links{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.mnav-main-links{
  margin-top:4px;
}

.mnav-extra-links{
  margin-top:10px;
}

.mnav-main-links a,
.mnav-top-links a,
.mnav-extra-links a{
  font-size:15px;
}

.mnav .lang-row{
  display:flex;
  align-items:center;
  gap:6px;

  margin-top:10px;

  color:var(--muted);

  font-size:13px;
}


/* =========================================================
   15. VERTICAL ALIGNMENT FIXES
   Existing production visual alignment
   ========================================================= */

#eph-header .eph-topbar-center,
#eph-header .eph-topbar-right,
#eph-header .eph-actions{
  margin-top:0 !important;
}

#eph-header .eph-topbar-center,
#eph-header .eph-topbar-right{
  position:relative;
  top:8px;
}


/* =========================================================
   16. RESPONSIVE HEADER RULES
   ========================================================= */

@media (max-width:1080px){
  #eph-header .wrap{
    grid-template-columns:minmax(0,1fr) auto;
  }

  #eph-header nav.eph-nav{
    margin-top:0;
  }

  nav.eph-nav{
    display:none;
  }

  body.eph-hero-mega-open #eph-header nav.eph-nav{
    display:block;
  }
}

@media (max-width:880px){
  .mnav-inner{
    grid-template-columns:1fr;
  }
}

@media (max-width:640px){
  :root{
    --hdr-h-m:72px;
  }

  .eph-topbar{
    display:block;
    height:auto;
  }

  .eph-topbar .inner{
    height:auto;

    flex-wrap:wrap;
    row-gap:4px;
  }

  .top-pill-print,
  .top-tools a[aria-label="RSS kanál"]{
    display:none;
  }

  .eph-main{
    height:72px;

    align-items:center;
  }

  #eph-header .wrap{
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;

    padding:0 12px;

    align-items:center;
  }

  .eph-logo{
    min-width:0;
    min-height:auto;

    flex-direction:row;
    align-items:center;
    justify-content:flex-start;
    gap:8px;

    margin-top:0;
    padding:0;
  }

  .eph-logo img{
    height:26px;
    width:auto;
  }

  .logo-tagline{
    max-width:170px;

    font-size:10px;
    line-height:1.3;
    text-align:left;
  }

  .eph-topbar-center{
    padding-right:0;

    justify-content:flex-start;
  }

  .eph-topbar-right{
    margin-right:0;
  }

  .eph-actions{
    top:0 !important;
    gap:6px;
  }

  #eph-header .eph-topbar-center,
  #eph-header .eph-topbar-right{
    top:0 !important;
  }

  .eph-actions .burger,
  .eph-actions .icon-btn{
    width:40px;
    height:40px;
  }

  .icon-btn svg{
    width:20px;
    height:20px;
  }

  .icon-btn img{
    width:22px;
    height:22px;
  }

  .lang-dropdown{
    display:block;
  }

  .tooltip-bubble{
    display:none !important;
    opacity:0 !important;
    pointer-events:none !important;
  }

  .mnav{
    top:var(--hdr-h-m);
  }

  .mega-menu{
    display:none;
  }
}

@media (max-width:480px){
  .logo-tagline{
    display:none;
  }
}