/**
 * YOUin3D improve layer on corpo
 * Brand anchors: header #3b3b3b · accent #ed422c · body greys from parent
 * Goal: clearer mobile nav, touch targets, header hierarchy — same look.
 */

:root {
  --y3d-header: #3b3b3b;
  --y3d-accent: #ed422c;
  --y3d-muted: #797979;
  --y3d-surface: #ffffff;
  --y3d-border: #e1e1e1;
  --y3d-focus: #ed422c;
  --y3d-max: 1100px;
}

/* ----- Focus / a11y (does not change brand chrome) ----- */
a:focus-visible,
button:focus-visible,
.tinynav:focus-visible,
select:focus-visible {
  outline: 2px solid var(--y3d-focus);
  outline-offset: 2px;
}

/* ----- Header: one compact row, title beside the menu ----- */
.y3d-menu-toggle {
  display: none;
}

#logo h1,
#logo h1 a,
#logo a.logo-img {
  text-decoration: none;
}

@media only screen and (min-width: 860px) {
  #header {
    min-height: 0;
  }

  #header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  #logo {
    float: none;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 260px;
    padding: 8px 0;
  }

  #logo h1 {
    margin: 0;
    line-height: 1.05;
  }

  #logo h1 a {
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  #logo .site_tagline {
    margin: 2px 0 0;
    font-size: 10px;
    line-height: 1.25;
    letter-spacing: 0.04em;
    opacity: 0.72;
    white-space: normal;
  }

  nav#main-nav {
    float: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 1 1 auto;
    width: auto;
    margin: 0 0 0 10px;
    min-width: 0;
  }

  .tinynav {
    display: none !important;
  }

  #main-menu {
    display: flex !important;
    align-items: center;
    height: auto !important;
    float: none;
    order: 1;
    margin: 0;
    min-width: 0;
  }

  nav#main-nav > ul > li {
    float: none;
    display: block;
    position: relative;
    margin: 0;
    padding: 14px 1px;
    border: 0 !important;
    background: transparent !important;
  }

  nav#main-nav > ul > li > a {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    padding: 8px 8px 6px;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
  }

  nav#main-nav > ul > li:hover > a,
  nav#main-nav > ul > li.current-menu-item > a,
  nav#main-nav > ul > li.current-menu-parent > a,
  nav#main-nav > ul > li.current-menu-ancestor > a {
    background: transparent;
    border-bottom-color: var(--y3d-accent);
    color: #fff;
  }

  nav#main-nav #main-menu > .menu-item > .sub-menu {
    top: 100%;
    left: 0;
    z-index: 40;
    margin: 0;
    min-width: 230px;
    padding: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  }

  nav#main-nav #main-menu .sub-menu::before {
    display: none;
  }

  nav#main-nav #main-menu > .menu-item > .sub-menu li {
    border: 0;
    background: none;
  }

  nav#main-nav #main-menu > .menu-item > .sub-menu a {
    padding: 9px 12px;
    border-radius: 8px;
    color: #2a2a2a;
    font-size: 13.5px;
    font-weight: 500;
    background: transparent;
    white-space: normal;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  nav#main-nav #main-menu > .menu-item > .sub-menu a:hover {
    color: var(--y3d-accent);
    background: #f4f4f4;
  }
}

@media only screen and (min-width: 860px) and (max-width: 1180px) {
  #logo h1 a {
    font-size: 18px;
  }

  #logo .site_tagline {
    display: none;
  }

  nav#main-nav {
    margin-left: 8px;
  }

  nav#main-nav > ul > li > a {
    font-size: 12.5px;
    padding: 7px 7px;
  }
}

/* Shop + cart pill: in #top-bar on small screens, fixed top right from 1181px. */
#top-bar .shopping-cart-menu {
  float: right;
  padding-right: 14px;
}

#top-bar .shopping-cart-menu > ul {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 3px 3px 12px;
  background: #fff;
  border: 1px solid var(--y3d-border);
  border-radius: 999px;
}

#top-bar .shopping-cart-menu li {
  float: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  list-style: none;
}

#top-bar .shopping-cart-menu a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  color: #2a2a2a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

#top-bar .shopping-cart-menu a:hover {
  color: var(--y3d-accent);
}

#top-bar .shopping-cart-menu .wpmenucart-contents {
  justify-content: center;
  min-width: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--y3d-accent);
  color: #fff;
}

#top-bar .shopping-cart-menu .wpmenucart-contents:hover {
  background: #d23520;
  color: #fff;
}

#top-bar .shopping-cart-menu .cartcontents {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #fff;
  color: var(--y3d-accent);
  font-size: 11px;
  font-weight: 700;
}

#top-bar .shopping-cart-menu.is-empty .wpmenucart-contents {
  padding: 0;
}

@media only screen and (min-width: 1181px) {
  /* Above the parent's sticky #header-wrapper.stick (z-index 10000). */
  #top-bar .shopping-cart-menu {
    position: fixed;
    top: 51px;
    right: 14px;
    z-index: 10001;
    padding: 0;
  }

  body:has(#header-wrapper.stick) #top-bar .shopping-cart-menu {
    top: 17px;
  }
}

