/* =========================================================
   BASE
   ========================================================= */

body {
  color: #191717;
  background: #fafafa;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 0;
  background: rgba(248, 248, 246, 0.92);
  backdrop-filter: blur(8px);
}

.header-inner {
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid #d8d8d2;
  border-radius: 0;
  background: linear-gradient(180deg, #fcfcfa 0%, #f0f0ec 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(14px, 2vw, 26px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.header-center {
  justify-self: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0;
  justify-self: end;
}

.header-cart {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  color: #191717;
  line-height: 1;
  margin-right: 20px;
}

.header-cart-icon {
  min-width: 30px;
  min-height: 30px;
  display: block;
  flex: 0 0 22px;
}

.header-cart-count {
  display: none;
  order: -1;
  min-width: 16px;
  height: 16px;
  /* padding: 0 4px; */
  border-radius: 15px;
  background: #191717;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.header-cart-count.has-items {
  display: inline-flex;
}

.header-cart:hover {
  opacity: 0.68;
}

.header-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 20px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #191717;
  cursor: pointer;
}

.header-menu-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-menu-toggle:focus-visible {
  outline: 2px solid #191717;
  outline-offset: 4px;
}

.app-layout.sidebar-open .header-menu-toggle span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.app-layout.sidebar-open .header-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.app-layout.sidebar-open .header-menu-toggle span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.header-phone {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #191717;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  max-height: 50px;
  width: auto;
}

.site-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-socials {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-social {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: #191717;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.header-social i {
  font-size: 25px;
  line-height: 1;
}

.header-social:hover {
  opacity: 0.68;
}

/* =========================================================
   HOME HERO HEADER
   ========================================================= */

.home .app-header {
  position: fixed;
  left: 0;
  right: 0;
  transition: background 0.25s ease, backdrop-filter 0.25s ease;
}

.home .app-header .header-inner {
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.home .app-header.is-hero-transparent {
  background: transparent;
  backdrop-filter: none;
}

.home .app-header.is-hero-transparent .header-inner {
  background: transparent;
  border-bottom-color: transparent;
}

.home .app-header.is-hero-transparent .header-menu-toggle,
.home .app-header.is-hero-transparent .header-phone,
.home .app-header.is-hero-transparent .header-cart,
.home .app-header.is-hero-transparent .header-social,
.home .app-header.is-hero-transparent .site-logo {
  color: #fff;
}

.home .app-header.is-hero-transparent .header-cart-count {
  background: #fff;
  color: #191717;
}

.home .app-header.is-hero-transparent .custom-logo {
  filter: brightness(0) invert(1);
}

.home .app-header.is-hero-transparent .header-menu-toggle:focus-visible {
  outline-color: #fff;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.app-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  z-index: 40;
  width: var(--sidebar-open-width);
  min-width: 0;
  height: calc(100dvh - 64px);
  margin: 0;
  padding: 14px 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: padding 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.app-layout.sidebar-open .app-sidebar {
  /* padding: 14px 18px 20px; */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sidebar-nav {
  width: max-content;
  max-width: 100%;
  height: 100%;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
}

.sidebar-menu li {
  width: max-content;
  max-width: 100%;
  text-align: center;
}

.sidebar-menu li a {
  display: inline-block;
  width: auto;
  min-height: 0;
  padding: 4px 0;
  color: #191717;
  border: 0;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.sidebar-menu li.menu-item-cart > a {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.anyform-mobile-cart-badge {
  display: none;
  order: -1;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: #191717;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.sidebar-menu li a:hover {
  text-decoration: underline;
}

.sidebar-menu li.current-menu-item a,
.sidebar-menu li.current-menu-parent > a {
  text-decoration: underline;
}

.sidebar-menu .sub-menu {
  display: none;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.app-main {
  margin: 0;
  padding-right: 12px;
  background: #fafafa;
}

.app-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.app-footer {
  margin: 0 0 10px;
  padding-right: 12px;
}

.footer-inner {
  min-height: 40px;
  padding-top: 10px;
  border-top: 1px solid #d8d8d2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner p {
  margin: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: #62625e;
}

.footer-inner a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 767px) {
  .header-inner {
    min-height: 62px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "phone logo socials";
    column-gap: 10px;
    row-gap: 0;
    padding: 10px 12px;
  }

  .header-left {
    grid-area: phone;
    justify-self: start;
    align-self: center;
    gap: 0;
  }

  .header-center {
    grid-area: logo;
    justify-self: center;
    align-self: center;
  }

  .header-right {
    grid-area: socials;
    justify-self: end;
    align-self: center;
  }

  .header-menu-toggle {
    display: none;
  }

  .header-cart {
    display: none;
  }

  .custom-logo {
    max-height: 34px;
  }

  .header-phone {
    font-size: clamp(9px, 2.7vw, 11px);
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .app-sidebar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    width: auto;
    height: auto;
    min-height: 52px;
    padding: 6px 12px;
    border: 0;
    border-top: 1px solid #d8d8d2;
    border-radius: 0;
    background: rgba(249, 249, 246, 0.96);
    backdrop-filter: blur(10px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .app-layout.sidebar-open .app-sidebar {
    padding: 6px 12px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .sidebar-menu {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .sidebar-menu li {
    flex: 1 1 auto;
    min-width: 0;
  }

  .sidebar-menu li a {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 0;
  }

  .sidebar-menu li.menu-item-cart > a {
    gap: 6px;
  }

  .sidebar-menu li.menu-item-cart .anyform-mobile-cart-badge {
    display: none;
  }

  .sidebar-menu li.menu-item-cart .anyform-mobile-cart-badge.has-items {
    display: inline-flex;
  }

  .app-main,
  .app-footer {
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-main {
    padding-bottom: 64px;
  }

  .app-footer {
    padding-bottom: 64px;
  }
}

@media (max-width: 640px) {
  .header-social i {
    font-size: 17px;
  }

  .header-phone {
    font-size: clamp(9px, 2.8vw, 10px);
  }

  .sidebar-menu li a {
    font-size: 10px;
  }

  .sidebar-menu li.menu-item-cart .anyform-mobile-cart-badge {
    min-width: 13px;
    height: 13px;
    font-size: 8px;
  }

  .footer-inner p {
    font-size: 11px;
  }
}
