.oph-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.oph-product-search {
  display: flex;
  align-items: stretch;
  width: min(320px, 30vw);
  min-width: 220px;
}

.oph-product-search input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line, #d9d5ce);
  border-right: 0;
  border-radius: 2px 0 0 2px;
  background: #fff;
  color: var(--ink, #171717);
  font: inherit;
}

.oph-product-search button {
  min-width: 68px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ink, #171717);
  border-radius: 0 2px 2px 0;
  background: var(--ink, #171717);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.oph-header-cart {
  position: relative;
  flex: 0 0 auto;
}

.oph-mini-cart > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  cursor: pointer;
  list-style: none;
  color: var(--ink, #171717);
}

.oph-mini-cart > summary::-webkit-details-marker {
  display: none;
}

.oph-cart-count {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink, #171717);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.oph-mini-cart__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: min(380px, calc(100vw - 36px));
  max-height: min(620px, calc(100vh - 140px));
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line, #d9d5ce);
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}

.oph-mini-cart__panel .woocommerce-mini-cart {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.oph-mini-cart__panel .woocommerce-mini-cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #e3e0da);
}

.oph-mini-cart__panel .woocommerce-mini-cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.oph-mini-cart__panel .quantity {
  display: block;
  margin-top: 5px;
  color: var(--muted, #68645f);
}

.oph-mini-cart__panel .woocommerce-mini-cart__total {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.oph-mini-cart__panel .woocommerce-mini-cart__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.oph-mini-cart__panel .woocommerce-mini-cart__buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ink, #171717);
  background: var(--ink, #171717);
  color: #fff;
  text-align: center;
}

.oph-discovery-nav {
  border-top: 1px solid var(--line, #d9d5ce);
  background: #fff;
}

.oph-discovery-nav__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  max-width: 1420px;
  min-height: 42px;
  margin: 0 auto;
  padding: 0 32px;
  font-size: 13px;
}

.oph-discovery-nav__all,
.oph-discovery-menu > summary {
  color: var(--ink, #171717);
  font-weight: 600;
}

.oph-discovery-menu {
  position: relative;
}

.oph-discovery-menu > summary {
  cursor: pointer;
  list-style: none;
}

.oph-discovery-menu > summary::-webkit-details-marker {
  display: none;
}

.oph-discovery-menu__panel {
  position: absolute;
  top: calc(100% + 13px);
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 2px 20px;
  width: max-content;
  max-width: min(520px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--line, #d9d5ce);
  background: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.12);
}

.oph-discovery-menu__panel a {
  padding: 7px 4px;
  white-space: nowrap;
  color: var(--muted, #68645f);
}

.oph-product-search-results {
  min-height: 55vh;
}

@media (max-width: 1100px) {
  .site-header__inner {
    flex-wrap: wrap;
  }

  .oph-header-tools {
    width: 100%;
  }

  .oph-product-search {
    width: min(420px, calc(100% - 76px));
  }
}

@media (max-width: 760px) {
  .oph-header-tools {
    align-items: flex-start;
    width: 100%;
  }

  .oph-product-search {
    width: calc(100% - 70px);
    min-width: 0;
  }

  .oph-mini-cart__panel {
    position: fixed;
    top: 126px;
    right: 18px;
    left: 18px;
    width: auto;
  }

  .oph-discovery-nav__inner {
    gap: 18px;
    min-height: 44px;
    padding: 0 18px;
    overflow-x: auto;
  }

  .oph-discovery-menu {
    position: static;
  }

  .oph-discovery-menu__panel {
    position: fixed;
    top: 170px;
    right: 18px;
    left: 18px;
    grid-template-columns: 1fr 1fr;
    width: auto;
  }
}

