.tea-shelf {
  color: var(--text);
}

.shelf-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: clamp(30px, 6vw, 100px);
  row-gap: 12px;
  animation: shelf-enter 0.65s var(--ease-tea) both;
}

.shelf-heading h1 {
  font-size: clamp(2.6rem, 5.5vw, 5.75rem);
  max-width: 18ch;
  line-height: 1.02;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.shelf-heading p {
  max-width: 36ch;
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}

.shelf-departments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem clamp(16px, 2.5vw, 42px);
  border-bottom: 1px solid var(--line);
  margin: clamp(20px, 2.8vw, 42px) 0 0;
  animation: shelf-enter 0.7s var(--ease-tea) 0.06s both;
}

.shelf-departments a {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 46px;
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.28s var(--ease-tea);
}

.shelf-departments a::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.34s var(--ease-tea);
}

.shelf-departments a:hover {
  color: var(--text);
}

.shelf-departments a:hover::after {
  transform: scaleX(0.5);
}

.shelf-departments a[aria-current] {
  color: var(--accent);
}

.shelf-departments a[aria-current]::after {
  transform: scaleX(1);
}

.shelf-controls {
  padding-block: clamp(18px, 2vw, 30px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(20px, 2.2vw, 34px);
  animation: shelf-enter 0.7s var(--ease-tea) 0.12s both;
}

.shelf-control-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.shelf-control-row svg {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shelf-kinds {
  position: relative;
  flex: 0 1 237px;
  min-width: 0;
}

.shelf-kinds summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.28s var(--ease-tea), background-color 0.28s var(--ease-tea), box-shadow 0.28s var(--ease-tea);
}

.shelf-kinds summary::-webkit-details-marker {
  display: none;
}

.shelf-kinds summary:hover,
.shelf-kinds[open] summary {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.shelf-kinds .shelf-kind-icon {
  color: var(--muted);
}

.shelf-kinds .shelf-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  transition: transform 0.32s var(--ease-tea);
}

.shelf-kinds[open] .shelf-chevron {
  transform: rotate(180deg);
}

.shelf-kind-menu,
#shelf-suggestions {
  z-index: 10;
  position: absolute;
  top: calc(100% + 7px);
  background: #181818;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid #585858;
  border-radius: 9px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
  max-height: min(360px, 45dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #585858 var(--panel);
  animation: shelf-dropdown 0.24s var(--ease-tea) both;
}

.shelf-kind-menu {
  left: 0;
  width: max(100%, 278px);
  padding: 6px;
}

.shelf-kind-menu a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 2.3rem 0.5rem 0.85rem;
  border-radius: 5px;
  color: var(--text);
  transition: background-color 0.2s var(--ease-tea), color 0.2s var(--ease-tea), padding-left 0.2s var(--ease-tea);
}

.shelf-kind-menu a[aria-current] {
  background: #242424;
  color: var(--accent);
}

.shelf-kind-menu a[aria-current]::after {
  content: "";
  position: absolute;
  right: 1rem;
  width: 5px;
  height: 10px;
  border: solid currentColor;
  border-width: 0 1.7px 1.7px 0;
  transform: translateY(-2px) rotate(45deg);
}

.shelf-kind-menu a:hover,
.shelf-kind-menu a:focus-visible {
  background: #262626;
  padding-left: 1rem;
}

.shelf-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shelf-search {
  position: relative;
  flex: 1 1 220px;
  max-width: 37rem;
  min-width: 0;
}

.shelf-search form {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 50px;
  background: var(--panel);
  padding-inline: 0.9rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  transition: border-color 0.28s var(--ease-tea), box-shadow 0.28s var(--ease-tea), background-color 0.28s var(--ease-tea);
}

.shelf-search form:hover {
  border-color: #656565;
}

.shelf-search form:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.shelf-search input[type="search"] {
  flex: 1;
  min-width: 0;
  width: 0;
  height: 44px;
  background: transparent;
  padding: 0 0.6rem;
  border: 0;
  outline: 0;
  color: var(--text);
  appearance: none;
}

.shelf-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.shelf-search button {
  height: 38px;
  padding: 0 0.85rem;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
  background: transparent;
  font-size: 0.9rem;
  color: var(--accent);
}

