/* Trinity V35 — compact right-side bubble header
   Inspired by the slim horizontal navigation reference:
   one clean logo on the left, evenly distributed quick actions on the right,
   and tactile hover/touch "bubble" motion. */

:root{
  --v35-gold:#d7ac55;
  --v35-gold-bright:#f2d58b;
  --v35-line:rgba(216,173,86,.38);
  --v35-panel:rgba(5,5,5,.94);
  --v35-text:#efe3c9;
}

/* Hide obsolete header layers from older builds. */
.trinity-v35-header .trinity-command-rail,
.trinity-v35-header + .trinity-section-menu,
#trinitySectionMenu{
  display:none!important;
}

.site-header.trinity-v35-header{
  position:sticky!important;
  top:0;
  z-index:160;
  width:100%;
  min-height:0!important;
  padding:0!important;
  background:rgba(3,3,3,.96)!important;
  border-top:1px solid var(--v35-line);
  border-bottom:1px solid rgba(216,173,86,.55);
  box-shadow:0 12px 34px rgba(0,0,0,.28);
  backdrop-filter:blur(15px);
  -webkit-backdrop-filter:blur(15px);
}

.trinity-v35-shell{
  width:min(1540px,100%);
  min-height:88px;
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(150px,240px) minmax(0,1fr);
  align-items:center;
  gap:18px;
  padding:8px clamp(16px,2.5vw,38px);
}

.trinity-v35-brand{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-decoration:none;
}
.trinity-v35-brand img{
  display:block;
  width:min(205px,100%);
  max-height:72px;
  object-fit:contain;
  object-position:left center;
  filter:drop-shadow(0 8px 18px rgba(0,0,0,.22));
}

.trinity-v35-actions{
  min-width:0;
  display:grid;
  grid-template-columns:repeat(7,minmax(82px,1fr));
  align-items:stretch;
  justify-content:end;
  border-left:1px solid rgba(216,173,86,.22);
}
.trinity-v35-search-wrap{min-width:0;display:flex}
.trinity-v35-search{
  width:100%;
  min-width:0;
  display:flex;
  position:relative;
}
.trinity-v35-search .advanced-research-close,
.trinity-v35-search input{
  display:none;
}

.trinity-v35-bubble{
  -webkit-tap-highlight-color:transparent;
  appearance:none;
  position:relative;
  isolation:isolate;
  min-width:0;
  min-height:70px;
  margin:0;
  padding:10px 9px;
  display:flex!important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  color:var(--v35-text)!important;
  background:transparent!important;
  border:0!important;
  border-right:1px solid rgba(216,173,86,.22)!important;
  border-radius:0!important;
  box-shadow:none!important;
  text-decoration:none!important;
  font:700 clamp(.62rem,.75vw,.78rem)/1.05 Arial,sans-serif!important;
  letter-spacing:.065em;
  text-transform:uppercase;
  cursor:pointer;
  overflow:hidden;
  transition:
    transform .20s cubic-bezier(.2,.8,.2,1),
    color .20s ease,
    background .20s ease,
    box-shadow .20s ease,
    border-color .20s ease;
}
.trinity-v35-bubble::before{
  content:"";
  position:absolute;
  inset:8px;
  z-index:-1;
  border:1px solid transparent;
  border-radius:999px;
  background:radial-gradient(circle at 50% 52%,rgba(231,187,94,.13),rgba(231,187,94,0) 70%);
  opacity:0;
  transform:scale(.72);
  transition:opacity .20s ease,transform .24s cubic-bezier(.2,.8,.2,1),border-color .20s ease;
}
.trinity-v35-bubble svg{
  width:23px;
  height:23px;
  flex:0 0 auto;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:transform .22s ease,filter .22s ease;
}
.trinity-v35-bubble span{
  white-space:nowrap;
}
.trinity-v35-bubble:hover,
.trinity-v35-bubble:focus-visible{
  color:var(--v35-gold-bright)!important;
  transform:translateY(-2px) scale(1.045);
  background:rgba(216,173,86,.04)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.28)!important;
  outline:none;
}
.trinity-v35-bubble:hover::before,
.trinity-v35-bubble:focus-visible::before{
  opacity:1;
  transform:scale(1);
  border-color:rgba(240,205,126,.34);
}
.trinity-v35-bubble:hover svg,
.trinity-v35-bubble:focus-visible svg{
  transform:scale(1.08);
  filter:drop-shadow(0 0 7px rgba(232,188,99,.38));
}
.trinity-v35-bubble:active{
  transform:translateY(0) scale(.96);
}
.trinity-v35-bubble:active::before{
  opacity:1;
  transform:scale(.92);
  background:radial-gradient(circle,rgba(242,206,124,.26),rgba(242,206,124,.02) 70%);
}

