/* =========================================================
   TOPS Countertops — Primary Navigation + Mega Menu
   Self-contained stylesheet: safe to enqueue on its own in
   WordPress / Elementor Pro alongside (or instead of) theme
   styles. Re-declares the Summit brand tokens so this file
   has no hard dependency on styles.css being loaded first.

   Markup conventions used (see header.php):
   - Native WP wp_nav_menu() output: ul.menu, li.menu-item,
     li.menu-item-has-children, ul.sub-menu
   - Custom "tn-*" (Tops Nav) classes cover the mega-menu
     behavior (the 25/75 hover-preview panel, the 3-col
     Contact panel), driven by assets/js/nav-menu.js.
   NOTE: this nav deliberately carries NO Elementor classes.
   It used to also apply .elementor-nav-menu/.elementor-item
   so it could drop into a Nav Menu widget, but the nav is
   static PHP now and those classes pulled in the whole of
   Elementor's nav-menu stylesheet — including a
   position:relative on every li that broke the full-width
   mega panel in the editor. The paired ".elementor-item"
   selectors below are kept only as harmless fallbacks.
   ========================================================= */

:root{
 --evergreen:#174A3A;--evergreen-deep:#0F3327;
 --moss:#53735B;
 --charcoal:#202522;
 --warm-stone:#F7F4EC;--warm-stone-2:#FBF9F4;--line:#E4DCC8;
 --gold:#D5A528;--gold-deep:#B98B1F;
 --white:#fff;--text:#202522;--muted:#5B6259;
 --veins:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.012 0.026' numOctaves='4' seed='7'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='gamma' amplitude='1.1' exponent='5' offset='-0.1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23v)'/%3E%3C/svg%3E");
 --tn-maxw:1320px;
 --tn-header-h:78px;
}

/* ---------------------------------------------------------
   Bar
   --------------------------------------------------------- */
/* Stacking order (must beat the Slab Cloud inventory plugin's menu, which
   sits at z-index 980):
     .tn         1000  sticky header bar — the value that actually matters
     .tn-mega      40  mega panels, INSIDE .tn
     .tn-mobile  1010  full-screen mobile overlay, outside .tn, covers it
   .tn's z-index + positioning creates a stacking context, so everything in
   the header (including the mega panels) is ranked against the rest of the
   page by .tn's 1000, not by its own z-index. Raising .tn-mega's number
   alone would change nothing. Position and z-index are !important because
   if any plugin/theme CSS set .tn back to position:static, z-index would
   stop applying and the panels would drop to z-index 40, underneath the
   plugin. */
.tn{position:sticky!important;top:0;z-index:1000!important;background:var(--evergreen);font-family:'Lato',system-ui,sans-serif;box-shadow:0 1px 0 rgba(0,0,0,.15)}
.tn *{box-sizing:border-box}
.tn__inner{max-width:var(--tn-maxw);margin:0 auto;padding:0 32px;height:var(--tn-header-h);display:flex;align-items:center;gap:8px}

.tn__brand{display:flex;align-items:center;flex:none;margin-right:20px;text-decoration:none}
.tn__brand-logo{height:56px;width:auto;display:block}
.tn__div{width:1px;align-self:stretch;margin:18px 22px 18px 0;background:rgba(255,255,255,.14);flex:none}

/* primary menu (native WP: .menu > .menu-item > a / .sub-menu) */
.tn__menu-wrap{flex:1;display:flex}
/* The full-width mega panel is position:absolute with left:0;right:0, so
   it sizes to its nearest POSITIONED ancestor — which must stay .tn (the
   sticky header bar), not the individual menu item. Any stylesheet that
   makes .menu-item positioned traps the panel at the trigger's width.
   Elementor Pro's widget-nav-menu.css does exactly that
   (".elementor-nav-menu a,.elementor-nav-menu li{position:relative}") and
   the Elementor editor loads every widget's CSS whether or not the widget
   is on the page, which broke the panel in the editor while the live site
   looked fine. The offending elementor-nav-menu/elementor-item classes
   have been removed from header.php, and this guard keeps any other
   plugin/theme CSS from reintroducing the same problem. */
