* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #111;
}

.topbar {
  position: sticky;
  top: 0;
  background: #111;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar a {
  color: #38bdf8;
  text-decoration: none;
  margin-left: 12px;
}
.title { font-weight: 700; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

h1, h2 { margin-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  background: #ddd;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wrap { flex-wrap: wrap; }
.space-between { justify-content: space-between; }

.col {
  flex: 1;
  min-width: 260px;
}

label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-top: 8px;
}
input, textarea, select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
}

textarea { min-height: 80px; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: #0ea5e9; border: 1px solid #0ea5e9; }
.btn.ok { background: #16a34a; color: #fff; }
.btn.danger { background: #ef4444; color: #fff; }

.small { font-size: 12px; color: #666; }

.empty {
  padding: 20px;
  border-radius: 10px;
  border: 1px dashed #ccc;
  text-align: center;
  margin-top: 16px;
}

/* Carrito */
.cart-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #0ea5e9;
  color: #fff;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}
#cart-count {
  background: #fff;
  color: #000;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 12px;
}

/* Modal carrito */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
}

.thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #ddd;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #ccc;
  margin-top: 4px;
}
.size-pill {
  display: inline-block;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 4px 8px;
  margin: 4px 4px 0 0;
  cursor: pointer;
  font-size: 13px;
}
.size-pill.active {
  border-color: #0ea5e9;
  color: #0ea5e9;
}
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
  display: inline-block;
  margin-right: 4px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}