.shelf-search button:hover,
.shelf-search button:focus-visible {
  color: var(--accent-hover);
  background: #242424;
}

#shelf-suggestions {
  inset-inline: 0;
  padding: 5px;
}

#shelf-suggestions a {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 56px;
  align-items: center;
  gap: 0.8rem;
  padding: 0.42rem 0.65rem;
  border-radius: 5px;
  transition: background-color 0.18s var(--ease-tea);
}

#shelf-suggestions a:hover,
#shelf-suggestions [aria-selected="true"] {
  background: #242424;
}

#shelf-suggestions img {
  width: 46px;
  height: 46px;
  border-radius: 5px;
  object-fit: cover;
}

#shelf-suggestions strong {
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#shelf-suggestions small {
  display: block;
  color: var(--accent);
  margin-top: 0.15rem;
}

.shelf-state-row {
  display: flex;
  gap: 15px;
  align-items: baseline;
  margin-top: 17px;
}

.shelf-state-row h2 {
  font-family: inherit;
  line-height: 1.4;
  font-size: 0.93rem;
  letter-spacing: 0;
  color: var(--muted);
}

.shelf-states {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.shelf-states a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.34rem 0.94rem;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  transition:
    border-color 0.26s var(--ease-tea),
    color 0.26s var(--ease-tea),
    background-color 0.26s var(--ease-tea),
    transform 0.26s var(--ease-tea),
    box-shadow 0.28s var(--ease-tea);
}

.shelf-states a[aria-current] {
  color: #101010;
  background: var(--accent);
  border-color: var(--accent);
}

.shelf-states a:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.shelf-states a[aria-current]:hover {
  color: #101010;
}

.shelf-products .card {
  padding: 7px;
  background: var(--panel);
  border-color: var(--line);
  border-radius: 11px;
}

.shelf-products .cardbody {
  padding: 16px 14px 12px;
}

.shelf-products .imagebtn {
  border-radius: 6px;
}

.shelf-products .imagebtn img {
  aspect-ratio: 1.64;
}

.shelf-products .titlebtn {
  line-height: 1.19;
  margin: 0.75rem 0 0.45rem;
  text-wrap: pretty;
}

.shelf-products .summary {
  color: var(--muted);
}

.shelf-products .cardfoot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.shelf-products .price {
  font: normal 1.28rem / 1.3 Georgia, serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shelf-products .price small {
  font: normal 0.83rem / 1.3 Arial, sans-serif;
}

.shelf-products .small {
  min-height: 40px;
  color: var(--text);
  border-color: #666;
}

.shelf-products .tag {
  background: var(--panel);
  border-color: var(--line);
  color: var(--accent);
}

@keyframes shelf-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shelf-dropdown {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 800px) {
  .shelf-heading p {
    max-width: 55ch;
  }
  .shelf-kinds {
    flex-basis: 190px;
  }
  .shelf-count {
    font-size: 0.8rem;
  }
  .shelf-products .cardbody {
    padding: 12px 8px 9px;
  }
}

@media (max-width: 600px) {
  .shelf-heading h1 {
    font-size: clamp(2.55rem, 10.6vw, 3.9rem);
  }
  .shelf-heading p {
    font-size: 0.94rem;
  }
  .shelf-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .shelf-search {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: none;
  }
  .shelf-kinds {
    width: 100%;
    max-width: 17rem;
  }
  .shelf-kind-menu {
    width: max(100%, 230px);
    max-width: 86vw;
  }
  .shelf-state-row {
    display: grid;
    gap: 8px;
    margin-top: 14px;
  }
  .shelf-states {
    gap: 6px;
  }
  .shelf-states a {
    min-height: 38px;
    padding: 0.35rem 0.76rem;
  }
  .shelf-products .cardfoot {
    align-items: flex-start;
  }
  .shelf-products .price {
    font-size: 1.12rem;
  }
}

@media (max-width: 430px) {
  .shelf-products {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .shelf-products .cardbody {
    padding: 14px 12px 10px;
  }
  .shelf-products .titlebtn {
    font-size: 1.43rem;
  }
  .shelf-products .cardfoot {
    flex-direction: row;
    align-items: center;
  }
}
