/* Keychain Workshop — minimal, light, clear */

:root {
  --ink: #111;
  --muted: #666;
  --line: #e5e5e5;
  --bg: #fff;
  --max-width: 960px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cart-button {
  background: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-button:hover { background: var(--ink); color: #fff; }

.cart-count {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  min-width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-button:hover .cart-count { background: #fff; color: var(--ink); }

/* Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero-sub {
  color: var(--muted);
  margin: 0;
}

/* Products */
.products {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  justify-content: center;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 380px;
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.product-price {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.product-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.product-link:hover .product-image { border-color: var(--ink); }

.product-name .product-link:hover { text-decoration: underline; }

.view-button {
  align-self: start;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.45rem 1.4rem;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.view-button:hover { background: var(--ink); color: #fff; }

/* Product detail page */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
  font-size: 0.9rem;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }

.breadcrumb a:hover { color: var(--ink); }

.product-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

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

.detail-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.detail-name {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.detail-price {
  color: var(--muted);
  margin: 0;
}

.detail-missing {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 0;
}

.color-picker {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
}

.color-swatch.selected {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.color-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.add-button {
  align-self: start;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.25rem;
}

.add-button:hover { opacity: 0.85; }

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

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

.cart-header h2 { margin: 0; font-size: 1.1rem; }

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.cart-items {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.cart-item-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-name { font-weight: 600; }

.cart-item-variant {
  color: var(--muted);
  font-size: 0.85rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  line-height: 1;
}

.qty-button:hover { border-color: var(--ink); }

.qty-value {
  min-width: 1.2rem;
  text-align: center;
}

.cart-footer { border-top: 1px solid var(--line); padding-top: 1rem; }

.cart-deal {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cart-total { margin: 0 0 1rem; font-weight: 600; }

.checkout-button {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem;
  font-size: 1rem;
  cursor: pointer;
}

.checkout-button:disabled { opacity: 0.4; cursor: not-allowed; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem;
}
