/* Search, categories and the shelves of products. */
.store-tools {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 15;
  display: grid;
  gap: 10px;
  padding: 12px var(--gutter) 10px;
  background: rgb(247 244 236 / 0.92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow 0.25s;
}
.store-tools.is-stuck {
  box-shadow:
    0 1px 0 var(--crema),
    0 10px 24px -18px rgb(32 27 23 / 0.45);
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 6px 0 14px;
  gap: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--crema-2);
  color: var(--torra);
}
.search:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--espresso);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}
.search input::-webkit-search-cancel-button {
  display: none;
}
.search-clear {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.search-clear .icon {
  width: 18px;
  height: 18px;
}
.category-strip {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.category-strip::-webkit-scrollbar {
  display: none;
}
.chip-indicator {
  position: absolute;
  top: 2px;
  left: 0;
  height: 40px;
  width: 0;
  border-radius: 999px;
  background: var(--espresso);
  transition:
    transform 0.35s var(--ease-out),
    width 0.35s var(--ease-out);
  pointer-events: none;
}
.chip {
  position: relative;
  z-index: 1;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--crema-2);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 0.25s,
    box-shadow 0.25s;
}
.chip img,
.chip .chip-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--crema);
}
.chip[aria-current="true"] {
  color: var(--marfim);
  box-shadow: none;
}

.catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px var(--gutter) 0;
  outline: none;
}
.notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--crema);
  font-size: 0.9rem;
}
.preview-notice {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--espresso);
  color: var(--marfim);
  font-size: 0.86rem;
}
.preview-notice a {
  color: var(--champagne-2);
  text-decoration: underline;
}
.shelf {
  padding-top: 26px;
}
.shelf[hidden] {
  display: none;
}
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.shelf-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.62rem;
  font-variation-settings: "opsz" 40;
  line-height: 1.1;
}
.shelf-head span {
  color: var(--torra);
  font-size: 0.82rem;
  white-space: nowrap;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}
.product-card {
  position: relative;
  container-type: inline-size;
}
.product-card[hidden] {
  display: none;
}
.card-open {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 18px;
}
.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--crema);
  box-shadow: inset 0 0 0 1px rgb(32 27 23 / 0.05);
}
.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 0.45s,
    transform 0.6s var(--ease-out);
}
.photo img.is-loaded {
  opacity: 1;
  transform: none;
}
.no-photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--torra);
}
.card-name {
  display: -webkit-box;
  margin: 10px 2px 2px;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  display: -webkit-box;
  margin: 0 2px;
  color: var(--torra);
  font-size: 0.8rem;
  line-height: 1.35;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  display: block;
  margin: 6px 2px 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card-price.is-pending {
  color: var(--torra);
  font-weight: 600;
  font-size: 0.86rem;
}
.card-add {
  position: absolute;
  right: 8px;
  /* Phones without container units (iOS < 16): the card is half of the screen minus the gutters. */
  top: calc((100vw - 46px) / 2 - 50px);
  top: calc(100cqw - 50px);
  height: 42px;
  min-width: 42px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--espresso);
  color: var(--marfim);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow:
    0 0 0 2px rgb(247 244 236 / 0.9),
    0 8px 18px -8px rgb(32 27 23 / 0.6);
  transition: transform 0.18s var(--ease-spring);
}
.card-add:active {
  transform: scale(0.9);
}
.card-add .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}
.card-add[data-qty]::after {
  content: attr(data-qty);
  position: absolute;
  top: -7px;
  left: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--champagne);
  color: var(--espresso);
  font-size: 0.72rem;
  font-weight: 800;
}
.skeleton .photo {
  background: linear-gradient(100deg, var(--crema) 40%, #f3ede1 50%, var(--crema) 60%) 0 0 / 200%
    100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton .card-name {
  width: 70%;
  height: 14px;
  border-radius: 6px;
  background: var(--crema);
}
.empty-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 56px 0 24px;
  text-align: center;
}
.empty-state p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
}

@media (min-width: 760px) {
  .store-tools {
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
    align-items: center;
    padding-left: max(var(--gutter), calc((100vw - 1200px) / 2));
    padding-right: max(var(--gutter), calc((100vw - 1200px) / 2));
  }
  .category-strip {
    margin: 0;
    padding: 2px 0;
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 32px), transparent);
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 30px 22px;
  }
  .shelf {
    padding-top: 40px;
  }
  .shelf-head h2 {
    font-size: 2.1rem;
  }
  .card-open:hover .photo img.is-loaded {
    transform: scale(1.035);
  }
}
