/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.product-card a {
  text-decoration: none;
  color: inherit;
}

.out-of-stock {
  color: var(--pico-color-red-500);
  font-size: 0.85rem;
}

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .product-detail { grid-template-columns: 1fr; }
}

.product-images img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.bulk-note {
  color: var(--pico-color-green-600);
  font-size: 0.9rem;
}

/* Cart sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--pico-background-color);
  border-left: 1px solid var(--pico-muted-border-color);
  z-index: 1000;
  overflow-y: auto;
  transition: right 0.3s ease;
  padding: 1.5rem;
}

.cart-sidebar.open {
  right: 0;
}

.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
}

.cart-sidebar.open ~ .cart-overlay {
  display: block;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr 120px auto auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cart-item-name {
  font-size: 0.9rem;
}

.cart-item-controls form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.qty-input {
  width: 52px;
  text-align: center;
  padding: 0.2rem;
  margin: 0;
  font-size: 0.9rem;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input[type=number] {
  -moz-appearance: textfield;
}

.cart-item-price {
  font-size: 0.9rem;
  white-space: nowrap;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--pico-muted-color);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
}

.bulk-active {
  color: var(--pico-color-green-600);
  background: var(--pico-color-green-50);
  padding: 0.5rem;
  border-radius: 4px;
}

.bulk-hint {
  color: var(--pico-color-orange-600);
  background: var(--pico-color-orange-50);
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Checkout layout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  margin-top: 1rem;
}

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

.order-summary {
  background: var(--pico-card-background-color);
  padding: 1.5rem;
  border-radius: 8px;
  height: fit-content;
}

/* Misc */
.hidden { display: none; }
.error { color: var(--pico-color-red-500); }

button.small {
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}
