/* public/styles.css */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #666;
  --border: #e5e5e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.site-header {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 1000;
}
.brand { font-weight: 700; letter-spacing: 0.5px; }
.nav a {
  color: var(--fg);
  text-decoration: none;
  margin: 0 10px;
  padding: 6px 0;
}
.nav a:hover { text-decoration: underline; }

/* Cart icon button */
.cart-btn {
  position: relative;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  width: 40px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cart-icon { display: block; }
.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  min-width: 18px;
  text-align: center;
}

.hero {
  padding: 64px 18px 24px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 42px;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}
.hero p { color: var(--muted); margin: 0; }

.section {
  padding: 28px 18px;
  border-bottom: 1px solid var(--border);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}
.section h2 { margin: 0; font-size: 24px; }
.section-head p { margin: 0; color: var(--muted); }

.collection-block {
  margin: 20px 0 32px;
}
.collection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 12px;
}
.collection-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 800px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

.card {
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Carousel image area */
.card .img-wrap {
  aspect-ratio: 1 / 1;
  background: #000;
  position: relative;
  overflow: hidden;
}
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
}
.carousel .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.carousel .slide.active { opacity: 1; }

/* Hide nav and dots by default; show on hover */
.carousel .nav-btn,
.carousel .dots {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.img-wrap:hover .nav-btn,
.img-wrap:hover .dots {
  opacity: 1;
  pointer-events: auto;
}

.carousel .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: 1px solid rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.35);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 2;
}
.carousel .nav-btn.left { left: 6px; }
.carousel .nav-btn.right { right: 6px; }
.carousel .dots {
  position: absolute;
  bottom: 6px; left: 0; right: 0;
  display: flex; gap: 6px; justify-content: center;
  z-index: 2;
}
.carousel .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.carousel .dot.active { background: #fff; }

.card .body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card .name {
  font-size: 14px;
}
.card .price {
  font-size: 14px;
  color: var(--muted);
}
.badge {
  display: inline-block;
  border: 1px solid var(--fg);
  padding: 2px 6px;
  font-size: 12px;
}
.badge.sold { border-color: #999; color: #999; }
.size-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.size-btn {
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.size-btn.active {
  background: var(--fg);
  color: var(--bg);
}
.add-btn {
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
}
.add-btn.secondary {
  background: transparent;
  color: var(--fg);
}
.add-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
}

.info { color: var(--muted); }

.site-footer {
  padding: 24px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }

.cart-drawer {
  position: fixed;
  right: -420px;
  top: 0; bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: #fff;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1200;
  transition: right 0.25s ease;
}
.cart-drawer.open { right: 0; }
.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; border-bottom: 1px solid var(--border);
}
.cart-items {
  padding: 10px;
  overflow-y: auto; flex: 1;
}
.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.cart-item img {
  width: 64px; height: 64px; object-fit: cover; background: #000;
}
.cart-item .meta { font-size: 12px; color: var(--muted); }
.cart-item .qty-row { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  border: 1px solid var(--fg);
  background: transparent; color: var(--fg);
  width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer;
  font-size: 12px;
}
.remove-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
}
.cart-summary {
  border-top: 1px solid var(--border);
  padding: 12px;
}
.cart-total { display: flex; justify-content: space-between; margin-bottom: 12px; }
.checkout-btn {
  display: block; text-align: center;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  padding: 10px;
  text-decoration: none;
}
.backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  z-index: 1100;
}
.backdrop.show { opacity: 1; pointer-events: auto; }

/* Thumbs (also used in admin) */
.thumbs { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.thumb { position:relative; }
.thumb img { width:56px; height:56px; object-fit:cover; border:1px solid #eee; }
.thumb button {
  position:absolute; top:-6px; right:-6px;
  border:none; background:#000; color:#fff; width:18px; height:18px; font-size:12px; cursor:pointer;
}


.badge-preorder {
  display: inline-block;
  border: 1px solid #c00;
  color: #c00;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}