.tn__menu > .menu-item{position:static}
.menu.tn__menu,.elementor-nav-menu.tn__menu{list-style:none;display:flex;align-items:center;gap:6px;margin:0;padding:0}
.tn__menu>.menu-item>a,.tn__menu>.menu-item>.elementor-item{display:flex;align-items:center;gap:.4rem;color:#fff;font-family:'Bodoni Moda',Georgia,serif;font-weight:600;font-size:.98rem;letter-spacing:0;text-decoration:none;padding:0 14px;height:var(--tn-header-h);position:relative}
.tn__menu>.menu-item>a::after,.tn__menu>.menu-item>.elementor-item::after{content:"";position:absolute;left:14px;right:14px;bottom:22px;height:2px;background:var(--gold);transform:scaleX(0);transform-origin:left;transition:transform .2s}
.tn__menu>.menu-item:hover>a::after,.tn__menu>.menu-item.tn-open>a::after,
.tn__menu>.menu-item:hover>.elementor-item::after,.tn__menu>.menu-item.tn-open>.elementor-item::after{transform:scaleX(1)}
.tn__caret{width:9px;height:9px;flex:none;transition:transform .22s ease}
.tn__menu>.menu-item.tn-open .tn__caret{transform:rotate(180deg)}
.tn__menu>.menu-item>a:focus-visible,.tn__menu>.menu-item>.elementor-item:focus-visible,
.tn__contact-btn:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}

.tn__right{margin-left:auto;display:flex;align-items:center;gap:14px;flex:none}
/* !important throughout this button's declarations: Elementor Pro's
   Theme Style > Buttons setting (if ever configured in Site Settings)
   applies to every <button> on the page, not just Elementor's own
   widgets — this is a plain nav <button>, and needs to stay immune to
   that cascade regardless of what gets set there. */
