.inventory {
  background:
    linear-gradient(rgba(228, 229, 231, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 229, 231, 0.5) 1px, transparent 1px),
    #f7f7f6;
  background-size: 70px 70px, 70px 70px, auto;
}

.inventory-heading p {
  max-width: 430px;
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 24px;
  align-items: start;
}

.inventory-panel,
.cart-panel,
.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.inventory-panel {
  padding: 24px;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  margin-bottom: 18px;
}

.inventory-toolbar label,
.auth-form label {
  display: grid;
  gap: 8px;
  color: #34363a;
  font-size: 0.78rem;
  font-weight: 760;
}

.inventory-toolbar input,
.inventory-toolbar select,
.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfbfb;
  border: 1px solid #d8dade;
  border-radius: 11px;
  font: inherit;
  outline: none;
}

.inventory-toolbar input:focus,
.inventory-toolbar select:focus,
.auth-form input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(229, 36, 42, 0.1);
}

.inventory-list {
  display: grid;
  gap: 14px;
}

.product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.product-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.product-meta span,
.cart-kicker,
.product-type {
  color: #6b6e75;
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-meta span {
  padding: 6px 8px;
  background: #f2f2f1;
  border-radius: 8px;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.product-price {
  display: grid;
  justify-items: end;
  gap: 10px;
  align-content: center;
  min-width: 130px;
}

.product-price strong {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.add-cart-button,
.qty-button,
.checkout-button,
.auth-form button {
  border: 0;
}

.add-cart-button {
  min-height: 42px;
  padding: 0 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 10px;
  font-weight: 780;
  cursor: pointer;
}

.add-cart-button:hover {
  background: var(--red);
}

.cart-panel {
  position: sticky;
  top: 96px;
  padding: 24px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.cart-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.cart-kicker {
  margin: 0 0 6px;
  color: var(--red);
}

.cart-auth-link,
.auth-alt a,
.text-button {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.auth-status {
  margin-bottom: 18px;
  padding: 10px 12px;
  color: #595d64;
  background: #f6f6f5;
  border-radius: 10px;
  font-size: 0.82rem;
}

.cart-items {
  display: grid;
  gap: 12px;
  min-height: 64px;
}

.empty-cart {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cart-item strong,
.cart-item span {
  display: block;
}

.cart-item strong {
  font-size: 0.92rem;
}

.cart-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-button {
  width: 30px;
  height: 30px;
  color: var(--ink);
  background: #f1f1f0;
  border-radius: 8px;
  cursor: pointer;
}

.cart-summary {
  margin: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.92rem;
}

.cart-summary strong {
  font-size: 1.4rem;
}

.checkout-button {
  width: 100%;
}

.cart-note,
.auth-message {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.cart-note.error,
.auth-message.error {
  color: var(--red-dark);
}

.cart-note.success,
.auth-message.success {
  color: #237146;
}

.auth-page {
  min-height: calc(100svh - 76px);
  padding: 76px 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(228, 229, 231, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 229, 231, 0.5) 1px, transparent 1px),
    linear-gradient(135deg, #fff 48%, #f7f7f6);
  background-size: 70px 70px, 70px 70px, auto;
}

.auth-card {
  width: min(520px, calc(100% - 32px));
  padding: clamp(28px, 5vw, 44px);
}

.auth-card h1 {
  max-width: none;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 0.95;
}

.auth-intro {
  margin: 16px 0 26px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form .button {
  width: 100%;
  margin-top: 6px;
}

.auth-alt {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .store-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .inventory-toolbar,
  .product-card {
    grid-template-columns: 1fr;
  }

  .product-price {
    justify-items: start;
  }

  .inventory-panel,
  .cart-panel {
    padding: 18px;
  }
}