/* A filled cart pill reaches into the header until about 1475px. */
@media only screen and (min-width: 1181px) and (max-width: 1475px) {
  #top-bar .shopping-cart-menu .amount {
    display: none !important;
  }

  body:has(#top-bar .shopping-cart-menu:not(.is-empty)) nav#main-nav {
    padding-right: max(0px, calc(700px - 50vw));
  }

  #top-bar .shopping-cart-menu > ul {
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  }
}

#top-bar .shopping-cart-menu .sub-menu,
#top-bar .shopping-cart-menu.is-empty .cartcontents,
#top-bar .shopping-cart-menu.is-empty .amount {
  display: none !important;
}

/* Release number on footer year hover. */
.y3d-version-year {
  position: relative;
  cursor: help;
}

.y3d-version-year::after {
  content: attr(data-version);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: #2a2a2a;
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.y3d-version-year:hover::after,
.y3d-version-year:focus::after {
  opacity: 1;
}

/*
 * Sticky header at every width, pure CSS.
 * The parent script (menuFocus.js sticky_relocate) toggles .stick to switch
 * between static and fixed and sets the anchor height by hand; that jumps on
 * phones and the parent disables it at 1050px and below. position: sticky
 * needs no placeholder. The anchor stays in the flow at zero height so .stick
 * still marks "header reached the top" (used by the shop pill).
 * Requires: #header-wrapper stays a direct child of body, and body/html keep
 * overflow visible (overflow hidden on an ancestor disables sticky).
 */
#sticky-anchor {
  display: block !important;
  height: 0 !important;
}

#header-wrapper,
#header-wrapper.stick {
  position: sticky !important;
  top: 0;
  left: auto;
  right: auto;
  width: 100%;
  z-index: 10000;
}

body.admin-bar #header-wrapper {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar #header-wrapper {
    top: 46px;
  }
}

/* The admin bar stops being fixed at 600px and below. */
@media screen and (max-width: 600px) {
  body.admin-bar #header-wrapper {
    top: 0;
  }
}

@media only screen and (max-width: 859px) {
  body.y3d-nav-open nav#main-nav {
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
  }
}

/* Dropdown readability */
nav#main-nav ul ul li a {
  line-height: 1.35;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ----- Mobile: short bar, menu opens underneath ----- */
@media only screen and (max-width: 859px) {
  #header {
    min-height: 0;
    text-align: left;
  }

  #header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: auto !important;
    padding: 8px 14px 10px;
  }

  #logo {
    float: none;
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    padding: 0;
    margin: 0;
  }

  #logo h1 {
    margin: 0;
    min-width: 0;
    line-height: 1.15;
  }

  #logo h1 a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.15;
  }

  #logo .site_tagline {
    display: none;
  }

  button.y3d-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 8px !important;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
  }

  .y3d-menu-toggle:hover,
  .y3d-menu-toggle[aria-expanded="true"] {
    border-color: var(--y3d-accent);
    color: #fff;
  }

  nav#main-nav {
    display: none;
    float: none;
    width: 100%;
    margin: 8px 0 0;
    order: 3;
  }

  body.y3d-nav-open nav#main-nav {
    display: block;
  }

  .tinynav {
    display: none !important;
  }

  nav#main-nav #main-menu {
    display: block !important;
    height: auto !important;
    width: 100%;
    margin: 0;
  }

  nav#main-nav #main-menu > li {
    float: none !important;
    clear: both;
    display: block;
    width: 100% !important;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent !important;
  }

  #main-menu > li > a {
    display: block;
    padding: 12px 2px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: 0;
  }

  nav#main-nav #main-menu .sub-menu {
    display: none !important;
    position: static;
    width: auto;
    left: auto;
    margin: 0;
    box-shadow: none;
  }

  nav#main-nav #main-menu > li.y3d-sub-open > .sub-menu {
    display: block !important;
    background: rgba(0, 0, 0, 0.18);
  }

  nav#main-nav #main-menu .sub-menu li {
    background: transparent !important;
  }

  #main-menu > li.y3d-sub-open > .sub-menu > li > a {
    padding: 10px 12px;
    font-size: 14px;
    color: #f2f2f2;
  }
}

/* ----- Content width comfort on large phones / small tablets ----- */
@media only screen and (max-width: 768px) {
  #content-wrapper,
  #content {
    box-sizing: border-box;
  }

  .woocommerce ul.products li.product,
  .woocommerce-page ul.products li.product {
    margin-bottom: 1.5em;
  }
}

/* ----- Woo: clearer add-to-cart / prices without new skin ----- */
.woocommerce .price,
.woocommerce div.product p.price {
  color: #333;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  border-radius: 2px;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  opacity: 0.92;
}

/* ----- Footer link contrast ----- */
#footer-menu li a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

#footer-menu li a:hover {
  color: var(--y3d-accent);
}