.tn__contact-btn{display:inline-flex!important;align-items:center;gap:.4rem;background:var(--warm-stone-2)!important;color:var(--evergreen)!important;font-family:'Lato',system-ui,sans-serif!important;font-weight:700!important;font-size:.8rem!important;letter-spacing:.02em;text-transform:uppercase;text-decoration:none;padding:.7rem 1.3rem!important;border-radius:3px!important;border:none!important;cursor:pointer;transition:.2s}
.tn__contact-btn:hover{background:#fff!important}
.tn__menu-btn{display:none}

/* ---------------------------------------------------------
   Mega panel — 25/75 category menus
   --------------------------------------------------------- */
.tn-mega{position:absolute;top:100%;left:0;right:0;background:var(--evergreen);opacity:0;visibility:hidden;transform:translateY(-8px);box-shadow:0 30px 60px rgba(0,0,0,.32);transition:opacity .2s ease,transform .2s ease,visibility 0s linear .2s;z-index:40}
.menu-item.tn-open>.tn-mega{opacity:1;visibility:visible;transform:translateY(0);transition:opacity .2s ease,transform .2s ease}
.tn-mega__inner{max-width:var(--tn-maxw);margin:0 auto;display:grid;grid-template-columns:25% 75%}

.tn-mega__aside{position:relative;padding:36px 32px;border-right:1px solid rgba(255,255,255,.12);background:var(--evergreen-deep);min-height:280px}
.tn-mega__aside::before{content:"";position:absolute;inset:0;background-image:var(--veins);background-size:220% 220%;opacity:.1;mix-blend-mode:screen;pointer-events:none}
.tn-preview{position:relative;transition:opacity .16s ease}
.tn-preview.tn-fading{opacity:0}
.tn-preview__img{width:100%;aspect-ratio:4/3;border-radius:6px;overflow:hidden;background:#0e2a20;margin-bottom:1.1rem;box-shadow:0 14px 30px rgba(0,0,0,.3)}
.tn-preview__img img{width:100%;height:100%;object-fit:cover;display:block}
.tn-preview__eyebrow{font-weight:700;font-size:.68rem;letter-spacing:.18em;text-transform:uppercase;color:var(--gold);margin-bottom:.5rem;display:block}
.tn-preview__title{color:#fff;font-family:'Bodoni Moda',Georgia,serif;font-weight:600;font-size:1.28rem;line-height:1.15;margin-bottom:.55rem}
.tn-preview__text{color:#C7D8CD;font-size:.86rem;line-height:1.55}

/* icon-only fallback preview (no product photo available) */
.tn-preview__img.tn-icon{display:grid;place-items:center;background:linear-gradient(135deg,#1c4a3a,#0e2a20)}
.tn-preview__img.tn-icon svg{width:44px;height:44px;color:var(--gold)}

.tn-mega__links{padding:36px 40px}
.tn-mega__links .sub-menu{list-style:none;margin:0;padding:0;column-count:2;column-gap:40px}
.tn-mega__links .sub-menu>.menu-item{break-inside:avoid;margin-bottom:4px}
.tn-mega__links .sub-menu a{display:flex;align-items:center;gap:13px;color:#EAF1EC;font-weight:600;font-size:.95rem;text-decoration:none;padding:10px 14px;border-radius:4px;transition:background .15s,padding .15s}
.tn-mega__links .sub-menu a:hover,.tn-mega__links .sub-menu a:focus-visible{background:rgba(255,255,255,.08);color:#fff;padding-left:20px}
.tn-mega__links .sub-menu a:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}

/* small leading icon/swatch/thumb on each sub-menu link */
.tn-mini{width:32px;height:32px;border-radius:7px;overflow:hidden;flex:none;background:rgba(255,255,255,.08)}
.tn-mini img{width:100%;height:100%;object-fit:cover;display:block}
.tn-mini.tn-mini-icon{display:grid;place-items:center;background:rgba(213,165,40,.14);border:1px solid rgba(213,165,40,.4)}
.tn-mini.tn-mini-icon svg{width:15px;height:15px;color:var(--gold)}

/* material letter badge — same square/semi-transparent treatment as .tn-mini-icon */
.tn-mini.tn-mini-dia{display:grid;place-items:center;background:rgba(213,165,40,.14);border:1px solid rgba(213,165,40,.4);color:var(--gold);font-family:'Bodoni Moda',Georgia,serif;font-weight:700;font-size:.68rem;line-height:1}

/* Resources: featured Blog + Buying Guide row beneath the link list */
.tn-feature-row{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:28px;padding-top:28px;border-top:1px solid rgba(255,255,255,.12)}
.tn-feature{display:flex;gap:18px;align-items:center;text-decoration:none;padding:16px;border-radius:8px;transition:background .15s}
.tn-feature:hover,.tn-feature:focus-visible{background:rgba(255,255,255,.06)}
.tn-feature__img{width:132px;height:98px;border-radius:6px;overflow:hidden;flex:none;background:#0e2a20}
.tn-feature__img img{width:100%;height:100%;object-fit:cover;display:block}
.tn-feature__body{min-width:0}
.tn-feature__tag{display:block;font-weight:700;font-size:.68rem;letter-spacing:.14em;text-transform:uppercase;color:var(--gold);margin-bottom:.4rem}
.tn-feature__body h4{color:#fff;font-family:'Bodoni Moda',Georgia,serif;font-weight:600;font-size:1.12rem;line-height:1.26;margin:0 0 .55rem}
.tn-feature__link{color:#E9C9A6;font-weight:600;font-size:.85rem}

/* material swatches reused for the Browse menu (matches materials grid elsewhere on-site) */
.sw-granite{background:radial-gradient(120% 140% at 30% 20%,#5b5750,#363430 60%,#21201d)}
.sw-quartz{background:linear-gradient(135deg,#f3f0ea,#e3ddd2 70%,#d6cfc2)}
.sw-quartzite{background:linear-gradient(135deg,#eef3f5,#cdd9de 55%,#b6c7cf)}
.sw-porcelain{background:linear-gradient(135deg,#faf8f4,#ece6db 75%,#ddd5c7)}
.sw-marble{background:linear-gradient(135deg,#fbfaf8,#eae6df 60%,#d9d4ca)}
.sw-soapstone{background:linear-gradient(135deg,#3a423d,#2a302c 60%,#1d221f)}

/* ---------------------------------------------------------
   Contact Us — 3 equal columns
   --------------------------------------------------------- */
.tn-mega.tn-mega--contact .tn-mega__inner{grid-template-columns:none;display:grid;grid-template-columns:repeat(3,1fr)}
.tn-cta-col{padding:40px 36px;border-right:1px solid rgba(255,255,255,.12);display:flex;flex-direction:column;align-items:flex-start;gap:.9rem}
.tn-cta-col:last-child{border-right:none}
.tn-cta-col .tn-ico{width:46px;height:46px;border-radius:50%;background:rgba(213,165,40,.14);border:1.5px solid var(--gold);display:grid;place-items:center;color:var(--gold)}
.tn-cta-col .tn-ico svg{width:22px;height:22px}
.tn-cta-col h3{color:#fff;font-family:'Bodoni Moda',Georgia,serif;font-weight:600;font-size:1.2rem;margin:.2rem 0 0}
.tn-cta-col p{color:#C7D8CD;font-size:.88rem;line-height:1.55;margin:0}
.tn-cta-col .btn-gold{display:inline-flex;align-items:center;gap:.5rem;background:var(--gold);color:#fff;font-weight:700;font-size:.82rem;text-decoration:none;padding:.8rem 1.3rem;border-radius:3px;margin-top:.3rem;transition:.2s}
.tn-cta-col .btn-gold:hover{background:var(--gold-deep)}
.tn-cta-col .tn-phone{display:inline-flex;align-items:center;gap:.6rem;color:#fff;font-family:'Bodoni Moda',Georgia,serif;font-size:1.35rem;font-weight:600;text-decoration:none;margin-top:.2rem}
.tn-cta-col .tn-phone svg{width:18px;height:18px;color:var(--gold)}
.tn-cta-col .tn-link{color:#E9C9A6;font-weight:600;font-size:.85rem;text-decoration:underline;text-underline-offset:3px}

/* ---------------------------------------------------------
   Mobile: hamburger + accordion overlay
   --------------------------------------------------------- */
.tn-mobile{position:fixed;inset:0;z-index:1010;background:var(--evergreen);display:flex;flex-direction:column;transform:translateX(100%);visibility:hidden;transition:transform .32s ease,visibility 0s linear .32s}
.tn-mobile.tn-open{transform:translateX(0);visibility:visible;transition:transform .32s ease}
.tn-mobile__top{display:flex;align-items:center;justify-content:space-between;padding:20px 22px;flex:none;border-bottom:1px solid rgba(255,255,255,.12)}
.tn-mobile__close{width:40px!important;height:40px!important;flex:none;border:1.5px solid rgba(255,255,255,.35)!important;border-radius:8px!important;background:none!important;color:#fff!important;font-size:1.5rem;line-height:1;display:grid;place-items:center;cursor:pointer;padding:0!important}
.tn-mobile__close:hover{background:rgba(255,255,255,.12)!important}
.tn-mobile__body{overflow-y:auto;flex:1;padding:8px 0 30px}

.tn-acc{border-bottom:1px solid rgba(255,255,255,.12)}
/* !important: a plain nav <button>, needs to stay immune to Elementor
   Pro's site-wide Theme Style > Buttons cascade (if ever configured) —
   see the note on .tn__contact-btn above. Without this, that setting can
   turn every accordion trigger into a solid pill matching whatever the
   global button style is set to. */
.tn-acc__q{width:100%;display:flex!important;align-items:center;justify-content:space-between;gap:1rem;background:none!important;border:none!important;border-radius:0!important;color:#fff!important;font-family:'Bodoni Moda',Georgia,serif!important;font-weight:600!important;font-size:1.12rem!important;padding:18px 22px!important;cursor:pointer;text-align:left}
.tn-acc__q .tn__caret{color:#9FC4AE}
.tn-acc.tn-open .tn__caret{transform:rotate(180deg)}
.tn-acc__panel{max-height:0;overflow:hidden;transition:max-height .3s ease}
.tn-acc__panel ul{list-style:none;margin:0;padding:0 22px 18px}
.tn-acc__panel a{display:block;color:#D7E2DA;font-weight:500;font-size:.96rem;text-decoration:none;padding:10px 8px}
.tn-acc__panel a:hover{color:#fff}
.tn-mobile__contact{padding:22px}
.tn-mobile__contact a.tn-phone{color:#fff;font-family:'Bodoni Moda',Georgia,serif;font-size:1.4rem;font-weight:600;text-decoration:none;display:flex;align-items:center;gap:.6rem;margin-bottom:.9rem}
.tn-mobile__contact a.btn-gold{display:inline-flex;align-items:center;gap:.5rem;background:var(--gold);color:#fff;font-weight:700;font-size:.85rem;text-decoration:none;padding:.85rem 1.4rem;border-radius:3px}

@media(prefers-reduced-motion:reduce){
 .tn-mega,.menu-item.tn-open>.tn-mega,.tn-mobile,.tn-mobile.tn-open,.tn__caret,.tn-acc__panel{transition:none}
}

@media(max-width:1180px){
 .tn__inner{padding:0 20px}
 .tn-mega__inner{padding:0 20px}
}

@media(max-width:980px){
 .tn__menu-wrap,.tn__div{display:none}
 /* Contact Us is desktop-only; the mobile overlay has its own phone number
    and estimate button. Hide the whole .menu-item wrapper, not just the
    button: the Contact panel is a SIBLING of the button, not inside it,
    and a hidden panel (opacity/visibility:hidden) still takes up layout
    space. Its 3-column grid can't shrink below its content's minimum
    width, so on a phone it ran past the right edge and made the whole
    page wider than the screen (mobile browsers then zoom out, leaving
    blank space beside every full-width section). display:none on the
    wrapper takes both out of layout — and, being on the parent, doesn't
    have to fight the button's own display:inline-flex!important. */
 .tn__right > .menu-item{display:none}
 .tn__right{margin-left:auto}
 .tn__menu-btn{display:grid;place-items:center;width:42px!important;height:42px!important;border:1.5px solid rgba(255,255,255,.3)!important;border-radius:4px!important;color:#fff!important;background:none!important;cursor:pointer;padding:0!important}
}