.trinity-v35-ai{width:100%}
.trinity-v35-theme::after{
  content:"Light / Dark";
  white-space:nowrap;
}
.trinity-v35-theme svg{display:block!important}
.trinity-v35-cart{position:relative}
.trinity-v35-cart b{
  position:absolute;
  top:8px;
  right:12px;
  min-width:19px;
  height:19px;
  padding:0 4px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#c92722;
  color:#fff;
  font-size:.66rem;
  line-height:1;
}

/* Search transforms from a bubble into a clean floating input when activated. */
.trinity-v35-search.search-active{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  width:min(680px,calc(100vw - 28px))!important;
  height:58px!important;
  transform:translateX(-50%)!important;
  z-index:260!important;
  padding:6px!important;
  display:grid!important;
  grid-template-columns:42px 1fr 110px!important;
  align-items:center!important;
  gap:5px!important;
  background:rgba(7,7,7,.98)!important;
  border:1px solid rgba(222,178,86,.72)!important;
  border-radius:999px!important;
  box-shadow:0 18px 48px rgba(0,0,0,.52)!important;
}
.trinity-v35-search.search-active .advanced-research-close{
  display:grid!important;
  place-items:center;
  height:42px;
  width:42px;
  border:0;
  border-radius:999px;
  background:rgba(216,173,86,.09);
  color:var(--v35-gold-bright);
}
.trinity-v35-search.search-active input{
  display:block!important;
  width:100%!important;
  min-width:0;
  height:44px!important;
  margin:0!important;
  padding:0 12px!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:#fff!important;
  font-size:16px!important;
}
.trinity-v35-search.search-active .trinity-v35-ai{
  min-height:42px!important;
  height:42px!important;
  padding:0 15px!important;
  flex-direction:row!important;
  border:1px solid rgba(216,173,86,.45)!important;
  border-radius:999px!important;
  background:linear-gradient(180deg,#d8ae58,#a97822)!important;
  color:#16100a!important;
}
.trinity-v35-search.search-active .trinity-v35-ai svg{width:18px;height:18px}

/* Existing menu becomes a compact dropdown under the new bar. */
.trinity-v35-menu-panel{
  position:absolute!important;
  top:100%!important;
  right:16px!important;
  left:auto!important;
  width:min(330px,calc(100vw - 32px))!important;
  max-height:min(70vh,620px);
  overflow:auto;
  padding:10px!important;
  display:none!important;
  grid-template-columns:1fr 1fr;
  gap:7px;
  background:rgba(6,6,6,.98)!important;
  border:1px solid rgba(216,173,86,.42)!important;
  border-radius:16px!important;
  box-shadow:0 18px 50px rgba(0,0,0,.46)!important;
}
.trinity-v35-menu-panel.mobile-open{
  display:grid!important;
}
.trinity-v35-menu-panel a,
.trinity-v35-menu-panel button{
  padding:11px 12px!important;
  border:1px solid rgba(216,173,86,.18)!important;
  border-radius:999px!important;
  background:rgba(216,173,86,.035)!important;
  color:#e9d8b5!important;
  text-decoration:none!important;
  font:700 .74rem/1.1 Arial,sans-serif!important;
  letter-spacing:.04em;
  text-align:center;
}
.trinity-v35-menu-panel a:hover,
.trinity-v35-menu-panel button:hover{
  border-color:rgba(216,173,86,.6)!important;
  color:#f1cf7f!important;
  transform:scale(1.025);
}

/* Light mode: clean ivory/gold navigation rather than a black-backed logo/header. */
[data-theme="light"] .site-header.trinity-v35-header{
  background:rgba(255,250,241,.97)!important;
  border-color:rgba(142,97,31,.35)!important;
  box-shadow:0 12px 30px rgba(92,61,20,.12);
}
[data-theme="light"] .trinity-v35-actions{
  border-color:rgba(133,91,31,.18);
}
[data-theme="light"] .trinity-v35-bubble{
  color:#5b3d18!important;
  border-color:rgba(133,91,31,.20)!important;
}
[data-theme="light"] .trinity-v35-bubble:hover,
[data-theme="light"] .trinity-v35-bubble:focus-visible{
  color:#8a5b14!important;
  background:rgba(183,126,39,.06)!important;
}
[data-theme="light"] .trinity-v35-search.search-active,
[data-theme="light"] .trinity-v35-menu-panel{
  background:#fffaf1!important;
}
[data-theme="light"] .trinity-v35-search.search-active input{
  color:#2b2116!important;
}
[data-theme="light"] .trinity-v35-menu-panel a,
[data-theme="light"] .trinity-v35-menu-panel button{
  color:#5b3d18!important;
  background:#fffaf1!important;
}

/* Tablet: keep the premium horizontal look but allow finger-friendly scrolling. */
@media (max-width:1050px){
  .trinity-v35-shell{
    grid-template-columns:145px minmax(0,1fr);
    min-height:82px;
    gap:8px;
    padding-inline:12px;
  }
  .trinity-v35-brand img{max-height:62px}
  .trinity-v35-actions{
    display:flex;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    scrollbar-width:none;
    scroll-snap-type:x proximity;
  }
  .trinity-v35-actions::-webkit-scrollbar{display:none}
  .trinity-v35-search-wrap,
  .trinity-v35-bubble{
    flex:0 0 82px;
    scroll-snap-align:start;
  }
}

/* Mobile: logo on the first row, evenly spaced bubble controls beneath it.
   This is much more compact than the previous oversized icon/header grid. */
@media (max-width:700px){
  .site-header.trinity-v35-header{
    position:sticky!important;
  }
  .trinity-v35-shell{
    min-height:0;
    grid-template-columns:1fr;
    gap:0;
    padding:6px 0 0;
  }
  .trinity-v35-brand{
    height:58px;
    padding:0 16px;
  }
  .trinity-v35-brand img{
    width:132px;
    max-height:54px;
  }
  .trinity-v35-actions{
    width:100%;
    min-height:64px;
    padding:0 6px;
    border-top:1px solid rgba(216,173,86,.20);
    border-left:0;
  }
  .trinity-v35-search-wrap,
  .trinity-v35-bubble{
    flex:1 0 68px;
  }
  .trinity-v35-bubble{
    min-height:62px;
    padding:7px 5px;
    font-size:.56rem!important;
    letter-spacing:.035em;
  }
  .trinity-v35-bubble svg{
    width:20px;
    height:20px;
  }
  .trinity-v35-bubble::before{inset:5px}
  .trinity-v35-cart b{
    top:5px;
    right:7px;
  }
  .trinity-v35-menu-panel{
    right:8px!important;
    width:calc(100vw - 16px)!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:430px){
  .trinity-v35-brand{height:54px}
  .trinity-v35-brand img{width:122px;max-height:50px}
  .trinity-v35-actions{min-height:60px}
  .trinity-v35-search-wrap,
  .trinity-v35-bubble{flex-basis:65px}
  .trinity-v35-bubble{min-height:58px;font-size:.53rem!important}
}
