:root {
  --sd-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sd-radius: 10px;
  --sd-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sd-font);
  background: var(--sd-bg, #f6f7f9);
  color: var(--sd-text, #1a1a1a);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sd-inner {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.sd-header {
  background: var(--sd-header-bg, #fff);
  border-bottom: 1px solid var(--sd-border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sd-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.sd-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--sd-heading, inherit);
}

.sd-main {
  flex: 1;
  padding: 1.5rem 0 3rem;
}

.sd-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: var(--sd-radius);
  margin-bottom: 1rem;
}

.sd-filters {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sd-filters select {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--sd-border, #d1d5db);
  background: #fff;
}

.sd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.sd-card {
  background: var(--sd-card-bg, #fff);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-card-shadow, var(--sd-shadow));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sd-card-border, transparent);
}

.sd-card-img-wrap {
  aspect-ratio: 4/3;
  background: var(--sd-img-bg, #eef0f3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sd-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sd-card-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
}

.sd-price {
  font-weight: 700;
  color: var(--sd-accent, #2563eb);
  margin-top: auto;
}

.sd-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--sd-border, #d1d5db);
  background: #fff;
  color: inherit;
}

.sd-btn-primary {
  background: var(--sd-accent, #2563eb);
  color: #fff;
  border-color: transparent;
  width: 100%;
  margin-top: 0.5rem;
}

.sd-btn-ghost {
  background: transparent;
}

.sd-muted {
  color: var(--sd-muted, #6b7280);
}

.sd-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--sd-border, #e5e7eb);
  font-size: 0.9rem;
  color: var(--sd-muted, #6b7280);
}

.sd-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.sd-drawer[aria-hidden="false"] {
  pointer-events: auto;
}

.sd-drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s;
}

.sd-drawer[aria-hidden="false"] .sd-drawer-scrim {
  opacity: 1;
}

.sd-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 100%);
  background: var(--sd-drawer-bg, #fff);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  padding: 1rem 1.25rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.sd-drawer[aria-hidden="false"] .sd-drawer-panel {
  transform: translateX(0);
}

.sd-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.sd-drawer-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.sd-cart-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.sd-cart-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--sd-border, #e5e7eb);
  font-size: 0.9rem;
}

.sd-checkout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sd-checkout label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.sd-checkout input,
.sd-checkout textarea {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--sd-border, #d1d5db);
}

.sd-order-result {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--sd-radius);
  background: #ecfdf5;
  color: #065f46;
}
