/* Stock/inventory + product search — additive styles. */

/* ---- Search bar (products page) ---- */
.search-bar {
  position: relative;
  max-width: 460px;
  margin: 0 0 var(--space-5, 1.5rem);
}
.search-bar .search-icon {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  transform: translateY(-50%);
  color: var(--text-muted, #9a8f86);
  pointer-events: none;
}
.search-bar .search-input {
  width: 100%;
  padding-left: 2.6rem;
}
/* Hide the native clear "X" so it doesn't clash with the icon styling. */
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.grid-empty {
  text-align: center;
  color: var(--text-muted, #9a8f86);
  padding: var(--space-6, 3rem) var(--space-3, 1rem);
  font-size: var(--text-small);
}

/* ---- Monogram placeholder (wines with no photo) ---- */
/* A generated serif monogram on a deep wine panel — reads as a deliberate
   label rather than a broken image. Sized by its container per context. */
.wine-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b1f24;
  color: #e8ded2;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.04em;
  line-height: 1;
  user-select: none;
  overflow: hidden;
}
.card-image-wrapper .wine-monogram {
  width: 100%;
  aspect-ratio: 3 / 4;
  font-size: clamp(2rem, 7vw, 3rem);
}
.product-detail-image .wine-monogram {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  font-size: clamp(3rem, 10vw, 5rem);
}
.cart-item .wine-monogram {
  width: 60px;
  height: 80px;
  border-radius: var(--radius-sm);
  font-size: var(--text-h4);
}

/* ---- Sold out ---- */
/* A centered overlay over the bottle reads as a deliberate state, not a
   broken image. Only rendered on sold-out cards. */
.sold-out-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
}
.sold-out-label {
  background: var(--color-white);
  color: var(--color-black);
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
}
/* Lightly desaturate the bottle behind the scrim. */
.product-card.is-sold-out .card-image { filter: grayscale(0.6); }

/* Disabled controls follow the black/white token system (was an undefined
   token that fell back to an off-palette beige). */
.btn-disabled,
.btn:disabled {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--color-gray-300);
  cursor: not-allowed;
}

/* ---- Stock state on the detail page ---- */
/* Sold-out notice strip. */
.stock-notice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
  color: var(--text-secondary);
}
.stock-notice-icon { color: #c0392b; flex-shrink: 0; }

/* Low-stock nudge (a few bottles left). */
.stock-note {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  margin: 0.5rem 0 0;
}
.stock-note.low { color: #b9772b; }
